DatabaseService

A set of methods for managing MySQL databases.

Call Description
Get Returns the specified MySQL database.
List Retrieves the list of MySQL databases in the specified cluster.
Create Creates a new MySQL database in the specified cluster.
Delete Deletes the specified MySQL database.

Calls DatabaseService

Get

Returns the specified MySQL database.
To get the list of available MySQL databases, make a List request.

rpc Get (GetDatabaseRequest) returns (Database)

GetDatabaseRequest

Field Description
cluster_id string
Required. ID of the MySQL cluster that the database belongs to. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
database_name string
Required. Name of the MySQL database to return. To get the name of the database use a DatabaseService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the MySQL cluster that the database belongs to.

List

Retrieves the list of MySQL databases in the specified cluster.

rpc List (ListDatabasesRequest) returns (ListDatabasesResponse)

ListDatabasesRequest

Field Description
cluster_id string
Required. ID of the MySQL cluster to list databases in. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
page_size int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListDatabasesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 1000, inclusive.
page_token string
Page token. To get the next page of results, Set page_token to the ListDatabasesResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.

ListDatabasesResponse

Field Description
databases[] Database
List of MySQL databases.
next_page_token string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListDatabasesRequest.page_size, use the next_page_token as the value for the ListDatabasesRequest.page_token parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the MySQL cluster that the database belongs to.

Create

Creates a new MySQL database in the specified cluster.

rpc Create (CreateDatabaseRequest) returns (operation.Operation)

Metadata and response of Operation:
    Operation.metadata:CreateDatabaseMetadata
    Operation.response:Database

CreateDatabaseRequest

Field Description
cluster_id string
Required. ID of the MySQL cluster to create a database in. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
database_spec DatabaseSpec
Required. Configuration of the database to create.

DatabaseSpec

Field Description
name string
Required. Name of the MySQL database. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<CreateDatabaseMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<Database>
if operation finished successfully.

CreateDatabaseMetadata

Field Description
cluster_id string
ID of the MySQL cluster where a database is being created.
database_name string
Name of the MySQL database that is being created.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the MySQL cluster that the database belongs to.

Delete

Deletes the specified MySQL database.

rpc Delete (DeleteDatabaseRequest) returns (operation.Operation)

Metadata and response of Operation:
    Operation.metadata:DeleteDatabaseMetadata
    Operation.response:google.protobuf.Empty

DeleteDatabaseRequest

Field Description
cluster_id string
Required. ID of the MySQL cluster to delete a database in. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50.
database_name string
Required. Name of the database to delete. To get the name of the database, use a DatabaseService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<DeleteDatabaseMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<google.protobuf.Empty>
if operation finished successfully.

DeleteDatabaseMetadata

Field Description
cluster_id string
ID of the MySQL cluster where a database is being deleted.
database_name string
Name of the MySQL database that is being deleted.