public abstract class InstanceAdminClient
InstanceAdmin client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Spanner.Admin.Instance.V1Assembly
Google.Cloud.Spanner.Admin.Instance.V1.dll
Remarks
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.
Properties
CreateInstanceOperationsClient
public virtual OperationsClient CreateInstanceOperationsClient { get; }
The long-running operations client for CreateInstance
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the InstanceAdmin service, which is a host of "spanner.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default InstanceAdmin scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default InstanceAdmin scopes are:
GrpcClient
public virtual InstanceAdmin.InstanceAdminClient GrpcClient { get; }
The underlying gRPC InstanceAdmin client
Property Value | |
---|---|
Type | Description |
InstanceAdmin.InstanceAdminClient |
UpdateInstanceOperationsClient
public virtual OperationsClient UpdateInstanceOperationsClient { get; }
The long-running operations client for UpdateInstance
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static InstanceAdminClient Create()
Synchronously creates a InstanceAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstanceAdminClientBuilder.
Returns | |
---|---|
Type | Description |
InstanceAdminClient | The created InstanceAdminClient. |
CreateAsync(CancellationToken)
public static Task<InstanceAdminClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a InstanceAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstanceAdminClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<InstanceAdminClient> | The task representing the created InstanceAdminClient. |
CreateInstance(ProjectName, String, Instance, CallSettings)
public virtual Operation<Instance, CreateInstanceMetadata> CreateInstance(ProjectName parent, string instanceId, Instance instance, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, CreateInstanceMetadata> | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = instanceAdminClient.CreateInstance(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = instanceAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(CreateInstanceRequest, CallSettings)
public virtual Operation<Instance, CreateInstanceMetadata> CreateInstance(CreateInstanceRequest request, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, CreateInstanceMetadata> | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
InstanceId = "",
Instance = new Instance(),
};
// Make the request
Operation<Instance, CreateInstanceMetadata> response = instanceAdminClient.CreateInstance(request);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = instanceAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(String, String, Instance, CallSettings)
public virtual Operation<Instance, CreateInstanceMetadata> CreateInstance(string parent, string instanceId, Instance instance, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, CreateInstanceMetadata> | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = instanceAdminClient.CreateInstance(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = instanceAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(ProjectName, String, Instance, CallSettings)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(ProjectName parent, string instanceId, Instance instance, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(ProjectName, String, Instance, CancellationToken)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(ProjectName parent, string instanceId, Instance instance, CancellationToken cancellationToken)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(CreateInstanceRequest request, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
InstanceId = "",
Instance = new Instance(),
};
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(CreateInstanceRequest request, CancellationToken cancellationToken)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
InstanceId = "",
Instance = new Instance(),
};
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(String, String, Instance, CallSettings)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(string parent, string instanceId, Instance instance, CallSettings callSettings = null)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(String, String, Instance, CancellationToken)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> CreateInstanceAsync(string parent, string instanceId, Instance instance, CancellationToken cancellationToken)
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:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project in which to create the instance. Values
are of the form |
instanceId | String Required. The ID of the instance to create. Valid identifiers are of the
form |
instance | Instance Required. The instance to create. The name may be omitted, but if
specified must be |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string instanceId = "";
Instance instance = new Instance();
// Make the request
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(parent, instanceId, instance);
// Poll until the returned long-running operation is complete
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstance(DeleteInstanceRequest, CallSettings)
public virtual void DeleteInstance(DeleteInstanceRequest request, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
request | DeleteInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
DeleteInstanceRequest request = new DeleteInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
};
// Make the request
instanceAdminClient.DeleteInstance(request);
DeleteInstance(InstanceName, CallSettings)
public virtual void DeleteInstance(InstanceName name, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance to be deleted. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
instanceAdminClient.DeleteInstance(name);
DeleteInstance(String, CallSettings)
public virtual void DeleteInstance(string name, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the instance to be deleted. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
instanceAdminClient.DeleteInstance(name);
DeleteInstanceAsync(DeleteInstanceRequest, CallSettings)
public virtual Task DeleteInstanceAsync(DeleteInstanceRequest request, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
request | DeleteInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteInstanceRequest request = new DeleteInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
};
// Make the request
await instanceAdminClient.DeleteInstanceAsync(request);
DeleteInstanceAsync(DeleteInstanceRequest, CancellationToken)
public virtual Task DeleteInstanceAsync(DeleteInstanceRequest request, CancellationToken cancellationToken)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
request | DeleteInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteInstanceRequest request = new DeleteInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
};
// Make the request
await instanceAdminClient.DeleteInstanceAsync(request);
DeleteInstanceAsync(InstanceName, CallSettings)
public virtual Task DeleteInstanceAsync(InstanceName name, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance to be deleted. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
await instanceAdminClient.DeleteInstanceAsync(name);
DeleteInstanceAsync(InstanceName, CancellationToken)
public virtual Task DeleteInstanceAsync(InstanceName name, CancellationToken cancellationToken)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance to be deleted. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
await instanceAdminClient.DeleteInstanceAsync(name);
DeleteInstanceAsync(String, CallSettings)
public virtual Task DeleteInstanceAsync(string name, CallSettings callSettings = null)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the instance to be deleted. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
await instanceAdminClient.DeleteInstanceAsync(name);
DeleteInstanceAsync(String, CancellationToken)
public virtual Task DeleteInstanceAsync(string name, CancellationToken cancellationToken)
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the instance to be deleted. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
await instanceAdminClient.DeleteInstanceAsync(name);
GetIamPolicy(IResourceName, CallSettings)
public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = instanceAdminClient.GetIamPolicy(resource);
GetIamPolicy(GetIamPolicyRequest, CallSettings)
public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = instanceAdminClient.GetIamPolicy(request);
GetIamPolicy(String, CallSettings)
public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = instanceAdminClient.GetIamPolicy(resource);
GetIamPolicyAsync(IResourceName, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(IResourceName, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(String, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(String, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await instanceAdminClient.GetIamPolicyAsync(resource);
GetInstance(GetInstanceRequest, CallSettings)
public virtual Instance GetInstance(GetInstanceRequest request, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
request | GetInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Instance | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
FieldMask = new FieldMask(),
};
// Make the request
Instance response = instanceAdminClient.GetInstance(request);
GetInstance(InstanceName, CallSettings)
public virtual Instance GetInstance(InstanceName name, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the requested instance. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Instance | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
Instance response = instanceAdminClient.GetInstance(name);
GetInstance(String, CallSettings)
public virtual Instance GetInstance(string name, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Instance | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
Instance response = instanceAdminClient.GetInstance(name);
GetInstanceAsync(GetInstanceRequest, CallSettings)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
request | GetInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
FieldMask = new FieldMask(),
};
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(request);
GetInstanceAsync(GetInstanceRequest, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CancellationToken cancellationToken)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
request | GetInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
FieldMask = new FieldMask(),
};
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(request);
GetInstanceAsync(InstanceName, CallSettings)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the requested instance. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(name);
GetInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CancellationToken cancellationToken)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the requested instance. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(name);
GetInstanceAsync(String, CallSettings)
public virtual Task<Instance> GetInstanceAsync(string name, CallSettings callSettings = null)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(name);
GetInstanceAsync(String, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(string name, CancellationToken cancellationToken)
Gets information about a particular instance.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Instance> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
Instance response = await instanceAdminClient.GetInstanceAsync(name);
GetInstanceConfig(GetInstanceConfigRequest, CallSettings)
public virtual InstanceConfig GetInstanceConfig(GetInstanceConfigRequest request, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
request | GetInstanceConfigRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
InstanceConfig | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
GetInstanceConfigRequest request = new GetInstanceConfigRequest
{
InstanceConfigName = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]"),
};
// Make the request
InstanceConfig response = instanceAdminClient.GetInstanceConfig(request);
GetInstanceConfig(InstanceConfigName, CallSettings)
public virtual InstanceConfig GetInstanceConfig(InstanceConfigName name, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | InstanceConfigName Required. The name of the requested instance configuration. Values are of
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
InstanceConfig | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
InstanceConfigName name = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]");
// Make the request
InstanceConfig response = instanceAdminClient.GetInstanceConfig(name);
GetInstanceConfig(String, CallSettings)
public virtual InstanceConfig GetInstanceConfig(string name, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance configuration. Values are of
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
InstanceConfig | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instanceConfigs/[INSTANCE_CONFIG]";
// Make the request
InstanceConfig response = instanceAdminClient.GetInstanceConfig(name);
GetInstanceConfigAsync(GetInstanceConfigRequest, CallSettings)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(GetInstanceConfigRequest request, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
request | GetInstanceConfigRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetInstanceConfigRequest request = new GetInstanceConfigRequest
{
InstanceConfigName = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]"),
};
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(request);
GetInstanceConfigAsync(GetInstanceConfigRequest, CancellationToken)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(GetInstanceConfigRequest request, CancellationToken cancellationToken)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
request | GetInstanceConfigRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
GetInstanceConfigRequest request = new GetInstanceConfigRequest
{
InstanceConfigName = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]"),
};
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(request);
GetInstanceConfigAsync(InstanceConfigName, CallSettings)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(InstanceConfigName name, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | InstanceConfigName Required. The name of the requested instance configuration. Values are of
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceConfigName name = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]");
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(name);
GetInstanceConfigAsync(InstanceConfigName, CancellationToken)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(InstanceConfigName name, CancellationToken cancellationToken)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | InstanceConfigName Required. The name of the requested instance configuration. Values are of
the form |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceConfigName name = InstanceConfigName.FromProjectInstanceConfig("[PROJECT]", "[INSTANCE_CONFIG]");
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(name);
GetInstanceConfigAsync(String, CallSettings)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(string name, CallSettings callSettings = null)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance configuration. Values are of
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instanceConfigs/[INSTANCE_CONFIG]";
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(name);
GetInstanceConfigAsync(String, CancellationToken)
public virtual Task<InstanceConfig> GetInstanceConfigAsync(string name, CancellationToken cancellationToken)
Gets information about a particular instance configuration.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the requested instance configuration. Values are of
the form |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<InstanceConfig> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instanceConfigs/[INSTANCE_CONFIG]";
// Make the request
InstanceConfig response = await instanceAdminClient.GetInstanceConfigAsync(name);
ListInstanceConfigs(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigs(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project for which a list of supported instance
configurations is requested. Values are of the form
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceConfig item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstanceConfigsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstanceConfigs(ListInstanceConfigsRequest, CallSettings)
public virtual PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigs(ListInstanceConfigsRequest request, CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
request | ListInstanceConfigsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
ListInstanceConfigsRequest request = new ListInstanceConfigsRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigs(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceConfig item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstanceConfigsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstanceConfigs(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigs(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project for which a list of supported instance
configurations is requested. Values are of the form
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceConfig item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstanceConfigsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstanceConfigsAsync(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigsAsync(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project for which a list of supported instance
configurations is requested. Values are of the form
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable asynchronous sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceConfig item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstanceConfigsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstanceConfigsAsync(ListInstanceConfigsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigsAsync(ListInstanceConfigsRequest request, CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
request | ListInstanceConfigsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable asynchronous sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ListInstanceConfigsRequest request = new ListInstanceConfigsRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceConfig item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstanceConfigsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstanceConfigsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> ListInstanceConfigsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists the supported instance configurations for a given project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project for which a list of supported instance
configurations is requested. Values are of the form
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> | A pageable asynchronous sequence of InstanceConfig resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListInstanceConfigsResponse, InstanceConfig> response = instanceAdminClient.ListInstanceConfigsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceConfig item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstanceConfigsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (InstanceConfig item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceConfig> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceConfig item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstances(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project for which a list of instances is
requested. Values are of the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstancesResponse, Instance> | A pageable sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstances(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstances(ListInstancesRequest, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(ListInstancesRequest request, CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
request | ListInstancesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstancesResponse, Instance> | A pageable sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
ListInstancesRequest request = new ListInstancesRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstances(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstances(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project for which a list of instances is
requested. Values are of the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInstancesResponse, Instance> | A pageable sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstances(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The name of the project for which a list of instances is
requested. Values are of the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstancesResponse, Instance> | A pageable asynchronous sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstancesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Instance item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstancesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(ListInstancesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(ListInstancesRequest request, CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
request | ListInstancesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstancesResponse, Instance> | A pageable asynchronous sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
ListInstancesRequest request = new ListInstancesRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstancesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Instance item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstancesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Lists all instances in the given project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the project for which a list of instances is
requested. Values are of the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInstancesResponse, Instance> | A pageable asynchronous sequence of Instance resources. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListInstancesResponse, Instance> response = instanceAdminClient.ListInstancesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Instance item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInstancesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
PollOnceCreateInstance(String, CallSettings)
public virtual Operation<Instance, CreateInstanceMetadata> PollOnceCreateInstance(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of CreateInstance
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, CreateInstanceMetadata> | The result of polling the operation. |
PollOnceCreateInstanceAsync(String, CallSettings)
public virtual Task<Operation<Instance, CreateInstanceMetadata>> PollOnceCreateInstanceAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
CreateInstance
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, CreateInstanceMetadata>> | A task representing the result of polling the operation. |
PollOnceUpdateInstance(String, CallSettings)
public virtual Operation<Instance, UpdateInstanceMetadata> PollOnceUpdateInstance(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of UpdateInstance
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, UpdateInstanceMetadata> | The result of polling the operation. |
PollOnceUpdateInstanceAsync(String, CallSettings)
public virtual Task<Operation<Instance, UpdateInstanceMetadata>> PollOnceUpdateInstanceAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
UpdateInstance
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, UpdateInstanceMetadata>> | A task representing the result of polling the operation. |
SetIamPolicy(IResourceName, Policy, CallSettings)
public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = instanceAdminClient.SetIamPolicy(resource, policy);
SetIamPolicy(SetIamPolicyRequest, CallSettings)
public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
};
// Make the request
Policy response = instanceAdminClient.SetIamPolicy(request);
SetIamPolicy(String, Policy, CallSettings)
public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = instanceAdminClient.SetIamPolicy(resource, policy);
SetIamPolicyAsync(IResourceName, Policy, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(resource, policy);
SetIamPolicyAsync(IResourceName, Policy, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(resource, policy);
SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
};
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(request);
SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
request | SetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Policy = new Policy(),
};
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(request);
SetIamPolicyAsync(String, Policy, CallSettings)
public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(resource, policy);
SetIamPolicyAsync(String, Policy, CancellationToken)
public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)
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].
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | Policy REQUIRED: The complete policy to be applied to the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await instanceAdminClient.SetIamPolicyAsync(resource, policy);
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
TestIamPermissions(IResourceName, IEnumerable<String>, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = instanceAdminClient.TestIamPermissions(resource, permissions);
TestIamPermissions(TestIamPermissionsRequest, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = instanceAdminClient.TestIamPermissions(request);
TestIamPermissions(String, IEnumerable<String>, CallSettings)
public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TestIamPermissionsResponse | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = instanceAdminClient.TestIamPermissions(resource, permissions);
TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)
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.
Parameters | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(request);
TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)
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.
Parameters | |
---|---|
Name | Description |
request | TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(request);
TestIamPermissionsAsync(String, IEnumerable<String>, CallSettings)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)
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.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(resource, permissions);
TestIamPermissionsAsync(String, IEnumerable<String>, CancellationToken)
public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)
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.
Parameters | |
---|---|
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | IEnumerable<String> The set of permissions to check for the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<TestIamPermissionsResponse> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await instanceAdminClient.TestIamPermissionsAsync(resource, permissions);
UpdateInstance(Instance, FieldMask, CallSettings)
public virtual Operation<Instance, UpdateInstanceMetadata> UpdateInstance(Instance instance, FieldMask fieldMask, CallSettings callSettings = null)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
instance | 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. |
fieldMask | FieldMask 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, UpdateInstanceMetadata> | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
Instance instance = new Instance();
FieldMask fieldMask = new FieldMask();
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = instanceAdminClient.UpdateInstance(instance, fieldMask);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = instanceAdminClient.PollOnceUpdateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
UpdateInstance(UpdateInstanceRequest, CallSettings)
public virtual Operation<Instance, UpdateInstanceMetadata> UpdateInstance(UpdateInstanceRequest request, CallSettings callSettings = null)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
request | UpdateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Instance, UpdateInstanceMetadata> | The RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
// Initialize request argument(s)
UpdateInstanceRequest request = new UpdateInstanceRequest
{
Instance = new Instance(),
FieldMask = new FieldMask(),
};
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = instanceAdminClient.UpdateInstance(request);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = instanceAdminClient.PollOnceUpdateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
UpdateInstanceAsync(Instance, FieldMask, CallSettings)
public virtual Task<Operation<Instance, UpdateInstanceMetadata>> UpdateInstanceAsync(Instance instance, FieldMask fieldMask, CallSettings callSettings = null)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
instance | 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. |
fieldMask | FieldMask 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, UpdateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
Instance instance = new Instance();
FieldMask fieldMask = new FieldMask();
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = await instanceAdminClient.UpdateInstanceAsync(instance, fieldMask);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceUpdateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
UpdateInstanceAsync(Instance, FieldMask, CancellationToken)
public virtual Task<Operation<Instance, UpdateInstanceMetadata>> UpdateInstanceAsync(Instance instance, FieldMask fieldMask, CancellationToken cancellationToken)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
instance | 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. |
fieldMask | FieldMask 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. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, UpdateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
Instance instance = new Instance();
FieldMask fieldMask = new FieldMask();
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = await instanceAdminClient.UpdateInstanceAsync(instance, fieldMask);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceUpdateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
UpdateInstanceAsync(UpdateInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, UpdateInstanceMetadata>> UpdateInstanceAsync(UpdateInstanceRequest request, CallSettings callSettings = null)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
request | UpdateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, UpdateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
UpdateInstanceRequest request = new UpdateInstanceRequest
{
Instance = new Instance(),
FieldMask = new FieldMask(),
};
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = await instanceAdminClient.UpdateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceUpdateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
UpdateInstanceAsync(UpdateInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, UpdateInstanceMetadata>> UpdateInstanceAsync(UpdateInstanceRequest request, CancellationToken cancellationToken)
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:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
[cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
restoring resources to their pre-request values. The operation
is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format &lt;instance_name&gt;/operations/&lt;operation_id&gt;
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].
Parameters | |
---|---|
Name | Description |
request | UpdateInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Instance, UpdateInstanceMetadata>> | A Task containing the RPC response. |
// Create client
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync();
// Initialize request argument(s)
UpdateInstanceRequest request = new UpdateInstanceRequest
{
Instance = new Instance(),
FieldMask = new FieldMask(),
};
// Make the request
Operation<Instance, UpdateInstanceMetadata> response = await instanceAdminClient.UpdateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, UpdateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, UpdateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceUpdateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}