public class ComputeClient extends Object
| Constructor and Description |
|---|
ComputeClient() |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.services.compute.model.Operation.Error |
appendInstanceMetadata(String projectId,
String zone,
String instanceId,
List<com.google.api.services.compute.model.Metadata.Items> items)
Appends metadata to an instance.
|
static String |
buildLabelsFilterString(Map<String,String> labels) |
List<com.google.api.services.compute.model.AcceleratorType> |
getAcceleratorTypes(String projectId,
String zone) |
List<com.google.api.services.compute.model.DiskType> |
getBootDiskTypes(String projectId,
String zone) |
List<com.google.api.services.compute.model.DiskType> |
getDiskTypes(String projectId,
String zone) |
com.google.api.services.compute.model.Image |
getImage(String projectId,
String name) |
List<com.google.api.services.compute.model.Image> |
getImages(String projectId) |
com.google.api.services.compute.model.Instance |
getInstance(String projectId,
String zone,
String instanceId) |
List<com.google.api.services.compute.model.Instance> |
getInstancesWithLabel(String projectId,
Map<String,String> labels)
Return all instances that contain the given labels
|
List<com.google.api.services.compute.model.MachineType> |
getMachineTypes(String projectId,
String zone) |
List<com.google.api.services.compute.model.Network> |
getNetworks(String projectId) |
List<com.google.api.services.compute.model.Region> |
getRegions(String projectId) |
List<com.google.api.services.compute.model.Subnetwork> |
getSubnetworks(String projectId,
String networkSelfLink,
String region) |
List<com.google.api.services.compute.model.Zone> |
getZones(String projectId,
String region) |
com.google.api.services.compute.model.Operation |
insertInstance(String projectId,
com.google.api.services.compute.model.Instance i) |
static String |
lastParam(String value) |
static List<com.google.api.services.compute.model.Metadata.Items> |
mergeMetadataItems(List<com.google.api.services.compute.model.Metadata.Items> winner,
List<com.google.api.services.compute.model.Metadata.Items> loser) |
static String |
regionFromSelfLink(String regionSelfLink) |
void |
setCompute(com.google.api.services.compute.Compute compute) |
com.google.api.services.compute.model.Operation |
terminateInstance(String projectId,
String zone,
String InstanceId) |
com.google.api.services.compute.model.Operation |
terminateInstanceWithStatus(String projectId,
String zone,
String instanceId,
String desiredStatus) |
com.google.api.services.compute.model.Operation.Error |
waitForOperationCompletion(String projectId,
String operationId,
String zone,
long timeout)
Blocks until an existing operation completes.
|
static String |
zoneFromSelfLink(String zoneSelfLink) |
public static List<com.google.api.services.compute.model.Metadata.Items> mergeMetadataItems(List<com.google.api.services.compute.model.Metadata.Items> winner, List<com.google.api.services.compute.model.Metadata.Items> loser)
public void setCompute(com.google.api.services.compute.Compute compute)
public List<com.google.api.services.compute.model.Region> getRegions(String projectId) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.Zone> getZones(String projectId, String region) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.MachineType> getMachineTypes(String projectId, String zone) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.DiskType> getDiskTypes(String projectId, String zone) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.DiskType> getBootDiskTypes(String projectId, String zone) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.Image> getImages(String projectId) throws IOException
IOExceptionpublic com.google.api.services.compute.model.Image getImage(String projectId, String name) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.AcceleratorType> getAcceleratorTypes(String projectId, String zone) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.Network> getNetworks(String projectId) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.Subnetwork> getSubnetworks(String projectId, String networkSelfLink, String region) throws IOException
IOExceptionpublic com.google.api.services.compute.model.Operation insertInstance(String projectId, com.google.api.services.compute.model.Instance i) throws IOException
IOExceptionpublic com.google.api.services.compute.model.Operation terminateInstance(String projectId, String zone, String InstanceId) throws IOException
IOExceptionpublic com.google.api.services.compute.model.Operation terminateInstanceWithStatus(String projectId, String zone, String instanceId, String desiredStatus) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic com.google.api.services.compute.model.Instance getInstance(String projectId, String zone, String instanceId) throws IOException
IOExceptionpublic List<com.google.api.services.compute.model.Instance> getInstancesWithLabel(String projectId, Map<String,String> labels) throws IOException
projectId - labels - IOExceptionpublic com.google.api.services.compute.model.Operation.Error appendInstanceMetadata(String projectId, String zone, String instanceId, List<com.google.api.services.compute.model.Metadata.Items> items) throws IOException, InterruptedException
projectId - zone - instanceId - items - IOExceptionInterruptedExceptionpublic com.google.api.services.compute.model.Operation.Error waitForOperationCompletion(String projectId, String operationId, String zone, long timeout) throws IOException, InterruptedException
projectId - operationId - zone - timeout - IOExceptionInterruptedExceptionCopyright © 2016–2018 Google. All rights reserved.