Service for the projects resource.
https://cloud.google.com/compute/docs/reference/rest/v1/projects
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
ProjectsClient(ProjectsClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProjectsClient const &
|
ProjectsClient(ProjectsClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProjectsClient &&
|
ProjectsClient(std::shared_ptr< ProjectsConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ProjectsConnection >
|
opts |
Options
|
Operators
operator=(ProjectsClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProjectsClient const &
|
Returns | |
---|---|
Type | Description |
ProjectsClient & |
operator=(ProjectsClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ProjectsClient &&
|
Returns | |
---|---|
Type | Description |
ProjectsClient & |
Functions
DisableXpnHost(std::string const &, Options)
Disable this project as a shared VPC host project.
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 |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
DisableXpnHost(google::cloud::cpp::compute::projects::v1::DisableXpnHostRequest const &, Options)
Disable this project as a shared VPC host project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::DisableXpnHostRequest 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 |
DisableXpnResource(std::string const &, google::cloud::cpp::compute::v1::ProjectsDisableXpnResourceRequest const &, Options)
Disable a service resource (also known as service project) associated with this host project.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
projects_disable_xpn_resource_request_resource |
google::cloud::cpp::compute::v1::ProjectsDisableXpnResourceRequest const &
The ProjectsDisableXpnResourceRequest 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 |
DisableXpnResource(google::cloud::cpp::compute::projects::v1::DisableXpnResourceRequest const &, Options)
Disable a service resource (also known as service project) associated with this host project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::DisableXpnResourceRequest 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 |
EnableXpnHost(std::string const &, Options)
Enable this project as a shared VPC host project.
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 |
future< StatusOr< google::cloud::cpp::compute::v1::Operation > > | A |
EnableXpnHost(google::cloud::cpp::compute::projects::v1::EnableXpnHostRequest const &, Options)
Enable this project as a shared VPC host project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::EnableXpnHostRequest 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 |
EnableXpnResource(std::string const &, google::cloud::cpp::compute::v1::ProjectsEnableXpnResourceRequest const &, Options)
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
projects_enable_xpn_resource_request_resource |
google::cloud::cpp::compute::v1::ProjectsEnableXpnResourceRequest const &
The ProjectsEnableXpnResourceRequest 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 |
EnableXpnResource(google::cloud::cpp::compute::projects::v1::EnableXpnResourceRequest const &, Options)
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::EnableXpnResourceRequest 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 |
GetProject(std::string const &, Options)
Returns the specified Project resource.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas
field). To exclude one or more fields, set your request's fields
query parameter to only include the fields you need. For example, to only include the id
and selfLink
fields, add the query parameter ?fields=id,selfLink
to your request. https://cloud.google.com/compute/docs/reference/rest/v1/projects/get
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 |
StatusOr< google::cloud::cpp::compute::v1::Project > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Project) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetProject(google::cloud::cpp::compute::projects::v1::GetProjectRequest const &, Options)
Returns the specified Project resource.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas
field). To exclude one or more fields, set your request's fields
query parameter to only include the fields you need. For example, to only include the id
and selfLink
fields, add the query parameter ?fields=id,selfLink
to your request. https://cloud.google.com/compute/docs/reference/rest/v1/projects/get
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::GetProjectRequest 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::Project > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Project) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetXpnHost(std::string const &, Options)
Gets the shared VPC host project that this project links to.
May be empty if no link exists. https://cloud.google.com/compute/docs/reference/rest/v1/projects/getXpnHost
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 |
StatusOr< google::cloud::cpp::compute::v1::Project > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Project) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetXpnHost(google::cloud::cpp::compute::projects::v1::GetXpnHostRequest const &, Options)
Gets the shared VPC host project that this project links to.
May be empty if no link exists. https://cloud.google.com/compute/docs/reference/rest/v1/projects/getXpnHost
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::GetXpnHostRequest 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::Project > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Project) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetXpnResources(std::string const &, Options)
Gets service resources (a.k.a service project) associated with this host project.
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 |
StatusOr< google::cloud::cpp::compute::v1::ProjectsGetXpnResources > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.ProjectsGetXpnResources) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetXpnResources(google::cloud::cpp::compute::projects::v1::GetXpnResourcesRequest const &, Options)
Gets service resources (a.k.a service project) associated with this host project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::GetXpnResourcesRequest 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::ProjectsGetXpnResources > | the result of the RPC. The response message type (google.cloud.cpp.compute.v1.ProjectsGetXpnResources) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListXpnHosts(std::string const &, google::cloud::cpp::compute::v1::ProjectsListXpnHostsRequest const &, Options)
Lists all shared VPC host projects visible to the user in an organization.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
projects_list_xpn_hosts_request_resource |
google::cloud::cpp::compute::v1::ProjectsListXpnHostsRequest const &
The ProjectsListXpnHostsRequest 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::Project > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListXpnHosts(google::cloud::cpp::compute::projects::v1::ListXpnHostsRequest, Options)
Lists all shared VPC host projects visible to the user in an organization.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::ListXpnHostsRequest
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::Project > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
MoveDisk(std::string const &, google::cloud::cpp::compute::v1::DiskMoveRequest const &, Options)
Moves a persistent disk from one zone to another.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
disk_move_request_resource |
google::cloud::cpp::compute::v1::DiskMoveRequest const &
The DiskMoveRequest 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 |
MoveDisk(google::cloud::cpp::compute::projects::v1::MoveDiskRequest const &, Options)
Moves a persistent disk from one zone to another.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::MoveDiskRequest 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 |
MoveInstance(std::string const &, google::cloud::cpp::compute::v1::InstanceMoveRequest const &, Options)
Moves an instance and its attached persistent disks from one zone to another.
Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue. [Deprecated] This method is deprecated. See moving instance across zones instead. https://cloud.google.com/compute/docs/reference/rest/v1/projects/moveInstance
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
instance_move_request_resource |
google::cloud::cpp::compute::v1::InstanceMoveRequest const &
The InstanceMoveRequest 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 |
MoveInstance(google::cloud::cpp::compute::projects::v1::MoveInstanceRequest const &, Options)
Moves an instance and its attached persistent disks from one zone to another.
Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue. [Deprecated] This method is deprecated. See moving instance across zones instead. https://cloud.google.com/compute/docs/reference/rest/v1/projects/moveInstance
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::MoveInstanceRequest 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 |
SetCommonInstanceMetadata(std::string const &, google::cloud::cpp::compute::v1::Metadata const &, Options)
Sets metadata common to all instances within the specified project using the data included in the request.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for 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 |
SetCommonInstanceMetadata(google::cloud::cpp::compute::projects::v1::SetCommonInstanceMetadataRequest const &, Options)
Sets metadata common to all instances within the specified project using the data included in the request.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::SetCommonInstanceMetadataRequest 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 |
SetDefaultNetworkTier(std::string const &, google::cloud::cpp::compute::v1::ProjectsSetDefaultNetworkTierRequest const &, Options)
Sets the default network tier of the project.
The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. https://cloud.google.com/compute/docs/reference/rest/v1/projects/setDefaultNetworkTier
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
projects_set_default_network_tier_request_resource |
google::cloud::cpp::compute::v1::ProjectsSetDefaultNetworkTierRequest const &
The ProjectsSetDefaultNetworkTierRequest 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 |
SetDefaultNetworkTier(google::cloud::cpp::compute::projects::v1::SetDefaultNetworkTierRequest const &, Options)
Sets the default network tier of the project.
The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. https://cloud.google.com/compute/docs/reference/rest/v1/projects/setDefaultNetworkTier
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::SetDefaultNetworkTierRequest 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 |
SetUsageExportBucket(std::string const &, google::cloud::cpp::compute::v1::UsageExportLocation const &, Options)
Enables the usage export feature and sets the usage export bucket where reports are stored.
If you provide an empty request body using this method, the usage export feature will be disabled. https://cloud.google.com/compute/docs/reference/rest/v1/projects/setUsageExportBucket
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Project ID for this request. |
usage_export_location_resource |
google::cloud::cpp::compute::v1::UsageExportLocation const &
The UsageExportLocation 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 |
SetUsageExportBucket(google::cloud::cpp::compute::projects::v1::SetUsageExportBucketRequest const &, Options)
Enables the usage export feature and sets the usage export bucket where reports are stored.
If you provide an empty request body using this method, the usage export feature will be disabled. https://cloud.google.com/compute/docs/reference/rest/v1/projects/setUsageExportBucket
Parameters | |
---|---|
Name | Description |
request |
google::cloud::cpp::compute::projects::v1::SetUsageExportBucketRequest 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 |