-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
firestore_admin.proto
539 lines (483 loc) · 20.3 KB
/
firestore_admin.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.firestore.admin.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/firestore/admin/v1/database.proto";
import "google/firestore/admin/v1/field.proto";
import "google/firestore/admin/v1/index.proto";
import "google/firestore/admin/v1/operation.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
option java_multiple_files = true;
option java_outer_classname = "FirestoreAdminProto";
option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
option ruby_package = "Google::Cloud::Firestore::Admin::V1";
option (google.api.resource_definition) = {
type: "firestore.googleapis.com/Location"
pattern: "projects/{project}/locations/{location}"
};
option (google.api.resource_definition) = {
type: "firestore.googleapis.com/CollectionGroup"
pattern: "projects/{project}/databases/{database}/collectionGroups/{collection}"
};
// The Cloud Firestore Admin API.
//
// This API provides several administrative services for Cloud Firestore.
//
// Project, Database, Namespace, Collection, Collection Group, and Document are
// used as defined in the Google Cloud Firestore API.
//
// Operation: An Operation represents work being performed in the background.
//
// The index service manages Cloud Firestore indexes.
//
// Index creation is performed asynchronously.
// An Operation resource is created for each such asynchronous operation.
// The state of the operation (including any errors encountered)
// may be queried via the Operation resource.
//
// The Operations collection provides a record of actions performed for the
// specified Project (including any Operations in progress). Operations are not
// created directly but through calls on other collections or resources.
//
// An Operation that is done may be deleted so that it is no longer listed as
// part of the Operation collection. Operations are garbage collected after
// 30 days. By default, ListOperations will only return in progress and failed
// operations. To list completed operation, issue a ListOperations request with
// the filter `done: true`.
//
// Operations are created by service `FirestoreAdmin`, but are accessed via
// service `google.longrunning.Operations`.
service FirestoreAdmin {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/datastore";
// Creates a composite index. This returns a
// [google.longrunning.Operation][google.longrunning.Operation] which may be
// used to track the status of the creation. The metadata for the operation
// will be the type
// [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
body: "index"
};
option (google.api.method_signature) = "parent,index";
option (google.longrunning.operation_info) = {
response_type: "Index"
metadata_type: "IndexOperationMetadata"
};
}
// Lists composite indexes.
rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
};
option (google.api.method_signature) = "parent";
}
// Gets a composite index.
rpc GetIndex(GetIndexRequest) returns (Index) {
option (google.api.http) = {
get: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
};
option (google.api.method_signature) = "name";
}
// Deletes a composite index.
rpc DeleteIndex(DeleteIndexRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
};
option (google.api.method_signature) = "name";
}
// Gets the metadata and configuration for a Field.
rpc GetField(GetFieldRequest) returns (Field) {
option (google.api.http) = {
get: "/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}"
};
option (google.api.method_signature) = "name";
}
// Updates a field configuration. Currently, field updates apply only to
// single field index configuration. However, calls to
// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]
// should provide a field mask to avoid changing any configuration that the
// caller isn't aware of. The field mask should be specified as: `{ paths:
// "index_config" }`.
//
// This call returns a
// [google.longrunning.Operation][google.longrunning.Operation] which may be
// used to track the status of the field update. The metadata for the
// operation will be the type
// [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
//
// To configure the default field settings for the database, use
// the special `Field` with resource name:
// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
rpc UpdateField(UpdateFieldRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}"
body: "field"
};
option (google.api.method_signature) = "field";
option (google.longrunning.operation_info) = {
response_type: "Field"
metadata_type: "FieldOperationMetadata"
};
}
// Lists the field configuration and metadata for this database.
//
// Currently,
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
// only supports listing fields that have been explicitly overridden. To issue
// this query, call
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
// with the filter set to `indexConfig.usesAncestorConfig:false` .
rpc ListFields(ListFieldsRequest) returns (ListFieldsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields"
};
option (google.api.method_signature) = "parent";
}
// Exports a copy of all or a subset of documents from Google Cloud Firestore
// to another storage system, such as Google Cloud Storage. Recent updates to
// documents may not be reflected in the export. The export occurs in the
// background and its progress can be monitored and managed via the
// Operation resource that is created. The output of an export may only be
// used once the associated operation is done. If an export operation is
// cancelled before completion it may leave partial data behind in Google
// Cloud Storage.
//
// For more details on export behavior and output format, refer to:
// https://cloud.google.com/firestore/docs/manage-data/export-import
rpc ExportDocuments(ExportDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/databases/*}:exportDocuments"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "ExportDocumentsResponse"
metadata_type: "ExportDocumentsMetadata"
};
}
// Imports documents into Google Cloud Firestore. Existing documents with the
// same name are overwritten. The import occurs in the background and its
// progress can be monitored and managed via the Operation resource that is
// created. If an ImportDocuments operation is cancelled, it is possible
// that a subset of the data has already been imported to Cloud Firestore.
rpc ImportDocuments(ImportDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/databases/*}:importDocuments"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "ImportDocumentsMetadata"
};
}
// Create a database.
rpc CreateDatabase(CreateDatabaseRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*}/databases"
body: "database"
};
option (google.api.method_signature) = "parent,database,database_id";
option (google.longrunning.operation_info) = {
response_type: "Database"
metadata_type: "CreateDatabaseMetadata"
};
}
// Gets information about a database.
rpc GetDatabase(GetDatabaseRequest) returns (Database) {
option (google.api.http) = {
get: "/v1/{name=projects/*/databases/*}"
};
option (google.api.method_signature) = "name";
}
// List all the databases in the project.
rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*}/databases"
};
option (google.api.method_signature) = "parent";
}
// Updates a database.
rpc UpdateDatabase(UpdateDatabaseRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{database.name=projects/*/databases/*}"
body: "database"
};
option (google.api.method_signature) = "database,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Database"
metadata_type: "UpdateDatabaseMetadata"
};
}
}
// A request to list the Firestore Databases in all locations for a project.
message ListDatabasesRequest {
// Required. A parent name of the form
// `projects/{project_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "firestore.googleapis.com/Database"
}
];
}
// The request for
// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
message CreateDatabaseRequest {
// Required. A parent name of the form
// `projects/{project_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "firestore.googleapis.com/Database"
}
];
// Required. The Database to create.
Database database = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the database, which will become the final
// component of the database's resource name.
//
// The value must be set to "(default)".
string database_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Metadata related to the create database operation.
message CreateDatabaseMetadata {}
// The list of databases for a project.
message ListDatabasesResponse {
// The databases in the project.
repeated Database databases = 1;
}
// The request for
// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
message GetDatabaseRequest {
// Required. A name of the form
// `projects/{project_id}/databases/{database_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/Database"
}
];
}
// The request for
// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
message UpdateDatabaseRequest {
// Required. The database to update.
Database database = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}
// Metadata related to the update database operation.
message UpdateDatabaseMetadata {}
// The request for
// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
message CreateIndexRequest {
// Required. A parent name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/CollectionGroup"
}
];
// Required. The composite index to create.
Index index = 2 [(google.api.field_behavior) = REQUIRED];
}
// The request for
// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
message ListIndexesRequest {
// Required. A parent name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/CollectionGroup"
}
];
// The filter to apply to list results.
string filter = 2;
// The number of results to return.
int32 page_size = 3;
// A page token, returned from a previous call to
// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
// that may be used to get the next page of results.
string page_token = 4;
}
// The response for
// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
message ListIndexesResponse {
// The requested indexes.
repeated Index indexes = 1;
// A page token that may be used to request another page of results. If blank,
// this is the last page.
string next_page_token = 2;
}
// The request for
// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
message GetIndexRequest {
// Required. A name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "firestore.googleapis.com/Index" }
];
}
// The request for
// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
message DeleteIndexRequest {
// Required. A name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "firestore.googleapis.com/Index" }
];
}
// The request for
// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
message UpdateFieldRequest {
// Required. The field to be updated.
Field field = 1 [(google.api.field_behavior) = REQUIRED];
// A mask, relative to the field. If specified, only configuration specified
// by this field_mask will be updated in the field.
google.protobuf.FieldMask update_mask = 2;
}
// The request for
// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
message GetFieldRequest {
// Required. A name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "firestore.googleapis.com/Field" }
];
}
// The request for
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
message ListFieldsRequest {
// Required. A parent name of the form
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/CollectionGroup"
}
];
// The filter to apply to list results. Currently,
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
// only supports listing fields that have been explicitly overridden. To issue
// this query, call
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
// with a filter that includes `indexConfig.usesAncestorConfig:false` .
string filter = 2;
// The number of results to return.
int32 page_size = 3;
// A page token, returned from a previous call to
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
// that may be used to get the next page of results.
string page_token = 4;
}
// The response for
// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
message ListFieldsResponse {
// The requested fields.
repeated Field fields = 1;
// A page token that may be used to request another page of results. If blank,
// this is the last page.
string next_page_token = 2;
}
// The request for
// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
message ExportDocumentsRequest {
// Required. Database to export. Should be of the form:
// `projects/{project_id}/databases/{database_id}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/Database"
}
];
// Which collection ids to export. Unspecified means all collections.
repeated string collection_ids = 2;
// The output URI. Currently only supports Google Cloud Storage URIs of the
// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
// Google Cloud Storage namespace path. When
// choosing a name, be sure to consider Google Cloud Storage naming
// guidelines: https://cloud.google.com/storage/docs/naming.
// If the URI is a bucket (without a namespace path), a prefix will be
// generated based on the start time.
string output_uri_prefix = 3;
// Unspecified means all namespaces. This is the preferred
// usage for databases that don't use namespaces.
//
// An empty string element represents the default namespace. This should be
// used if the database has data in non-default namespaces, but doesn't want
// to include them. Each namespace in this list must be unique.
repeated string namespace_ids = 4;
// The timestamp that corresponds to the version of the database to be
// exported. The timestamp must be in the past, rounded to the minute and not
// older than
// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
// If specified, then the exported documents will represent a consistent view
// of the database at the provided time. Otherwise, there are no guarantees
// about the consistency of the exported documents.
google.protobuf.Timestamp snapshot_time = 5;
}
// The request for
// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
message ImportDocumentsRequest {
// Required. Database to import into. Should be of the form:
// `projects/{project_id}/databases/{database_id}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "firestore.googleapis.com/Database"
}
];
// Which collection ids to import. Unspecified means all collections included
// in the import.
repeated string collection_ids = 2;
// Location of the exported files.
// This must match the output_uri_prefix of an ExportDocumentsResponse from
// an export that has completed successfully.
// See:
// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
string input_uri_prefix = 3;
// Unspecified means all namespaces. This is the preferred
// usage for databases that don't use namespaces.
//
// An empty string element represents the default namespace. This should be
// used if the database has data in non-default namespaces, but doesn't want
// to include them. Each namespace in this list must be unique.
repeated string namespace_ids = 4;
}