cloud_memcache.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. // Copyright 2020 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.memcache.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/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/memcache/v1;memcache";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "CloudMemcacheProto";
  26. option java_package = "com.google.cloud.memcache.v1";
  27. // Configures and manages Cloud Memorystore for Memcached instances.
  28. //
  29. //
  30. // The `memcache.googleapis.com` service implements the Google Cloud Memorystore
  31. // for Memcached API and defines the following resource model for managing
  32. // Memorystore Memcached (also called Memcached below) instances:
  33. // * The service works with a collection of cloud projects, named: `/projects/*`
  34. // * Each project has a collection of available locations, named: `/locations/*`
  35. // * Each location has a collection of Memcached instances, named:
  36. // `/instances/*`
  37. // * As such, Memcached instances are resources of the form:
  38. // `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
  39. //
  40. // Note that location_id must be a GCP `region`; for example:
  41. // * `projects/my-memcached-project/locations/us-central1/instances/my-memcached`
  42. service CloudMemcache {
  43. option (google.api.default_host) = "memcache.googleapis.com";
  44. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  45. // Lists Instances in a given location.
  46. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
  47. option (google.api.http) = {
  48. get: "/v1/{parent=projects/*/locations/*}/instances"
  49. };
  50. option (google.api.method_signature) = "parent";
  51. }
  52. // Gets details of a single Instance.
  53. rpc GetInstance(GetInstanceRequest) returns (Instance) {
  54. option (google.api.http) = {
  55. get: "/v1/{name=projects/*/locations/*/instances/*}"
  56. };
  57. option (google.api.method_signature) = "name";
  58. }
  59. // Creates a new Instance in a given location.
  60. rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
  61. option (google.api.http) = {
  62. post: "/v1/{parent=projects/*/locations/*}/instances"
  63. body: "instance"
  64. };
  65. option (google.api.method_signature) = "parent,instance,instance_id";
  66. option (google.longrunning.operation_info) = {
  67. response_type: "google.cloud.memcache.v1.Instance"
  68. metadata_type: "google.cloud.memcache.v1.OperationMetadata"
  69. };
  70. }
  71. // Updates an existing Instance in a given project and location.
  72. rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. patch: "/v1/{instance.name=projects/*/locations/*/instances/*}"
  75. body: "instance"
  76. };
  77. option (google.api.method_signature) = "instance,update_mask";
  78. option (google.longrunning.operation_info) = {
  79. response_type: "google.cloud.memcache.v1.Instance"
  80. metadata_type: "google.cloud.memcache.v1.OperationMetadata"
  81. };
  82. }
  83. // Updates the defined Memcached Parameters for an existing Instance.
  84. // This method only stages the parameters, it must be followed by
  85. // ApplyParameters to apply the parameters to nodes of the Memcached Instance.
  86. rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) {
  87. option (google.api.http) = {
  88. patch: "/v1/{name=projects/*/locations/*/instances/*}:updateParameters"
  89. body: "*"
  90. };
  91. option (google.api.method_signature) = "name,update_mask,parameters";
  92. option (google.longrunning.operation_info) = {
  93. response_type: "google.cloud.memcache.v1.Instance"
  94. metadata_type: "google.cloud.memcache.v1.OperationMetadata"
  95. };
  96. }
  97. // Deletes a single Instance.
  98. rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
  99. option (google.api.http) = {
  100. delete: "/v1/{name=projects/*/locations/*/instances/*}"
  101. };
  102. option (google.api.method_signature) = "name";
  103. option (google.longrunning.operation_info) = {
  104. response_type: "google.protobuf.Empty"
  105. metadata_type: "google.cloud.memcache.v1.OperationMetadata"
  106. };
  107. }
  108. // ApplyParameters will restart the set of specified nodes in order to update
  109. // them to the current set of parameters for the Memcached Instance.
  110. rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) {
  111. option (google.api.http) = {
  112. post: "/v1/{name=projects/*/locations/*/instances/*}:applyParameters"
  113. body: "*"
  114. };
  115. option (google.api.method_signature) = "name,node_ids,apply_all";
  116. option (google.longrunning.operation_info) = {
  117. response_type: "google.cloud.memcache.v1.Instance"
  118. metadata_type: "google.cloud.memcache.v1.OperationMetadata"
  119. };
  120. }
  121. }
  122. message Instance {
  123. option (google.api.resource) = {
  124. type: "memcache.googleapis.com/Instance"
  125. pattern: "projects/{project}/locations/{location}/instances/{instance}"
  126. };
  127. // Configuration for a Memcached Node.
  128. message NodeConfig {
  129. // Required. Number of cpus per Memcached node.
  130. int32 cpu_count = 1 [(google.api.field_behavior) = REQUIRED];
  131. // Required. Memory size in MiB for each Memcached node.
  132. int32 memory_size_mb = 2 [(google.api.field_behavior) = REQUIRED];
  133. }
  134. message Node {
  135. // Different states of a Memcached node.
  136. enum State {
  137. // Node state is not set.
  138. STATE_UNSPECIFIED = 0;
  139. // Node is being created.
  140. CREATING = 1;
  141. // Node has been created and ready to be used.
  142. READY = 2;
  143. // Node is being deleted.
  144. DELETING = 3;
  145. // Node is being updated.
  146. UPDATING = 4;
  147. }
  148. // Output only. Identifier of the Memcached node. The node id does not
  149. // include project or location like the Memcached instance name.
  150. string node_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  151. // Output only. Location (GCP Zone) for the Memcached node.
  152. string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  153. // Output only. Current state of the Memcached node.
  154. State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  155. // Output only. Hostname or IP address of the Memcached node used by the
  156. // clients to connect to the Memcached server on this node.
  157. string host = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. // Output only. The port number of the Memcached server on this node.
  159. int32 port = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  160. // User defined parameters currently applied to the node.
  161. MemcacheParameters parameters = 6;
  162. }
  163. message InstanceMessage {
  164. enum Code {
  165. // Message Code not set.
  166. CODE_UNSPECIFIED = 0;
  167. // Memcached nodes are distributed unevenly.
  168. ZONE_DISTRIBUTION_UNBALANCED = 1;
  169. }
  170. // A code that correspond to one type of user-facing message.
  171. Code code = 1;
  172. // Message on memcached instance which will be exposed to users.
  173. string message = 2;
  174. }
  175. // Different states of a Memcached instance.
  176. enum State {
  177. // State not set.
  178. STATE_UNSPECIFIED = 0;
  179. // Memcached instance is being created.
  180. CREATING = 1;
  181. // Memcached instance has been created and ready to be used.
  182. READY = 2;
  183. // Memcached instance is being deleted.
  184. DELETING = 4;
  185. // Memcached instance is going through maintenance, e.g. data plane rollout.
  186. PERFORMING_MAINTENANCE = 5;
  187. }
  188. // Required. Unique name of the resource in this scope including project and
  189. // location using the form:
  190. // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
  191. //
  192. // Note: Memcached instances are managed and addressed at regional level so
  193. // location_id here refers to a GCP region; however, users may choose which
  194. // zones Memcached nodes within an instances should be provisioned in.
  195. // Refer to [zones] field for more details.
  196. string name = 1 [(google.api.field_behavior) = REQUIRED];
  197. // User provided name for the instance only used for display
  198. // purposes. Cannot be more than 80 characters.
  199. string display_name = 2;
  200. // Resource labels to represent user-provided metadata.
  201. // Refer to cloud documentation on labels for more details.
  202. // https://cloud.google.com/compute/docs/labeling-resources
  203. map<string, string> labels = 3;
  204. // The full name of the Google Compute Engine
  205. // [network](/compute/docs/networks-and-firewalls#networks) to which the
  206. // instance is connected. If left unspecified, the `default` network
  207. // will be used.
  208. string authorized_network = 4;
  209. // Zones where Memcached nodes should be provisioned in.
  210. // Memcached nodes will be equally distributed across these zones. If not
  211. // provided, the service will by default create nodes in all zones in the
  212. // region for the instance.
  213. repeated string zones = 5;
  214. // Required. Number of nodes in the Memcached instance.
  215. int32 node_count = 6 [(google.api.field_behavior) = REQUIRED];
  216. // Required. Configuration for Memcached nodes.
  217. NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED];
  218. // The major version of Memcached software.
  219. // If not provided, latest supported version will be used. Currently the
  220. // latest supported major version is MEMCACHE_1_5.
  221. // The minor version will be automatically determined by our system based on
  222. // the latest supported minor version.
  223. MemcacheVersion memcache_version = 9;
  224. // Optional: User defined parameters to apply to the memcached process
  225. // on each node.
  226. MemcacheParameters parameters = 11;
  227. // Output only. List of Memcached nodes.
  228. // Refer to [Node] message for more details.
  229. repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  230. // Output only. The time the instance was created.
  231. google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  232. // Output only. The time the instance was updated.
  233. google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  234. // Output only. The state of this Memcached instance.
  235. State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  236. // Output only. The full version of memcached server running on this instance.
  237. // System automatically determines the full memcached version for an instance
  238. // based on the input MemcacheVersion.
  239. // The full version format will be "memcached-1.5.16".
  240. string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  241. // List of messages that describe current statuses of memcached instance.
  242. repeated InstanceMessage instance_messages = 19;
  243. // Output only. Endpoint for Discovery API
  244. string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  245. }
  246. // Request for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances].
  247. message ListInstancesRequest {
  248. // Required. The resource name of the instance location using the form:
  249. // `projects/{project_id}/locations/{location_id}`
  250. // where `location_id` refers to a GCP region
  251. string parent = 1 [
  252. (google.api.field_behavior) = REQUIRED,
  253. (google.api.resource_reference) = {
  254. type: "locations.googleapis.com/Location"
  255. }
  256. ];
  257. // The maximum number of items to return.
  258. //
  259. // If not specified, a default value of 1000 will be used by the service.
  260. // Regardless of the page_size value, the response may include a partial list
  261. // and a caller should only rely on response's
  262. // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token]
  263. // to determine if there are more instances left to be queried.
  264. int32 page_size = 2;
  265. // The next_page_token value returned from a previous List request,
  266. // if any.
  267. string page_token = 3;
  268. // List filter. For example, exclude all Memcached instances with name as
  269. // my-instance by specifying "name != my-instance".
  270. string filter = 4;
  271. // Sort results. Supported values are "name", "name desc" or "" (unsorted).
  272. string order_by = 5;
  273. }
  274. // Response for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances].
  275. message ListInstancesResponse {
  276. // A list of Memcached instances in the project in the specified location,
  277. // or across all locations.
  278. //
  279. // If the `location_id` in the parent field of the request is "-", all regions
  280. // available to the project are queried, and the results aggregated.
  281. repeated Instance instances = 1;
  282. // Token to retrieve the next page of results, or empty if there are no more
  283. // results in the list.
  284. string next_page_token = 2;
  285. // Locations that could not be reached.
  286. repeated string unreachable = 3;
  287. }
  288. // Request for [GetInstance][google.cloud.memcache.v1.CloudMemcache.GetInstance].
  289. message GetInstanceRequest {
  290. // Required. Memcached instance resource name in the format:
  291. // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
  292. // where `location_id` refers to a GCP region
  293. string name = 1 [
  294. (google.api.field_behavior) = REQUIRED,
  295. (google.api.resource_reference) = {
  296. type: "memcache.googleapis.com/Instance"
  297. }
  298. ];
  299. }
  300. // Request for [CreateInstance][google.cloud.memcache.v1.CloudMemcache.CreateInstance].
  301. message CreateInstanceRequest {
  302. // Required. The resource name of the instance location using the form:
  303. // `projects/{project_id}/locations/{location_id}`
  304. // where `location_id` refers to a GCP region
  305. string parent = 1 [
  306. (google.api.field_behavior) = REQUIRED,
  307. (google.api.resource_reference) = {
  308. type: "locations.googleapis.com/Location"
  309. }
  310. ];
  311. // Required. The logical name of the Memcached instance in the user
  312. // project with the following restrictions:
  313. //
  314. // * Must contain only lowercase letters, numbers, and hyphens.
  315. // * Must start with a letter.
  316. // * Must be between 1-40 characters.
  317. // * Must end with a number or a letter.
  318. // * Must be unique within the user project / location
  319. //
  320. // If any of the above are not met, will raise an invalid argument error.
  321. string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
  322. // Required. A Memcached Instance
  323. Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
  324. }
  325. // Request for [UpdateInstance][google.cloud.memcache.v1.CloudMemcache.UpdateInstance].
  326. message UpdateInstanceRequest {
  327. // Required. Mask of fields to update.
  328. // * `displayName`
  329. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
  330. // Required. A Memcached Instance.
  331. // Only fields specified in update_mask are updated.
  332. Instance instance = 2 [(google.api.field_behavior) = REQUIRED];
  333. }
  334. // Request for [DeleteInstance][google.cloud.memcache.v1.CloudMemcache.DeleteInstance].
  335. message DeleteInstanceRequest {
  336. // Required. Memcached instance resource name in the format:
  337. // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
  338. // where `location_id` refers to a GCP region
  339. string name = 1 [
  340. (google.api.field_behavior) = REQUIRED,
  341. (google.api.resource_reference) = {
  342. type: "memcache.googleapis.com/Instance"
  343. }
  344. ];
  345. }
  346. // Request for [ApplyParameters][google.cloud.memcache.v1.CloudMemcache.ApplyParameters].
  347. message ApplyParametersRequest {
  348. // Required. Resource name of the Memcached instance for which parameter group updates
  349. // should be applied.
  350. string name = 1 [
  351. (google.api.field_behavior) = REQUIRED,
  352. (google.api.resource_reference) = {
  353. type: "memcache.googleapis.com/Instance"
  354. }
  355. ];
  356. // Nodes to which we should apply the instance-level parameter group.
  357. repeated string node_ids = 2;
  358. // Whether to apply instance-level parameter group to all nodes. If set to
  359. // true, will explicitly restrict users from specifying any nodes, and apply
  360. // parameter group updates to all nodes within the instance.
  361. bool apply_all = 3;
  362. }
  363. // Request for [UpdateParameters][google.cloud.memcache.v1.CloudMemcache.UpdateParameters].
  364. message UpdateParametersRequest {
  365. // Required. Resource name of the Memcached instance for which the parameters should be
  366. // updated.
  367. string name = 1 [
  368. (google.api.field_behavior) = REQUIRED,
  369. (google.api.resource_reference) = {
  370. type: "memcache.googleapis.com/Instance"
  371. }
  372. ];
  373. // Required. Mask of fields to update.
  374. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  375. // The parameters to apply to the instance.
  376. MemcacheParameters parameters = 3;
  377. }
  378. message MemcacheParameters {
  379. // Output only. The unique ID associated with this set of parameters. Users
  380. // can use this id to determine if the parameters associated with the instance
  381. // differ from the parameters associated with the nodes and any action needs
  382. // to be taken to apply parameters on nodes.
  383. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  384. // User defined set of parameters to use in the memcached process.
  385. map<string, string> params = 3;
  386. }
  387. // Represents the metadata of a long-running operation.
  388. message OperationMetadata {
  389. // Output only. Time when the operation was created.
  390. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  391. // Output only. Time when the operation finished running.
  392. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  393. // Output only. Server-defined resource path for the target of the operation.
  394. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  395. // Output only. Name of the verb executed by the operation.
  396. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  397. // Output only. Human-readable status of the operation, if any.
  398. string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  399. // Output only. Identifies whether the user has requested cancellation
  400. // of the operation. Operations that have successfully been cancelled
  401. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  402. // corresponding to `Code.CANCELLED`.
  403. bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  404. // Output only. API version used to start the operation.
  405. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  406. }
  407. // Memcached versions supported by our service.
  408. enum MemcacheVersion {
  409. MEMCACHE_VERSION_UNSPECIFIED = 0;
  410. // Memcached 1.5 version.
  411. MEMCACHE_1_5 = 1;
  412. }