Managed Service for MySQL API, gRPC: UserService
A set of methods for managing MySQL users.
See the documentation for details.
Call | Description |
---|---|
Get | Retrieves information about the specified user. |
List | Retrieves the list of users in a cluster. |
Create | Creates a user in a cluster. |
Update | Updates a user in a cluster. |
Delete | Deletes a user in a cluster. |
GrantPermission | Grants permission to access a database to a user in a cluster. |
RevokePermission | Revokes permission to access a database from a user in a cluster. |
Calls UserService
Get
Retrieves information about the specified user.
rpc Get (GetUserRequest) returns (User)
GetUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster the user belongs to. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to return information about. To get this name, make a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |
List
Retrieves the list of users in a cluster.
rpc List (ListUsersRequest) returns (ListUsersResponse)
ListUsersRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to list the users in. To get this ID, make 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 API returns a ListUsersResponse.next_page_token that can be used to get the next page of results in the subsequent UserService.List requests. Acceptable values are 0 to 1000, inclusive. |
page_token | string Page token that can be used to iterate through multiple pages of results. To get the next page of results, set page_token to the ListUsersResponse.next_page_token returned by the previous UserService.List request. The maximum string length in characters is 100. |
ListUsersResponse
Field | Description |
---|---|
users[] | User List of users. |
next_page_token | string The token that can be used to get the next page of results. If the number of results is larger than ListUsersRequest.page_size, use the next_page_token as the value for the ListUsersRequest.page_token in the subsequent UserService.List request to iterate through multiple pages of results. Each of the subsequent UserService.List requests should use the next_page_token value returned by the previous request to continue paging through the results. |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |
Create
Creates a user in a cluster.
rpc Create (CreateUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateUserMetadata
Operation.response:User
CreateUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to create the user in. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_spec | UserSpec Required. Configuration of the user. |
UserSpec
Field | Description |
---|---|
name | string Required. Name of the user. The maximum string length in characters is 32. Value must match the regular expression [a-zA-Z0-9_-]* . |
password | string Required. Password of the user. The string length in characters must be 8-128. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. One permission per database. When a permission for a database is set, the user will have access to the database. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |
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 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 if operation finished successfully. |
CreateUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the cluster the user is being created in. |
user_name | string Name of the user that is being created. |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
Update
Updates a user in a cluster.
rpc Update (UpdateUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateUserMetadata
Operation.response:User
UpdateUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to update the user in. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to update. To get this name, make a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
update_mask | google.protobuf.FieldMask Field mask that specifies which settings of the user should be updated. |
password | string New password for the user. The string length in characters must be 8-128. |
permissions[] | Permission A new set of permissions that should be granted to the user. |
global_permissions[] | enum GlobalPermission New set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of changed user connection limits. |
authentication_plugin | enum AuthPlugin New user authentication plugin.
|
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |
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 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 if operation finished successfully. |
UpdateUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the cluster the user is being updated in. |
user_name | string Name of the user that is being updated. |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
Delete
Deletes a user in a cluster.
rpc Delete (DeleteUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteUserMetadata
Operation.response:google.protobuf.Empty
DeleteUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to delete the user from. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to delete. To get this name, make a UserService.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 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 if operation finished successfully. |
DeleteUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the cluster the user is being deleted from. |
user_name | string Name of the user that is being deleted. |
GrantPermission
Grants permission to access a database to a user in a cluster.
rpc GrantPermission (GrantUserPermissionRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:GrantUserPermissionMetadata
Operation.response:User
GrantUserPermissionRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to grant permission to the user in. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to grant permission to. To get this name, make a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
permission | Permission Required. Permission that should be granted to the specified user. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
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 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 if operation finished successfully. |
GrantUserPermissionMetadata
Field | Description |
---|---|
cluster_id | string ID of the cluster the user is being granted a permission in. |
user_name | string Name of the user that is being granted a permission. |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |
RevokePermission
Revokes permission to access a database from a user in a cluster.
rpc RevokePermission (RevokeUserPermissionRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:RevokeUserPermissionMetadata
Operation.response:User
RevokeUserPermissionRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to revoke permission from the user in. To get this ID, make a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to revoke permission from. To get this name, make a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
permission | Permission Required. Permission that should be revoked from the user. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
roles[] | enum Privilege Roles granted to the user within the database. See the documentation for details. The minimum number of elements is 1.
|
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 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 if operation finished successfully. |
RevokeUserPermissionMetadata
Field | Description |
---|---|
cluster_id | string ID of the cluster the user is being revoked a permission in. |
user_name | string Name of the user whose permission is being revoked. |
User
Field | Description |
---|---|
name | string Name of the user. |
cluster_id | string ID of the cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user. |
global_permissions[] | enum GlobalPermission Set of global permissions to grant to the user.
|
connection_limits | ConnectionLimits Set of user connection limits. |
authentication_plugin | enum AuthPlugin User authentication plugin.
|
ConnectionLimits
Field | Description |
---|---|
max_questions_per_hour | google.protobuf.Int64Value The maximum permitted number of user questions per hour. The minimum value is 0. |
max_updates_per_hour | google.protobuf.Int64Value The maximum permitted number of user updates per hour. The minimum value is 0. |
max_connections_per_hour | google.protobuf.Int64Value The maximum permitted number of simultaneous client connections per hour. The minimum value is 0. |
max_user_connections | google.protobuf.Int64Value The maximum number of simultaneous connections permitted to any given MySQL user account. The minimum value is 0. |