provisioning_service.proto 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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.cloud.apigeeregistry.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/apigeeregistry/v1;apigeeregistry";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "ProvisioningServiceProto";
  26. option java_package = "com.google.cloud.apigeeregistry.v1";
  27. option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1";
  28. option ruby_package = "Google::Cloud::ApigeeRegistry::V1";
  29. // The service that is used for managing the data plane provisioning of the
  30. // Registry.
  31. service Provisioning {
  32. option (google.api.default_host) = "apigeeregistry.googleapis.com";
  33. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  34. // Provisions instance resources for the Registry.
  35. rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
  36. option (google.api.http) = {
  37. post: "/v1/{parent=projects/*/locations/*}/instances"
  38. body: "instance"
  39. };
  40. option (google.api.method_signature) = "parent,instance,instance_id";
  41. option (google.longrunning.operation_info) = {
  42. response_type: "Instance"
  43. metadata_type: "OperationMetadata"
  44. };
  45. }
  46. // Deletes the Registry instance.
  47. rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
  48. option (google.api.http) = {
  49. delete: "/v1/{name=projects/*/locations/*/instances/*}"
  50. };
  51. option (google.api.method_signature) = "name";
  52. option (google.longrunning.operation_info) = {
  53. response_type: "google.protobuf.Empty"
  54. metadata_type: "OperationMetadata"
  55. };
  56. }
  57. // Gets details of a single Instance.
  58. rpc GetInstance(GetInstanceRequest) returns (Instance) {
  59. option (google.api.http) = {
  60. get: "/v1/{name=projects/*/locations/*/instances/*}"
  61. };
  62. option (google.api.method_signature) = "name";
  63. }
  64. }
  65. // Request message for CreateInstance.
  66. message CreateInstanceRequest {
  67. // Required. Parent resource of the Instance, of the form: `projects/*/locations/*`
  68. string parent = 1 [
  69. (google.api.field_behavior) = REQUIRED,
  70. (google.api.resource_reference) = {
  71. type: "locations.googleapis.com/Location"
  72. }
  73. ];
  74. // Required. Identifier to assign to the Instance. Must be unique within scope of the
  75. // parent resource.
  76. string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
  77. // Required. The Instance.
  78. Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
  79. }
  80. // Request message for DeleteInstance.
  81. message DeleteInstanceRequest {
  82. // Required. The name of the Instance to delete.
  83. // Format: `projects/*/locations/*/instances/*`.
  84. string name = 1 [
  85. (google.api.field_behavior) = REQUIRED,
  86. (google.api.resource_reference) = {
  87. type: "apigeeregistry.googleapis.com/Instance"
  88. }
  89. ];
  90. }
  91. // Request message for GetInstance.
  92. message GetInstanceRequest {
  93. // Required. The name of the Instance to retrieve.
  94. // Format: `projects/*/locations/*/instances/*`.
  95. string name = 1 [
  96. (google.api.field_behavior) = REQUIRED,
  97. (google.api.resource_reference) = {
  98. type: "apigeeregistry.googleapis.com/Instance"
  99. }
  100. ];
  101. }
  102. // Represents the metadata of the long-running operation.
  103. message OperationMetadata {
  104. // The time the operation was created.
  105. google.protobuf.Timestamp create_time = 1;
  106. // The time the operation finished running.
  107. google.protobuf.Timestamp end_time = 2;
  108. // Server-defined resource path for the target of the operation.
  109. string target = 3;
  110. // Name of the verb executed by the operation.
  111. string verb = 4;
  112. // Human-readable status of the operation, if any.
  113. string status_message = 5;
  114. // Identifies whether the user has requested cancellation
  115. // of the operation. Operations that have successfully been cancelled
  116. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  117. // corresponding to `Code.CANCELLED`.
  118. bool cancellation_requested = 6;
  119. // API version used to start the operation.
  120. string api_version = 7;
  121. }
  122. // An Instance represents the instance resources of the Registry.
  123. // Currently, only one instance is allowed for each project.
  124. message Instance {
  125. option (google.api.resource) = {
  126. type: "apigeeregistry.googleapis.com/Instance"
  127. pattern: "projects/{project}/locations/{location}/instances/{instance}"
  128. };
  129. // State of the Instance.
  130. enum State {
  131. // The default value. This value is used if the state is omitted.
  132. STATE_UNSPECIFIED = 0;
  133. // The Instance has not been initialized or has been deleted.
  134. INACTIVE = 1;
  135. // The Instance is being created.
  136. CREATING = 2;
  137. // The Instance has been created and is ready for use.
  138. ACTIVE = 3;
  139. // The Instance is being updated.
  140. UPDATING = 4;
  141. // The Instance is being deleted.
  142. DELETING = 5;
  143. // The Instance encountered an error during a state change.
  144. FAILED = 6;
  145. }
  146. // Available configurations to provision an Instance.
  147. message Config {
  148. // Output only. The GCP location where the Instance resides.
  149. string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  150. // Required. The Customer Managed Encryption Key (CMEK) used for data encryption.
  151. // The CMEK name should follow the format of
  152. // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
  153. // where the `location` must match InstanceConfig.location.
  154. string cmek_key_name = 2 [(google.api.field_behavior) = REQUIRED];
  155. }
  156. // Format: `projects/*/locations/*/instance`.
  157. // Currently only `locations/global` is supported.
  158. string name = 1;
  159. // Output only. Creation timestamp.
  160. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // Output only. Last update timestamp.
  162. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Output only. The current state of the Instance.
  164. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  165. // Output only. Extra information of Instance.State if the state is `FAILED`.
  166. string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  167. // Required. Config of the Instance.
  168. Config config = 6 [(google.api.field_behavior) = REQUIRED];
  169. }