Service for the instances resource.
https://cloud.google.com/compute/docs/reference/rest/v1/instances
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
InstancesClient(InstancesClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
InstancesClient const &
|
InstancesClient(InstancesClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
InstancesClient &&
|
InstancesClient(std::shared_ptr< InstancesConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< InstancesConnection >
|
opts |
Options
|
Operators
operator=(InstancesClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
InstancesClient const &
|
Returns | |
---|---|
Type | Description |
InstancesClient & |
operator=(InstancesClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
InstancesClient &&
|
Returns | |
---|---|
Type | Description |
InstancesClient & |
Functions
AddAccessConfig(std::string const &, std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::AccessConfig const &, Options)
Adds an access config to an instance's network interface.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
network_interface |
std::string const &
The name of the network interface to add to this instance. |
access_config_resource |
google::cloud::cpp::compute::v1::AccessConfig const &
The AccessConfig for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
AddAccessConfig(google::cloud::cpp::compute::instances::v1::AddAccessConfigRequest const &, Options)
Adds an access config to an instance's network interface.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::AddAccessConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
AddResourcePolicies(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesAddResourcePoliciesRequest const &, Options)
Adds existing resource policies to an instance.
You can only add one policy right now which will be applied to this instance for scheduling live migrations. https://cloud.google.com/compute/docs/reference/rest/v1/instances/addResourcePolicies
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
instances_add_resource_policies_request_resource |
google::cloud::cpp::compute::v1::InstancesAddResourcePoliciesRequest const &
The InstancesAddResourcePoliciesRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
AddResourcePolicies(google::cloud::cpp::compute::instances::v1::AddResourcePoliciesRequest const &, Options)
Adds existing resource policies to an instance.
You can only add one policy right now which will be applied to this instance for scheduling live migrations. https://cloud.google.com/compute/docs/reference/rest/v1/instances/addResourcePolicies
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::AddResourcePoliciesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
AggregatedListInstances(std::string const &, Options)
Retrieves an aggregated list of all of the instances in your project across all regions and zones.
The performance of this method degrades when a filter is specified on a project that has a very large number of instances. https://cloud.google.com/compute/docs/reference/rest/v1/instances/aggregatedList
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::pair< std::string, google::cloud::cpp::compute::v1::InstancesScopedList > > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
AggregatedListInstances(google::cloud::cpp::compute::instances::v1::AggregatedListInstancesRequest, Options)
Retrieves an aggregated list of all of the instances in your project across all regions and zones.
The performance of this method degrades when a filter is specified on a project that has a very large number of instances. https://cloud.google.com/compute/docs/reference/rest/v1/instances/aggregatedList
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::AggregatedListInstancesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::pair< std::string, google::cloud::cpp::compute::v1::InstancesScopedList > > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
AttachDisk(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::AttachedDisk const &, Options)
Attaches an existing Disk resource to an instance.
You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/attachDisk
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
attached_disk_resource |
google::cloud::cpp::compute::v1::AttachedDisk const &
The AttachedDisk for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
AttachDisk(google::cloud::cpp::compute::instances::v1::AttachDiskRequest const &, Options)
Attaches an existing Disk resource to an instance.
You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/attachDisk
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::AttachDiskRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
BulkInsert(std::string const &, std::string const &, google::cloud::cpp::compute::v1::BulkInsertInstanceResource const &, Options)
Creates multiple instances.
Count specifies the number of instances to create. For more information, see About bulk creation of VMs. https://cloud.google.com/compute/docs/reference/rest/v1/instances/bulkInsert
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
bulk_insert_instance_resource |
google::cloud::cpp::compute::v1::BulkInsertInstanceResource const &
The BulkInsertInstanceResource for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
BulkInsert(google::cloud::cpp::compute::instances::v1::BulkInsertRequest const &, Options)
Creates multiple instances.
Count specifies the number of instances to create. For more information, see About bulk creation of VMs. https://cloud.google.com/compute/docs/reference/rest/v1/instances/bulkInsert
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::BulkInsertRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DeleteInstance(std::string const &, std::string const &, std::string const &, Options)
Deletes the specified Instance resource.
For more information, see Deleting an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/delete
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DeleteInstance(google::cloud::cpp::compute::instances::v1::DeleteInstanceRequest const &, Options)
Deletes the specified Instance resource.
For more information, see Deleting an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/delete
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::DeleteInstanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DeleteAccessConfig(std::string const &, std::string const &, std::string const &, std::string const &, std::string const &, Options)
Deletes an access config from an instance's network interface.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
access_config |
std::string const &
The name of the access config to delete. |
network_interface |
std::string const &
The name of the network interface. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DeleteAccessConfig(google::cloud::cpp::compute::instances::v1::DeleteAccessConfigRequest const &, Options)
Deletes an access config from an instance's network interface.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::DeleteAccessConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DetachDisk(std::string const &, std::string const &, std::string const &, std::string const &, Options)
Detaches a disk from an instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Instance name for this request. |
device_name |
std::string const &
The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DetachDisk(google::cloud::cpp::compute::instances::v1::DetachDiskRequest const &, Options)
Detaches a disk from an instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::DetachDiskRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
GetInstance(std::string const &, std::string const &, std::string const &, Options)
Returns the specified Instance resource.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to return. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Instance > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Instance) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetInstance(google::cloud::cpp::compute::instances::v1::GetInstanceRequest const &, Options)
Returns the specified Instance resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetInstanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Instance > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Instance) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetEffectiveFirewalls(std::string const &, std::string const &, std::string const &, std::string const &, Options)
Returns effective firewalls applied to an interface of the instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
network_interface |
std::string const &
The name of the network interface to get the effective firewalls. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::InstancesGetEffectiveFirewallsResponse > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.InstancesGetEffectiveFirewallsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetEffectiveFirewalls(google::cloud::cpp::compute::instances::v1::GetEffectiveFirewallsRequest const &, Options)
Returns effective firewalls applied to an interface of the instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetEffectiveFirewallsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::InstancesGetEffectiveFirewallsResponse > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.InstancesGetEffectiveFirewallsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetGuestAttributes(std::string const &, std::string const &, std::string const &, Options)
Returns the specified guest attributes entry.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::GuestAttributes > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.GuestAttributes) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetGuestAttributes(google::cloud::cpp::compute::instances::v1::GetGuestAttributesRequest const &, Options)
Returns the specified guest attributes entry.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetGuestAttributesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::GuestAttributes > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.GuestAttributes) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetIamPolicy(std::string const &, std::string const &, std::string const &, Options)
Gets the access control policy for a resource.
May be empty if no such policy or resource exists. https://cloud.google.com/compute/docs/reference/rest/v1/instances/getIamPolicy
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
resource |
std::string const &
Name or id of the resource for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Policy > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetIamPolicy(google::cloud::cpp::compute::instances::v1::GetIamPolicyRequest const &, Options)
Gets the access control policy for a resource.
May be empty if no such policy or resource exists. https://cloud.google.com/compute/docs/reference/rest/v1/instances/getIamPolicy
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Policy > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetScreenshot(std::string const &, std::string const &, std::string const &, Options)
Returns the screenshot from the specified instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Screenshot > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Screenshot) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetScreenshot(google::cloud::cpp::compute::instances::v1::GetScreenshotRequest const &, Options)
Returns the screenshot from the specified instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetScreenshotRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Screenshot > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Screenshot) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSerialPortOutput(std::string const &, std::string const &, std::string const &, Options)
Returns the last 1 MB of serial port output from the specified instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::SerialPortOutput > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.SerialPortOutput) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSerialPortOutput(google::cloud::cpp::compute::instances::v1::GetSerialPortOutputRequest const &, Options)
Returns the last 1 MB of serial port output from the specified instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetSerialPortOutputRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::SerialPortOutput > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.SerialPortOutput) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetShieldedInstanceIdentity(std::string const &, std::string const &, std::string const &, Options)
Returns the Shielded Instance Identity of an instance https://cloud.google.com/compute/docs/reference/rest/v1/instances/getShieldedInstanceIdentity.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name or id of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::ShieldedInstanceIdentity > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.ShieldedInstanceIdentity) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetShieldedInstanceIdentity(google::cloud::cpp::compute::instances::v1::GetShieldedInstanceIdentityRequest const &, Options)
Returns the Shielded Instance Identity of an instance https://cloud.google.com/compute/docs/reference/rest/v1/instances/getShieldedInstanceIdentity.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::GetShieldedInstanceIdentityRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::ShieldedInstanceIdentity > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.ShieldedInstanceIdentity) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
InsertInstance(std::string const &, std::string const &, google::cloud::cpp::compute::v1::Instance const &, Options)
Creates an instance resource in the specified project using the data included in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance_resource |
google::cloud::cpp::compute::v1::Instance const &
The Instance for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
InsertInstance(google::cloud::cpp::compute::instances::v1::InsertInstanceRequest const &, Options)
Creates an instance resource in the specified project using the data included in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::InsertInstanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
ListInstances(std::string const &, std::string const &, Options)
Retrieves the list of instances contained within the specified zone.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::cpp::compute::v1::Instance > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListInstances(google::cloud::cpp::compute::instances::v1::ListInstancesRequest, Options)
Retrieves the list of instances contained within the specified zone.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::ListInstancesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::cpp::compute::v1::Instance > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListReferrers(std::string const &, std::string const &, std::string const &, Options)
Retrieves a list of resources that refer to the VM instance specified in the request.
For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. https://cloud.google.com/compute/docs/reference/rest/v1/instances/listReferrers
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::cpp::compute::v1::Reference > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListReferrers(google::cloud::cpp::compute::instances::v1::ListReferrersRequest, Options)
Retrieves a list of resources that refer to the VM instance specified in the request.
For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. https://cloud.google.com/compute/docs/reference/rest/v1/instances/listReferrers
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::ListReferrersRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::cpp::compute::v1::Reference > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
PerformMaintenance(std::string const &, std::string const &, std::string const &, Options)
Perform a manual maintenance on the instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
PerformMaintenance(google::cloud::cpp::compute::instances::v1::PerformMaintenanceRequest const &, Options)
Perform a manual maintenance on the instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::PerformMaintenanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
RemoveResourcePolicies(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesRemoveResourcePoliciesRequest const &, Options)
Removes resource policies from an instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
instances_remove_resource_policies_request_resource |
google::cloud::cpp::compute::v1::InstancesRemoveResourcePoliciesRequest const &
The InstancesRemoveResourcePoliciesRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
RemoveResourcePolicies(google::cloud::cpp::compute::instances::v1::RemoveResourcePoliciesRequest const &, Options)
Removes resource policies from an instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::RemoveResourcePoliciesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Reset(std::string const &, std::string const &, std::string const &, Options)
Performs a reset on the instance.
This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/reset
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Reset(google::cloud::cpp::compute::instances::v1::ResetRequest const &, Options)
Performs a reset on the instance.
This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/reset
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::ResetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Resume(std::string const &, std::string const &, std::string const &, Options)
Resumes an instance that was suspended using the instances().suspend method.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to resume. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Resume(google::cloud::cpp::compute::instances::v1::ResumeRequest const &, Options)
Resumes an instance that was suspended using the instances().suspend method.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::ResumeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SendDiagnosticInterrupt(std::string const &, std::string const &, std::string const &, Options)
Sends diagnostic interrupt to the instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
SendDiagnosticInterrupt(google::cloud::cpp::compute::instances::v1::SendDiagnosticInterruptRequest const &, Options)
Sends diagnostic interrupt to the instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SendDiagnosticInterruptRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
SetDeletionProtection(std::string const &, std::string const &, std::string const &, Options)
Sets deletion protection on the instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
resource |
std::string const &
Name or id of the resource for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetDeletionProtection(google::cloud::cpp::compute::instances::v1::SetDeletionProtectionRequest const &, Options)
Sets deletion protection on the instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetDeletionProtectionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetDiskAutoDelete(std::string const &, std::string const &, std::string const &, bool, std::string const &, Options)
Sets the auto-delete flag for a disk attached to an instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
auto_delete |
bool
Whether to auto-delete the disk when the instance is deleted. |
device_name |
std::string const &
The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetDiskAutoDelete(google::cloud::cpp::compute::instances::v1::SetDiskAutoDeleteRequest const &, Options)
Sets the auto-delete flag for a disk attached to an instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetDiskAutoDeleteRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetIamPolicy(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::ZoneSetPolicyRequest const &, Options)
Sets the access control policy on the specified resource.
Replaces any existing policy. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setIamPolicy
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
resource |
std::string const &
Name or id of the resource for this request. |
zone_set_policy_request_resource |
google::cloud::cpp::compute::v1::ZoneSetPolicyRequest const &
The ZoneSetPolicyRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Policy > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetIamPolicy(google::cloud::cpp::compute::instances::v1::SetIamPolicyRequest const &, Options)
Sets the access control policy on the specified resource.
Replaces any existing policy. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setIamPolicy
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::Policy > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetLabels(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetLabelsRequest const &, Options)
Sets labels on an instance.
To learn more about labels, read the Labeling Resources documentation. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setLabels
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
instances_set_labels_request_resource |
google::cloud::cpp::compute::v1::InstancesSetLabelsRequest const &
The InstancesSetLabelsRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetLabels(google::cloud::cpp::compute::instances::v1::SetLabelsRequest const &, Options)
Sets labels on an instance.
To learn more about labels, read the Labeling Resources documentation. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setLabels
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetLabelsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMachineResources(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetMachineResourcesRequest const &, Options)
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
instances_set_machine_resources_request_resource |
google::cloud::cpp::compute::v1::InstancesSetMachineResourcesRequest const &
The InstancesSetMachineResourcesRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMachineResources(google::cloud::cpp::compute::instances::v1::SetMachineResourcesRequest const &, Options)
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetMachineResourcesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMachineType(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetMachineTypeRequest const &, Options)
Changes the machine type for a stopped instance to the machine type specified in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
instances_set_machine_type_request_resource |
google::cloud::cpp::compute::v1::InstancesSetMachineTypeRequest const &
The InstancesSetMachineTypeRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMachineType(google::cloud::cpp::compute::instances::v1::SetMachineTypeRequest const &, Options)
Changes the machine type for a stopped instance to the machine type specified in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetMachineTypeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMetadata(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::Metadata const &, Options)
Sets metadata for the specified instance to the data included in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
metadata_resource |
google::cloud::cpp::compute::v1::Metadata const &
The Metadata for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMetadata(google::cloud::cpp::compute::instances::v1::SetMetadataRequest const &, Options)
Sets metadata for the specified instance to the data included in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetMetadataRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMinCpuPlatform(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetMinCpuPlatformRequest const &, Options)
Changes the minimum CPU platform that this instance should use.
This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setMinCpuPlatform
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
instances_set_min_cpu_platform_request_resource |
google::cloud::cpp::compute::v1::InstancesSetMinCpuPlatformRequest const &
The InstancesSetMinCpuPlatformRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetMinCpuPlatform(google::cloud::cpp::compute::instances::v1::SetMinCpuPlatformRequest const &, Options)
Changes the minimum CPU platform that this instance should use.
This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setMinCpuPlatform
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetMinCpuPlatformRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetName(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetNameRequest const &, Options)
Sets name of an instance.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
instances_set_name_request_resource |
google::cloud::cpp::compute::v1::InstancesSetNameRequest const &
The InstancesSetNameRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetName(google::cloud::cpp::compute::instances::v1::SetNameRequest const &, Options)
Sets name of an instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetNameRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetScheduling(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::Scheduling const &, Options)
Sets an instance's scheduling options.
You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED
state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Instance name for this request. |
scheduling_resource |
google::cloud::cpp::compute::v1::Scheduling const &
The Scheduling for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetScheduling(google::cloud::cpp::compute::instances::v1::SetSchedulingRequest const &, Options)
Sets an instance's scheduling options.
You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED
state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetSchedulingRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetSecurityPolicy(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetSecurityPolicyRequest const &, Options)
Sets the Google Cloud Armor security policy for the specified instance.
For more information, see Google Cloud Armor Overview https://cloud.google.com/compute/docs/reference/rest/v1/instances/setSecurityPolicy
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
Name of the zone scoping this request. |
instance |
std::string const &
Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. |
instances_set_security_policy_request_resource |
google::cloud::cpp::compute::v1::InstancesSetSecurityPolicyRequest const &
The InstancesSetSecurityPolicyRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetSecurityPolicy(google::cloud::cpp::compute::instances::v1::SetSecurityPolicyRequest const &, Options)
Sets the Google Cloud Armor security policy for the specified instance.
For more information, see Google Cloud Armor Overview https://cloud.google.com/compute/docs/reference/rest/v1/instances/setSecurityPolicy
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetSecurityPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetServiceAccount(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesSetServiceAccountRequest const &, Options)
Sets the service account on the instance.
For more information, read Changing the service account and access scopes for an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setServiceAccount
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to start. |
instances_set_service_account_request_resource |
google::cloud::cpp::compute::v1::InstancesSetServiceAccountRequest const &
The InstancesSetServiceAccountRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetServiceAccount(google::cloud::cpp::compute::instances::v1::SetServiceAccountRequest const &, Options)
Sets the service account on the instance.
For more information, read Changing the service account and access scopes for an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setServiceAccount
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetServiceAccountRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetShieldedInstanceIntegrityPolicy(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::ShieldedInstanceIntegrityPolicy const &, Options)
Sets the Shielded Instance integrity policy for an instance.
You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setShieldedInstanceIntegrityPolicy
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name or id of the instance scoping this request. |
shielded_instance_integrity_policy_resource |
google::cloud::cpp::compute::v1::ShieldedInstanceIntegrityPolicy const &
The ShieldedInstanceIntegrityPolicy for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetShieldedInstanceIntegrityPolicy(google::cloud::cpp::compute::instances::v1::SetShieldedInstanceIntegrityPolicyRequest const &, Options)
Sets the Shielded Instance integrity policy for an instance.
You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/setShieldedInstanceIntegrityPolicy
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetShieldedInstanceIntegrityPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetTags(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::Tags const &, Options)
Sets network tags for the specified instance to the data included in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
tags_resource |
google::cloud::cpp::compute::v1::Tags const &
The Tags for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SetTags(google::cloud::cpp::compute::instances::v1::SetTagsRequest const &, Options)
Sets network tags for the specified instance to the data included in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SetTagsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SimulateMaintenanceEvent(std::string const &, std::string const &, std::string const &, Options)
Simulates a host maintenance event on a VM.
For more information, see Simulate a host maintenance event. https://cloud.google.com/compute/docs/reference/rest/v1/instances/simulateMaintenanceEvent
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
SimulateMaintenanceEvent(google::cloud::cpp::compute::instances::v1::SimulateMaintenanceEventRequest const &, Options)
Simulates a host maintenance event on a VM.
For more information, see Simulate a host maintenance event. https://cloud.google.com/compute/docs/reference/rest/v1/instances/simulateMaintenanceEvent
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SimulateMaintenanceEventRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Start(std::string const &, std::string const &, std::string const &, Options)
Starts an instance that was stopped using the instances().stop method.
For more information, see Restart an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/start
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to start. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Start(google::cloud::cpp::compute::instances::v1::StartRequest const &, Options)
Starts an instance that was stopped using the instances().stop method.
For more information, see Restart an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/start
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::StartRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
StartWithEncryptionKey(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::InstancesStartWithEncryptionKeyRequest const &, Options)
Starts an instance that was stopped using the instances().stop method.
For more information, see Restart an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/startWithEncryptionKey
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to start. |
instances_start_with_encryption_key_request_resource |
google::cloud::cpp::compute::v1::InstancesStartWithEncryptionKeyRequest const &
The InstancesStartWithEncryptionKeyRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
StartWithEncryptionKey(google::cloud::cpp::compute::instances::v1::StartWithEncryptionKeyRequest const &, Options)
Starts an instance that was stopped using the instances().stop method.
For more information, see Restart an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/startWithEncryptionKey
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::StartWithEncryptionKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Stop(std::string const &, std::string const &, std::string const &, Options)
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time.
Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/stop
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to stop. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Stop(google::cloud::cpp::compute::instances::v1::StopRequest const &, Options)
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time.
Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/stop
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::StopRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Suspend(std::string const &, std::string const &, std::string const &, Options)
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time.
Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/suspend
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to suspend. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
Suspend(google::cloud::cpp::compute::instances::v1::SuspendRequest const &, Options)
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time.
Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. https://cloud.google.com/compute/docs/reference/rest/v1/instances/suspend
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::SuspendRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
TestIamPermissions(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::TestPermissionsRequest const &, Options)
Returns permissions that a caller has on the specified resource.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
resource |
std::string const &
Name or id of the resource for this request. |
test_permissions_request_resource |
google::cloud::cpp::compute::v1::TestPermissionsRequest const &
The TestPermissionsRequest for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::TestPermissionsResponse > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.TestPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TestIamPermissions(google::cloud::cpp::compute::instances::v1::TestIamPermissionsRequest const &, Options)
Returns permissions that a caller has on the specified resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::TestIamPermissionsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::cpp::compute::v1::TestPermissionsResponse > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.TestPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateInstance(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::Instance const &, Options)
Updates an instance only if the necessary resources are available.
This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. https://cloud.google.com/compute/docs/reference/rest/v1/instances/update
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance resource to update. |
instance_resource |
google::cloud::cpp::compute::v1::Instance const &
The Instance for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateInstance(google::cloud::cpp::compute::instances::v1::UpdateInstanceRequest const &, Options)
Updates an instance only if the necessary resources are available.
This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. https://cloud.google.com/compute/docs/reference/rest/v1/instances/update
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::UpdateInstanceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateAccessConfig(std::string const &, std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::AccessConfig const &, Options)
Updates the specified access config from an instance's network interface with the data included in the request.
This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateAccessConfig
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
network_interface |
std::string const &
The name of the network interface where the access config is attached. |
access_config_resource |
google::cloud::cpp::compute::v1::AccessConfig const &
The AccessConfig for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateAccessConfig(google::cloud::cpp::compute::instances::v1::UpdateAccessConfigRequest const &, Options)
Updates the specified access config from an instance's network interface with the data included in the request.
This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateAccessConfig
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::UpdateAccessConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateDisplayDevice(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::DisplayDevice const &, Options)
Updates the Display config for a VM instance.
You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateDisplayDevice
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name of the instance scoping this request. |
display_device_resource |
google::cloud::cpp::compute::v1::DisplayDevice const &
The DisplayDevice for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateDisplayDevice(google::cloud::cpp::compute::instances::v1::UpdateDisplayDeviceRequest const &, Options)
Updates the Display config for a VM instance.
You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateDisplayDevice
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::UpdateDisplayDeviceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateNetworkInterface(std::string const &, std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::NetworkInterface const &, Options)
Updates an instance's network interface.
This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateNetworkInterface
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
The instance name for this request. |
network_interface |
std::string const &
The name of the network interface to update. |
network_interface_resource |
google::cloud::cpp::compute::v1::NetworkInterface const &
The NetworkInterface for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateNetworkInterface(google::cloud::cpp::compute::instances::v1::UpdateNetworkInterfaceRequest const &, Options)
Updates an instance's network interface.
This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateNetworkInterface
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::UpdateNetworkInterfaceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateShieldedInstanceConfig(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::ShieldedInstanceConfig const &, Options)
Updates the Shielded Instance config for an instance.
You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateShieldedInstanceConfig
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
zone |
std::string const &
The name of the zone for this request. |
instance |
std::string const &
Name or id of the instance scoping this request. |
shielded_instance_config_resource |
google::cloud::cpp::compute::v1::ShieldedInstanceConfig const &
The ShieldedInstanceConfig for this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
UpdateShieldedInstanceConfig(google::cloud::cpp::compute::instances::v1::UpdateShieldedInstanceConfigRequest const &, Options)
Updates the Shielded Instance config for an instance.
You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. https://cloud.google.com/compute/docs/reference/rest/v1/instances/updateShieldedInstanceConfig
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::instances::v1::UpdateShieldedInstanceConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |