Reference documentation and code samples for the Cloud Bigtable V2 Client class BigtableInstanceAdminClient.
Service Description: Service for creating, configuring, and deleting Cloud Bigtable Instances and Clusters. Provides access to the Instance and Cluster schemas only, not the tables' metadata or data stored in those tables.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$appProfileId = 'app_profile_id';
$appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile();
$response = $bigtableInstanceAdminClient->createAppProfile($formattedParent, $appProfileId, $appProfile);
} finally {
$bigtableInstanceAdminClient->close();
}
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Methods
appProfileName
Formats a string containing the fully-qualified path to represent a app_profile resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
appProfile |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted app_profile resource. |
clusterName
Formats a string containing the fully-qualified path to represent a cluster resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
cluster |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted cluster resource. |
instanceName
Formats a string containing the fully-qualified path to represent a instance resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted instance resource. |
locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted location resource. |
projectName
Formats a string containing the fully-qualified path to represent a project resource.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project resource. |
parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- appProfile: projects/{project}/instances/{instance}/appProfiles/{app_profile}
- cluster: projects/{project}/instances/{instance}/clusters/{cluster}
- instance: projects/{project}/instances/{instance}
- location: projects/{project}/locations/{location}
- project: projects/{project}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array | An associative array from name component IDs to component values. |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\ApiCore\LongRunning\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
createAppProfile
Creates an app profile within an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$appProfileId = 'app_profile_id';
$appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile();
$response = $bigtableInstanceAdminClient->createAppProfile($formattedParent, $appProfileId, $appProfile);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the instance in which to create the new app profile.
Values are of the form
|
appProfileId |
string
Required. The ID to be used when referring to the new app profile within its
instance, e.g., just |
appProfile |
Google\Cloud\Bigtable\Admin\V2\AppProfile
Required. The app profile to be created.
Fields marked |
optionalArgs |
array
Optional. |
↳ ignoreWarnings |
bool
If true, ignore safety checks when creating the app profile. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\AppProfile |
createCluster
Creates a cluster within an instance.
Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$clusterId = 'cluster_id';
$cluster = new Google\Cloud\Bigtable\Admin\V2\Cluster();
$operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'createCluster');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the instance in which to create the new cluster.
Values are of the form
|
clusterId |
string
Required. The ID to be used when referring to the new cluster within its instance,
e.g., just |
cluster |
Google\Cloud\Bigtable\Admin\V2\Cluster
Required. The cluster to be created.
Fields marked |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
createInstance
Create an instance within a project.
Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]');
$instanceId = 'instance_id';
$instance = new Google\Cloud\Bigtable\Admin\V2\Instance();
$clusters = [];
$operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'createInstance');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the project in which to create the new instance.
Values are of the form |
instanceId |
string
Required. The ID to be used when referring to the new instance within its project,
e.g., just |
instance |
Google\Cloud\Bigtable\Admin\V2\Instance
Required. The instance to create.
Fields marked |
clusters |
array
Required. The clusters to be created within the instance, mapped by desired
cluster ID, e.g., just |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
deleteAppProfile
Deletes an app profile from an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]');
$ignoreWarnings = false;
$bigtableInstanceAdminClient->deleteAppProfile($formattedName, $ignoreWarnings);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the app profile to be deleted. Values are of the form
|
ignoreWarnings |
bool
Required. If true, ignore safety checks when deleting the app profile. |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
deleteCluster
Deletes a cluster from an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
$bigtableInstanceAdminClient->deleteCluster($formattedName);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the cluster to be deleted. Values are of the form
|
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
deleteInstance
Delete an instance from a project.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$bigtableInstanceAdminClient->deleteInstance($formattedName);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the instance to be deleted.
Values are of the form |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
getAppProfile
Gets information about an app profile.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]');
$response = $bigtableInstanceAdminClient->getAppProfile($formattedName);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the requested app profile. Values are of the form
|
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\AppProfile |
getCluster
Gets information about a cluster.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
$response = $bigtableInstanceAdminClient->getCluster($formattedName);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the requested cluster. Values are of the form
|
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\Cluster |
getIamPolicy
Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$resource = 'resource';
$response = $bigtableInstanceAdminClient->getIamPolicy($resource);
} finally {
$bigtableInstanceAdminClient->close();
}
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. |
optionalArgs |
array
Optional. |
↳ options |
GetPolicyOptions
OPTIONAL: A |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
getInstance
Gets information about an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$response = $bigtableInstanceAdminClient->getInstance($formattedName);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
Required. The unique name of the requested instance. Values are of the form
|
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\Instance |
listAppProfiles
Lists information about app profiles in an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
// Iterate over pages of elements
$pagedResponse = $bigtableInstanceAdminClient->listAppProfiles($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $bigtableInstanceAdminClient->listAppProfiles($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the instance for which a list of app profiles is
requested. Values are of the form
|
optionalArgs |
array
Optional. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listClusters
Lists information about clusters in an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]');
$response = $bigtableInstanceAdminClient->listClusters($formattedParent);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the instance for which a list of clusters is requested.
Values are of the form |
optionalArgs |
array
Optional. |
↳ pageToken |
string
DEPRECATED: This field is unused and ignored. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\ListClustersResponse |
listHotTablets
Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
// Iterate over pages of elements
$pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent);
foreach ($pagedResponse->iteratePages() as $page) {
foreach ($page as $element) {
// doSomethingWith($element);
}
}
// Alternatively:
// Iterate through all elements
$pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent);
foreach ($pagedResponse->iterateAllElements() as $element) {
// doSomethingWith($element);
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The cluster name to list hot tablets.
Value is in the following form:
|
optionalArgs |
array
Optional. |
↳ startTime |
Timestamp
The start time to list hot tablets. The hot tablets in the response will have start times between the requested start time and end time. Start time defaults to Now if it is unset, and end time defaults to Now - 24 hours if it is unset. The start time should be less than the end time, and the maximum allowed time range between start time and end time is 48 hours. Start time and end time should have values between Now and Now - 14 days. |
↳ endTime |
Timestamp
The end time to list hot tablets. |
↳ pageSize |
int
The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. |
↳ pageToken |
string
A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listInstances
Lists information about instances in a project.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]');
$response = $bigtableInstanceAdminClient->listInstances($formattedParent);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
parent |
string
Required. The unique name of the project for which a list of instances is requested.
Values are of the form |
optionalArgs |
array
Optional. |
↳ pageToken |
string
DEPRECATED: This field is unused and ignored. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse |
partialUpdateCluster
Partially updates a cluster within a project. This method is the preferred way to update a Cluster.
To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask.
To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$cluster = new Google\Cloud\Bigtable\Admin\V2\Cluster();
$updateMask = new Google\Protobuf\FieldMask();
$operationResponse = $bigtableInstanceAdminClient->partialUpdateCluster($cluster, $updateMask);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->partialUpdateCluster($cluster, $updateMask);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'partialUpdateCluster');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
cluster |
Google\Cloud\Bigtable\Admin\V2\Cluster
Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. |
updateMask |
Google\Protobuf\FieldMask
Required. The subset of Cluster fields which should be replaced. |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
partialUpdateInstance
Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$instance = new Google\Cloud\Bigtable\Admin\V2\Instance();
$updateMask = new Google\Protobuf\FieldMask();
$operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'partialUpdateInstance');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
instance |
Google\Cloud\Bigtable\Admin\V2\Instance
Required. The Instance which will (partially) replace the current value. |
updateMask |
Google\Protobuf\FieldMask
Required. The subset of Instance fields which should be replaced. Must be explicitly set. |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
setIamPolicy
Sets the access control policy on an instance resource. Replaces any existing policy.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$resource = 'resource';
$policy = new Google\Cloud\Iam\V1\Policy();
$response = $bigtableInstanceAdminClient->setIamPolicy($resource, $policy);
} finally {
$bigtableInstanceAdminClient->close();
}
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 |
Google\Cloud\Iam\V1\Policy
REQUIRED: The complete policy to be applied to the |
optionalArgs |
array
Optional. |
↳ updateMask |
FieldMask
OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
testIamPermissions
Returns permissions that the caller has on the specified instance resource.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$resource = 'resource';
$permissions = [];
$response = $bigtableInstanceAdminClient->testIamPermissions($resource, $permissions);
} finally {
$bigtableInstanceAdminClient->close();
}
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 |
string[]
The set of permissions to check for the |
optionalArgs |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
updateAppProfile
Updates an app profile within an instance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile();
$updateMask = new Google\Protobuf\FieldMask();
$operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'updateAppProfile');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
appProfile |
Google\Cloud\Bigtable\Admin\V2\AppProfile
Required. The app profile which will (partially) replace the current value. |
updateMask |
Google\Protobuf\FieldMask
Required. The subset of app profile fields which should be replaced. If unset, all fields will be replaced. |
optionalArgs |
array
Optional. |
↳ ignoreWarnings |
bool
If true, ignore safety checks when updating the app profile. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
updateCluster
Updates a cluster within an instance.
Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$name = 'name';
$serveNodes = 0;
$operationResponse = $bigtableInstanceAdminClient->updateCluster($name, $serveNodes);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$result = $operationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $operationResponse->getError();
// handleError($error)
}
// Alternatively:
// start the operation, keep the operation name, and resume later
$operationResponse = $bigtableInstanceAdminClient->updateCluster($name, $serveNodes);
$operationName = $operationResponse->getName();
// ... do other work
$newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'updateCluster');
while (!$newOperationResponse->isDone()) {
// ... do other work
$newOperationResponse->reload();
}
if ($newOperationResponse->operationSucceeded()) {
$result = $newOperationResponse->getResult();
// doSomethingWith($result)
} else {
$error = $newOperationResponse->getError();
// handleError($error)
}
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
The unique name of the cluster. Values are of the form
|
serveNodes |
int
The number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance. |
optionalArgs |
array
Optional. |
↳ location |
string
Immutable. The location where this cluster's nodes and storage reside. For best performance, clients should be located as close as possible to this cluster. Currently only zones are supported, so values should be of the form |
↳ state |
int
Output only. The current state of the cluster. For allowed values, use constants defined on Google\Cloud\Bigtable\Admin\V2\Cluster\State |
↳ clusterConfig |
ClusterConfig
Configuration for this cluster. |
↳ defaultStorageType |
int
Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden. For allowed values, use constants defined on Google\Cloud\Bigtable\Admin\V2\StorageType |
↳ encryptionConfig |
EncryptionConfig
Immutable. The encryption configuration for CMEK-protected clusters. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
updateInstance
Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.
Sample code:
$bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient();
try {
$name = 'name';
$displayName = 'display_name';
$type = Google\Cloud\Bigtable\Admin\V2\Instance\Type::TYPE_UNSPECIFIED;
$labels = [];
$response = $bigtableInstanceAdminClient->updateInstance($name, $displayName, $type, $labels);
} finally {
$bigtableInstanceAdminClient->close();
}
Parameters | |
---|---|
Name | Description |
name |
string
The unique name of the instance. Values are of the form
|
displayName |
string
Required. The descriptive name for this instance as it appears in UIs. Can be changed at any time, but should be kept globally unique to avoid confusion. |
type |
int
The type of the instance. Defaults to |
labels |
array
Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. They can be used to filter resources and aggregate metrics.
|
optionalArgs |
array
Optional. |
↳ state |
int
( |
↳ createTime |
Timestamp
Output only. A server-assigned timestamp representing when this Instance was created. For instances created before this field was added (August 2021), this value is |
↳ satisfiesPzs |
bool
Output only. Reserved for future use. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Bigtable\Admin\V2\Instance |
Constants
SERVICE_NAME
Value: 'google.bigtable.admin.v2.BigtableInstanceAdmin'
The name of the service.
SERVICE_ADDRESS
Value: 'bigtableadmin.googleapis.com'
The default address of the service.
DEFAULT_SERVICE_PORT
Value: 443
The default port of the service.
CODEGEN_NAME
Value: 'gapic'
The name of the code generator, to be included in the agent header.