Google Cloud Spanner C++ Client
1.32.0
A C++ Client Library for Google Cloud Spanner
|
Cloud Spanner Instance Admin API. More...
#include <google/cloud/spanner/admin/instance_admin_client.h>
Public Member Functions | |
InstanceAdminClient (std::shared_ptr< InstanceAdminConnection > connection) | |
~InstanceAdminClient () | |
InstanceAdminClient (InstanceAdminClient const &)=default | |
InstanceAdminClient & | operator= (InstanceAdminClient const &)=default |
InstanceAdminClient (InstanceAdminClient &&)=default | |
InstanceAdminClient & | operator= (InstanceAdminClient &&)=default |
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > | ListInstanceConfigs (std::string const &parent) |
Lists the supported instance configurations for a given project. More... | |
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > | GetInstanceConfig (std::string const &name) |
Gets information about a particular instance configuration. More... | |
StreamRange< google::spanner::admin::instance::v1::Instance > | ListInstances (std::string const &parent) |
Lists all instances in the given project. More... | |
StatusOr< google::spanner::admin::instance::v1::Instance > | GetInstance (std::string const &name) |
Gets information about a particular instance. More... | |
future< StatusOr< google::spanner::admin::instance::v1::Instance > > | CreateInstance (std::string const &parent, std::string const &instance_id, google::spanner::admin::instance::v1::Instance const &instance) |
Creates an instance and begins preparing it to begin serving. More... | |
future< StatusOr< google::spanner::admin::instance::v1::Instance > > | UpdateInstance (google::spanner::admin::instance::v1::Instance const &instance, google::protobuf::FieldMask const &field_mask) |
Updates an instance, and begins allocating or releasing resources as requested. More... | |
Status | DeleteInstance (std::string const &name) |
Deletes an instance. More... | |
StatusOr< google::iam::v1::Policy > | SetIamPolicy (std::string const &resource, google::iam::v1::Policy const &policy) |
Sets the access control policy on an instance resource. More... | |
StatusOr< google::iam::v1::Policy > | SetIamPolicy (std::string const &resource, IamUpdater const &updater, Options options={}) |
Updates the IAM policy for resource using an optimistic concurrency control loop. More... | |
StatusOr< google::iam::v1::Policy > | GetIamPolicy (std::string const &resource) |
Gets the access control policy for an instance resource. More... | |
StatusOr< google::iam::v1::TestIamPermissionsResponse > | TestIamPermissions (std::string const &resource, std::vector< std::string > const &permissions) |
Returns permissions that the caller has on the specified instance resource. More... | |
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > | ListInstanceConfigs (google::spanner::admin::instance::v1::ListInstanceConfigsRequest request) |
Lists the supported instance configurations for a given project. More... | |
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > | GetInstanceConfig (google::spanner::admin::instance::v1::GetInstanceConfigRequest const &request) |
Gets information about a particular instance configuration. More... | |
StreamRange< google::spanner::admin::instance::v1::Instance > | ListInstances (google::spanner::admin::instance::v1::ListInstancesRequest request) |
Lists all instances in the given project. More... | |
StatusOr< google::spanner::admin::instance::v1::Instance > | GetInstance (google::spanner::admin::instance::v1::GetInstanceRequest const &request) |
Gets information about a particular instance. More... | |
future< StatusOr< google::spanner::admin::instance::v1::Instance > > | CreateInstance (google::spanner::admin::instance::v1::CreateInstanceRequest const &request) |
Creates an instance and begins preparing it to begin serving. More... | |
future< StatusOr< google::spanner::admin::instance::v1::Instance > > | UpdateInstance (google::spanner::admin::instance::v1::UpdateInstanceRequest const &request) |
Updates an instance, and begins allocating or releasing resources as requested. More... | |
Status | DeleteInstance (google::spanner::admin::instance::v1::DeleteInstanceRequest const &request) |
Deletes an instance. More... | |
StatusOr< google::iam::v1::Policy > | SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request) |
Sets the access control policy on an instance resource. More... | |
StatusOr< google::iam::v1::Policy > | GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request) |
Gets the access control policy for an instance resource. More... | |
StatusOr< google::iam::v1::TestIamPermissionsResponse > | TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request) |
Returns permissions that the caller has on the specified instance resource. More... | |
Friends | |
bool | operator== (InstanceAdminClient const &a, InstanceAdminClient const &b) |
bool | operator!= (InstanceAdminClient const &a, InstanceAdminClient const &b) |
Cloud Spanner Instance Admin API.
The Cloud Spanner Instance Admin API can be used to create, delete, modify and list instances. Instances are dedicated Cloud Spanner serving and storage resources to be used by Cloud Spanner databases.
Each instance has a "configuration", which dictates where the serving resources for the Cloud Spanner instance are located (e.g., US-central, Europe). Configurations are created by Google based on resource availability.
Cloud Spanner billing is based on the instances that exist and their sizes. After an instance exists, there are no additional per-database or per-operation charges for use of the instance (though there may be additional network bandwidth charges). Instances offer isolation: problems with databases in one instance will not affect other instances. However, within an instance databases can affect each other. For example, if one database in an instance receives a lot of requests and consumes most of the instance resources, fewer resources are available for other databases in that instance, and their performance may suffer.
Definition at line 61 of file instance_admin_client.h.
|
explicit |
Definition at line 30 of file instance_admin_client.cc.
|
default |
|
default |
|
default |
future< StatusOr< google::spanner::admin::instance::v1::Instance > > google::cloud::spanner_admin::v1::InstanceAdminClient::CreateInstance | ( | google::spanner::admin::instance::v1::CreateInstanceRequest const & | request | ) |
Creates an instance and begins preparing it to begin serving.
The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, CreateInstance
returns ALREADY_EXISTS
.
Immediately upon completion of this request:
CREATING
.Until completion of the returned operation:
Upon completion of the returned operation:
READY
.The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id>
and can be used to track creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful.
request | google::spanner::admin::instance::v1::CreateInstanceRequest |
Definition at line 165 of file instance_admin_client.cc.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > google::cloud::spanner_admin::v1::InstanceAdminClient::CreateInstance | ( | std::string const & | parent, |
std::string const & | instance_id, | ||
google::spanner::admin::instance::v1::Instance const & | instance | ||
) |
Creates an instance and begins preparing it to begin serving.
The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, CreateInstance
returns ALREADY_EXISTS
.
Immediately upon completion of this request:
CREATING
.Until completion of the returned operation:
Upon completion of the returned operation:
READY
.The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id>
and can be used to track creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful.
parent | Required. The name of the project in which to create the instance. Values are of the form projects/<project> . |
instance_id | Required. The ID of the instance to create. Valid identifiers are of the form [a-z][-a-z0-9]*[a-z0-9] and must be between 2 and 64 characters in length. |
instance | Required. The instance to create. The name may be omitted, but if specified must be <parent>/instances/<instance_id> . |
Definition at line 64 of file instance_admin_client.cc.
Status google::cloud::spanner_admin::v1::InstanceAdminClient::DeleteInstance | ( | google::spanner::admin::instance::v1::DeleteInstanceRequest const & | request | ) |
Deletes an instance.
Immediately upon completion of the request:
Soon afterward:
request | google::spanner::admin::instance::v1::DeleteInstanceRequest |
Definition at line 178 of file instance_admin_client.cc.
Status google::cloud::spanner_admin::v1::InstanceAdminClient::DeleteInstance | ( | std::string const & | name | ) |
Deletes an instance.
Immediately upon completion of the request:
Soon afterward:
name | Required. The name of the instance to be deleted. Values are of the form projects/<project>/instances/<instance> |
Definition at line 84 of file instance_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::InstanceAdminClient::GetIamPolicy | ( | google::iam::v1::GetIamPolicyRequest const & | request | ) |
Gets the access control policy for an instance resource.
Returns an empty policy if an instance exists but does not have a policy set.
Authorization requires spanner.instances.getIamPolicy
on [resource][google.iam.v1.GetIamPolicyRequest.resource].
request | google::iam::v1::GetIamPolicyRequest |
Definition at line 189 of file instance_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::InstanceAdminClient::GetIamPolicy | ( | std::string const & | resource | ) |
Gets the access control policy for an instance resource.
Returns an empty policy if an instance exists but does not have a policy set.
Authorization requires spanner.instances.getIamPolicy
on [resource][google.iam.v1.GetIamPolicyRequest.resource].
resource | REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
Definition at line 123 of file instance_admin_client.cc.
StatusOr< google::spanner::admin::instance::v1::Instance > google::cloud::spanner_admin::v1::InstanceAdminClient::GetInstance | ( | google::spanner::admin::instance::v1::GetInstanceRequest const & | request | ) |
Gets information about a particular instance.
request | google::spanner::admin::instance::v1::GetInstanceRequest |
Definition at line 159 of file instance_admin_client.cc.
StatusOr< google::spanner::admin::instance::v1::Instance > google::cloud::spanner_admin::v1::InstanceAdminClient::GetInstance | ( | std::string const & | name | ) |
Gets information about a particular instance.
name | Required. The name of the requested instance. Values are of the form projects/<project>/instances/<instance> . |
Definition at line 57 of file instance_admin_client.cc.
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > google::cloud::spanner_admin::v1::InstanceAdminClient::GetInstanceConfig | ( | google::spanner::admin::instance::v1::GetInstanceConfigRequest const & | request | ) |
Gets information about a particular instance configuration.
request | google::spanner::admin::instance::v1::GetInstanceConfigRequest |
Definition at line 146 of file instance_admin_client.cc.
StatusOr< google::spanner::admin::instance::v1::InstanceConfig > google::cloud::spanner_admin::v1::InstanceAdminClient::GetInstanceConfig | ( | std::string const & | name | ) |
Gets information about a particular instance configuration.
name | Required. The name of the requested instance configuration. Values are of the form projects/<project>/instanceConfigs/<config> . |
Definition at line 43 of file instance_admin_client.cc.
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > google::cloud::spanner_admin::v1::InstanceAdminClient::ListInstanceConfigs | ( | google::spanner::admin::instance::v1::ListInstanceConfigsRequest | request | ) |
Lists the supported instance configurations for a given project.
request | google::spanner::admin::instance::v1::ListInstanceConfigsRequest |
Definition at line 140 of file instance_admin_client.cc.
StreamRange< google::spanner::admin::instance::v1::InstanceConfig > google::cloud::spanner_admin::v1::InstanceAdminClient::ListInstanceConfigs | ( | std::string const & | parent | ) |
Lists the supported instance configurations for a given project.
parent | Required. The name of the project for which a list of supported instance configurations is requested. Values are of the form projects/<project> . |
Definition at line 36 of file instance_admin_client.cc.
StreamRange< google::spanner::admin::instance::v1::Instance > google::cloud::spanner_admin::v1::InstanceAdminClient::ListInstances | ( | google::spanner::admin::instance::v1::ListInstancesRequest | request | ) |
Lists all instances in the given project.
request | google::spanner::admin::instance::v1::ListInstancesRequest |
Definition at line 153 of file instance_admin_client.cc.
StreamRange< google::spanner::admin::instance::v1::Instance > google::cloud::spanner_admin::v1::InstanceAdminClient::ListInstances | ( | std::string const & | parent | ) |
Lists all instances in the given project.
parent | Required. The name of the project for which a list of instances is requested. Values are of the form projects/<project> . |
Definition at line 50 of file instance_admin_client.cc.
|
default |
|
default |
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::InstanceAdminClient::SetIamPolicy | ( | google::iam::v1::SetIamPolicyRequest const & | request | ) |
Sets the access control policy on an instance resource.
Replaces any existing policy.
Authorization requires spanner.instances.setIamPolicy
on [resource][google.iam.v1.SetIamPolicyRequest.resource].
request | google::iam::v1::SetIamPolicyRequest |
Definition at line 184 of file instance_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::InstanceAdminClient::SetIamPolicy | ( | std::string const & | resource, |
google::iam::v1::Policy const & | policy | ||
) |
Sets the access control policy on an instance resource.
Replaces any existing policy.
Authorization requires spanner.instances.setIamPolicy
on [resource][google.iam.v1.SetIamPolicyRequest.resource].
resource | REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | REQUIRED: The complete policy to be applied to the resource . The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |
Definition at line 90 of file instance_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::InstanceAdminClient::SetIamPolicy | ( | std::string const & | resource, |
IamUpdater const & | updater, | ||
Options | options = {} |
||
) |
Updates the IAM policy for resource
using an optimistic concurrency control loop.
The loop fetches the current policy for resource
, and passes it to updater
, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If updater
does not yield a policy, the control loop is terminated and kCancelled is returned.
resource | Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
updater | Required. Functor to map the current policy to a new one. |
options | Optional. Options to control the loop. Expected options are: |
Definition at line 98 of file instance_admin_client.cc.
StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::v1::InstanceAdminClient::TestIamPermissions | ( | google::iam::v1::TestIamPermissionsRequest const & | request | ) |
Returns permissions that the caller has on the specified instance resource.
Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has spanner.instances.list
permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions.
request | google::iam::v1::TestIamPermissionsRequest |
Definition at line 195 of file instance_admin_client.cc.
StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::v1::InstanceAdminClient::TestIamPermissions | ( | std::string const & | resource, |
std::vector< std::string > const & | permissions | ||
) |
Returns permissions that the caller has on the specified instance resource.
Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has spanner.instances.list
permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions.
resource | REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | The set of permissions to check for the resource . Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview. |
Definition at line 131 of file instance_admin_client.cc.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > google::cloud::spanner_admin::v1::InstanceAdminClient::UpdateInstance | ( | google::spanner::admin::instance::v1::Instance const & | instance, |
google::protobuf::FieldMask const & | field_mask | ||
) |
Updates an instance, and begins allocating or releasing resources as requested.
The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance. If the named instance does not exist, returns NOT_FOUND
.
Immediately upon completion of this request:
Until completion of the returned operation:
CANCELLED
status.Upon completion of the returned operation:
The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id>
and can be used to track the instance modification. The [metadata][google.longrunning.Operation.metadata] field type is [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful.
Authorization requires spanner.instances.update
permission on resource [name][google.spanner.admin.instance.v1.Instance.name].
instance | Required. The instance to update, which must always include the instance name. Otherwise, only fields mentioned in [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included. |
field_mask | Required. A mask specifying which fields in [Instance][google.spanner.admin.instance.v1.Instance] should be updated. The field mask must always be specified; this prevents any future fields in [Instance][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know about them. |
Definition at line 75 of file instance_admin_client.cc.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > google::cloud::spanner_admin::v1::InstanceAdminClient::UpdateInstance | ( | google::spanner::admin::instance::v1::UpdateInstanceRequest const & | request | ) |
Updates an instance, and begins allocating or releasing resources as requested.
The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance. If the named instance does not exist, returns NOT_FOUND
.
Immediately upon completion of this request:
Until completion of the returned operation:
CANCELLED
status.Upon completion of the returned operation:
The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id>
and can be used to track the instance modification. The [metadata][google.longrunning.Operation.metadata] field type is [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful.
Authorization requires spanner.instances.update
permission on resource [name][google.spanner.admin.instance.v1.Instance.name].
request | google::spanner::admin::instance::v1::UpdateInstanceRequest |
Definition at line 172 of file instance_admin_client.cc.
|
friend |
Definition at line 81 of file instance_admin_client.h.
|
friend |
Definition at line 77 of file instance_admin_client.h.