@@ -187,6 +187,10 @@ service DatabaseAdmin {
187187 post : "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions"
188188 body : "*"
189189 }
190+ additional_bindings {
191+ post : "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions"
192+ body : "*"
193+ }
190194 };
191195 option (google.api.method_signature ) = "resource,permissions" ;
192196 }
@@ -334,6 +338,14 @@ service DatabaseAdmin {
334338 };
335339 option (google.api.method_signature ) = "parent" ;
336340 }
341+
342+ // Lists Cloud Spanner database roles.
343+ rpc ListDatabaseRoles (ListDatabaseRolesRequest ) returns (ListDatabaseRolesResponse ) {
344+ option (google.api.http ) = {
345+ get : "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles"
346+ };
347+ option (google.api.method_signature ) = "parent" ;
348+ }
337349}
338350
339351// Information about the database restore.
@@ -868,3 +880,51 @@ enum RestoreSourceType {
868880 // A backup was used as the source of the restore.
869881 BACKUP = 1 ;
870882}
883+
884+ // A Cloud Spanner database role.
885+ message DatabaseRole {
886+ option (google.api.resource ) = {
887+ type : "spanner.googleapis.com/DatabaseRole"
888+ pattern : "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}"
889+ };
890+
891+ // Required. The name of the database role. Values are of the form
892+ // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
893+ // {role}`, where `<role>` is as specified in the `CREATE ROLE`
894+ // DDL statement. This name can be passed to Get/Set IAMPolicy methods to
895+ // identify the database role.
896+ string name = 1 [(google.api.field_behavior ) = REQUIRED ];
897+ }
898+
899+ // The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
900+ message ListDatabaseRolesRequest {
901+ // Required. The database whose roles should be listed.
902+ // Values are of the form
903+ // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
904+ string parent = 1 [
905+ (google.api.field_behavior ) = REQUIRED ,
906+ (google.api.resource_reference ) = {
907+ type : "spanner.googleapis.com/Database"
908+ }
909+ ];
910+
911+ // Number of database roles to be returned in the response. If 0 or less,
912+ // defaults to the server's maximum allowed page size.
913+ int32 page_size = 2 ;
914+
915+ // If non-empty, `page_token` should contain a
916+ // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
917+ // previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
918+ string page_token = 3 ;
919+ }
920+
921+ // The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
922+ message ListDatabaseRolesResponse {
923+ // Database roles that matched the request.
924+ repeated DatabaseRole database_roles = 1 ;
925+
926+ // `next_page_token` can be sent in a subsequent
927+ // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
928+ // call to fetch more of the matching roles.
929+ string next_page_token = 2 ;
930+ }
0 commit comments