index.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.datastore.admin.v1;
  16. import "google/api/field_behavior.proto";
  17. option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "IndexProto";
  21. option java_package = "com.google.datastore.admin.v1";
  22. option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1";
  23. option ruby_package = "Google::Cloud::Datastore::Admin::V1";
  24. // Datastore composite index definition.
  25. message Index {
  26. // For an ordered index, specifies whether each of the entity's ancestors
  27. // will be included.
  28. enum AncestorMode {
  29. // The ancestor mode is unspecified.
  30. ANCESTOR_MODE_UNSPECIFIED = 0;
  31. // Do not include the entity's ancestors in the index.
  32. NONE = 1;
  33. // Include all the entity's ancestors in the index.
  34. ALL_ANCESTORS = 2;
  35. }
  36. // The direction determines how a property is indexed.
  37. enum Direction {
  38. // The direction is unspecified.
  39. DIRECTION_UNSPECIFIED = 0;
  40. // The property's values are indexed so as to support sequencing in
  41. // ascending order and also query by <, >, <=, >=, and =.
  42. ASCENDING = 1;
  43. // The property's values are indexed so as to support sequencing in
  44. // descending order and also query by <, >, <=, >=, and =.
  45. DESCENDING = 2;
  46. }
  47. // A property of an index.
  48. message IndexedProperty {
  49. // Required. The property name to index.
  50. string name = 1 [(google.api.field_behavior) = REQUIRED];
  51. // Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED.
  52. Direction direction = 2 [(google.api.field_behavior) = REQUIRED];
  53. }
  54. // The possible set of states of an index.
  55. enum State {
  56. // The state is unspecified.
  57. STATE_UNSPECIFIED = 0;
  58. // The index is being created, and cannot be used by queries.
  59. // There is an active long-running operation for the index.
  60. // The index is updated when writing an entity.
  61. // Some index data may exist.
  62. CREATING = 1;
  63. // The index is ready to be used.
  64. // The index is updated when writing an entity.
  65. // The index is fully populated from all stored entities it applies to.
  66. READY = 2;
  67. // The index is being deleted, and cannot be used by queries.
  68. // There is an active long-running operation for the index.
  69. // The index is not updated when writing an entity.
  70. // Some index data may exist.
  71. DELETING = 3;
  72. // The index was being created or deleted, but something went wrong.
  73. // The index cannot by used by queries.
  74. // There is no active long-running operation for the index,
  75. // and the most recently finished long-running operation failed.
  76. // The index is not updated when writing an entity.
  77. // Some index data may exist.
  78. ERROR = 4;
  79. }
  80. // Output only. Project ID.
  81. string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  82. // Output only. The resource ID of the index.
  83. string index_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  84. // Required. The entity kind to which this index applies.
  85. string kind = 4 [(google.api.field_behavior) = REQUIRED];
  86. // Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED.
  87. AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED];
  88. // Required. An ordered sequence of property names and their index attributes.
  89. repeated IndexedProperty properties = 6 [(google.api.field_behavior) = REQUIRED];
  90. // Output only. The state of the index.
  91. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  92. }