cloud_memcache.proto 21 KB

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