firestore_admin.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. // Copyright 2019 Google LLC.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. syntax = "proto3";
  16. package google.firestore.admin.v1beta2;
  17. import "google/api/annotations.proto";
  18. import "google/firestore/admin/v1beta2/field.proto";
  19. import "google/firestore/admin/v1beta2/index.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/api/client.proto";
  24. option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta2";
  25. option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta2;admin";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "FirestoreAdminProto";
  28. option java_package = "com.google.firestore.admin.v1beta2";
  29. option objc_class_prefix = "GCFS";
  30. // Operations are created by service `FirestoreAdmin`, but are accessed via
  31. // service `google.longrunning.Operations`.
  32. service FirestoreAdmin {
  33. option (google.api.default_host) = "firestore.googleapis.com";
  34. option (google.api.oauth_scopes) =
  35. "https://www.googleapis.com/auth/cloud-platform,"
  36. "https://www.googleapis.com/auth/datastore";
  37. // Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
  38. // which may be used to track the status of the creation. The metadata for
  39. // the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1beta2.IndexOperationMetadata].
  40. rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) {
  41. option (google.api.http) = {
  42. post: "/v1beta2/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
  43. body: "index"
  44. };
  45. }
  46. // Lists composite indexes.
  47. rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) {
  48. option (google.api.http) = {
  49. get: "/v1beta2/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
  50. };
  51. }
  52. // Gets a composite index.
  53. rpc GetIndex(GetIndexRequest) returns (Index) {
  54. option (google.api.http) = {
  55. get: "/v1beta2/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
  56. };
  57. }
  58. // Deletes a composite index.
  59. rpc DeleteIndex(DeleteIndexRequest) returns (google.protobuf.Empty) {
  60. option (google.api.http) = {
  61. delete: "/v1beta2/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
  62. };
  63. }
  64. // Gets the metadata and configuration for a Field.
  65. rpc GetField(GetFieldRequest) returns (Field) {
  66. option (google.api.http) = {
  67. get: "/v1beta2/{name=projects/*/databases/*/collectionGroups/*/fields/*}"
  68. };
  69. }
  70. // Updates a field configuration. Currently, field updates apply only to
  71. // single field index configuration. However, calls to
  72. // [FirestoreAdmin.UpdateField][google.firestore.admin.v1beta2.FirestoreAdmin.UpdateField] should provide a field mask to avoid
  73. // changing any configuration that the caller isn't aware of. The field mask
  74. // should be specified as: `{ paths: "index_config" }`.
  75. //
  76. // This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
  77. // track the status of the field update. The metadata for
  78. // the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1beta2.FieldOperationMetadata].
  79. //
  80. // To configure the default field settings for the database, use
  81. // the special `Field` with resource name:
  82. // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
  83. rpc UpdateField(UpdateFieldRequest) returns (google.longrunning.Operation) {
  84. option (google.api.http) = {
  85. patch: "/v1beta2/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}"
  86. body: "field"
  87. };
  88. }
  89. // Lists the field configuration and metadata for this database.
  90. //
  91. // Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields] only supports listing fields
  92. // that have been explicitly overridden. To issue this query, call
  93. // [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields] with the filter set to
  94. // `indexConfig.usesAncestorConfig:false`.
  95. rpc ListFields(ListFieldsRequest) returns (ListFieldsResponse) {
  96. option (google.api.http) = {
  97. get: "/v1beta2/{parent=projects/*/databases/*/collectionGroups/*}/fields"
  98. };
  99. }
  100. // Exports a copy of all or a subset of documents from Google Cloud Firestore
  101. // to another storage system, such as Google Cloud Storage. Recent updates to
  102. // documents may not be reflected in the export. The export occurs in the
  103. // background and its progress can be monitored and managed via the
  104. // Operation resource that is created. The output of an export may only be
  105. // used once the associated operation is done. If an export operation is
  106. // cancelled before completion it may leave partial data behind in Google
  107. // Cloud Storage.
  108. rpc ExportDocuments(ExportDocumentsRequest) returns (google.longrunning.Operation) {
  109. option (google.api.http) = {
  110. post: "/v1beta2/{name=projects/*/databases/*}:exportDocuments"
  111. body: "*"
  112. };
  113. }
  114. // Imports documents into Google Cloud Firestore. Existing documents with the
  115. // same name are overwritten. The import occurs in the background and its
  116. // progress can be monitored and managed via the Operation resource that is
  117. // created. If an ImportDocuments operation is cancelled, it is possible
  118. // that a subset of the data has already been imported to Cloud Firestore.
  119. rpc ImportDocuments(ImportDocumentsRequest) returns (google.longrunning.Operation) {
  120. option (google.api.http) = {
  121. post: "/v1beta2/{name=projects/*/databases/*}:importDocuments"
  122. body: "*"
  123. };
  124. }
  125. }
  126. // The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1beta2.FirestoreAdmin.CreateIndex].
  127. message CreateIndexRequest {
  128. // A parent name of the form
  129. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
  130. string parent = 1;
  131. // The composite index to create.
  132. Index index = 2;
  133. }
  134. // The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta2.FirestoreAdmin.ListIndexes].
  135. message ListIndexesRequest {
  136. // A parent name of the form
  137. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
  138. string parent = 1;
  139. // The filter to apply to list results.
  140. string filter = 2;
  141. // The number of results to return.
  142. int32 page_size = 3;
  143. // A page token, returned from a previous call to
  144. // [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta2.FirestoreAdmin.ListIndexes], that may be used to get the next
  145. // page of results.
  146. string page_token = 4;
  147. }
  148. // The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta2.FirestoreAdmin.ListIndexes].
  149. message ListIndexesResponse {
  150. // The requested indexes.
  151. repeated Index indexes = 1;
  152. // A page token that may be used to request another page of results. If blank,
  153. // this is the last page.
  154. string next_page_token = 2;
  155. }
  156. // The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1beta2.FirestoreAdmin.GetIndex].
  157. message GetIndexRequest {
  158. // A name of the form
  159. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
  160. string name = 1;
  161. }
  162. // The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1beta2.FirestoreAdmin.DeleteIndex].
  163. message DeleteIndexRequest {
  164. // A name of the form
  165. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
  166. string name = 1;
  167. }
  168. // The request for [FirestoreAdmin.UpdateField][google.firestore.admin.v1beta2.FirestoreAdmin.UpdateField].
  169. message UpdateFieldRequest {
  170. // The field to be updated.
  171. Field field = 1;
  172. // A mask, relative to the field. If specified, only configuration specified
  173. // by this field_mask will be updated in the field.
  174. google.protobuf.FieldMask update_mask = 2;
  175. }
  176. // The request for [FirestoreAdmin.GetField][google.firestore.admin.v1beta2.FirestoreAdmin.GetField].
  177. message GetFieldRequest {
  178. // A name of the form
  179. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
  180. string name = 1;
  181. }
  182. // The request for [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields].
  183. message ListFieldsRequest {
  184. // A parent name of the form
  185. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
  186. string parent = 1;
  187. // The filter to apply to list results. Currently,
  188. // [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields] only supports listing fields
  189. // that have been explicitly overridden. To issue this query, call
  190. // [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields] with the filter set to
  191. // `indexConfig.usesAncestorConfig:false`.
  192. string filter = 2;
  193. // The number of results to return.
  194. int32 page_size = 3;
  195. // A page token, returned from a previous call to
  196. // [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields], that may be used to get the next
  197. // page of results.
  198. string page_token = 4;
  199. }
  200. // The response for [FirestoreAdmin.ListFields][google.firestore.admin.v1beta2.FirestoreAdmin.ListFields].
  201. message ListFieldsResponse {
  202. // The requested fields.
  203. repeated Field fields = 1;
  204. // A page token that may be used to request another page of results. If blank,
  205. // this is the last page.
  206. string next_page_token = 2;
  207. }
  208. // The request for [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1beta2.FirestoreAdmin.ExportDocuments].
  209. message ExportDocumentsRequest {
  210. // Database to export. Should be of the form:
  211. // `projects/{project_id}/databases/{database_id}`.
  212. string name = 1;
  213. // Which collection ids to export. Unspecified means all collections.
  214. repeated string collection_ids = 2;
  215. // The output URI. Currently only supports Google Cloud Storage URIs of the
  216. // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
  217. // of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
  218. // Google Cloud Storage namespace path. When
  219. // choosing a name, be sure to consider Google Cloud Storage naming
  220. // guidelines: https://cloud.google.com/storage/docs/naming.
  221. // If the URI is a bucket (without a namespace path), a prefix will be
  222. // generated based on the start time.
  223. string output_uri_prefix = 3;
  224. }
  225. // The request for [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1beta2.FirestoreAdmin.ImportDocuments].
  226. message ImportDocumentsRequest {
  227. // Database to import into. Should be of the form:
  228. // `projects/{project_id}/databases/{database_id}`.
  229. string name = 1;
  230. // Which collection ids to import. Unspecified means all collections included
  231. // in the import.
  232. repeated string collection_ids = 2;
  233. // Location of the exported files.
  234. // This must match the output_uri_prefix of an ExportDocumentsResponse from
  235. // an export that has completed successfully.
  236. // See:
  237. // [google.firestore.admin.v1beta2.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1beta2.ExportDocumentsResponse.output_uri_prefix].
  238. string input_uri_prefix = 3;
  239. }