def down(self, background=True): cmd = [ "gcloud", "compute", "tpus", "stop", "--zone={}".format(self.manager.zone), self.name ] if background: cmd += ["--async"] utils.try_call(cmd)
def delete(self, background=True): super().delete(background=background) if not self.still_exists: return cmd = ["gcloud", "compute", "tpus", "delete", "--zone={}".format(self.manager.zone), self.name] if background: cmd += ["--async"] cmd += ["--quiet"] # suppress user confirmation utils.try_call(cmd)
def down(self, background=True): cmd = ["gcloud", "alpha", "compute", "tpus", "stop", self.name] if background: cmd += ["--async"] utils.try_call(cmd)
def up(self, background=False): cmd = ["gcloud", "alpha", "compute", "tpus", "start", self.name] if background: cmd += ["--async"] utils.try_call(cmd)