|
| 1 | +// Copyright 2017 Google Inc. |
| 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 | + |
| 17 | +package google.firestore.admin.v1beta1; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/firestore/admin/v1beta1/index.proto"; |
| 21 | +import "google/longrunning/operations.proto"; |
| 22 | +import "google/protobuf/empty.proto"; |
| 23 | +import "google/protobuf/timestamp.proto"; |
| 24 | + |
| 25 | +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta1"; |
| 26 | +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta1;admin"; |
| 27 | +option java_multiple_files = true; |
| 28 | +option java_outer_classname = "FirestoreAdminProto"; |
| 29 | +option java_package = "com.google.firestore.admin.v1beta1"; |
| 30 | +option objc_class_prefix = "GCFS"; |
| 31 | + |
| 32 | + |
| 33 | +// The Cloud Firestore Admin API. |
| 34 | +// |
| 35 | +// This API provides several administrative services for Cloud Firestore. |
| 36 | +// |
| 37 | +// # Concepts |
| 38 | +// |
| 39 | +// Project, Database, Namespace, Collection, and Document are used as defined in |
| 40 | +// the Google Cloud Firestore API. |
| 41 | +// |
| 42 | +// Operation: An Operation represents work being performed in the background. |
| 43 | +// |
| 44 | +// |
| 45 | +// # Services |
| 46 | +// |
| 47 | +// ## Index |
| 48 | +// |
| 49 | +// The index service manages Cloud Firestore indexes. |
| 50 | +// |
| 51 | +// Index creation is performed asynchronously. |
| 52 | +// An Operation resource is created for each such asynchronous operation. |
| 53 | +// The state of the operation (including any errors encountered) |
| 54 | +// may be queried via the Operation resource. |
| 55 | +// |
| 56 | +// ## Metadata |
| 57 | +// |
| 58 | +// Provides metadata and statistical information about data in Cloud Firestore. |
| 59 | +// The data provided as part of this API may be stale. |
| 60 | +// |
| 61 | +// ## Operation |
| 62 | +// |
| 63 | +// The Operations collection provides a record of actions performed for the |
| 64 | +// specified Project (including any Operations in progress). Operations are not |
| 65 | +// created directly but through calls on other collections or resources. |
| 66 | +// |
| 67 | +// An Operation that is not yet done may be cancelled. The request to cancel is |
| 68 | +// asynchronous and the Operation may continue to run for some time after the |
| 69 | +// request to cancel is made. |
| 70 | +// |
| 71 | +// An Operation that is done may be deleted so that it is no longer listed as |
| 72 | +// part of the Operation collection. |
| 73 | +// |
| 74 | +// Operations are created by service `FirestoreAdmin`, but are accessed via |
| 75 | +// service `google.longrunning.Operations`. |
| 76 | +service FirestoreAdmin { |
| 77 | + // Creates the specified index. |
| 78 | + // A newly created index's initial state is `CREATING`. On completion of the |
| 79 | + // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. |
| 80 | + // If the index already exists, the call will return an `ALREADY_EXISTS` |
| 81 | + // status. |
| 82 | + // |
| 83 | + // During creation, the process could result in an error, in which case the |
| 84 | + // index will move to the `ERROR` state. The process can be recovered by |
| 85 | + // fixing the data that caused the error, removing the index with |
| 86 | + // [delete][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex], then re-creating the index with |
| 87 | + // [create][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex]. |
| 88 | + // |
| 89 | + // Indexes with a single field cannot be created. |
| 90 | + rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { |
| 91 | + option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*}/indexes" body: "index" }; |
| 92 | + } |
| 93 | + |
| 94 | + // Lists the indexes that match the specified filters. |
| 95 | + rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { |
| 96 | + option (google.api.http) = { get: "/v1beta1/{parent=projects/*/databases/*}/indexes" }; |
| 97 | + } |
| 98 | + |
| 99 | + // Gets an index. |
| 100 | + rpc GetIndex(GetIndexRequest) returns (Index) { |
| 101 | + option (google.api.http) = { get: "/v1beta1/{name=projects/*/databases/*/indexes/*}" }; |
| 102 | + } |
| 103 | + |
| 104 | + // Deletes an index. |
| 105 | + rpc DeleteIndex(DeleteIndexRequest) returns (google.protobuf.Empty) { |
| 106 | + option (google.api.http) = { delete: "/v1beta1/{name=projects/*/databases/*/indexes/*}" }; |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +// Metadata for index operations. This metadata populates |
| 111 | +// the metadata field of [google.longrunning.Operation][google.longrunning.Operation]. |
| 112 | +message IndexOperationMetadata { |
| 113 | + // The type of index operation. |
| 114 | + enum OperationType { |
| 115 | + // Unspecified. Never set by server. |
| 116 | + OPERATION_TYPE_UNSPECIFIED = 0; |
| 117 | + |
| 118 | + // The operation is creating the index. Initiated by a `CreateIndex` call. |
| 119 | + CREATING_INDEX = 1; |
| 120 | + } |
| 121 | + |
| 122 | + // The time that work began on the operation. |
| 123 | + google.protobuf.Timestamp start_time = 1; |
| 124 | + |
| 125 | + // The time the operation ended, either successfully or otherwise. Unset if |
| 126 | + // the operation is still active. |
| 127 | + google.protobuf.Timestamp end_time = 2; |
| 128 | + |
| 129 | + // The index resource that this operation is acting on. For example: |
| 130 | + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` |
| 131 | + string index = 3; |
| 132 | + |
| 133 | + // The type of index operation. |
| 134 | + OperationType operation_type = 4; |
| 135 | + |
| 136 | + // True if the [google.longrunning.Operation] was cancelled. If the |
| 137 | + // cancellation is in progress, cancelled will be true but |
| 138 | + // [google.longrunning.Operation.done][google.longrunning.Operation.done] will be false. |
| 139 | + bool cancelled = 5; |
| 140 | + |
| 141 | + // Progress of the existing operation, measured in number of documents. |
| 142 | + Progress document_progress = 6; |
| 143 | +} |
| 144 | + |
| 145 | +// Measures the progress of a particular metric. |
| 146 | +message Progress { |
| 147 | + // An estimate of how much work has been completed. Note that this may be |
| 148 | + // greater than `work_estimated`. |
| 149 | + int64 work_completed = 1; |
| 150 | + |
| 151 | + // An estimate of how much work needs to be performed. Zero if the |
| 152 | + // work estimate is unavailable. May change as work progresses. |
| 153 | + int64 work_estimated = 2; |
| 154 | +} |
| 155 | + |
| 156 | +// The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex]. |
| 157 | +message CreateIndexRequest { |
| 158 | + // The name of the database this index will apply to. For example: |
| 159 | + // `projects/{project_id}/databases/{database_id}` |
| 160 | + string parent = 1; |
| 161 | + |
| 162 | + // The index to create. The name and state should not be specified. |
| 163 | + // Certain single field indexes cannot be created or deleted. |
| 164 | + Index index = 2; |
| 165 | +} |
| 166 | + |
| 167 | +// The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1beta1.FirestoreAdmin.GetIndex]. |
| 168 | +message GetIndexRequest { |
| 169 | + // The name of the index. For example: |
| 170 | + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` |
| 171 | + string name = 1; |
| 172 | +} |
| 173 | + |
| 174 | +// The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta1.FirestoreAdmin.ListIndexes]. |
| 175 | +message ListIndexesRequest { |
| 176 | + // The database name. For example: |
| 177 | + // `projects/{project_id}/databases/{database_id}` |
| 178 | + string parent = 1; |
| 179 | + |
| 180 | + string filter = 2; |
| 181 | + |
| 182 | + // The standard List page size. |
| 183 | + int32 page_size = 3; |
| 184 | + |
| 185 | + // The standard List page token. |
| 186 | + string page_token = 4; |
| 187 | +} |
| 188 | + |
| 189 | +// The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex]. |
| 190 | +message DeleteIndexRequest { |
| 191 | + // The index name. For example: |
| 192 | + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` |
| 193 | + string name = 1; |
| 194 | +} |
| 195 | + |
| 196 | +// The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta1.FirestoreAdmin.ListIndexes]. |
| 197 | +message ListIndexesResponse { |
| 198 | + // The indexes. |
| 199 | + repeated Index indexes = 1; |
| 200 | + |
| 201 | + // The standard List next-page token. |
| 202 | + string next_page_token = 2; |
| 203 | +} |
0 commit comments