@@ -28,6 +28,7 @@ option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;ad
2828option java_multiple_files = true ;
2929option java_outer_classname = "DatastoreAdminProto" ;
3030option java_package = "com.google.datastore.admin.v1" ;
31+ option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1" ;
3132option ruby_package = "Google::Cloud::Datastore::Admin::V1" ;
3233
3334// Google Cloud Datastore Admin API
@@ -134,6 +135,51 @@ service DatastoreAdmin {
134135 };
135136 }
136137
138+ // Creates the specified index.
139+ // A newly created index's initial state is `CREATING`. On completion of the
140+ // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
141+ // If the index already exists, the call will return an `ALREADY_EXISTS`
142+ // status.
143+ //
144+ // During index creation, the process could result in an error, in which
145+ // case the index will move to the `ERROR` state. The process can be recovered
146+ // by fixing the data that caused the error, removing the index with
147+ // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
148+ // re-creating the index with [create]
149+ // [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
150+ //
151+ // Indexes with a single property cannot be created.
152+ rpc CreateIndex (CreateIndexRequest ) returns (google.longrunning.Operation ) {
153+ option (google.api.http ) = {
154+ post : "/v1/projects/{project_id}/indexes"
155+ body : "index"
156+ };
157+ option (google.longrunning.operation_info ) = {
158+ response_type : "Index"
159+ metadata_type : "IndexOperationMetadata"
160+ };
161+ }
162+
163+ // Deletes an existing index.
164+ // An index can only be deleted if it is in a `READY` or `ERROR` state. On
165+ // successful execution of the request, the index will be in a `DELETING`
166+ // [state][google.datastore.admin.v1.Index.State]. And on completion of the
167+ // returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
168+ //
169+ // During index deletion, the process could result in an error, in which
170+ // case the index will move to the `ERROR` state. The process can be recovered
171+ // by fixing the data that caused the error, followed by calling
172+ // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
173+ rpc DeleteIndex (DeleteIndexRequest ) returns (google.longrunning.Operation ) {
174+ option (google.api.http ) = {
175+ delete : "/v1/projects/{project_id}/indexes/{index_id}"
176+ };
177+ option (google.longrunning.operation_info ) = {
178+ response_type : "Index"
179+ metadata_type : "IndexOperationMetadata"
180+ };
181+ }
182+
137183 // Gets an index.
138184 rpc GetIndex (GetIndexRequest ) returns (Index ) {
139185 option (google.api.http ) = {
@@ -200,24 +246,6 @@ message CommonMetadata {
200246 State state = 5 ;
201247}
202248
203- // Operation types.
204- enum OperationType {
205- // Unspecified.
206- OPERATION_TYPE_UNSPECIFIED = 0 ;
207-
208- // ExportEntities.
209- EXPORT_ENTITIES = 1 ;
210-
211- // ImportEntities.
212- IMPORT_ENTITIES = 2 ;
213-
214- // CreateIndex.
215- CREATE_INDEX = 3 ;
216-
217- // DeleteIndex.
218- DELETE_INDEX = 4 ;
219- }
220-
221249// Measures the progress of a particular metric.
222250message Progress {
223251 // The amount of work that has been completed. Note that this may be greater
@@ -325,6 +353,24 @@ message ExportEntitiesMetadata {
325353 string output_url_prefix = 5 ;
326354}
327355
356+ // Operation types.
357+ enum OperationType {
358+ // Unspecified.
359+ OPERATION_TYPE_UNSPECIFIED = 0 ;
360+
361+ // ExportEntities.
362+ EXPORT_ENTITIES = 1 ;
363+
364+ // ImportEntities.
365+ IMPORT_ENTITIES = 2 ;
366+
367+ // CreateIndex.
368+ CREATE_INDEX = 3 ;
369+
370+ // DeleteIndex.
371+ DELETE_INDEX = 4 ;
372+ }
373+
328374// Metadata for ImportEntities operations.
329375message ImportEntitiesMetadata {
330376 // Metadata common to all Datastore Admin operations.
@@ -377,6 +423,27 @@ message EntityFilter {
377423 repeated string namespace_ids = 2 ;
378424}
379425
426+ // The request for
427+ // [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
428+ message CreateIndexRequest {
429+ // Project ID against which to make the request.
430+ string project_id = 1 ;
431+
432+ // The index to create. The name and state fields are output only and will be
433+ // ignored. Single property indexes cannot be created or deleted.
434+ Index index = 3 ;
435+ }
436+
437+ // The request for
438+ // [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex].
439+ message DeleteIndexRequest {
440+ // Project ID against which to make the request.
441+ string project_id = 1 ;
442+
443+ // The resource ID of the index to delete.
444+ string index_id = 3 ;
445+ }
446+
380447// The request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex].
381448message GetIndexRequest {
382449 // Project ID against which to make the request.
0 commit comments