database.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.firestore.admin.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
  19. option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "DatabaseProto";
  22. option java_package = "com.google.firestore.admin.v1";
  23. option objc_class_prefix = "GCFS";
  24. option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
  25. option ruby_package = "Google::Cloud::Firestore::Admin::V1";
  26. // A Cloud Firestore Database.
  27. // Currently only one database is allowed per cloud project; this database
  28. // must have a `database_id` of '(default)'.
  29. message Database {
  30. option (google.api.resource) = {
  31. type: "firestore.googleapis.com/Database"
  32. pattern: "projects/{project}/databases/{database}"
  33. style: DECLARATIVE_FRIENDLY
  34. };
  35. // The type of the database.
  36. // See https://cloud.google.com/datastore/docs/firestore-or-datastore for
  37. // information about how to choose.
  38. //
  39. // Mode changes are only allowed if the database is empty.
  40. enum DatabaseType {
  41. // The default value. This value is used if the database type is omitted.
  42. DATABASE_TYPE_UNSPECIFIED = 0;
  43. // Firestore Native Mode
  44. FIRESTORE_NATIVE = 1;
  45. // Firestore in Datastore Mode.
  46. DATASTORE_MODE = 2;
  47. }
  48. // The type of concurrency control mode for transactions.
  49. enum ConcurrencyMode {
  50. // Not used.
  51. CONCURRENCY_MODE_UNSPECIFIED = 0;
  52. // Use optimistic concurrency control by default. This mode is available
  53. // for Cloud Firestore databases.
  54. OPTIMISTIC = 1;
  55. // Use pessimistic concurrency control by default. This mode is available
  56. // for Cloud Firestore databases.
  57. //
  58. // This is the default setting for Cloud Firestore.
  59. PESSIMISTIC = 2;
  60. // Use optimistic concurrency control with entity groups by default.
  61. //
  62. // This is the only available mode for Cloud Datastore.
  63. //
  64. // This mode is also available for Cloud Firestore with Datastore Mode but
  65. // is not recommended.
  66. OPTIMISTIC_WITH_ENTITY_GROUPS = 3;
  67. }
  68. // The type of App Engine integration mode.
  69. enum AppEngineIntegrationMode {
  70. // Not used.
  71. APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0;
  72. // If an App Engine application exists in the same region as this database,
  73. // App Engine configuration will impact this database. This includes
  74. // disabling of the application & database, as well as disabling writes to
  75. // the database.
  76. ENABLED = 1;
  77. // Appengine has no affect on the ability of this database to serve
  78. // requests.
  79. DISABLED = 2;
  80. }
  81. // The resource name of the Database.
  82. // Format: `projects/{project}/databases/{database}`
  83. string name = 1;
  84. // The location of the database. Available databases are listed at
  85. // https://cloud.google.com/firestore/docs/locations.
  86. string location_id = 9;
  87. // The type of the database.
  88. // See https://cloud.google.com/datastore/docs/firestore-or-datastore for
  89. // information about how to choose.
  90. DatabaseType type = 10;
  91. // The concurrency control mode to use for this database.
  92. ConcurrencyMode concurrency_mode = 15;
  93. // The App Engine integration mode to use for this database.
  94. AppEngineIntegrationMode app_engine_integration_mode = 19;
  95. // Output only. The key_prefix for this database. This key_prefix is used, in combination
  96. // with the project id ("<key prefix>~<project id>") to construct the
  97. // application id that is returned from the Cloud Datastore APIs in Google App
  98. // Engine first generation runtimes.
  99. //
  100. // This value may be empty in which case the appid to use for URL-encoded keys
  101. // is the project_id (eg: foo instead of v~foo).
  102. string key_prefix = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  103. // This checksum is computed by the server based on the value of other
  104. // fields, and may be sent on update and delete requests to ensure the
  105. // client has an up-to-date value before proceeding.
  106. string etag = 99;
  107. }