Lines Matching refs:zone

165                 zone=scope_name)
232 def GetMetricQuota(regions_info, zone, metric): argument
245 if region_info["name"] in zone:
249 logger.info("Can't get %s quota info from zone(%s)", metric, zone)
252 def EnoughMetricsInZone(self, zone): argument
265 quota = self.GetMetricQuota(regions_info, zone, metric)
268 "Can't query the metric(%s) in zone(%s)", metric, zone)
272 "The metric(%s) is over limit in zone(%s)", metric, zone)
276 def GetDisk(self, disk_name, zone): argument
288 project=self._project, zone=zone, disk=disk_name)
291 def CheckDiskExists(self, disk_name, zone): argument
302 self.GetDisk(disk_name, zone)
314 zone, argument
337 "type": "projects/%s/zones/%s/diskTypes/%s" % (self._project, zone,
343 zone=zone,
350 scope_name=zone)
353 if self.CheckDiskExists(disk_name, zone):
354 self.DeleteDisk(disk_name, zone)
358 def DeleteDisk(self, disk_name, zone): argument
367 project=self._project, zone=zone, disk=disk_name)
372 scope_name=zone)
375 def DeleteDisks(self, disk_names, zone): argument
396 project=self._project, disk=disk_name, zone=zone)
399 delete_requests, OperationScope.ZONE, scope_name=zone)
401 def ListDisks(self, zone, disk_filter=None): argument
417 zone=zone,
623 def GetInstance(self, instance, zone): argument
635 project=self._project, zone=zone, instance=instance)
638 def AttachAccelerator(self, instance, zone, accelerator_count, argument
660 self.GetAcceleratorUrl(accelerator_type, zone),
666 project=self._project, zone=zone, instance=instance, body=body)
672 scope_name=zone)
679 def AttachDisk(self, instance, zone, **kwargs): argument
725 project=self._project, zone=zone, instance=instance, body=kwargs)
731 scope_name=zone)
737 def DetachDisk(self, instance, zone, disk_name): argument
754 zone=zone,
762 scope_name=zone)
768 def StartInstance(self, instance, zone): argument
779 project=self._project, zone=zone, instance=instance)
785 scope_name=zone)
791 def StartInstances(self, instances, zone): argument
807 self.service.instances().start, project=self._project, zone=zone)
808 return self._BatchExecuteOnInstances(instances, zone, action)
810 def StopInstance(self, instance, zone): argument
821 project=self._project, zone=zone, instance=instance)
827 scope_name=zone)
833 def StopInstances(self, instances, zone): argument
849 self.service.instances().stop, project=self._project, zone=zone)
850 return self._BatchExecuteOnInstances(instances, zone, action)
854 zone, argument
879 project=self._project, zone=zone, instance=instance, body=body)
885 scope_name=zone)
961 zone, argument
995 zone=zone,
997 return self._BatchExecuteOnInstances(instances, zone, action)
999 def _BatchExecuteOnInstances(self, instances, zone, action): argument
1026 requests, operation_scope=OperationScope.ZONE, scope_name=zone)
1144 def _GetNetworkArgs(self, network, zone): argument
1164 network_args["subnetwork"] = self.GetSubnetworkUrl(network, zone)
1195 def _GetExtraDiskArgs(self, extra_disk_name, zone): argument
1208 "source": "projects/%s/zones/%s/disks/%s" % (self._project, zone,
1223 zone, argument
1256 disk_args.extend(self._GetExtraDiskArgs(extra_disk_name, zone))
1266 "machineType": self.GetMachineType(machine_type, zone)["selfLink"],
1268 "networkInterfaces": [self._GetNetworkArgs(network, zone)],
1281 "acceleratorType": self.GetAcceleratorUrl(gpu, zone),
1294 self._project, zone, body)
1296 project=self._project, zone=zone, body=body)
1299 operation, operation_scope=OperationScope.ZONE, scope_name=zone)
1302 def DeleteInstance(self, instance, zone): argument
1311 project=self._project, zone=zone, instance=instance)
1314 operation, operation_scope=OperationScope.ZONE, scope_name=zone)
1317 def DeleteInstances(self, instances, zone): argument
1331 self.service.instances().delete, project=self._project, zone=zone)
1332 return self._BatchExecuteOnInstances(instances, zone, action)
1334 def ResetInstance(self, instance, zone): argument
1343 project=self._project, zone=zone, instance=instance)
1346 operation, operation_scope=OperationScope.ZONE, scope_name=zone)
1349 def GetMachineType(self, machine_type, zone): argument
1362 project=self._project, zone=zone, machineType=machine_type)
1365 def GetAcceleratorUrl(self, accelerator_type, zone): argument
1379 project=self._project, zone=zone, acceleratorType=accelerator_type)
1399 def GetSubnetworkUrl(self, network, zone): argument
1422 region = zone.rsplit("-", 1)[0]
1429 def CompareMachineSize(self, machine_type_1, machine_type_2, zone): argument
1448 machine_info_1 = self.GetMachineType(machine_type_1, zone)
1449 machine_info_2 = self.GetMachineType(machine_type_2, zone)
1463 def GetSerialPortOutput(self, instance, zone, port=1): argument
1478 project=self._project, zone=zone, instance=instance, port=port)
1510 def GetInstanceIP(self, instance, zone): argument
1520 instance = self.GetInstance(instance, zone)
1526 def SetInstanceMetadata(self, zone, instance, body): argument
1546 project=self._project, zone=zone, instance=instance, body=body)
1549 operation, operation_scope=OperationScope.ZONE, scope_name=zone)
1567 zone = self.GetZoneByInstance(instance)
1568 gce_instance = self.GetInstance(instance, zone)
1571 self.UpdateRsaInMetadata(zone, instance, metadata, entry)
1620 for zone, instance_data in response["items"].items():
1622 zone_match = _ZONE_RE.match(zone)
1641 zone = self.GetZoneByInstance(instance)
1642 if zone in zone_instances:
1643 zone_instances[zone].append(instance)
1645 zone_instances[zone] = [instance]
1670 def UpdateRsaInMetadata(self, zone, instance, metadata, entry): argument
1694 self.SetInstanceMetadata(zone, instance, metadata)