1- // Copyright 2019 Google LLC.
1+ // Copyright 2020 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
14- //
1514
1615syntax = "proto3" ;
1716
@@ -33,10 +32,6 @@ option java_multiple_files = true;
3332option java_outer_classname = "SpannerDatabaseAdminProto" ;
3433option java_package = "com.google.spanner.admin.database.v1" ;
3534option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1" ;
36-
37- // The Instance resource is defined in `google.spanner.admin.instance.v1`.
38- // Because this is a separate, independent API (technically), we redefine
39- // the resource name pattern here.
4035option (google.api.resource_definition ) = {
4136 type : "spanner.googleapis.com/Instance"
4237 pattern : "projects/{project}/instances/{instance}"
@@ -66,11 +61,10 @@ service DatabaseAdmin {
6661 // have a name of the format `<database_name>/operations/<operation_id>` and
6762 // can be used to track preparation of the database. The
6863 // [metadata][google.longrunning.Operation.metadata] field type is
69- // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
70- // The [response][google.longrunning.Operation.response] field type is
64+ // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
65+ // [response][google.longrunning.Operation.response] field type is
7166 // [Database][google.spanner.admin.database.v1.Database], if successful.
72- rpc CreateDatabase (CreateDatabaseRequest )
73- returns (google.longrunning.Operation ) {
67+ rpc CreateDatabase (CreateDatabaseRequest ) returns (google.longrunning.Operation ) {
7468 option (google.api.http ) = {
7569 post : "/v1/{parent=projects/*/instances/*}/databases"
7670 body : "*"
@@ -96,10 +90,8 @@ service DatabaseAdmin {
9690 // the format `<database_name>/operations/<operation_id>` and can be used to
9791 // track execution of the schema change(s). The
9892 // [metadata][google.longrunning.Operation.metadata] field type is
99- // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
100- // The operation has no response.
101- rpc UpdateDatabaseDdl (UpdateDatabaseDdlRequest )
102- returns (google.longrunning.Operation ) {
93+ // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
94+ rpc UpdateDatabaseDdl (UpdateDatabaseDdlRequest ) returns (google.longrunning.Operation ) {
10395 option (google.api.http ) = {
10496 patch : "/v1/{database=projects/*/instances/*/databases/*}/ddl"
10597 body : "*"
@@ -134,8 +126,7 @@ service DatabaseAdmin {
134126 //
135127 // Authorization requires `spanner.databases.setIamPolicy`
136128 // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
137- rpc SetIamPolicy (google.iam.v1.SetIamPolicyRequest )
138- returns (google.iam.v1.Policy ) {
129+ rpc SetIamPolicy (google.iam.v1.SetIamPolicyRequest ) returns (google.iam.v1.Policy ) {
139130 option (google.api.http ) = {
140131 post : "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy"
141132 body : "*"
@@ -153,8 +144,7 @@ service DatabaseAdmin {
153144 //
154145 // Authorization requires `spanner.databases.getIamPolicy` permission on
155146 // [resource][google.iam.v1.GetIamPolicyRequest.resource].
156- rpc GetIamPolicy (google.iam.v1.GetIamPolicyRequest )
157- returns (google.iam.v1.Policy ) {
147+ rpc GetIamPolicy (google.iam.v1.GetIamPolicyRequest ) returns (google.iam.v1.Policy ) {
158148 option (google.api.http ) = {
159149 post : "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy"
160150 body : "*"
@@ -172,8 +162,7 @@ service DatabaseAdmin {
172162 // result in a NOT_FOUND error if the user has
173163 // `spanner.databases.list` permission on the containing Cloud
174164 // Spanner instance. Otherwise returns an empty set of permissions.
175- rpc TestIamPermissions (google.iam.v1.TestIamPermissionsRequest )
176- returns (google.iam.v1.TestIamPermissionsResponse ) {
165+ rpc TestIamPermissions (google.iam.v1.TestIamPermissionsRequest ) returns (google.iam.v1.TestIamPermissionsResponse ) {
177166 option (google.api.http ) = {
178167 post : "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions"
179168 body : "*"
@@ -217,8 +206,7 @@ message Database {
217206 State state = 2 ;
218207}
219208
220- // The request for
221- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
209+ // The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
222210message ListDatabasesRequest {
223211 // Required. The instance whose databases should be listed.
224212 // Values are of the form `projects/<project>/instances/<instance>`.
@@ -234,26 +222,23 @@ message ListDatabasesRequest {
234222 int32 page_size = 3 ;
235223
236224 // If non-empty, `page_token` should contain a
237- // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token]
238- // from a previous
239- // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse].
225+ // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a
226+ // previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse].
240227 string page_token = 4 ;
241228}
242229
243- // The response for
244- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
230+ // The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
245231message ListDatabasesResponse {
246232 // Databases that matched the request.
247233 repeated Database databases = 1 ;
248234
249235 // `next_page_token` can be sent in a subsequent
250- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]
251- // call to fetch more of the matching databases.
236+ // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more
237+ // of the matching databases.
252238 string next_page_token = 2 ;
253239}
254240
255- // The request for
256- // [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
241+ // The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
257242message CreateDatabaseRequest {
258243 // Required. The name of the instance that will serve the new database.
259244 // Values are of the form `projects/<project>/instances/<instance>`.
@@ -283,12 +268,11 @@ message CreateDatabaseRequest {
283268message CreateDatabaseMetadata {
284269 // The database being created.
285270 string database = 1 [(google.api.resource_reference ) = {
286- type : "spanner.googleapis.com/Database"
287- }];
271+ type : "spanner.googleapis.com/Database"
272+ }];
288273}
289274
290- // The request for
291- // [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
275+ // The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
292276message GetDatabaseRequest {
293277 // Required. The name of the requested database. Values are of the form
294278 // `projects/<project>/instances/<instance>/databases/<database>`.
@@ -314,8 +298,8 @@ message GetDatabaseRequest {
314298// Each batch of statements is assigned a name which can be used with
315299// the [Operations][google.longrunning.Operations] API to monitor
316300// progress. See the
317- // [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id]
318- // field for more details.
301+ // [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more
302+ // details.
319303message UpdateDatabaseDdlRequest {
320304 // Required. The database to update.
321305 string database = 1 [
@@ -335,20 +319,18 @@ message UpdateDatabaseDdlRequest {
335319 //
336320 // Specifying an explicit operation ID simplifies determining
337321 // whether the statements were executed in the event that the
338- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
339- // call is replayed, or the return value is otherwise lost: the
340- // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database]
341- // and `operation_id` fields can be combined to form the
322+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
323+ // or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
324+ // `operation_id` fields can be combined to form the
342325 // [name][google.longrunning.Operation.name] of the resulting
343- // [longrunning.Operation][google.longrunning.Operation]:
344- // `<database>/operations/<operation_id>`.
326+ // [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`.
345327 //
346328 // `operation_id` should be unique within the database, and must be
347329 // a valid identifier: `[a-z][a-z0-9_]*`. Note that
348330 // automatically-generated operation IDs always begin with an
349331 // underscore. If the named operation already exists,
350- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
351- // returns `ALREADY_EXISTS`.
332+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
333+ // `ALREADY_EXISTS`.
352334 string operation_id = 3 ;
353335}
354336
@@ -357,8 +339,8 @@ message UpdateDatabaseDdlRequest {
357339message UpdateDatabaseDdlMetadata {
358340 // The database being modified.
359341 string database = 1 [(google.api.resource_reference ) = {
360- type : "spanner.googleapis.com/Database"
361- }];
342+ type : "spanner.googleapis.com/Database"
343+ }];
362344
363345 // For an update this list contains all the statements. For an
364346 // individual statement, this list contains only that statement.
@@ -370,8 +352,7 @@ message UpdateDatabaseDdlMetadata {
370352 repeated google.protobuf.Timestamp commit_timestamps = 3 ;
371353}
372354
373- // The request for
374- // [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
355+ // The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
375356message DropDatabaseRequest {
376357 // Required. The database to be dropped.
377358 string database = 1 [
@@ -382,8 +363,7 @@ message DropDatabaseRequest {
382363 ];
383364}
384365
385- // The request for
386- // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
366+ // The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
387367message GetDatabaseDdlRequest {
388368 // Required. The database whose schema we wish to get.
389369 string database = 1 [
@@ -394,8 +374,7 @@ message GetDatabaseDdlRequest {
394374 ];
395375}
396376
397- // The response for
398- // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
377+ // The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
399378message GetDatabaseDdlResponse {
400379 // A list of formatted DDL statements defining the schema of the database
401380 // specified in the request.
0 commit comments