From 1db494483608c22f8ff011f1014dd3c50ced7add Mon Sep 17 00:00:00 2001 From: himanikh Date: Thu, 15 Aug 2024 23:08:03 +0000 Subject: [PATCH 01/19] memorystore open api --- .../memorystore_public_openapi3_0_v1beta.json | 2575 +++++++++++++++++ 1 file changed, 2575 insertions(+) create mode 100644 mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json diff --git a/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json b/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json new file mode 100644 index 000000000000..a9938b995652 --- /dev/null +++ b/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json @@ -0,0 +1,2575 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Memorystore API", + "description": "", + "version": "v1beta", + "x-google-revision": "0" + }, + "servers": [ + { + "url": "https://memorystore.googleapis.com", + "description": "Global Endpoint" + } + ], + "paths": { + "/v1beta/projects/{project}/locations/{location}/operations": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "ListOperations", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "description": "The standard list filter.", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "description": "The standard list page size.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "description": "The standard list page token.", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOperationsResponse" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}/operations/{operation}": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "GetOperation", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "operation", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Operation" + } + } + } + } + } + }, + "delete": { + "tags": [ + "memorystore" + ], + "operationId": "DeleteOperation", + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "operation", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Empty" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}/operations/{operation}:cancel": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "post": { + "tags": [ + "memorystore" + ], + "operationId": "CancelOperation", + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "operation", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Empty" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}/instances": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "ListInstances", + "description": "Lists Instances in a given project and location.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "description": "Optional. Requested page size. Server may return fewer items than requested.\nIf unspecified, server will pick an appropriate default.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "description": "Optional. A token identifying a page of results the server should return.", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "description": "Optional. Expression for filtering results.", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "orderBy", + "description": "Optional. Sort results by a defined order. Supported values: \"name\", \"create_time\".", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListInstancesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "memorystore" + ], + "operationId": "CreateInstance", + "description": "Creates a new Instance in a given project and location.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instanceId", + "description": "Required. The ID to use for the instance, which will become the final component of\nthe instance's resource name.\n\nThis value is subject to the following restrictions:\n\n* Must be 4-63 characters in length\n* Must begin with a letter or digit\n* Must contain only lowercase letters, digits, and hyphens\n* Must not end with a hyphen\n* Must be unique within a location", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requestId", + "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes since the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Required. The instance to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Instance" + } + } + } + }, + "x-google-lro": "true", + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInstanceOperation" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}/instances/{instance}": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "GetInstance", + "description": "Gets details of a single Instance.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instance", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Instance" + } + } + } + } + } + }, + "patch": { + "tags": [ + "memorystore" + ], + "operationId": "UpdateInstance", + "description": "Updates the parameters of a single Instance.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instance", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "updateMask", + "description": "Optional. The list of fields to be updated on the instance. At least one field must\nbe specified.", + "in": "query", + "schema": { + "type": "string", + "pattern": "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$", + "format": "google-fieldmask" + } + }, + { + "name": "requestId", + "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes since the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Required. The instance to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Instance" + } + } + } + }, + "x-google-lro": "true", + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateInstanceOperation" + } + } + } + } + } + }, + "delete": { + "tags": [ + "memorystore" + ], + "operationId": "DeleteInstance", + "description": "Deletes a single Instance.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instance", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requestId", + "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes after the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "x-google-lro": "true", + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteInstanceOperation" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}/instances/{instance}/certificateAuthority": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "GetCertificateAuthority", + "description": "Gets details about the certificate authority for an Instance.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instance", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CertificateAuthority" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "ListLocations", + "description": "Lists information about the supported locations for this service.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "description": "A filter to narrow down results to a preferred subset.\nThe filtering language accepts strings like `\"displayName=tokyo\"`, and\nis documented in more detail in [AIP-160](https://google.aip.dev/160).", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "description": "The maximum number of results to return.\nIf not set, the service selects a default.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageToken", + "description": "A page token received from the `next_page_token` field in the response.\nSend that page token to receive the subsequent page.", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationsResponse" + } + } + } + } + } + } + }, + "/v1beta/projects/{project}/locations/{location}": { + "parameters": [ + { + "$ref": "#/components/parameters/alt" + }, + { + "$ref": "#/components/parameters/callback" + }, + { + "$ref": "#/components/parameters/prettyPrint" + }, + { + "$ref": "#/components/parameters/_.xgafv" + } + ], + "get": { + "tags": [ + "memorystore" + ], + "operationId": "GetLocation", + "description": "Gets information about a location.", + "security": [ + { + "google_oauth_implicit": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "google_oauth_code": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + { + "bearer_auth": [] + } + ], + "parameters": [ + { + "name": "project", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "location", + "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Location" + } + } + } + } + } + } + } + }, + "components": { + "parameters": { + "alt": { + "name": "$alt", + "description": "Data format for response.", + "schema": { + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "x-google-enum-descriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "type": "string" + }, + "in": "query" + }, + "callback": { + "name": "$callback", + "description": "JSONP", + "schema": { + "type": "string" + }, + "in": "query" + }, + "prettyPrint": { + "name": "$prettyPrint", + "description": "Returns response with indentations and line breaks.", + "schema": { + "default": "true", + "type": "boolean" + }, + "in": "query" + }, + "_.xgafv": { + "name": "$.xgafv", + "description": "V1 error format.", + "schema": { + "enum": [ + "1", + "2" + ], + "x-google-enum-descriptions": [ + "v1 error format", + "v2 error format" + ], + "type": "string" + }, + "in": "query" + } + }, + "securitySchemes": { + "google_oauth_implicit": { + "type": "oauth2", + "description": "Google Oauth 2.0 implicit authentication flow.", + "flows": { + "implicit": { + "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth", + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "google_oauth_code": { + "type": "oauth2", + "description": "Google Oauth 2.0 authorizationCode authentication flow.", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth", + "tokenUrl": "https://oauth2.googleapis.com/token", + "refreshUrl": "https://oauth2.googleapis.com/token", + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "bearer_auth": { + "type": "http", + "description": "Http bearer authentication.", + "scheme": "bearer" + } + }, + "schemas": { + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Operation" + } + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + } + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors).", + "type": "object", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer", + "format": "int32" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + } + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }", + "type": "object" + }, + "ListInstancesResponse": { + "description": "Response message for ListInstances.", + "type": "object", + "properties": { + "instances": { + "description": "If the {location} requested was \"-\" the response contains a list of\ninstances from all locations. Instances in unreachable locations will be\nomitted.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Instance" + } + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page.\nIf this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "unreachable": { + "description": "Locations that could not be reached.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Instance": { + "description": "A Memorystore instance.", + "type": "object", + "properties": { + "name": { + "description": "Identifier. Unique name of the instance.\nFormat: projects/{project}/locations/{location}/instances/{instance}", + "x-google-identifier": true, + "type": "string" + }, + "createTime": { + "description": "Output only. Creation timestamp of the instance.", + "readOnly": true, + "type": "string", + "format": "date-time" + }, + "updateTime": { + "description": "Output only. Latest update timestamp of the instance.", + "readOnly": true, + "type": "string", + "format": "date-time" + }, + "labels": { + "description": "Optional. Labels to represent user-provided metadata.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "state": { + "description": "Output only. Current state of the instance.", + "readOnly": true, + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "Instance is being created.", + "Instance has been created and is usable.", + "Instance is being updated.", + "Instance is being deleted." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING" + ] + }, + "stateInfo": { + "description": "Output only. Additional information about the state of the instance.", + "readOnly": true, + "allOf": [ + { + "$ref": "#/components/schemas/StateInfo" + } + ] + }, + "uid": { + "description": "Output only. System assigned, unique identifier for the instance.", + "readOnly": true, + "type": "string" + }, + "replicaCount": { + "description": "Optional. Number of replica nodes per shard. If omitted the default is 0 replicas.", + "type": "integer", + "format": "int32" + }, + "authorizationMode": { + "description": "Optional. Immutable. Authorization mode of the instance.", + "x-google-immutable": true, + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "Authorization disabled.", + "IAM basic authorization." + ], + "enum": [ + "AUTHORIZATION_MODE_UNSPECIFIED", + "AUTH_DISABLED", + "IAM_AUTH" + ] + }, + "transitEncryptionMode": { + "description": "Optional. Immutable. In-transit encryption mode of the instance.", + "x-google-immutable": true, + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "In-transit encryption is disabled.", + "Server-managed encryption is used for in-transit encryption." + ], + "enum": [ + "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED", + "TRANSIT_ENCRYPTION_DISABLED", + "SERVER_AUTHENTICATION" + ] + }, + "shardCount": { + "description": "Required. Number of shards for the instance.", + "type": "integer", + "format": "int32" + }, + "discoveryEndpoints": { + "description": "Output only. Endpoints clients can connect to the instance through. Currently only one\ndiscovery endpoint is supported.", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscoveryEndpoint" + } + }, + "nodeType": { + "description": "Optional. Immutable. Machine type for individual nodes of the instance.", + "x-google-immutable": true, + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "Shared core nano.", + "High memory medium.", + "High memory extra large.", + "Standard small." + ], + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "SHARED_CORE_NANO", + "HIGHMEM_MEDIUM", + "HIGHMEM_XLARGE", + "STANDARD_SMALL" + ] + }, + "persistenceConfig": { + "description": "Optional. Persistence configuration of the instance.", + "allOf": [ + { + "$ref": "#/components/schemas/PersistenceConfig" + } + ] + }, + "engineVersion": { + "description": "Optional. Immutable. Engine version of the instance.", + "x-google-immutable": true, + "type": "string" + }, + "engineConfigs": { + "description": "Optional. User-provided engine configurations for the instance.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "nodeConfig": { + "description": "Output only. Configuration of individual nodes of the instance.", + "readOnly": true, + "allOf": [ + { + "$ref": "#/components/schemas/NodeConfig" + } + ] + }, + "zoneDistributionConfig": { + "description": "Optional. Immutable. Zone distribution configuration of the instance for node allocation.", + "x-google-immutable": true, + "allOf": [ + { + "$ref": "#/components/schemas/ZoneDistributionConfig" + } + ] + }, + "deletionProtectionEnabled": { + "description": "Optional. If set to true deletion of the instance will fail.", + "type": "boolean" + }, + "pscAutoConnections": { + "description": "Required. Immutable. User inputs and resource details of the auto-created PSC connections.", + "x-google-immutable": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/PscAutoConnection" + } + } + }, + "required": [ + "shardCount", + "pscAutoConnections" + ] + }, + "StateInfo": { + "description": "Additional information about the state of the instance.", + "type": "object", + "properties": { + "updateInfo": { + "description": "Output only. Describes ongoing update when instance state is UPDATING.", + "readOnly": true, + "allOf": [ + { + "$ref": "#/components/schemas/UpdateInfo" + } + ] + } + } + }, + "UpdateInfo": { + "description": "Represents information about instance with state UPDATING.", + "type": "object", + "properties": { + "targetShardCount": { + "description": "Output only. Target number of shards for the instance.", + "readOnly": true, + "type": "integer", + "format": "int32" + }, + "targetReplicaCount": { + "description": "Output only. Target number of replica nodes per shard for the instance.", + "readOnly": true, + "type": "integer", + "format": "int32" + } + } + }, + "DiscoveryEndpoint": { + "description": "Represents an endpoint for clients to connect to the instance.", + "type": "object", + "properties": { + "address": { + "description": "Output only. IP address of the exposed endpoint clients connect to.", + "readOnly": true, + "type": "string" + }, + "port": { + "description": "Output only. The port number of the exposed endpoint.", + "readOnly": true, + "type": "integer", + "format": "int32" + }, + "network": { + "description": "Output only. The network where the IP address of the discovery endpoint will be\nreserved, in the form of\nprojects/{network_project}/global/networks/{network_id}.", + "readOnly": true, + "type": "string" + } + } + }, + "PersistenceConfig": { + "description": "Represents persistence configuration for a instance.", + "type": "object", + "properties": { + "mode": { + "description": "Optional. Current persistence mode.", + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "Persistence is disabled, and any snapshot data is deleted.", + "RDB based persistence is enabled.", + "AOF based persistence is enabled." + ], + "enum": [ + "PERSISTENCE_MODE_UNSPECIFIED", + "DISABLED", + "RDB", + "AOF" + ] + }, + "rdbConfig": { + "description": "Optional. RDB configuration. This field will be ignored if mode is not RDB.", + "allOf": [ + { + "$ref": "#/components/schemas/RDBConfig" + } + ] + }, + "aofConfig": { + "description": "Optional. AOF configuration. This field will be ignored if mode is not AOF.", + "allOf": [ + { + "$ref": "#/components/schemas/AOFConfig" + } + ] + } + } + }, + "RDBConfig": { + "description": "Configuration for RDB based persistence.", + "type": "object", + "properties": { + "rdbSnapshotPeriod": { + "description": "Optional. Period between RDB snapshots.", + "type": "string", + "x-google-enum-descriptions": [ + "Not set.", + "One hour.", + "Six hours.", + "Twelve hours.", + "Twenty four hours." + ], + "enum": [ + "SNAPSHOT_PERIOD_UNSPECIFIED", + "ONE_HOUR", + "SIX_HOURS", + "TWELVE_HOURS", + "TWENTY_FOUR_HOURS" + ] + }, + "rdbSnapshotStartTime": { + "description": "Optional. Time that the first snapshot was/will be attempted, and to which future\nsnapshots will be aligned. If not provided, the current time will be\nused.", + "type": "string", + "format": "date-time" + } + } + }, + "AOFConfig": { + "description": "Configuration for AOF based persistence.", + "type": "object", + "properties": { + "appendFsync": { + "description": "Optional. The fsync mode.", + "type": "string", + "x-google-enum-descriptions": [ + "Not set. Default: EVERY_SEC", + "Never fsync. Normally Linux will flush data every 30 seconds with this\nconfiguration, but it's up to the kernel's exact tuning.", + "Fsync every second. You may lose 1 second of data if there is a\ndisaster.", + "Fsync every time new commands are appended to the AOF. The best data\nloss protection at the cost of performance." + ], + "enum": [ + "APPEND_FSYNC_UNSPECIFIED", + "NEVER", + "EVERY_SEC", + "ALWAYS" + ] + } + } + }, + "NodeConfig": { + "description": "Represents configuration for nodes of the instance.", + "type": "object", + "properties": { + "sizeGb": { + "description": "Output only. Memory size in GB of the node.", + "readOnly": true, + "type": "number", + "format": "double" + } + } + }, + "ZoneDistributionConfig": { + "description": "Zone distribution configuration for allocation of instance resources.", + "type": "object", + "properties": { + "zone": { + "description": "Optional. Defines zone where all resources will be allocated with SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode.", + "type": "string" + }, + "mode": { + "description": "Optional. Current zone distribution mode. Defaults to MULTI_ZONE.", + "type": "string", + "x-google-enum-descriptions": [ + "Not Set. Default: MULTI_ZONE", + "Distribute resources across 3 zones picked at random within the\nregion.", + "Provision resources in a single zone. Zone field must be specified." + ], + "enum": [ + "ZONE_DISTRIBUTION_MODE_UNSPECIFIED", + "MULTI_ZONE", + "SINGLE_ZONE" + ] + } + } + }, + "PscAutoConnection": { + "description": "Details of consumer resources in a PSC connection.", + "type": "object", + "properties": { + "pscConnectionId": { + "description": "Output only. The PSC connection id of the forwarding rule connected to the\nservice attachment.", + "readOnly": true, + "type": "string" + }, + "ipAddress": { + "description": "Output only. The IP allocated on the consumer network for the PSC forwarding rule.", + "readOnly": true, + "type": "string" + }, + "forwardingRule": { + "description": "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", + "readOnly": true, + "type": "string" + }, + "projectId": { + "description": "Required. The consumer project_id where the forwarding rule is created from.", + "type": "string" + }, + "network": { + "description": "Required. The consumer network where the IP address resides, in the form of\nprojects/{project_id}/global/networks/{network_id}.", + "type": "string" + } + }, + "required": [ + "projectId", + "network" + ] + }, + "OperationMetadata": { + "description": "Represents the metadata of a long-running operation.", + "type": "object", + "properties": { + "createTime": { + "description": "Output only. The time the operation was created.", + "readOnly": true, + "type": "string", + "format": "date-time" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "readOnly": true, + "type": "string", + "format": "date-time" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation\nof the operation. Operations that have been cancelled successfully\nhave Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + } + } + }, + "CertificateAuthority": { + "description": "A certificate authority for an instance.", + "type": "object", + "properties": { + "managedServerCa": { + "description": "A managed server certificate authority.", + "allOf": [ + { + "$ref": "#/components/schemas/ManagedCertificateAuthority" + } + ] + }, + "name": { + "description": "Identifier. Unique name of the certificate authority.\nFormat:\nprojects/{project}/locations/{location}/instances/{instance}", + "x-google-identifier": true, + "type": "string" + } + } + }, + "ManagedCertificateAuthority": { + "description": "A managed certificate authority.", + "type": "object", + "properties": { + "caCerts": { + "description": "PEM encoded CA certificate chains for managed server authentication.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CertChain" + } + } + } + }, + "CertChain": { + "description": "A certificate chain.", + "type": "object", + "properties": { + "certificates": { + "description": "The certificates that form the CA chain in order of leaf to root.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Location" + } + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + } + }, + "Location": { + "description": "A resource that represents a Google Cloud location.", + "type": "object", + "properties": { + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", + "type": "string" + }, + "locationId": { + "description": "The canonical id for this location. For example: `\"us-east1\"`.", + "type": "string" + }, + "displayName": { + "description": "The friendly name for this location, typically a nearby city name.\nFor example, \"Tokyo\".", + "type": "string" + }, + "labels": { + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "metadata": { + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + }, + "BillingView": { + "description": "Message for reporting billing requests through Eventstream.", + "type": "object", + "properties": { + "reportRequests": { + "description": "Billing requests to be reported for cloud.eventstream.v2.ResourceEvent\n\nEach request contains billing operations to be reported under a service\nname. See go/billing-view-construction for documentation on constructing\nbilling view report requests.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1ReportRequest" + } + } + } + }, + "GoogleApiServicecontrolV1ReportRequest": { + "description": "Request message for the Report method.", + "type": "object", + "properties": { + "serviceName": { + "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", + "type": "string" + }, + "operations": { + "description": "Operations to be reported.\n\nTypically the service should report one operation per request.\nPutting multiple operations into a single request is allowed, but should\nbe used only when multiple operations are natually available at the time\nof the report.\n\nThere is no limit on the number of operations in the same ReportRequest,\nhowever the ReportRequest size should be no larger than 1MB. See\nReportResponse.report_errors for partial failure behavior.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1Operation" + } + }, + "serviceConfigId": { + "description": "Specifies which version of service config should be used to process the\nrequest.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", + "type": "string" + } + } + }, + "GoogleApiServicecontrolV1Operation": { + "description": "Represents information regarding an operation.", + "type": "object", + "properties": { + "operationId": { + "description": "Identity of the operation. This must be unique within the scope of the\nservice that generated the operation. If the service calls\nCheck() and Report() on the same operation, the two calls should carry\nthe same id.\n\nUUID version 4 is recommended, though not required.\nIn scenarios where an operation is computed from existing information\nand an idempotent id is desirable for deduplication purpose, UUID version 5\nis recommended. See RFC 4122 for details.", + "type": "string" + }, + "operationName": { + "description": "Fully qualified name of the operation. Reserved for future use.", + "type": "string" + }, + "consumerId": { + "description": "Identity of the consumer who is using the service.\nThis field should be filled in for the operations initiated by a\nconsumer, but not for service-initiated operations that are\nnot related to a specific consumer.\n\n\n- This can be in one of the following formats:\n - project:PROJECT_ID,\n - project`_`number:PROJECT_NUMBER,\n - projects/PROJECT_ID or PROJECT_NUMBER,\n - folders/FOLDER_NUMBER,\n - organizations/ORGANIZATION_NUMBER,\n - api`_`key:API_KEY.", + "type": "string" + }, + "startTime": { + "description": "Required. Start time of the operation.", + "type": "string", + "format": "date-time" + }, + "endTime": { + "description": "End time of the operation.\nRequired when the operation is used in ServiceController.Report,\nbut optional when the operation is used in ServiceController.Check.", + "type": "string", + "format": "date-time" + }, + "labels": { + "description": "Labels describing the operation. Only the following labels are allowed:\n\n- Labels describing monitored resources as defined in\n the service configuration.\n- Default labels of metric values. When specified, labels defined in the\n metric value override these default.\n- The following labels defined by Google Cloud Platform:\n - `cloud.googleapis.com/location` describing the location where the\n operation happened,\n - `servicecontrol.googleapis.com/user_agent` describing the user agent\n of the API request,\n - `servicecontrol.googleapis.com/service_agent` describing the service\n used to handle the API request (e.g. ESP),\n - `servicecontrol.googleapis.com/platform` describing the platform\n where the API is served, such as App Engine, Compute Engine, or\n Kubernetes Engine.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "metricValueSets": { + "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1MetricValueSet" + } + }, + "logEntries": { + "description": "Represents information to be logged.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntry" + } + }, + "quotaProperties": { + "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request. If this is not specified, no quota\ncheck will be performed.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1QuotaProperties" + } + ] + }, + "importance": { + "description": "DO NOT USE. This is an experimental field.", + "type": "string", + "x-google-enum-descriptions": [ + "Allows data caching, batching, and aggregation. It provides\nhigher performance with higher data loss risk.", + "Disables data aggregation to minimize data loss. It is for operations\nthat contains significant monetary value or audit trail. This feature\nonly applies to the client libraries.", + "Deprecated. Do not use.\n\nDisables data aggregation and enables additional validation logic.\nIt should only be used during the onboarding process. It is only\navailable to Google internal services, and the service must be\napproved by chemist-dev@google.com in order to use this level.", + "Used internally by Chemist." + ], + "enum": [ + "LOW", + "HIGH", + "DEBUG", + "PROMOTED" + ] + }, + "userLabels": { + "description": "Private Preview. This feature is only available for approved services.\n\nUser defined labels for the resource that this operation is associated\nwith.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "resources": { + "description": "The resources that are involved in the operation.\nThe maximum supported number of entries in this field is 100.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1ResourceInfo" + } + }, + "traceSpans": { + "description": "Unimplemented. A list of Cloud Trace spans. The span names shall contain\nthe id of the destination project which can be either the produce or the\nconsumer project.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1TraceSpan" + } + } + } + }, + "GoogleApiServicecontrolV1MetricValueSet": { + "description": "Represents a set of metric values in the same metric.\nEach metric value in the set should have a unique combination of start time,\nend time, and label values.", + "type": "object", + "properties": { + "metricName": { + "description": "The metric name defined in the service configuration.", + "type": "string" + }, + "metricValues": { + "description": "The values in this metric.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1MetricValue" + } + } + } + }, + "GoogleApiServicecontrolV1MetricValue": { + "description": "Represents a single metric value.", + "type": "object", + "properties": { + "labels": { + "description": "The labels describing the metric value.\nSee comments on google.api.servicecontrol.v1.Operation.labels for\nthe overriding relationship.\nNote that this map must not contain monitored resource labels.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "startTime": { + "description": "The start of the time period over which this metric value's measurement\napplies. The time period has different semantics for different metric\ntypes (cumulative, delta, and gauge). See the metric definition\ndocumentation in the service configuration for details. If not specified,\ngoogle.api.servicecontrol.v1.Operation.start_time will be used.", + "type": "string", + "format": "date-time" + }, + "endTime": { + "description": "The end of the time period over which this metric value's measurement\napplies. If not specified,\ngoogle.api.servicecontrol.v1.Operation.end_time will be used.", + "type": "string", + "format": "date-time" + }, + "boolValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "int64Value": { + "description": "A signed 64-bit integer value.", + "type": "string", + "format": "int64" + }, + "doubleValue": { + "description": "A double precision floating point value.", + "type": "number", + "format": "double" + }, + "stringValue": { + "description": "A text string value.", + "type": "string" + }, + "distributionValue": { + "description": "A distribution value.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1Distribution" + } + ] + }, + "moneyValue": { + "description": "A money value.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + } + } + }, + "GoogleApiServicecontrolV1Distribution": { + "description": "Distribution represents a frequency distribution of double-valued sample\npoints. It contains the size of the population of sample points plus\nadditional optional information:\n\n* the arithmetic mean of the samples\n* the minimum and maximum of the samples\n* the sum-squared-deviation of the samples, used to compute variance\n* a histogram of the values of the sample points", + "type": "object", + "properties": { + "count": { + "description": "The total number of samples in the distribution. Must be >= 0.", + "type": "string", + "format": "int64" + }, + "mean": { + "description": "The arithmetic mean of the samples in the distribution. If `count` is\nzero then this field must be zero.", + "type": "number", + "format": "double" + }, + "minimum": { + "description": "The minimum of the population of values. Ignored if `count` is zero.", + "type": "number", + "format": "double" + }, + "maximum": { + "description": "The maximum of the population of values. Ignored if `count` is zero.", + "type": "number", + "format": "double" + }, + "sumOfSquaredDeviation": { + "description": "The sum of squared deviations from the mean:\n Sum[i=1..count]((x_i - mean)^2)\nwhere each x_i is a sample values. If `count` is zero then this field\nmust be zero, otherwise validation of the request fails.", + "type": "number", + "format": "double" + }, + "bucketCounts": { + "description": "The number of samples in each histogram bucket. `bucket_counts` are\noptional. If present, they must sum to the `count` value.\n\nThe buckets are defined below in `bucket_option`. There are N buckets.\n`bucket_counts[0]` is the number of samples in the underflow bucket.\n`bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples\nin each of the finite buckets. And `bucket_counts[N] is the number\nof samples in the overflow bucket. See the comments of `bucket_option`\nbelow for more details.\n\nAny suffix of trailing zeros may be omitted.", + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "linearBuckets": { + "description": "Buckets with constant width.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1LinearBuckets" + } + ] + }, + "exponentialBuckets": { + "description": "Buckets with exponentially growing width.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1ExponentialBuckets" + } + ] + }, + "explicitBuckets": { + "description": "Buckets with arbitrary user-provided width.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1ExplicitBuckets" + } + ] + }, + "exemplars": { + "description": "Example points. Must be in increasing order of `value` field.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Exemplar" + } + } + } + }, + "GoogleApiServicecontrolV1LinearBuckets": { + "description": "Describing buckets with constant width.", + "type": "object", + "properties": { + "numFiniteBuckets": { + "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", + "type": "integer", + "format": "int32" + }, + "width": { + "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.\nMust be strictly positive.", + "type": "number", + "format": "double" + }, + "offset": { + "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.", + "type": "number", + "format": "double" + } + } + }, + "GoogleApiServicecontrolV1ExponentialBuckets": { + "description": "Describing buckets with exponentially growing width.", + "type": "object", + "properties": { + "numFiniteBuckets": { + "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", + "type": "integer", + "format": "int32" + }, + "growthFactor": { + "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be larger than 1.0.", + "type": "number", + "format": "double" + }, + "scale": { + "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be > 0.", + "type": "number", + "format": "double" + } + } + }, + "GoogleApiServicecontrolV1ExplicitBuckets": { + "description": "Describing buckets with arbitrary user-provided width.", + "type": "object", + "properties": { + "bounds": { + "description": "'bound' is a list of strictly increasing boundaries between\nbuckets. Note that a list of length N-1 defines N buckets because\nof fenceposting. See comments on `bucket_options` for details.\n\nThe i'th finite bucket covers the interval\n [bound[i-1], bound[i])\nwhere i ranges from 1 to bound_size() - 1. Note that there are no\nfinite buckets at all if 'bound' only contains a single element; in\nthat special case the single bound defines the boundary between the\nunderflow and overflow buckets.\n\nbucket number lower bound upper bound\n i == 0 (underflow) -inf bound[i]\n 0 < i < bound_size() bound[i-1] bound[i]\n i == bound_size() (overflow) bound[i-1] +inf", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + }, + "Exemplar": { + "description": "Exemplars are example points that may be used to annotate aggregated\ndistribution values. They are metadata that gives information about a\nparticular value added to a Distribution bucket, such as a trace ID that\nwas active when a value was added. They may contain further information,\nsuch as a example values and timestamps, origin, etc.", + "type": "object", + "properties": { + "value": { + "description": "Value of the exemplar point. This value determines to which bucket the\nexemplar belongs.", + "type": "number", + "format": "double" + }, + "timestamp": { + "description": "The observation (sampling) time of the above value.", + "type": "string", + "format": "date-time" + }, + "attachments": { + "description": "Contextual information about the example value. Examples are:\n\n Trace: type.googleapis.com/google.monitoring.v3.SpanContext\n\n Literal string: type.googleapis.com/google.protobuf.StringValue\n\n Labels dropped during aggregation:\n type.googleapis.com/google.monitoring.v3.DroppedLabels\n\nThere may be only a single attachment of any given message type in a\nsingle exemplar, and this is enforced by the system.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + } + }, + "Money": { + "description": "Represents an amount of money with its currency type.", + "type": "object", + "properties": { + "currencyCode": { + "description": "The three-letter currency code defined in ISO 4217.", + "type": "string" + }, + "units": { + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "type": "string", + "format": "int64" + }, + "nanos": { + "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "type": "integer", + "format": "int32" + } + } + }, + "GoogleApiServicecontrolV1LogEntry": { + "description": "An individual log entry.", + "type": "object", + "properties": { + "name": { + "description": "Required. The log to which this log entry belongs. Examples: `\"syslog\"`,\n`\"book_log\"`.", + "type": "string" + }, + "timestamp": { + "description": "The time the event described by the log entry occurred. If\nomitted, defaults to operation start time.", + "type": "string", + "format": "date-time" + }, + "severity": { + "description": "The severity of the log entry. The default value is\n`LogSeverity.DEFAULT`.", + "allOf": [ + { + "$ref": "#/components/schemas/LogSeverity" + } + ] + }, + "httpRequest": { + "description": "Optional. Information about the HTTP request associated with this\nlog entry, if applicable.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1HttpRequest" + } + ] + }, + "trace": { + "description": "Optional. Resource name of the trace associated with the log entry, if any.\nIf this field contains a relative resource name, you can assume the name is\nrelative to `//tracing.googleapis.com`. Example:\n`projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`", + "type": "string" + }, + "insertId": { + "description": "A unique ID for the log entry used for deduplication. If omitted,\nthe implementation will generate one based on operation_id.", + "type": "string" + }, + "labels": { + "description": "A set of user-defined (key, value) data that provides additional\ninformation about the log entry.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "protoPayload": { + "description": "The log entry payload, represented as a protocol buffer that is\nexpressed as a JSON object. The only accepted type currently is\nAuditLog.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "textPayload": { + "description": "The log entry payload, represented as a Unicode string (UTF-8).", + "type": "string" + }, + "structPayload": { + "description": "The log entry payload, represented as a structure that\nis expressed as a JSON object.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object." + } + }, + "operation": { + "description": "Optional. Information about an operation associated with the log entry, if\napplicable.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntryOperation" + } + ] + }, + "sourceLocation": { + "description": "Optional. Source code location information associated with the log entry,\nif any.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntrySourceLocation" + } + ] + } + } + }, + "GoogleApiServicecontrolV1HttpRequest": { + "description": "A common proto for logging HTTP requests. Only contains semantics\ndefined by the HTTP specification. Product-specific logging\ninformation MUST be defined in a separate message.", + "type": "object", + "properties": { + "requestMethod": { + "description": "The request method. Examples: `\"GET\"`, `\"HEAD\"`, `\"PUT\"`, `\"POST\"`.", + "type": "string" + }, + "requestUrl": { + "description": "The scheme (http, https), the host name, the path, and the query\nportion of the URL that was requested.\nExample: `\"http://example.com/some/info?color=red\"`.", + "type": "string" + }, + "requestSize": { + "description": "The size of the HTTP request message in bytes, including the request\nheaders and the request body.", + "type": "string", + "format": "int64" + }, + "status": { + "description": "The response code indicating the status of the response.\nExamples: 200, 404.", + "type": "integer", + "format": "int32" + }, + "responseSize": { + "description": "The size of the HTTP response message sent back to the client, in bytes,\nincluding the response headers and the response body.", + "type": "string", + "format": "int64" + }, + "userAgent": { + "description": "The user agent sent by the client. Example:\n`\"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET\nCLR 1.0.3705)\"`.", + "type": "string" + }, + "remoteIp": { + "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP\nrequest. Examples: `\"192.168.1.1\"`, `\"FE80::0202:B3FF:FE1E:8329\"`.", + "type": "string" + }, + "serverIp": { + "description": "The IP address (IPv4 or IPv6) of the origin server that the request was\nsent to.", + "type": "string" + }, + "referer": { + "description": "The referer URL of the request, as defined in\n[HTTP/1.1 Header Field\nDefinitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).", + "type": "string" + }, + "latency": { + "description": "The request processing latency on the server, from the time the request was\nreceived until the response was sent.", + "type": "string", + "format": "google-duration" + }, + "cacheLookup": { + "description": "Whether or not a cache lookup was attempted.", + "type": "boolean" + }, + "cacheHit": { + "description": "Whether or not an entity was served from cache\n(with or without validation).", + "type": "boolean" + }, + "cacheValidatedWithOriginServer": { + "description": "Whether or not the response was validated with the origin server before\nbeing served from cache. This field is only meaningful if `cache_hit` is\nTrue.", + "type": "boolean" + }, + "cacheFillBytes": { + "description": "The number of HTTP response bytes inserted into cache. Set only when a\ncache fill was attempted.", + "type": "string", + "format": "int64" + }, + "protocol": { + "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"", + "type": "string" + } + } + }, + "GoogleApiServicecontrolV1LogEntryOperation": { + "description": "Additional information about a potentially long-running operation with which\na log entry is associated.", + "type": "object", + "properties": { + "id": { + "description": "Optional. An arbitrary operation identifier. Log entries with the\nsame identifier are assumed to be part of the same operation.", + "type": "string" + }, + "producer": { + "description": "Optional. An arbitrary producer identifier. The combination of\n`id` and `producer` must be globally unique. Examples for `producer`:\n`\"MyDivision.MyBigCompany.com\"`, `\"github.com/MyProject/MyApplication\"`.", + "type": "string" + }, + "first": { + "description": "Optional. Set this to True if this is the first log entry in the operation.", + "type": "boolean" + }, + "last": { + "description": "Optional. Set this to True if this is the last log entry in the operation.", + "type": "boolean" + } + } + }, + "GoogleApiServicecontrolV1LogEntrySourceLocation": { + "description": "Additional information about the source code location that produced the log\nentry.", + "type": "object", + "properties": { + "file": { + "description": "Optional. Source file name. Depending on the runtime environment, this\nmight be a simple name or a fully-qualified name.", + "type": "string" + }, + "line": { + "description": "Optional. Line within the source file. 1-based; 0 indicates no line number\navailable.", + "type": "string", + "format": "int64" + }, + "function": { + "description": "Optional. Human-readable name of the function or method being invoked, with\noptional context such as the class or package name. This information may be\nused in contexts such as the logs viewer, where a file and line number are\nless meaningful. The format can vary by language. For example:\n`qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`\n(Python).", + "type": "string" + } + } + }, + "GoogleApiServicecontrolV1QuotaProperties": { + "description": "Represents the properties needed for quota operations.", + "type": "object", + "properties": { + "quotaMode": { + "description": "Quota mode for this operation.", + "type": "string", + "x-google-enum-descriptions": [ + "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation fails and returns\nerror.", + "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation does not fail and\navailable quota goes down to zero but it returns error.", + "Does not change any available quota. Only checks if there is enough\nquota.\nNo lock is placed on the checked tokens neither." + ], + "enum": [ + "ACQUIRE", + "ACQUIRE_BEST_EFFORT", + "CHECK" + ] + } + } + }, + "GoogleApiServicecontrolV1ResourceInfo": { + "description": "Describes a resource associated with this operation.", + "type": "object", + "properties": { + "resourceContainer": { + "description": "The identifier of the parent of this resource instance.\nMust be in one of the following formats:\n - `projects/`\n - `folders/`\n - `organizations/`", + "type": "string" + }, + "resourceName": { + "description": "Name of the resource. This is used for auditing purposes.", + "type": "string" + }, + "resourceLocation": { + "description": "The location of the resource. If not empty, the resource will be checked\nagainst location policy. The value must be a valid zone, region or\nmultiregion. For example: \"europe-west4\" or \"northamerica-northeast1-a\"", + "type": "string" + }, + "permission": { + "description": "The resource permission required for this request.", + "type": "string" + } + } + }, + "GoogleApiServicecontrolV1TraceSpan": { + "description": "A span represents a single operation within a trace. Spans can be\nnested to form a trace tree. Often, a trace contains a root span\nthat describes the end-to-end latency, and one or more subspans for\nits sub-operations. A trace can also contain multiple root spans,\nor none at all. Spans do not need to be contiguous\u2014there may be\ngaps or overlaps between spans in a trace.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the span in the following format:\n\n projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.", + "type": "string" + }, + "spanId": { + "description": "The [SPAN_ID] portion of the span's resource name.", + "type": "string" + }, + "parentSpanId": { + "description": "The [SPAN_ID] of this span's parent span. If this is a root span,\nthen this field must be empty.", + "type": "string" + }, + "displayName": { + "description": "A description of the span's operation (up to 128 bytes).\nStackdriver Trace displays the description in the\nGoogle Cloud Platform Console.\nFor example, the display name can be a qualified method name or a file name\nand a line number where the operation is called. A best practice is to use\nthe same display name within an application and at the same call point.\nThis makes it easier to correlate spans in different traces.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1TruncatableString" + } + ] + }, + "startTime": { + "description": "The start time of the span. On the client side, this is the time kept by\nthe local machine where the span execution starts. On the server side, this\nis the time when the server's application handler starts running.", + "type": "string", + "format": "date-time" + }, + "endTime": { + "description": "The end time of the span. On the client side, this is the time kept by\nthe local machine where the span execution ends. On the server side, this\nis the time when the server application handler stops running.", + "type": "string", + "format": "date-time" + }, + "attributes": { + "description": "A set of attributes on the span. You can have up to 32 attributes per\nspan.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1Attributes" + } + ] + }, + "status": { + "description": "An optional final status for this span.", + "allOf": [ + { + "$ref": "#/components/schemas/Status" + } + ] + }, + "sameProcessAsParentSpan": { + "description": "(Optional) Set this parameter to indicate whether this span is in\nthe same process as its parent. If you do not set this parameter,\nStackdriver Trace is unable to take advantage of this helpful\ninformation.", + "type": "boolean" + }, + "childSpanCount": { + "description": "An optional number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.", + "type": "integer", + "format": "int32" + }, + "spanKind": { + "description": "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `CLIENT` (caller)\nand `SERVER` (callee) to identify an RPC call.", + "type": "string", + "x-google-enum-descriptions": [ + "Unspecified. Do NOT use as default.\nImplementations MAY assume SpanKind.INTERNAL to be default.", + "Indicates that the span is used internally. Default value.", + "Indicates that the span covers server-side handling of an RPC or other\nremote network request.", + "Indicates that the span covers the client-side wrapper around an RPC or\nother remote request.", + "Indicates that the span describes producer sending a message to a broker.\nUnlike client and server, there is no direct critical path latency\nrelationship between producer and consumer spans (e.g. publishing a\nmessage to a pubsub service).", + "Indicates that the span describes consumer receiving a message from a\nbroker. Unlike client and server, there is no direct critical path\nlatency relationship between producer and consumer spans (e.g. receiving\na message from a pubsub service subscription)." + ], + "enum": [ + "SPAN_KIND_UNSPECIFIED", + "INTERNAL", + "SERVER", + "CLIENT", + "PRODUCER", + "CONSUMER" + ] + } + } + }, + "GoogleApiServicecontrolV1TruncatableString": { + "description": "Represents a string that might be shortened to a specified length.", + "type": "object", + "properties": { + "value": { + "description": "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit.", + "type": "string" + }, + "truncatedByteCount": { + "description": "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.", + "type": "integer", + "format": "int32" + } + } + }, + "GoogleApiServicecontrolV1Attributes": { + "description": "A set of attributes, each in the format `[KEY]:[VALUE]`.", + "type": "object", + "properties": { + "attributeMap": { + "description": "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n \"/instance_id\": \"my-instance\"\n \"/http/user_agent\": \"\"\n \"/http/request_bytes\": 300\n \"abc.com/myattribute\": true", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1AttributeValue" + } + }, + "droppedAttributesCount": { + "description": "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid.", + "type": "integer", + "format": "int32" + } + } + }, + "GoogleApiServicecontrolV1AttributeValue": { + "description": "The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.", + "type": "object", + "properties": { + "stringValue": { + "description": "A string up to 256 bytes long.", + "allOf": [ + { + "$ref": "#/components/schemas/GoogleApiServicecontrolV1TruncatableString" + } + ] + }, + "intValue": { + "description": "A 64-bit signed integer.", + "type": "string", + "format": "int64" + }, + "boolValue": { + "description": "A Boolean value represented by `true` or `false`.", + "type": "boolean" + } + } + }, + "BaseOperation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should be a resource name ending with `operations/{unique_id}`.", + "type": "string" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "allOf": [ + { + "$ref": "#/components/schemas/Status" + } + ] + } + } + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseOperation" + }, + { + "type": "object", + "properties": { + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "response": { + "description": "The normal, successful response of the operation. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + } + ] + }, + "CreateInstanceOperation": { + "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseOperation" + }, + { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/components/schemas/OperationMetadata" + }, + "response": { + "$ref": "#/components/schemas/Instance" + } + } + } + ] + }, + "UpdateInstanceOperation": { + "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseOperation" + }, + { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/components/schemas/OperationMetadata" + }, + "response": { + "$ref": "#/components/schemas/Instance" + } + } + } + ] + }, + "DeleteInstanceOperation": { + "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/BaseOperation" + }, + { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/components/schemas/OperationMetadata" + }, + "response": { + "$ref": "#/components/schemas/Empty" + } + } + } + ] + }, + "LogSeverity": { + "type": "string", + "x-google-enum-descriptions": [ + "(0) The log entry has no assigned severity level.", + "(100) Debug or trace information.", + "(200) Routine information, such as ongoing status or performance.", + "(300) Normal but significant events, such as start up, shut down, or\na configuration change.", + "(400) Warning events might cause problems.", + "(500) Error events are likely to cause problems.", + "(600) Critical events cause more severe problems or outages.", + "(700) A person must take an action immediately.", + "(800) One or more systems are unusable." + ], + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ] + } + } + }, + "externalDocs": { + "description": "Find more info here.", + "url": "https://cloud.google.com/memorystore/" + } +} \ No newline at end of file From 91f60bf224781cd188a3a4095e2a599d4df075d3 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 16 Aug 2024 23:09:21 +0000 Subject: [PATCH 02/19] memorystore auto generated product and resource definition --- .../memorystore_public_openapi3_0_v1beta.json | 2575 ----------------- mmv1/products/memorystore/Instance.yaml | 259 ++ mmv1/products/memorystore/product.yaml | 9 + 3 files changed, 268 insertions(+), 2575 deletions(-) delete mode 100644 mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json create mode 100644 mmv1/products/memorystore/Instance.yaml create mode 100644 mmv1/products/memorystore/product.yaml diff --git a/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json b/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json deleted file mode 100644 index a9938b995652..000000000000 --- a/mmv1/openapi_generate/memorystore_public_openapi3_0_v1beta.json +++ /dev/null @@ -1,2575 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "Memorystore API", - "description": "", - "version": "v1beta", - "x-google-revision": "0" - }, - "servers": [ - { - "url": "https://memorystore.googleapis.com", - "description": "Global Endpoint" - } - ], - "paths": { - "/v1beta/projects/{project}/locations/{location}/operations": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "ListOperations", - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "filter", - "description": "The standard list filter.", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "description": "The standard list page size.", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "description": "The standard list page token.", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOperationsResponse" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}/operations/{operation}": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "GetOperation", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Operation" - } - } - } - } - } - }, - "delete": { - "tags": [ - "memorystore" - ], - "operationId": "DeleteOperation", - "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Empty" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}/operations/{operation}:cancel": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "post": { - "tags": [ - "memorystore" - ], - "operationId": "CancelOperation", - "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Empty" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}/instances": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "ListInstances", - "description": "Lists Instances in a given project and location.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "description": "Optional. Requested page size. Server may return fewer items than requested.\nIf unspecified, server will pick an appropriate default.", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "description": "Optional. A token identifying a page of results the server should return.", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "filter", - "description": "Optional. Expression for filtering results.", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "orderBy", - "description": "Optional. Sort results by a defined order. Supported values: \"name\", \"create_time\".", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListInstancesResponse" - } - } - } - } - } - }, - "post": { - "tags": [ - "memorystore" - ], - "operationId": "CreateInstance", - "description": "Creates a new Instance in a given project and location.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "instanceId", - "description": "Required. The ID to use for the instance, which will become the final component of\nthe instance's resource name.\n\nThis value is subject to the following restrictions:\n\n* Must be 4-63 characters in length\n* Must begin with a letter or digit\n* Must contain only lowercase letters, digits, and hyphens\n* Must not end with a hyphen\n* Must be unique within a location", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "requestId", - "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes since the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "Required. The instance to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Instance" - } - } - } - }, - "x-google-lro": "true", - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateInstanceOperation" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}/instances/{instance}": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "GetInstance", - "description": "Gets details of a single Instance.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "instance", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Instance" - } - } - } - } - } - }, - "patch": { - "tags": [ - "memorystore" - ], - "operationId": "UpdateInstance", - "description": "Updates the parameters of a single Instance.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "instance", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "updateMask", - "description": "Optional. The list of fields to be updated on the instance. At least one field must\nbe specified.", - "in": "query", - "schema": { - "type": "string", - "pattern": "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$", - "format": "google-fieldmask" - } - }, - { - "name": "requestId", - "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes since the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "Required. The instance to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Instance" - } - } - } - }, - "x-google-lro": "true", - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateInstanceOperation" - } - } - } - } - } - }, - "delete": { - "tags": [ - "memorystore" - ], - "operationId": "DeleteInstance", - "description": "Deletes a single Instance.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "instance", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "requestId", - "description": "Optional. An optional request ID to identify requests. Specify a unique request ID\nso that if you must retry your request, the server will know to ignore\nthe request if it has already been completed. The server will guarantee\nthat for at least 60 minutes after the first request.\n\nFor example, consider a situation where you make an initial request and the\nrequest times out. If you make the request again with the same request\nID, the server can check if original operation with the same request ID\nwas received, and if so, will ignore the second request. This prevents\nclients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is\nnot supported (00000000-0000-0000-0000-000000000000).", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "x-google-lro": "true", - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteInstanceOperation" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}/instances/{instance}/certificateAuthority": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "GetCertificateAuthority", - "description": "Gets details about the certificate authority for an Instance.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "instance", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CertificateAuthority" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "ListLocations", - "description": "Lists information about the supported locations for this service.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "filter", - "description": "A filter to narrow down results to a preferred subset.\nThe filtering language accepts strings like `\"displayName=tokyo\"`, and\nis documented in more detail in [AIP-160](https://google.aip.dev/160).", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "description": "The maximum number of results to return.\nIf not set, the service selects a default.", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "pageToken", - "description": "A page token received from the `next_page_token` field in the response.\nSend that page token to receive the subsequent page.", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListLocationsResponse" - } - } - } - } - } - } - }, - "/v1beta/projects/{project}/locations/{location}": { - "parameters": [ - { - "$ref": "#/components/parameters/alt" - }, - { - "$ref": "#/components/parameters/callback" - }, - { - "$ref": "#/components/parameters/prettyPrint" - }, - { - "$ref": "#/components/parameters/_.xgafv" - } - ], - "get": { - "tags": [ - "memorystore" - ], - "operationId": "GetLocation", - "description": "Gets information about a location.", - "security": [ - { - "google_oauth_implicit": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "google_oauth_code": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - { - "bearer_auth": [] - } - ], - "parameters": [ - { - "name": "project", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "location", - "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `memorystore.googleapis.com/CertificateAuthority`.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "default": { - "description": "Successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Location" - } - } - } - } - } - } - } - }, - "components": { - "parameters": { - "alt": { - "name": "$alt", - "description": "Data format for response.", - "schema": { - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "x-google-enum-descriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ], - "type": "string" - }, - "in": "query" - }, - "callback": { - "name": "$callback", - "description": "JSONP", - "schema": { - "type": "string" - }, - "in": "query" - }, - "prettyPrint": { - "name": "$prettyPrint", - "description": "Returns response with indentations and line breaks.", - "schema": { - "default": "true", - "type": "boolean" - }, - "in": "query" - }, - "_.xgafv": { - "name": "$.xgafv", - "description": "V1 error format.", - "schema": { - "enum": [ - "1", - "2" - ], - "x-google-enum-descriptions": [ - "v1 error format", - "v2 error format" - ], - "type": "string" - }, - "in": "query" - } - }, - "securitySchemes": { - "google_oauth_implicit": { - "type": "oauth2", - "description": "Google Oauth 2.0 implicit authentication flow.", - "flows": { - "implicit": { - "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth", - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." - } - } - } - }, - "google_oauth_code": { - "type": "oauth2", - "description": "Google Oauth 2.0 authorizationCode authentication flow.", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth", - "tokenUrl": "https://oauth2.googleapis.com/token", - "refreshUrl": "https://oauth2.googleapis.com/token", - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." - } - } - } - }, - "bearer_auth": { - "type": "http", - "description": "Http bearer authentication.", - "scheme": "bearer" - } - }, - "schemas": { - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Operation" - } - }, - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - } - } - }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors).", - "type": "object", - "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "type": "integer", - "format": "int32" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - } - } - } - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }", - "type": "object" - }, - "ListInstancesResponse": { - "description": "Response message for ListInstances.", - "type": "object", - "properties": { - "instances": { - "description": "If the {location} requested was \"-\" the response contains a list of\ninstances from all locations. Instances in unreachable locations will be\nomitted.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Instance" - } - }, - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page.\nIf this field is omitted, there are no subsequent pages.", - "type": "string" - }, - "unreachable": { - "description": "Locations that could not be reached.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "Instance": { - "description": "A Memorystore instance.", - "type": "object", - "properties": { - "name": { - "description": "Identifier. Unique name of the instance.\nFormat: projects/{project}/locations/{location}/instances/{instance}", - "x-google-identifier": true, - "type": "string" - }, - "createTime": { - "description": "Output only. Creation timestamp of the instance.", - "readOnly": true, - "type": "string", - "format": "date-time" - }, - "updateTime": { - "description": "Output only. Latest update timestamp of the instance.", - "readOnly": true, - "type": "string", - "format": "date-time" - }, - "labels": { - "description": "Optional. Labels to represent user-provided metadata.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "state": { - "description": "Output only. Current state of the instance.", - "readOnly": true, - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "Instance is being created.", - "Instance has been created and is usable.", - "Instance is being updated.", - "Instance is being deleted." - ], - "enum": [ - "STATE_UNSPECIFIED", - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING" - ] - }, - "stateInfo": { - "description": "Output only. Additional information about the state of the instance.", - "readOnly": true, - "allOf": [ - { - "$ref": "#/components/schemas/StateInfo" - } - ] - }, - "uid": { - "description": "Output only. System assigned, unique identifier for the instance.", - "readOnly": true, - "type": "string" - }, - "replicaCount": { - "description": "Optional. Number of replica nodes per shard. If omitted the default is 0 replicas.", - "type": "integer", - "format": "int32" - }, - "authorizationMode": { - "description": "Optional. Immutable. Authorization mode of the instance.", - "x-google-immutable": true, - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "Authorization disabled.", - "IAM basic authorization." - ], - "enum": [ - "AUTHORIZATION_MODE_UNSPECIFIED", - "AUTH_DISABLED", - "IAM_AUTH" - ] - }, - "transitEncryptionMode": { - "description": "Optional. Immutable. In-transit encryption mode of the instance.", - "x-google-immutable": true, - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "In-transit encryption is disabled.", - "Server-managed encryption is used for in-transit encryption." - ], - "enum": [ - "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED", - "TRANSIT_ENCRYPTION_DISABLED", - "SERVER_AUTHENTICATION" - ] - }, - "shardCount": { - "description": "Required. Number of shards for the instance.", - "type": "integer", - "format": "int32" - }, - "discoveryEndpoints": { - "description": "Output only. Endpoints clients can connect to the instance through. Currently only one\ndiscovery endpoint is supported.", - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/DiscoveryEndpoint" - } - }, - "nodeType": { - "description": "Optional. Immutable. Machine type for individual nodes of the instance.", - "x-google-immutable": true, - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "Shared core nano.", - "High memory medium.", - "High memory extra large.", - "Standard small." - ], - "enum": [ - "NODE_TYPE_UNSPECIFIED", - "SHARED_CORE_NANO", - "HIGHMEM_MEDIUM", - "HIGHMEM_XLARGE", - "STANDARD_SMALL" - ] - }, - "persistenceConfig": { - "description": "Optional. Persistence configuration of the instance.", - "allOf": [ - { - "$ref": "#/components/schemas/PersistenceConfig" - } - ] - }, - "engineVersion": { - "description": "Optional. Immutable. Engine version of the instance.", - "x-google-immutable": true, - "type": "string" - }, - "engineConfigs": { - "description": "Optional. User-provided engine configurations for the instance.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "nodeConfig": { - "description": "Output only. Configuration of individual nodes of the instance.", - "readOnly": true, - "allOf": [ - { - "$ref": "#/components/schemas/NodeConfig" - } - ] - }, - "zoneDistributionConfig": { - "description": "Optional. Immutable. Zone distribution configuration of the instance for node allocation.", - "x-google-immutable": true, - "allOf": [ - { - "$ref": "#/components/schemas/ZoneDistributionConfig" - } - ] - }, - "deletionProtectionEnabled": { - "description": "Optional. If set to true deletion of the instance will fail.", - "type": "boolean" - }, - "pscAutoConnections": { - "description": "Required. Immutable. User inputs and resource details of the auto-created PSC connections.", - "x-google-immutable": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/PscAutoConnection" - } - } - }, - "required": [ - "shardCount", - "pscAutoConnections" - ] - }, - "StateInfo": { - "description": "Additional information about the state of the instance.", - "type": "object", - "properties": { - "updateInfo": { - "description": "Output only. Describes ongoing update when instance state is UPDATING.", - "readOnly": true, - "allOf": [ - { - "$ref": "#/components/schemas/UpdateInfo" - } - ] - } - } - }, - "UpdateInfo": { - "description": "Represents information about instance with state UPDATING.", - "type": "object", - "properties": { - "targetShardCount": { - "description": "Output only. Target number of shards for the instance.", - "readOnly": true, - "type": "integer", - "format": "int32" - }, - "targetReplicaCount": { - "description": "Output only. Target number of replica nodes per shard for the instance.", - "readOnly": true, - "type": "integer", - "format": "int32" - } - } - }, - "DiscoveryEndpoint": { - "description": "Represents an endpoint for clients to connect to the instance.", - "type": "object", - "properties": { - "address": { - "description": "Output only. IP address of the exposed endpoint clients connect to.", - "readOnly": true, - "type": "string" - }, - "port": { - "description": "Output only. The port number of the exposed endpoint.", - "readOnly": true, - "type": "integer", - "format": "int32" - }, - "network": { - "description": "Output only. The network where the IP address of the discovery endpoint will be\nreserved, in the form of\nprojects/{network_project}/global/networks/{network_id}.", - "readOnly": true, - "type": "string" - } - } - }, - "PersistenceConfig": { - "description": "Represents persistence configuration for a instance.", - "type": "object", - "properties": { - "mode": { - "description": "Optional. Current persistence mode.", - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "Persistence is disabled, and any snapshot data is deleted.", - "RDB based persistence is enabled.", - "AOF based persistence is enabled." - ], - "enum": [ - "PERSISTENCE_MODE_UNSPECIFIED", - "DISABLED", - "RDB", - "AOF" - ] - }, - "rdbConfig": { - "description": "Optional. RDB configuration. This field will be ignored if mode is not RDB.", - "allOf": [ - { - "$ref": "#/components/schemas/RDBConfig" - } - ] - }, - "aofConfig": { - "description": "Optional. AOF configuration. This field will be ignored if mode is not AOF.", - "allOf": [ - { - "$ref": "#/components/schemas/AOFConfig" - } - ] - } - } - }, - "RDBConfig": { - "description": "Configuration for RDB based persistence.", - "type": "object", - "properties": { - "rdbSnapshotPeriod": { - "description": "Optional. Period between RDB snapshots.", - "type": "string", - "x-google-enum-descriptions": [ - "Not set.", - "One hour.", - "Six hours.", - "Twelve hours.", - "Twenty four hours." - ], - "enum": [ - "SNAPSHOT_PERIOD_UNSPECIFIED", - "ONE_HOUR", - "SIX_HOURS", - "TWELVE_HOURS", - "TWENTY_FOUR_HOURS" - ] - }, - "rdbSnapshotStartTime": { - "description": "Optional. Time that the first snapshot was/will be attempted, and to which future\nsnapshots will be aligned. If not provided, the current time will be\nused.", - "type": "string", - "format": "date-time" - } - } - }, - "AOFConfig": { - "description": "Configuration for AOF based persistence.", - "type": "object", - "properties": { - "appendFsync": { - "description": "Optional. The fsync mode.", - "type": "string", - "x-google-enum-descriptions": [ - "Not set. Default: EVERY_SEC", - "Never fsync. Normally Linux will flush data every 30 seconds with this\nconfiguration, but it's up to the kernel's exact tuning.", - "Fsync every second. You may lose 1 second of data if there is a\ndisaster.", - "Fsync every time new commands are appended to the AOF. The best data\nloss protection at the cost of performance." - ], - "enum": [ - "APPEND_FSYNC_UNSPECIFIED", - "NEVER", - "EVERY_SEC", - "ALWAYS" - ] - } - } - }, - "NodeConfig": { - "description": "Represents configuration for nodes of the instance.", - "type": "object", - "properties": { - "sizeGb": { - "description": "Output only. Memory size in GB of the node.", - "readOnly": true, - "type": "number", - "format": "double" - } - } - }, - "ZoneDistributionConfig": { - "description": "Zone distribution configuration for allocation of instance resources.", - "type": "object", - "properties": { - "zone": { - "description": "Optional. Defines zone where all resources will be allocated with SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode.", - "type": "string" - }, - "mode": { - "description": "Optional. Current zone distribution mode. Defaults to MULTI_ZONE.", - "type": "string", - "x-google-enum-descriptions": [ - "Not Set. Default: MULTI_ZONE", - "Distribute resources across 3 zones picked at random within the\nregion.", - "Provision resources in a single zone. Zone field must be specified." - ], - "enum": [ - "ZONE_DISTRIBUTION_MODE_UNSPECIFIED", - "MULTI_ZONE", - "SINGLE_ZONE" - ] - } - } - }, - "PscAutoConnection": { - "description": "Details of consumer resources in a PSC connection.", - "type": "object", - "properties": { - "pscConnectionId": { - "description": "Output only. The PSC connection id of the forwarding rule connected to the\nservice attachment.", - "readOnly": true, - "type": "string" - }, - "ipAddress": { - "description": "Output only. The IP allocated on the consumer network for the PSC forwarding rule.", - "readOnly": true, - "type": "string" - }, - "forwardingRule": { - "description": "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", - "readOnly": true, - "type": "string" - }, - "projectId": { - "description": "Required. The consumer project_id where the forwarding rule is created from.", - "type": "string" - }, - "network": { - "description": "Required. The consumer network where the IP address resides, in the form of\nprojects/{project_id}/global/networks/{network_id}.", - "type": "string" - } - }, - "required": [ - "projectId", - "network" - ] - }, - "OperationMetadata": { - "description": "Represents the metadata of a long-running operation.", - "type": "object", - "properties": { - "createTime": { - "description": "Output only. The time the operation was created.", - "readOnly": true, - "type": "string", - "format": "date-time" - }, - "endTime": { - "description": "Output only. The time the operation finished running.", - "readOnly": true, - "type": "string", - "format": "date-time" - }, - "target": { - "description": "Output only. Server-defined resource path for the target of the operation.", - "readOnly": true, - "type": "string" - }, - "verb": { - "description": "Output only. Name of the verb executed by the operation.", - "readOnly": true, - "type": "string" - }, - "statusMessage": { - "description": "Output only. Human-readable status of the operation, if any.", - "readOnly": true, - "type": "string" - }, - "requestedCancellation": { - "description": "Output only. Identifies whether the user has requested cancellation\nof the operation. Operations that have been cancelled successfully\nhave Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", - "readOnly": true, - "type": "boolean" - }, - "apiVersion": { - "description": "Output only. API version used to start the operation.", - "readOnly": true, - "type": "string" - } - } - }, - "CertificateAuthority": { - "description": "A certificate authority for an instance.", - "type": "object", - "properties": { - "managedServerCa": { - "description": "A managed server certificate authority.", - "allOf": [ - { - "$ref": "#/components/schemas/ManagedCertificateAuthority" - } - ] - }, - "name": { - "description": "Identifier. Unique name of the certificate authority.\nFormat:\nprojects/{project}/locations/{location}/instances/{instance}", - "x-google-identifier": true, - "type": "string" - } - } - }, - "ManagedCertificateAuthority": { - "description": "A managed certificate authority.", - "type": "object", - "properties": { - "caCerts": { - "description": "PEM encoded CA certificate chains for managed server authentication.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CertChain" - } - } - } - }, - "CertChain": { - "description": "A certificate chain.", - "type": "object", - "properties": { - "certificates": { - "description": "The certificates that form the CA chain in order of leaf to root.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ListLocationsResponse": { - "description": "The response message for Locations.ListLocations.", - "type": "object", - "properties": { - "locations": { - "description": "A list of locations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Location" - } - }, - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - } - } - }, - "Location": { - "description": "A resource that represents a Google Cloud location.", - "type": "object", - "properties": { - "name": { - "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", - "type": "string" - }, - "locationId": { - "description": "The canonical id for this location. For example: `\"us-east1\"`.", - "type": "string" - }, - "displayName": { - "description": "The friendly name for this location, typically a nearby city name.\nFor example, \"Tokyo\".", - "type": "string" - }, - "labels": { - "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "metadata": { - "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - } - } - }, - "BillingView": { - "description": "Message for reporting billing requests through Eventstream.", - "type": "object", - "properties": { - "reportRequests": { - "description": "Billing requests to be reported for cloud.eventstream.v2.ResourceEvent\n\nEach request contains billing operations to be reported under a service\nname. See go/billing-view-construction for documentation on constructing\nbilling view report requests.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1ReportRequest" - } - } - } - }, - "GoogleApiServicecontrolV1ReportRequest": { - "description": "Request message for the Report method.", - "type": "object", - "properties": { - "serviceName": { - "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", - "type": "string" - }, - "operations": { - "description": "Operations to be reported.\n\nTypically the service should report one operation per request.\nPutting multiple operations into a single request is allowed, but should\nbe used only when multiple operations are natually available at the time\nof the report.\n\nThere is no limit on the number of operations in the same ReportRequest,\nhowever the ReportRequest size should be no larger than 1MB. See\nReportResponse.report_errors for partial failure behavior.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1Operation" - } - }, - "serviceConfigId": { - "description": "Specifies which version of service config should be used to process the\nrequest.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", - "type": "string" - } - } - }, - "GoogleApiServicecontrolV1Operation": { - "description": "Represents information regarding an operation.", - "type": "object", - "properties": { - "operationId": { - "description": "Identity of the operation. This must be unique within the scope of the\nservice that generated the operation. If the service calls\nCheck() and Report() on the same operation, the two calls should carry\nthe same id.\n\nUUID version 4 is recommended, though not required.\nIn scenarios where an operation is computed from existing information\nand an idempotent id is desirable for deduplication purpose, UUID version 5\nis recommended. See RFC 4122 for details.", - "type": "string" - }, - "operationName": { - "description": "Fully qualified name of the operation. Reserved for future use.", - "type": "string" - }, - "consumerId": { - "description": "Identity of the consumer who is using the service.\nThis field should be filled in for the operations initiated by a\nconsumer, but not for service-initiated operations that are\nnot related to a specific consumer.\n\n\n- This can be in one of the following formats:\n - project:PROJECT_ID,\n - project`_`number:PROJECT_NUMBER,\n - projects/PROJECT_ID or PROJECT_NUMBER,\n - folders/FOLDER_NUMBER,\n - organizations/ORGANIZATION_NUMBER,\n - api`_`key:API_KEY.", - "type": "string" - }, - "startTime": { - "description": "Required. Start time of the operation.", - "type": "string", - "format": "date-time" - }, - "endTime": { - "description": "End time of the operation.\nRequired when the operation is used in ServiceController.Report,\nbut optional when the operation is used in ServiceController.Check.", - "type": "string", - "format": "date-time" - }, - "labels": { - "description": "Labels describing the operation. Only the following labels are allowed:\n\n- Labels describing monitored resources as defined in\n the service configuration.\n- Default labels of metric values. When specified, labels defined in the\n metric value override these default.\n- The following labels defined by Google Cloud Platform:\n - `cloud.googleapis.com/location` describing the location where the\n operation happened,\n - `servicecontrol.googleapis.com/user_agent` describing the user agent\n of the API request,\n - `servicecontrol.googleapis.com/service_agent` describing the service\n used to handle the API request (e.g. ESP),\n - `servicecontrol.googleapis.com/platform` describing the platform\n where the API is served, such as App Engine, Compute Engine, or\n Kubernetes Engine.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "metricValueSets": { - "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1MetricValueSet" - } - }, - "logEntries": { - "description": "Represents information to be logged.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntry" - } - }, - "quotaProperties": { - "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request. If this is not specified, no quota\ncheck will be performed.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1QuotaProperties" - } - ] - }, - "importance": { - "description": "DO NOT USE. This is an experimental field.", - "type": "string", - "x-google-enum-descriptions": [ - "Allows data caching, batching, and aggregation. It provides\nhigher performance with higher data loss risk.", - "Disables data aggregation to minimize data loss. It is for operations\nthat contains significant monetary value or audit trail. This feature\nonly applies to the client libraries.", - "Deprecated. Do not use.\n\nDisables data aggregation and enables additional validation logic.\nIt should only be used during the onboarding process. It is only\navailable to Google internal services, and the service must be\napproved by chemist-dev@google.com in order to use this level.", - "Used internally by Chemist." - ], - "enum": [ - "LOW", - "HIGH", - "DEBUG", - "PROMOTED" - ] - }, - "userLabels": { - "description": "Private Preview. This feature is only available for approved services.\n\nUser defined labels for the resource that this operation is associated\nwith.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "resources": { - "description": "The resources that are involved in the operation.\nThe maximum supported number of entries in this field is 100.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1ResourceInfo" - } - }, - "traceSpans": { - "description": "Unimplemented. A list of Cloud Trace spans. The span names shall contain\nthe id of the destination project which can be either the produce or the\nconsumer project.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1TraceSpan" - } - } - } - }, - "GoogleApiServicecontrolV1MetricValueSet": { - "description": "Represents a set of metric values in the same metric.\nEach metric value in the set should have a unique combination of start time,\nend time, and label values.", - "type": "object", - "properties": { - "metricName": { - "description": "The metric name defined in the service configuration.", - "type": "string" - }, - "metricValues": { - "description": "The values in this metric.", - "type": "array", - "items": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1MetricValue" - } - } - } - }, - "GoogleApiServicecontrolV1MetricValue": { - "description": "Represents a single metric value.", - "type": "object", - "properties": { - "labels": { - "description": "The labels describing the metric value.\nSee comments on google.api.servicecontrol.v1.Operation.labels for\nthe overriding relationship.\nNote that this map must not contain monitored resource labels.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "startTime": { - "description": "The start of the time period over which this metric value's measurement\napplies. The time period has different semantics for different metric\ntypes (cumulative, delta, and gauge). See the metric definition\ndocumentation in the service configuration for details. If not specified,\ngoogle.api.servicecontrol.v1.Operation.start_time will be used.", - "type": "string", - "format": "date-time" - }, - "endTime": { - "description": "The end of the time period over which this metric value's measurement\napplies. If not specified,\ngoogle.api.servicecontrol.v1.Operation.end_time will be used.", - "type": "string", - "format": "date-time" - }, - "boolValue": { - "description": "A boolean value.", - "type": "boolean" - }, - "int64Value": { - "description": "A signed 64-bit integer value.", - "type": "string", - "format": "int64" - }, - "doubleValue": { - "description": "A double precision floating point value.", - "type": "number", - "format": "double" - }, - "stringValue": { - "description": "A text string value.", - "type": "string" - }, - "distributionValue": { - "description": "A distribution value.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1Distribution" - } - ] - }, - "moneyValue": { - "description": "A money value.", - "allOf": [ - { - "$ref": "#/components/schemas/Money" - } - ] - } - } - }, - "GoogleApiServicecontrolV1Distribution": { - "description": "Distribution represents a frequency distribution of double-valued sample\npoints. It contains the size of the population of sample points plus\nadditional optional information:\n\n* the arithmetic mean of the samples\n* the minimum and maximum of the samples\n* the sum-squared-deviation of the samples, used to compute variance\n* a histogram of the values of the sample points", - "type": "object", - "properties": { - "count": { - "description": "The total number of samples in the distribution. Must be >= 0.", - "type": "string", - "format": "int64" - }, - "mean": { - "description": "The arithmetic mean of the samples in the distribution. If `count` is\nzero then this field must be zero.", - "type": "number", - "format": "double" - }, - "minimum": { - "description": "The minimum of the population of values. Ignored if `count` is zero.", - "type": "number", - "format": "double" - }, - "maximum": { - "description": "The maximum of the population of values. Ignored if `count` is zero.", - "type": "number", - "format": "double" - }, - "sumOfSquaredDeviation": { - "description": "The sum of squared deviations from the mean:\n Sum[i=1..count]((x_i - mean)^2)\nwhere each x_i is a sample values. If `count` is zero then this field\nmust be zero, otherwise validation of the request fails.", - "type": "number", - "format": "double" - }, - "bucketCounts": { - "description": "The number of samples in each histogram bucket. `bucket_counts` are\noptional. If present, they must sum to the `count` value.\n\nThe buckets are defined below in `bucket_option`. There are N buckets.\n`bucket_counts[0]` is the number of samples in the underflow bucket.\n`bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples\nin each of the finite buckets. And `bucket_counts[N] is the number\nof samples in the overflow bucket. See the comments of `bucket_option`\nbelow for more details.\n\nAny suffix of trailing zeros may be omitted.", - "type": "array", - "items": { - "type": "string", - "format": "int64" - } - }, - "linearBuckets": { - "description": "Buckets with constant width.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1LinearBuckets" - } - ] - }, - "exponentialBuckets": { - "description": "Buckets with exponentially growing width.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1ExponentialBuckets" - } - ] - }, - "explicitBuckets": { - "description": "Buckets with arbitrary user-provided width.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1ExplicitBuckets" - } - ] - }, - "exemplars": { - "description": "Example points. Must be in increasing order of `value` field.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Exemplar" - } - } - } - }, - "GoogleApiServicecontrolV1LinearBuckets": { - "description": "Describing buckets with constant width.", - "type": "object", - "properties": { - "numFiniteBuckets": { - "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", - "type": "integer", - "format": "int32" - }, - "width": { - "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.\nMust be strictly positive.", - "type": "number", - "format": "double" - }, - "offset": { - "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.", - "type": "number", - "format": "double" - } - } - }, - "GoogleApiServicecontrolV1ExponentialBuckets": { - "description": "Describing buckets with exponentially growing width.", - "type": "object", - "properties": { - "numFiniteBuckets": { - "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", - "type": "integer", - "format": "int32" - }, - "growthFactor": { - "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be larger than 1.0.", - "type": "number", - "format": "double" - }, - "scale": { - "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be > 0.", - "type": "number", - "format": "double" - } - } - }, - "GoogleApiServicecontrolV1ExplicitBuckets": { - "description": "Describing buckets with arbitrary user-provided width.", - "type": "object", - "properties": { - "bounds": { - "description": "'bound' is a list of strictly increasing boundaries between\nbuckets. Note that a list of length N-1 defines N buckets because\nof fenceposting. See comments on `bucket_options` for details.\n\nThe i'th finite bucket covers the interval\n [bound[i-1], bound[i])\nwhere i ranges from 1 to bound_size() - 1. Note that there are no\nfinite buckets at all if 'bound' only contains a single element; in\nthat special case the single bound defines the boundary between the\nunderflow and overflow buckets.\n\nbucket number lower bound upper bound\n i == 0 (underflow) -inf bound[i]\n 0 < i < bound_size() bound[i-1] bound[i]\n i == bound_size() (overflow) bound[i-1] +inf", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - } - } - }, - "Exemplar": { - "description": "Exemplars are example points that may be used to annotate aggregated\ndistribution values. They are metadata that gives information about a\nparticular value added to a Distribution bucket, such as a trace ID that\nwas active when a value was added. They may contain further information,\nsuch as a example values and timestamps, origin, etc.", - "type": "object", - "properties": { - "value": { - "description": "Value of the exemplar point. This value determines to which bucket the\nexemplar belongs.", - "type": "number", - "format": "double" - }, - "timestamp": { - "description": "The observation (sampling) time of the above value.", - "type": "string", - "format": "date-time" - }, - "attachments": { - "description": "Contextual information about the example value. Examples are:\n\n Trace: type.googleapis.com/google.monitoring.v3.SpanContext\n\n Literal string: type.googleapis.com/google.protobuf.StringValue\n\n Labels dropped during aggregation:\n type.googleapis.com/google.monitoring.v3.DroppedLabels\n\nThere may be only a single attachment of any given message type in a\nsingle exemplar, and this is enforced by the system.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - } - } - } - }, - "Money": { - "description": "Represents an amount of money with its currency type.", - "type": "object", - "properties": { - "currencyCode": { - "description": "The three-letter currency code defined in ISO 4217.", - "type": "string" - }, - "units": { - "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", - "type": "string", - "format": "int64" - }, - "nanos": { - "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", - "type": "integer", - "format": "int32" - } - } - }, - "GoogleApiServicecontrolV1LogEntry": { - "description": "An individual log entry.", - "type": "object", - "properties": { - "name": { - "description": "Required. The log to which this log entry belongs. Examples: `\"syslog\"`,\n`\"book_log\"`.", - "type": "string" - }, - "timestamp": { - "description": "The time the event described by the log entry occurred. If\nomitted, defaults to operation start time.", - "type": "string", - "format": "date-time" - }, - "severity": { - "description": "The severity of the log entry. The default value is\n`LogSeverity.DEFAULT`.", - "allOf": [ - { - "$ref": "#/components/schemas/LogSeverity" - } - ] - }, - "httpRequest": { - "description": "Optional. Information about the HTTP request associated with this\nlog entry, if applicable.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1HttpRequest" - } - ] - }, - "trace": { - "description": "Optional. Resource name of the trace associated with the log entry, if any.\nIf this field contains a relative resource name, you can assume the name is\nrelative to `//tracing.googleapis.com`. Example:\n`projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`", - "type": "string" - }, - "insertId": { - "description": "A unique ID for the log entry used for deduplication. If omitted,\nthe implementation will generate one based on operation_id.", - "type": "string" - }, - "labels": { - "description": "A set of user-defined (key, value) data that provides additional\ninformation about the log entry.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "protoPayload": { - "description": "The log entry payload, represented as a protocol buffer that is\nexpressed as a JSON object. The only accepted type currently is\nAuditLog.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - }, - "textPayload": { - "description": "The log entry payload, represented as a Unicode string (UTF-8).", - "type": "string" - }, - "structPayload": { - "description": "The log entry payload, represented as a structure that\nis expressed as a JSON object.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object." - } - }, - "operation": { - "description": "Optional. Information about an operation associated with the log entry, if\napplicable.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntryOperation" - } - ] - }, - "sourceLocation": { - "description": "Optional. Source code location information associated with the log entry,\nif any.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1LogEntrySourceLocation" - } - ] - } - } - }, - "GoogleApiServicecontrolV1HttpRequest": { - "description": "A common proto for logging HTTP requests. Only contains semantics\ndefined by the HTTP specification. Product-specific logging\ninformation MUST be defined in a separate message.", - "type": "object", - "properties": { - "requestMethod": { - "description": "The request method. Examples: `\"GET\"`, `\"HEAD\"`, `\"PUT\"`, `\"POST\"`.", - "type": "string" - }, - "requestUrl": { - "description": "The scheme (http, https), the host name, the path, and the query\nportion of the URL that was requested.\nExample: `\"http://example.com/some/info?color=red\"`.", - "type": "string" - }, - "requestSize": { - "description": "The size of the HTTP request message in bytes, including the request\nheaders and the request body.", - "type": "string", - "format": "int64" - }, - "status": { - "description": "The response code indicating the status of the response.\nExamples: 200, 404.", - "type": "integer", - "format": "int32" - }, - "responseSize": { - "description": "The size of the HTTP response message sent back to the client, in bytes,\nincluding the response headers and the response body.", - "type": "string", - "format": "int64" - }, - "userAgent": { - "description": "The user agent sent by the client. Example:\n`\"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET\nCLR 1.0.3705)\"`.", - "type": "string" - }, - "remoteIp": { - "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP\nrequest. Examples: `\"192.168.1.1\"`, `\"FE80::0202:B3FF:FE1E:8329\"`.", - "type": "string" - }, - "serverIp": { - "description": "The IP address (IPv4 or IPv6) of the origin server that the request was\nsent to.", - "type": "string" - }, - "referer": { - "description": "The referer URL of the request, as defined in\n[HTTP/1.1 Header Field\nDefinitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).", - "type": "string" - }, - "latency": { - "description": "The request processing latency on the server, from the time the request was\nreceived until the response was sent.", - "type": "string", - "format": "google-duration" - }, - "cacheLookup": { - "description": "Whether or not a cache lookup was attempted.", - "type": "boolean" - }, - "cacheHit": { - "description": "Whether or not an entity was served from cache\n(with or without validation).", - "type": "boolean" - }, - "cacheValidatedWithOriginServer": { - "description": "Whether or not the response was validated with the origin server before\nbeing served from cache. This field is only meaningful if `cache_hit` is\nTrue.", - "type": "boolean" - }, - "cacheFillBytes": { - "description": "The number of HTTP response bytes inserted into cache. Set only when a\ncache fill was attempted.", - "type": "string", - "format": "int64" - }, - "protocol": { - "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"", - "type": "string" - } - } - }, - "GoogleApiServicecontrolV1LogEntryOperation": { - "description": "Additional information about a potentially long-running operation with which\na log entry is associated.", - "type": "object", - "properties": { - "id": { - "description": "Optional. An arbitrary operation identifier. Log entries with the\nsame identifier are assumed to be part of the same operation.", - "type": "string" - }, - "producer": { - "description": "Optional. An arbitrary producer identifier. The combination of\n`id` and `producer` must be globally unique. Examples for `producer`:\n`\"MyDivision.MyBigCompany.com\"`, `\"github.com/MyProject/MyApplication\"`.", - "type": "string" - }, - "first": { - "description": "Optional. Set this to True if this is the first log entry in the operation.", - "type": "boolean" - }, - "last": { - "description": "Optional. Set this to True if this is the last log entry in the operation.", - "type": "boolean" - } - } - }, - "GoogleApiServicecontrolV1LogEntrySourceLocation": { - "description": "Additional information about the source code location that produced the log\nentry.", - "type": "object", - "properties": { - "file": { - "description": "Optional. Source file name. Depending on the runtime environment, this\nmight be a simple name or a fully-qualified name.", - "type": "string" - }, - "line": { - "description": "Optional. Line within the source file. 1-based; 0 indicates no line number\navailable.", - "type": "string", - "format": "int64" - }, - "function": { - "description": "Optional. Human-readable name of the function or method being invoked, with\noptional context such as the class or package name. This information may be\nused in contexts such as the logs viewer, where a file and line number are\nless meaningful. The format can vary by language. For example:\n`qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`\n(Python).", - "type": "string" - } - } - }, - "GoogleApiServicecontrolV1QuotaProperties": { - "description": "Represents the properties needed for quota operations.", - "type": "object", - "properties": { - "quotaMode": { - "description": "Quota mode for this operation.", - "type": "string", - "x-google-enum-descriptions": [ - "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation fails and returns\nerror.", - "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation does not fail and\navailable quota goes down to zero but it returns error.", - "Does not change any available quota. Only checks if there is enough\nquota.\nNo lock is placed on the checked tokens neither." - ], - "enum": [ - "ACQUIRE", - "ACQUIRE_BEST_EFFORT", - "CHECK" - ] - } - } - }, - "GoogleApiServicecontrolV1ResourceInfo": { - "description": "Describes a resource associated with this operation.", - "type": "object", - "properties": { - "resourceContainer": { - "description": "The identifier of the parent of this resource instance.\nMust be in one of the following formats:\n - `projects/`\n - `folders/`\n - `organizations/`", - "type": "string" - }, - "resourceName": { - "description": "Name of the resource. This is used for auditing purposes.", - "type": "string" - }, - "resourceLocation": { - "description": "The location of the resource. If not empty, the resource will be checked\nagainst location policy. The value must be a valid zone, region or\nmultiregion. For example: \"europe-west4\" or \"northamerica-northeast1-a\"", - "type": "string" - }, - "permission": { - "description": "The resource permission required for this request.", - "type": "string" - } - } - }, - "GoogleApiServicecontrolV1TraceSpan": { - "description": "A span represents a single operation within a trace. Spans can be\nnested to form a trace tree. Often, a trace contains a root span\nthat describes the end-to-end latency, and one or more subspans for\nits sub-operations. A trace can also contain multiple root spans,\nor none at all. Spans do not need to be contiguous\u2014there may be\ngaps or overlaps between spans in a trace.", - "type": "object", - "properties": { - "name": { - "description": "The resource name of the span in the following format:\n\n projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.", - "type": "string" - }, - "spanId": { - "description": "The [SPAN_ID] portion of the span's resource name.", - "type": "string" - }, - "parentSpanId": { - "description": "The [SPAN_ID] of this span's parent span. If this is a root span,\nthen this field must be empty.", - "type": "string" - }, - "displayName": { - "description": "A description of the span's operation (up to 128 bytes).\nStackdriver Trace displays the description in the\nGoogle Cloud Platform Console.\nFor example, the display name can be a qualified method name or a file name\nand a line number where the operation is called. A best practice is to use\nthe same display name within an application and at the same call point.\nThis makes it easier to correlate spans in different traces.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1TruncatableString" - } - ] - }, - "startTime": { - "description": "The start time of the span. On the client side, this is the time kept by\nthe local machine where the span execution starts. On the server side, this\nis the time when the server's application handler starts running.", - "type": "string", - "format": "date-time" - }, - "endTime": { - "description": "The end time of the span. On the client side, this is the time kept by\nthe local machine where the span execution ends. On the server side, this\nis the time when the server application handler stops running.", - "type": "string", - "format": "date-time" - }, - "attributes": { - "description": "A set of attributes on the span. You can have up to 32 attributes per\nspan.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1Attributes" - } - ] - }, - "status": { - "description": "An optional final status for this span.", - "allOf": [ - { - "$ref": "#/components/schemas/Status" - } - ] - }, - "sameProcessAsParentSpan": { - "description": "(Optional) Set this parameter to indicate whether this span is in\nthe same process as its parent. If you do not set this parameter,\nStackdriver Trace is unable to take advantage of this helpful\ninformation.", - "type": "boolean" - }, - "childSpanCount": { - "description": "An optional number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.", - "type": "integer", - "format": "int32" - }, - "spanKind": { - "description": "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `CLIENT` (caller)\nand `SERVER` (callee) to identify an RPC call.", - "type": "string", - "x-google-enum-descriptions": [ - "Unspecified. Do NOT use as default.\nImplementations MAY assume SpanKind.INTERNAL to be default.", - "Indicates that the span is used internally. Default value.", - "Indicates that the span covers server-side handling of an RPC or other\nremote network request.", - "Indicates that the span covers the client-side wrapper around an RPC or\nother remote request.", - "Indicates that the span describes producer sending a message to a broker.\nUnlike client and server, there is no direct critical path latency\nrelationship between producer and consumer spans (e.g. publishing a\nmessage to a pubsub service).", - "Indicates that the span describes consumer receiving a message from a\nbroker. Unlike client and server, there is no direct critical path\nlatency relationship between producer and consumer spans (e.g. receiving\na message from a pubsub service subscription)." - ], - "enum": [ - "SPAN_KIND_UNSPECIFIED", - "INTERNAL", - "SERVER", - "CLIENT", - "PRODUCER", - "CONSUMER" - ] - } - } - }, - "GoogleApiServicecontrolV1TruncatableString": { - "description": "Represents a string that might be shortened to a specified length.", - "type": "object", - "properties": { - "value": { - "description": "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit.", - "type": "string" - }, - "truncatedByteCount": { - "description": "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.", - "type": "integer", - "format": "int32" - } - } - }, - "GoogleApiServicecontrolV1Attributes": { - "description": "A set of attributes, each in the format `[KEY]:[VALUE]`.", - "type": "object", - "properties": { - "attributeMap": { - "description": "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, a signed 64-bit integer,\nor the Boolean values `true` and `false`. For example:\n\n \"/instance_id\": \"my-instance\"\n \"/http/user_agent\": \"\"\n \"/http/request_bytes\": 300\n \"abc.com/myattribute\": true", - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1AttributeValue" - } - }, - "droppedAttributesCount": { - "description": "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid.", - "type": "integer", - "format": "int32" - } - } - }, - "GoogleApiServicecontrolV1AttributeValue": { - "description": "The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.", - "type": "object", - "properties": { - "stringValue": { - "description": "A string up to 256 bytes long.", - "allOf": [ - { - "$ref": "#/components/schemas/GoogleApiServicecontrolV1TruncatableString" - } - ] - }, - "intValue": { - "description": "A 64-bit signed integer.", - "type": "string", - "format": "int64" - }, - "boolValue": { - "description": "A Boolean value represented by `true` or `false`.", - "type": "boolean" - } - } - }, - "BaseOperation": { - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", - "properties": { - "name": { - "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should be a resource name ending with `operations/{unique_id}`.", - "type": "string" - }, - "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", - "type": "boolean" - }, - "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "allOf": [ - { - "$ref": "#/components/schemas/Status" - } - ] - } - } - }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/BaseOperation" - }, - { - "type": "object", - "properties": { - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - }, - "response": { - "description": "The normal, successful response of the operation. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL." - } - } - } - } - ] - }, - "CreateInstanceOperation": { - "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/BaseOperation" - }, - { - "type": "object", - "properties": { - "metadata": { - "$ref": "#/components/schemas/OperationMetadata" - }, - "response": { - "$ref": "#/components/schemas/Instance" - } - } - } - ] - }, - "UpdateInstanceOperation": { - "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/BaseOperation" - }, - { - "type": "object", - "properties": { - "metadata": { - "$ref": "#/components/schemas/OperationMetadata" - }, - "response": { - "$ref": "#/components/schemas/Instance" - } - } - } - ] - }, - "DeleteInstanceOperation": { - "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/BaseOperation" - }, - { - "type": "object", - "properties": { - "metadata": { - "$ref": "#/components/schemas/OperationMetadata" - }, - "response": { - "$ref": "#/components/schemas/Empty" - } - } - } - ] - }, - "LogSeverity": { - "type": "string", - "x-google-enum-descriptions": [ - "(0) The log entry has no assigned severity level.", - "(100) Debug or trace information.", - "(200) Routine information, such as ongoing status or performance.", - "(300) Normal but significant events, such as start up, shut down, or\na configuration change.", - "(400) Warning events might cause problems.", - "(500) Error events are likely to cause problems.", - "(600) Critical events cause more severe problems or outages.", - "(700) A person must take an action immediately.", - "(800) One or more systems are unusable." - ], - "enum": [ - "DEFAULT", - "DEBUG", - "INFO", - "NOTICE", - "WARNING", - "ERROR", - "CRITICAL", - "ALERT", - "EMERGENCY" - ] - } - } - }, - "externalDocs": { - "description": "Find more info here.", - "url": "https://cloud.google.com/memorystore/" - } -} \ No newline at end of file diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml new file mode 100644 index 000000000000..bc89dbc1f4c0 --- /dev/null +++ b/mmv1/products/memorystore/Instance.yaml @@ -0,0 +1,259 @@ +--- +!ruby/object:Api::Resource +base_url: "/v1beta/projects/{{project}}/locations/{{location}}/instances" +create_url: "/v1beta/projects/{{project}}/locations/{{location}}/instances?instanceId={{instance_id}}" +self_link: "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" +id_format: "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" +import_format: + - "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" +name: Instance +description: Description +update_verb: :PATCH +update_mask: true +autogen_async: true +properties: + - !ruby/object:Api::Type::String + name: name + description: "Identifier. Unique name of the instance.\nFormat: projects/{project}/locations/{location}/instances/{instance} " + output: true + - !ruby/object:Api::Type::String + name: createTime + description: "Output only. Creation timestamp of the instance. " + output: true + - !ruby/object:Api::Type::String + name: updateTime + description: "Output only. Latest update timestamp of the instance. " + output: true + - !ruby/object:Api::Type::KeyValueLabels + name: labels + output: + api_name: + description: "Optional. Labels to represent user-provided metadata. " + min_version: + ignore_write: + update_verb: + update_url: + immutable: + - !ruby/object:Api::Type::String + name: state + description: + "Output only. Current state of the instance. \n Possible values:\n + STATE_UNSPECIFIED\nCREATING\nACTIVE\nUPDATING\nDELETING" + output: true + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::Integer + name: targetShardCount + description: "Output only. Target number of shards for the instance. " + output: true + - !ruby/object:Api::Type::Integer + name: targetReplicaCount + description: + "Output only. Target number of replica nodes per shard for the + instance. " + output: true + name: updateInfo + description: "Represents information about instance with state UPDATING. " + name: stateInfo + description: "Additional information about the state of the instance. " + - !ruby/object:Api::Type::String + name: uid + description: "Output only. System assigned, unique identifier for the instance. " + output: true + - !ruby/object:Api::Type::Integer + name: replicaCount + description: + "Optional. Number of replica nodes per shard. If omitted the default + is 0 replicas. " + - !ruby/object:Api::Type::String + name: authorizationMode + description: + "Optional. Immutable. Authorization mode of the instance. \n Possible + values:\n AUTHORIZATION_MODE_UNSPECIFIED\nAUTH_DISABLED\nIAM_AUTH" + immutable: true + - !ruby/object:Api::Type::String + name: transitEncryptionMode + description: + "Optional. Immutable. In-transit encryption mode of the instance. \n + Possible values:\n TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\nTRANSIT_ENCRYPTION_DISABLED\nSERVER_AUTHENTICATION" + immutable: true + - !ruby/object:Api::Type::Integer + name: shardCount + description: "Required. Number of shards for the instance. " + required: true + - !ruby/object:Api::Type::Array + name: discoveryEndpoints + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: address + description: + "Output only. IP address of the exposed endpoint clients connect + to. " + output: true + - !ruby/object:Api::Type::Integer + name: port + description: "Output only. The port number of the exposed endpoint. " + output: true + - !ruby/object:Api::Type::String + name: network + description: + "Output only. The network where the IP address of the discovery + endpoint will be\nreserved, in the form of\nprojects/{network_project}/global/networks/{network_id}. " + output: true + description: + "Output only. Endpoints clients can connect to the instance through. + Currently only one\ndiscovery endpoint is supported. " + output: true + - !ruby/object:Api::Type::String + name: nodeType + description: + "Optional. Immutable. Machine type for individual nodes of the instance. + \n Possible values:\n NODE_TYPE_UNSPECIFIED\nSHARED_CORE_NANO\nHIGHMEM_MEDIUM\nHIGHMEM_XLARGE\nSTANDARD_SMALL" + immutable: true + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: mode + description: "Optional. Current persistence mode. \n Possible values:\n PERSISTENCE_MODE_UNSPECIFIED\nDISABLED\nRDB\nAOF" + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: rdbSnapshotPeriod + description: + "Optional. Period between RDB snapshots. \n Possible values:\n + SNAPSHOT_PERIOD_UNSPECIFIED\nONE_HOUR\nSIX_HOURS\nTWELVE_HOURS\nTWENTY_FOUR_HOURS" + - !ruby/object:Api::Type::String + name: rdbSnapshotStartTime + description: + "Optional. Time that the first snapshot was/will be attempted, + and to which future\nsnapshots will be aligned. If not provided, the current + time will be\nused. " + name: rdbConfig + description: "Configuration for RDB based persistence. " + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: appendFsync + description: "Optional. The fsync mode. \n Possible values:\n APPEND_FSYNC_UNSPECIFIED\nNEVER\nEVERY_SEC\nALWAYS" + name: aofConfig + description: "Configuration for AOF based persistence. " + name: persistenceConfig + description: "Represents persistence configuration for a instance. " + - !ruby/object:Api::Type::String + name: engineVersion + description: "Optional. Immutable. Engine version of the instance. " + immutable: true + - !ruby/object:Api::Type::KeyValuePairs + name: engineConfigs + output: + api_name: + description: "Optional. User-provided engine configurations for the instance. " + min_version: + ignore_write: + update_verb: + update_url: + immutable: + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::Double + name: sizeGb + description: "Output only. Memory size in GB of the node. " + output: true + name: nodeConfig + description: "Represents configuration for nodes of the instance. " + - !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: zone + description: + "Optional. Defines zone where all resources will be allocated with + SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode. " + - !ruby/object:Api::Type::String + name: mode + description: + "Optional. Current zone distribution mode. Defaults to MULTI_ZONE. + \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" + name: zoneDistributionConfig + description: "Zone distribution configuration for allocation of instance resources. " + - !ruby/object:Api::Type::Boolean + name: deletionProtectionEnabled + description: "Optional. If set to true deletion of the instance will fail. " + - !ruby/object:Api::Type::Array + name: pscAutoConnections + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: pscConnectionId + description: + "Output only. The PSC connection id of the forwarding rule connected + to the\nservice attachment. " + output: true + - !ruby/object:Api::Type::String + name: ipAddress + description: + "Output only. The IP allocated on the consumer network for the + PSC forwarding rule. " + output: true + - !ruby/object:Api::Type::String + name: forwardingRule + description: "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} " + output: true + - !ruby/object:Api::Type::String + name: projectId + description: + "Required. The consumer project_id where the forwarding rule is + created from. " + required: true + - !ruby/object:Api::Type::String + name: network + description: + "Required. The consumer network where the IP address resides, in + the form of\nprojects/{project_id}/global/networks/{network_id}. " + required: true + description: + "Required. Immutable. User inputs and resource details of the auto-created + PSC connections. " + immutable: true + required: true +parameters: + - !ruby/object:Api::Type::String + name: location + description: + "Resource ID segment making up resource `name`. It identifies the resource + within its parent collection as described in https://google.aip.dev/122. See documentation + for resource type `memorystore.googleapis.com/CertificateAuthority`. " + url_param_only: true + required: true + immutable: true + - !ruby/object:Api::Type::String + name: instanceId + description: + "Required. The ID to use for the instance, which will become the final + component of\nthe instance's resource name.\n\nThis value is subject to the following + restrictions:\n\n* Must be 4-63 characters in length\n* Must begin with a letter + or digit\n* Must contain only lowercase letters, digits, and hyphens\n* Must not + end with a hyphen\n* Must be unique within a location " + url_param_only: true + required: true + immutable: true +async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: name + base_url: "{{op_id}}" + wait_ms: 1000 + timeouts: + result: !ruby/object:Api::OpAsync::Result + path: response + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: done + complete: true + allowed: + - true + - false + error: !ruby/object:Api::OpAsync::Error + path: error + message: message diff --git a/mmv1/products/memorystore/product.yaml b/mmv1/products/memorystore/product.yaml new file mode 100644 index 000000000000..34795a44d656 --- /dev/null +++ b/mmv1/products/memorystore/product.yaml @@ -0,0 +1,9 @@ +--- !ruby/object:Api::Product +versions: +- !ruby/object:Api::Product::Version + base_url: https://memorystore.googleapis.com/v1beta/ + name: ga +name: Memorystore +display_name: Memorystore +scopes: +- https://www.googleapis.com/auth/cloud-platform From a5d4416de72ebfbce889126c4db023102fca2121 Mon Sep 17 00:00:00 2001 From: himanikh Date: Mon, 19 Aug 2024 23:13:51 +0000 Subject: [PATCH 03/19] manual changes and basic example --- mmv1/products/memorystore/Instance.yaml | 18 +++++++++++++++++- mmv1/products/memorystore/product.yaml | 11 ++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index bc89dbc1f4c0..bf9d7cc48b0c 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -7,10 +7,26 @@ id_format: "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{inst import_format: - "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" name: Instance -description: Description +description: A Google Cloud Memorystore instance. update_verb: :PATCH update_mask: true autogen_async: true +min_version: beta +examples: + - !ruby/object:Provider::Terraform::Examples + name: "memorystore_ha" + primary_resource_id: "instance-ha" + min_version: beta + vars: + instance_name: "ha-instance" + policy_name: "mypolicy" + subnet_name: "mysubnet" + network_name: "mynetwork" + prevent_destroy: "true" + test_vars_overrides: + prevent_destroy: "false" + oics_vars_overrides: + prevent_destroy: "false" properties: - !ruby/object:Api::Type::String name: name diff --git a/mmv1/products/memorystore/product.yaml b/mmv1/products/memorystore/product.yaml index 34795a44d656..03e540c0556c 100644 --- a/mmv1/products/memorystore/product.yaml +++ b/mmv1/products/memorystore/product.yaml @@ -1,9 +1,10 @@ ---- !ruby/object:Api::Product +--- +!ruby/object:Api::Product versions: -- !ruby/object:Api::Product::Version - base_url: https://memorystore.googleapis.com/v1beta/ - name: ga + - !ruby/object:Api::Product::Version + base_url: https://memorystore.googleapis.com/v1beta/ + name: ga name: Memorystore display_name: Memorystore scopes: -- https://www.googleapis.com/auth/cloud-platform + - https://www.googleapis.com/auth/cloud-platform From 661fb1193853c61fb6b2290f2cb1f44b146e611e Mon Sep 17 00:00:00 2001 From: himanikh Date: Tue, 20 Aug 2024 17:40:55 +0000 Subject: [PATCH 04/19] minor fixes + example --- mmv1/products/memorystore/Instance.yaml | 2 +- mmv1/products/memorystore/product.yaml | 2 +- .../examples/memorystore_instance_ha.tf.erb | 52 +++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index bf9d7cc48b0c..7bc10b3d4286 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -14,7 +14,7 @@ autogen_async: true min_version: beta examples: - !ruby/object:Provider::Terraform::Examples - name: "memorystore_ha" + name: "memorystore_instance_ha" primary_resource_id: "instance-ha" min_version: beta vars: diff --git a/mmv1/products/memorystore/product.yaml b/mmv1/products/memorystore/product.yaml index 03e540c0556c..c0adf8a0fcde 100644 --- a/mmv1/products/memorystore/product.yaml +++ b/mmv1/products/memorystore/product.yaml @@ -3,7 +3,7 @@ versions: - !ruby/object:Api::Product::Version base_url: https://memorystore.googleapis.com/v1beta/ - name: ga + name: beta name: Memorystore display_name: Memorystore scopes: diff --git a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb new file mode 100644 index 000000000000..66adf5cea449 --- /dev/null +++ b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb @@ -0,0 +1,52 @@ +resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 + psc_auto_connections { + network = google_compute_network.producer_net.id + } + region = "us-central1" + replica_count = 1 + node_type = "REDIS_SHARED_CORE_NANO" + transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" + authorization_mode = "AUTH_DISABLED" + redis_configs = { + maxmemory-policy = "volatile-ttl" + } + zone_distribution_config { + mode = "MULTI_ZONE" + } + depends_on = [ + google_network_connectivity_service_connection_policy.default + ] + + lifecycle { + prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + } +} + +resource "google_network_connectivity_service_connection_policy" "default" { + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "us-central1" + service_class = "gcp-memorystore" + description = "my basic service connection policy" + network = google_compute_network.producer_net.id + psc_config { + subnetworks = [google_compute_subnetwork.producer_subnet.id] + } +} + +resource "google_compute_subnetwork" "producer_subnet" { + provider = google-beta + name = "<%= ctx[:vars]['subnet_name'] %>" + ip_cidr_range = "10.0.0.248/29" + region = "us-central1" + network = google_compute_network.producer_net.id +} + +resource "google_compute_network" "producer_net" { + provider = google-beta + name = "<%= ctx[:vars]['network_name'] %>" + auto_create_subnetworks = false +} \ No newline at end of file From 618a7b997c2011351139e8aa419a6df479f19fe8 Mon Sep 17 00:00:00 2001 From: himanikh Date: Thu, 22 Aug 2024 21:01:18 +0000 Subject: [PATCH 05/19] Adding update tests --- mmv1/products/memorystore/Instance.yaml | 19 +- .../examples/memorystore_instance_ha.tf.erb | 20 +- .../components/inputs/services_beta.kt | 5 + .../resource_memorystore_instance_test.go.erb | 279 ++++++++++++++++++ 4 files changed, 311 insertions(+), 12 deletions(-) create mode 100644 mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 7bc10b3d4286..bc851a60a771 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -1,11 +1,11 @@ --- !ruby/object:Api::Resource -base_url: "/v1beta/projects/{{project}}/locations/{{location}}/instances" -create_url: "/v1beta/projects/{{project}}/locations/{{location}}/instances?instanceId={{instance_id}}" -self_link: "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" -id_format: "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" +base_url: "projects/{{project}}/locations/{{location}}/instances" +create_url: "projects/{{project}}/locations/{{location}}/instances?instanceId={{instance_id}}" +self_link: "projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" +id_format: "projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" import_format: - - "/v1beta/projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" + - "projects/{{project}}/locations/{{location}}/instances/{{instance_id}}" name: Instance description: A Google Cloud Memorystore instance. update_verb: :PATCH @@ -89,12 +89,14 @@ properties: "Optional. Immutable. Authorization mode of the instance. \n Possible values:\n AUTHORIZATION_MODE_UNSPECIFIED\nAUTH_DISABLED\nIAM_AUTH" immutable: true + default_from_api: true - !ruby/object:Api::Type::String name: transitEncryptionMode description: "Optional. Immutable. In-transit encryption mode of the instance. \n Possible values:\n TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\nTRANSIT_ENCRYPTION_DISABLED\nSERVER_AUTHENTICATION" immutable: true + default_from_api: true - !ruby/object:Api::Type::Integer name: shardCount description: "Required. Number of shards for the instance. " @@ -129,15 +131,18 @@ properties: "Optional. Immutable. Machine type for individual nodes of the instance. \n Possible values:\n NODE_TYPE_UNSPECIFIED\nSHARED_CORE_NANO\nHIGHMEM_MEDIUM\nHIGHMEM_XLARGE\nSTANDARD_SMALL" immutable: true + default_from_api: true - !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String name: mode description: "Optional. Current persistence mode. \n Possible values:\n PERSISTENCE_MODE_UNSPECIFIED\nDISABLED\nRDB\nAOF" + default_from_api: true - !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String name: rdbSnapshotPeriod + default_from_api: true description: "Optional. Period between RDB snapshots. \n Possible values:\n SNAPSHOT_PERIOD_UNSPECIFIED\nONE_HOUR\nSIX_HOURS\nTWELVE_HOURS\nTWENTY_FOUR_HOURS" @@ -154,6 +159,7 @@ properties: - !ruby/object:Api::Type::String name: appendFsync description: "Optional. The fsync mode. \n Possible values:\n APPEND_FSYNC_UNSPECIFIED\nNEVER\nEVERY_SEC\nALWAYS" + default_from_api: true name: aofConfig description: "Configuration for AOF based persistence. " name: persistenceConfig @@ -162,6 +168,7 @@ properties: name: engineVersion description: "Optional. Immutable. Engine version of the instance. " immutable: true + default_from_api: true - !ruby/object:Api::Type::KeyValuePairs name: engineConfigs output: @@ -189,6 +196,7 @@ properties: SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode. " - !ruby/object:Api::Type::String name: mode + default_from_api: true description: "Optional. Current zone distribution mode. Defaults to MULTI_ZONE. \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" @@ -197,6 +205,7 @@ properties: - !ruby/object:Api::Type::Boolean name: deletionProtectionEnabled description: "Optional. If set to true deletion of the instance will fail. " + default_value: true - !ruby/object:Api::Type::Array name: pscAutoConnections item_type: !ruby/object:Api::Type::NestedObject diff --git a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb index 66adf5cea449..8269a5f44c9a 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb @@ -1,21 +1,23 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { provider = google-beta - name = "<%= ctx[:vars]['instance_name'] %>" + instance_id = "<%= ctx[:vars]['instance_name'] %>" shard_count = 3 psc_auto_connections { network = google_compute_network.producer_net.id + project_id = data.google_project.project.project_id } - region = "us-central1" - replica_count = 1 - node_type = "REDIS_SHARED_CORE_NANO" + location = "europe-west1" + replica_count = 0 + node_type = "SHARED_CORE_NANO" transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" authorization_mode = "AUTH_DISABLED" - redis_configs = { + engine_configs = { maxmemory-policy = "volatile-ttl" } zone_distribution_config { mode = "MULTI_ZONE" } + deletion_protection_enabled = false depends_on = [ google_network_connectivity_service_connection_policy.default ] @@ -28,7 +30,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { resource "google_network_connectivity_service_connection_policy" "default" { provider = google-beta name = "<%= ctx[:vars]['policy_name'] %>" - location = "us-central1" + location = "europe-west1" service_class = "gcp-memorystore" description = "my basic service connection policy" network = google_compute_network.producer_net.id @@ -41,7 +43,7 @@ resource "google_compute_subnetwork" "producer_subnet" { provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" - region = "us-central1" + region = "europe-west1" network = google_compute_network.producer_net.id } @@ -49,4 +51,8 @@ resource "google_compute_network" "producer_net" { provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" auto_create_subnetworks = false +} + +data "google_project" "project" { + provider = google-beta } \ No newline at end of file diff --git a/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt b/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt index f34fbacc057e..5321fbf21683 100644 --- a/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt +++ b/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt @@ -496,6 +496,11 @@ var ServicesListBeta = mapOf( "displayName" to "Memcache", "path" to "./google-beta/services/memcache" ), + "memorystore" to mapOf( + "name" to "memorystore", + "displayName" to "Memorystore", + "path" to "./google-beta/services/memorystore" + ), "migrationcenter" to mapOf( "name" to "migrationcenter", "displayName" to "Migrationcenter", diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb new file mode 100644 index 000000000000..53f766a6a4c2 --- /dev/null +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -0,0 +1,279 @@ +<% autogen_exception -%> +package memorystore_test +<% unless version == "ga" -%> + +import ( + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-google/google/acctest" +) + + +// Validate that replica count is updated for the instance +func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckMemorystoreInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create instance with replica count 1 + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // update replica count to 2 + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // update replica count to 0 + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // clean up the resource + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + }, + }) +} + +// Validate that shard count is updated for the cluster +func TestAccMemorystoreInstance_updateShardCount(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckMemorystoreInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create cluster with shard count 3 + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // update shard count to 5 + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // clean up the resource + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled:false}), + }, + }, + }) +} + +// Validate that engineConfigs is updated for the cluster +func TestAccMemorystoreInstance_updateRedisConfigs(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckMemorystoreInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create cluster + Config: createOrUpdateMemorystoreInstance(&InstanceParams{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + deletionProtectionEnabled: false, + engineConfigs: map[string]string{ + "maxmemory-policy": "volatile-ttl", + }}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // add a new redis config key-value pair and update existing redis config + Config: createOrUpdateMemorystoreInstance(&InstanceParams{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + deletionProtectionEnabled: false, + engineConfigs: map[string]string{ + "maxmemory-policy": "allkeys-lru", + "maxmemory-clients": "90%", + }}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // remove all redis configs + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, shardCount: 3, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + }, + + }, + }) +} + +// Validate that deletion protection is updated for the cluster +func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckMemorystoreInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create cluster with deletion protection true + Config: createOrUpdateMemorystoreInstance(&InstanceParams{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + deletionProtectionEnabled: true, + }), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // update cluster with deletion protection false + Config: createOrUpdateMemorystoreInstance(&InstanceParams{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + deletionProtectionEnabled: false, + }), + }, + }, + }) +} + +type InstanceParams struct { + name string + replicaCount int + shardCount int + preventDestroy bool + nodeType string + engineConfigs map[string]string + zoneDistributionMode string + zone string + deletionProtectionEnabled bool +} + +func createOrUpdateMemorystoreInstance(params *InstanceParams) string { + lifecycleBlock := "" + if params.preventDestroy { + lifecycleBlock = ` + lifecycle { + prevent_destroy = true + }` + } + var strBuilder strings.Builder + for key, value := range params.engineConfigs { + strBuilder.WriteString(fmt.Sprintf("%s = \"%s\"\n", key, value)) + } + + zoneDistributionConfigBlock := `` + if params.zoneDistributionMode != "" { + zoneDistributionConfigBlock = fmt.Sprintf(` + zone_distribution_config { + mode = "%s" + zone = "%s" + } + `, params.zoneDistributionMode, params.zone) + } + + return fmt.Sprintf(` +resource "google_memorystore_instance" "test" { + provider = google-beta + instance_id = "%s" + replica_count = %d + shard_count = %d + node_type = "%s" + location = "europe-west1" + psc_auto_connections { + network = google_compute_network.producer_net.id + project_id = data.google_project.project.project_id + } + deletion_protection_enabled = %t + engine_configs = { + %s + } + %s + depends_on = [ + google_network_connectivity_service_connection_policy.default + ] + %s +} + +resource "google_network_connectivity_service_connection_policy" "default" { + provider = google-beta + name = "%s" + location = "europe-west1" + service_class = "gcp-memorystore" + description = "my basic service connection policy" + network = google_compute_network.producer_net.id + psc_config { + subnetworks = [google_compute_subnetwork.producer_subnet.id] + } +} + +resource "google_compute_subnetwork" "producer_subnet" { + provider = google-beta + name = "%s" + ip_cidr_range = "10.0.0.248/29" + region = "europe-west1" + network = google_compute_network.producer_net.id +} + +resource "google_compute_network" "producer_net" { + provider = google-beta + name = "%s" + auto_create_subnetworks = false +} + +data "google_project" "project" { + provider = google-beta +} +`, params.name, params.replicaCount, params.shardCount, params.nodeType, params.deletionProtectionEnabled, strBuilder.String(), zoneDistributionConfigBlock, lifecycleBlock, params.name, params.name, params.name) +} + +<% end -%> From 8af5bd65fde56864c3cdf76a147a05185c31cf61 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 23 Aug 2024 17:29:36 +0000 Subject: [PATCH 06/19] adding desiredPscAutoConnections to capture user input --- mmv1/products/memorystore/Instance.yaml | 40 +++++++++++++++++++------ 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index bc851a60a771..cc023f95fae1 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -12,6 +12,8 @@ update_verb: :PATCH update_mask: true autogen_async: true min_version: beta +custom_code: !ruby/object:Provider::Terraform::CustomCode + encoder: templates/terraform/encoders/memorystore_instance.go.erb examples: - !ruby/object:Provider::Terraform::Examples name: "memorystore_instance_ha" @@ -83,6 +85,7 @@ properties: description: "Optional. Number of replica nodes per shard. If omitted the default is 0 replicas. " + default_from_api: true - !ruby/object:Api::Type::String name: authorizationMode description: @@ -152,6 +155,7 @@ properties: "Optional. Time that the first snapshot was/will be attempted, and to which future\nsnapshots will be aligned. If not provided, the current time will be\nused. " + default_from_api: true name: rdbConfig description: "Configuration for RDB based persistence. " - !ruby/object:Api::Type::NestedObject @@ -228,21 +232,18 @@ properties: output: true - !ruby/object:Api::Type::String name: projectId - description: - "Required. The consumer project_id where the forwarding rule is + description: "The consumer project_id where the forwarding rule is created from. " - required: true + output: true - !ruby/object:Api::Type::String name: network - description: - "Required. The consumer network where the IP address resides, in + description: "The consumer network where the IP address resides, in the form of\nprojects/{project_id}/global/networks/{network_id}. " - required: true + output: true description: - "Required. Immutable. User inputs and resource details of the auto-created + "Output only. User inputs and resource details of the auto-created PSC connections. " - immutable: true - required: true + output: true parameters: - !ruby/object:Api::Type::String name: location @@ -264,6 +265,27 @@ parameters: url_param_only: true required: true immutable: true +virtual_fields: + - !ruby/object:Api::Type::Array + name: desiredPscAutoConnections + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: projectId + description: + "Required. The consumer project_id where the forwarding rule is + created from. " + required: true + - !ruby/object:Api::Type::String + name: network + description: + "Required. The consumer network where the IP address resides, in + the form of\nprojects/{project_id}/global/networks/{network_id}. " + required: true + description: "Required. Immutable. User inputs for the auto-created + PSC connections. " + immutable: true + required: true async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation path: name From 4b574f0b8dcb95640c2eea200c4d9c6ab72bf712 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 23 Aug 2024 20:11:04 +0000 Subject: [PATCH 07/19] use desired_psc_auto_connections instead of psc_auto_connections in the test --- mmv1/products/memorystore/Instance.yaml | 11 +++++++---- .../terraform/examples/memorystore_instance_ha.tf.erb | 2 +- .../resource_memorystore_instance_test.go.erb | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index cc023f95fae1..543d46737f2a 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -14,6 +14,7 @@ autogen_async: true min_version: beta custom_code: !ruby/object:Provider::Terraform::CustomCode encoder: templates/terraform/encoders/memorystore_instance.go.erb + decoder: templates/terraform/decoders/memorystore_instance.go.erb examples: - !ruby/object:Provider::Terraform::Examples name: "memorystore_instance_ha" @@ -232,12 +233,14 @@ properties: output: true - !ruby/object:Api::Type::String name: projectId - description: "The consumer project_id where the forwarding rule is + description: + "Output only. The consumer project_id where the forwarding rule is created from. " output: true - !ruby/object:Api::Type::String name: network - description: "The consumer network where the IP address resides, in + description: + "Output only. The consumer network where the IP address resides, in the form of\nprojects/{project_id}/global/networks/{network_id}. " output: true description: @@ -267,11 +270,11 @@ parameters: immutable: true virtual_fields: - !ruby/object:Api::Type::Array - name: desiredPscAutoConnections + name: desired_psc_auto_connections item_type: !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String - name: projectId + name: project_id description: "Required. The consumer project_id where the forwarding rule is created from. " diff --git a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb index 8269a5f44c9a..86978e405f14 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb @@ -2,7 +2,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { provider = google-beta instance_id = "<%= ctx[:vars]['instance_name'] %>" shard_count = 3 - psc_auto_connections { + desired_psc_auto_connections { network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index 53f766a6a4c2..66c0c55fba3d 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -229,7 +229,7 @@ resource "google_memorystore_instance" "test" { shard_count = %d node_type = "%s" location = "europe-west1" - psc_auto_connections { + desired_psc_auto_connections { network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } From a9cf705806726793577a5a9e8ec797a49ad8dd94 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 23 Aug 2024 21:28:22 +0000 Subject: [PATCH 08/19] adding encoder decoder files --- .../decoders/memorystore_instance.go.erb | 16 +++++++++++ .../encoders/memorystore_instance.go.erb | 27 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 mmv1/templates/terraform/decoders/memorystore_instance.go.erb create mode 100644 mmv1/templates/terraform/encoders/memorystore_instance.go.erb diff --git a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb new file mode 100644 index 000000000000..54ea57419929 --- /dev/null +++ b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb @@ -0,0 +1,16 @@ +v := res["psc_auto_connections"] + l := v.([]interface{}) + transformed := make([]interface{}, 0, len(l)) + for _, raw := range l { + original := raw.(map[string]interface{}) + if len(original) < 1 { + // Do not include empty json objects coming back from the api + continue + } + transformed = append(transformed, map[string]interface{}{ + "project_id": original["projectId"], + "network": original["network"], + }) + } + d.Set("desired_psc_auto_connections", transformed) + return res, nil \ No newline at end of file diff --git a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb new file mode 100644 index 000000000000..90c321d091e1 --- /dev/null +++ b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb @@ -0,0 +1,27 @@ + v, ok := d.GetOk("desired_psc_auto_connections") + if !ok { + return obj, nil // No desired connections, nothing to update + } + l := v.([]interface{}) + req := make([]interface{}, 0, len(l)) + for _, raw := range l { + if raw == nil { + continue + } + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) + + transformedProjectId := original["project_id"] + if val := reflect.ValueOf(transformedProjectId); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["projectId"] = transformedProjectId + } + + transformedNetwork := original["network"] + if val := reflect.ValueOf(transformedNetwork); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["network"] = transformedNetwork + } + + req = append(req, transformed) + } + obj["psc_auto_connections"] = req + return obj, nil \ No newline at end of file From 7c439b4957f51e6b6437d5019e43aba16b8dca92 Mon Sep 17 00:00:00 2001 From: himanikh Date: Wed, 28 Aug 2024 00:04:52 +0000 Subject: [PATCH 09/19] Adding Memorystore Instance support --- mmv1/products/memorystore/Instance.yaml | 6 +- .../memorystore_instance_basic.tf.erb | 48 +++++++++++++ .../examples/memorystore_instance_full.tf.erb | 70 +++++++++++++++++++ .../resource_memorystore_instance_test.go.erb | 67 ++++++++++++++++-- 4 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb create mode 100644 mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 543d46737f2a..9bc961feeb59 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -22,9 +22,9 @@ examples: min_version: beta vars: instance_name: "ha-instance" - policy_name: "mypolicy" - subnet_name: "mysubnet" - network_name: "mynetwork" + policy_name: "my-policy" + subnet_name: "my-subnet" + network_name: "my-network" prevent_destroy: "true" test_vars_overrides: prevent_destroy: "false" diff --git a/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb new file mode 100644 index 000000000000..87640d36f223 --- /dev/null +++ b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb @@ -0,0 +1,48 @@ +resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + instance_id = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 + desired_psc_auto_connections { + network = google_compute_network.producer_net.id + project_id = data.google_project.project.project_id + } + location = "europe-west1" + deletion_protection_enabled = false + depends_on = [ + google_network_connectivity_service_connection_policy.default + ] + + lifecycle { + prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + } +} + +resource "google_network_connectivity_service_connection_policy" "default" { + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "europe-west1" + service_class = "gcp-memorystore" + description = "my basic service connection policy" + network = google_compute_network.producer_net.id + psc_config { + subnetworks = [google_compute_subnetwork.producer_subnet.id] + } +} + +resource "google_compute_subnetwork" "producer_subnet" { + provider = google-beta + name = "<%= ctx[:vars]['subnet_name'] %>" + ip_cidr_range = "10.0.0.248/29" + region = "europe-west1" + network = google_compute_network.producer_net.id +} + +resource "google_compute_network" "producer_net" { + provider = google-beta + name = "<%= ctx[:vars]['network_name'] %>" + auto_create_subnetworks = false +} + +data "google_project" "project" { + provider = google-beta +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb new file mode 100644 index 000000000000..2d5c0bb1ca88 --- /dev/null +++ b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb @@ -0,0 +1,70 @@ +resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + instance_id = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 + desired_psc_auto_connections { + network = google_compute_network.producer_net.id + project_id = data.google_project.project.project_id + } + location = "us-central1" + replica_count = 0 + node_type = "SHARED_CORE_NANO" + transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" + authorization_mode = "AUTH_DISABLED" + engine_configs = { + maxmemory-policy = "volatile-ttl" + } + zone_distribution_config { + mode = "SINGLE_ZONE" + zone = "us-central1-b" + } + engine_version = "VALKEY_7_2" + deletion_protection_enabled = false + persistence_config { + mode = "RDB" + rdb_config = { + rdb_snapshot_period = "ONE_HOUR" + rdb_snapshot_start_time = "2024-10-02T15:01:23Z" + } + } + labels = { + "abc" : "xyz" + } + depends_on = [ + google_network_connectivity_service_connection_policy.default + ] + + lifecycle { + prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + } +} + +resource "google_network_connectivity_service_connection_policy" "default" { + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "europe-west1" + service_class = "gcp-memorystore" + description = "my basic service connection policy" + network = google_compute_network.producer_net.id + psc_config { + subnetworks = [google_compute_subnetwork.producer_subnet.id] + } +} + +resource "google_compute_subnetwork" "producer_subnet" { + provider = google-beta + name = "<%= ctx[:vars]['subnet_name'] %>" + ip_cidr_range = "10.0.0.248/29" + region = "europe-west1" + network = google_compute_network.producer_net.id +} + +resource "google_compute_network" "producer_net" { + provider = google-beta + name = "<%= ctx[:vars]['network_name'] %>" + auto_create_subnetworks = false +} + +data "google_project" "project" { + provider = google-beta +} \ No newline at end of file diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index 66c0c55fba3d..33e553e8fd34 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -112,10 +112,10 @@ func TestAccMemorystoreInstance_updateRedisConfigs(t *testing.T) { name: name, shardCount: 3, zoneDistributionMode: "MULTI_ZONE", - deletionProtectionEnabled: false, engineConfigs: map[string]string{ "maxmemory-policy": "volatile-ttl", - }}), + }, + deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -128,11 +128,11 @@ func TestAccMemorystoreInstance_updateRedisConfigs(t *testing.T) { name: name, shardCount: 3, zoneDistributionMode: "MULTI_ZONE", - deletionProtectionEnabled: false, engineConfigs: map[string]string{ "maxmemory-policy": "allkeys-lru", "maxmemory-clients": "90%", - }}), + }, + deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -141,7 +141,15 @@ func TestAccMemorystoreInstance_updateRedisConfigs(t *testing.T) { }, { // remove all redis configs - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, shardCount: 3, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + engineConfigs: map[string]string{ + "maxmemory-policy": "allkeys-lru", + "maxmemory-clients": "90%", + }, + deletionProtectionEnabled: false}), }, }, @@ -186,6 +194,43 @@ func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) { }) } +// Validate that persistence config is updated for the cluster +func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckMemorystoreInstanceDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create instance with AOF enabled + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"AOF", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // update persitence to RDB + Config: createOrUpdateRedisCluster(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, + { + // clean up the resource + Config: createOrUpdateRedisCluster(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, nodeType: "REDIS_STANDARD_SMALL",zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + }, + }, + }) +} + type InstanceParams struct { name string replicaCount int @@ -196,6 +241,7 @@ type InstanceParams struct { zoneDistributionMode string zone string deletionProtectionEnabled bool + persistenceMode string } func createOrUpdateMemorystoreInstance(params *InstanceParams) string { @@ -220,6 +266,13 @@ func createOrUpdateMemorystoreInstance(params *InstanceParams) string { } `, params.zoneDistributionMode, params.zone) } + persistenceBlock := "" + if params.persistenceMode == "RDB" { + persistenceBlock = "persistenceConfig = {mode: = \"RDB\"}" + } + if params.persistenceMode == "AOF" { + persistenceBlock = "persistenceConfig = {mode: \"AOF\"}" + } return fmt.Sprintf(` resource "google_memorystore_instance" "test" { @@ -229,7 +282,7 @@ resource "google_memorystore_instance" "test" { shard_count = %d node_type = "%s" location = "europe-west1" - desired_psc_auto_connections { + desired_psc_auto_connections { network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } @@ -273,7 +326,7 @@ resource "google_compute_network" "producer_net" { data "google_project" "project" { provider = google-beta } -`, params.name, params.replicaCount, params.shardCount, params.nodeType, params.deletionProtectionEnabled, strBuilder.String(), zoneDistributionConfigBlock, lifecycleBlock, params.name, params.name, params.name) +`, params.name, params.replicaCount, params.shardCount, params.nodeType, params.deletionProtectionEnabled, strBuilder.String(), zoneDistributionConfigBlock, persistenceBlock, lifecycleBlock, params.name, params.name, params.name) } <% end -%> From 3414a2f8dd0d57cbf7c98d8d96086dbcbbb8b7da Mon Sep 17 00:00:00 2001 From: himanikh Date: Wed, 28 Aug 2024 02:03:00 +0000 Subject: [PATCH 10/19] minor fixes --- mmv1/products/memorystore/Instance.yaml | 20 ++++++++++++++++--- .../examples/memorystore_instance_full.tf.erb | 4 ++-- .../resource_memorystore_instance_test.go.erb | 5 +++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 9bc961feeb59..9d80ca7d549e 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -17,11 +17,25 @@ custom_code: !ruby/object:Provider::Terraform::CustomCode decoder: templates/terraform/decoders/memorystore_instance.go.erb examples: - !ruby/object:Provider::Terraform::Examples - name: "memorystore_instance_ha" - primary_resource_id: "instance-ha" + name: "memorystore_instance_basic" + primary_resource_id: "instance-basic" min_version: beta vars: - instance_name: "ha-instance" + instance_name: "basic-instance" + policy_name: "my-policy" + subnet_name: "my-subnet" + network_name: "my-network" + prevent_destroy: "true" + test_vars_overrides: + prevent_destroy: "false" + oics_vars_overrides: + prevent_destroy: "false" + - !ruby/object:Provider::Terraform::Examples + name: "memorystore_instance_full" + primary_resource_id: "instance-full" + min_version: beta + vars: + instance_name: "full-instance" policy_name: "my-policy" subnet_name: "my-subnet" network_name: "my-network" diff --git a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb index 2d5c0bb1ca88..9009421501c3 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb @@ -7,7 +7,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { project_id = data.google_project.project.project_id } location = "us-central1" - replica_count = 0 + replica_count = 2 node_type = "SHARED_CORE_NANO" transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" authorization_mode = "AUTH_DISABLED" @@ -22,7 +22,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { deletion_protection_enabled = false persistence_config { mode = "RDB" - rdb_config = { + rdb_config { rdb_snapshot_period = "ONE_HOUR" rdb_snapshot_start_time = "2024-10-02T15:01:23Z" } diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index 33e553e8fd34..ed75b72bed6c 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -216,7 +216,7 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { }, { // update persitence to RDB - Config: createOrUpdateRedisCluster(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -225,7 +225,7 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateRedisCluster(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, nodeType: "REDIS_STANDARD_SMALL",zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, nodeType: "REDIS_STANDARD_SMALL",zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), }, }, }) @@ -290,6 +290,7 @@ resource "google_memorystore_instance" "test" { engine_configs = { %s } + %s %s depends_on = [ google_network_connectivity_service_connection_policy.default From e9af56142809d4c8540871a8c020f515d87b75fb Mon Sep 17 00:00:00 2001 From: himanikh Date: Wed, 28 Aug 2024 19:05:52 +0000 Subject: [PATCH 11/19] fix in decoder --- mmv1/products/memorystore/Instance.yaml | 17 +++-------------- .../decoders/memorystore_instance.go.erb | 2 +- .../encoders/memorystore_instance.go.erb | 2 +- .../resource_memorystore_instance_test.go.erb | 17 ++--------------- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 9d80ca7d549e..8fb61a39d156 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -59,14 +59,7 @@ properties: output: true - !ruby/object:Api::Type::KeyValueLabels name: labels - output: - api_name: description: "Optional. Labels to represent user-provided metadata. " - min_version: - ignore_write: - update_verb: - update_url: - immutable: - !ruby/object:Api::Type::String name: state description: @@ -190,14 +183,7 @@ properties: default_from_api: true - !ruby/object:Api::Type::KeyValuePairs name: engineConfigs - output: - api_name: description: "Optional. User-provided engine configurations for the instance. " - min_version: - ignore_write: - update_verb: - update_url: - immutable: - !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::Double @@ -205,6 +191,7 @@ properties: description: "Output only. Memory size in GB of the node. " output: true name: nodeConfig + output: true description: "Represents configuration for nodes of the instance. " - !ruby/object:Api::Type::NestedObject properties: @@ -213,12 +200,14 @@ properties: description: "Optional. Defines zone where all resources will be allocated with SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode. " + immutable: true - !ruby/object:Api::Type::String name: mode default_from_api: true description: "Optional. Current zone distribution mode. Defaults to MULTI_ZONE. \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" + immutable: true name: zoneDistributionConfig description: "Zone distribution configuration for allocation of instance resources. " - !ruby/object:Api::Type::Boolean diff --git a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb index 54ea57419929..09bdd2921333 100644 --- a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb @@ -1,4 +1,4 @@ -v := res["psc_auto_connections"] +v := res["pscAutoConnections"] l := v.([]interface{}) transformed := make([]interface{}, 0, len(l)) for _, raw := range l { diff --git a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb index 90c321d091e1..b76635a67124 100644 --- a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb @@ -23,5 +23,5 @@ req = append(req, transformed) } - obj["psc_auto_connections"] = req + obj["pscAutoConnections"] = req return obj, nil \ No newline at end of file diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index ed75b72bed6c..be436cb659ad 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -25,7 +25,7 @@ func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { Steps: []resource.TestStep{ { // create instance with replica count 1 - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -34,26 +34,13 @@ func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { }, { // update replica count to 2 - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", ImportState: true, ImportStateVerify: true, }, - { - // update replica count to 0 - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), - }, - { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, - }, - { - // clean up the resource - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), - }, }, }) } From 2427c1525ee65467cefe040f00eecdfbfd239b29 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 30 Aug 2024 22:34:12 +0000 Subject: [PATCH 12/19] Corrected type from string to enum --- mmv1/products/memorystore/Instance.yaml | 18 +++++-- .../decoders/memorystore_instance.go.erb | 54 ++++++++++++++----- .../encoders/memorystore_instance.go.erb | 48 ++++++++--------- .../memorystore_instance_basic.tf.erb | 2 +- .../examples/memorystore_instance_full.tf.erb | 6 +-- .../components/inputs/services_ga.kt | 5 ++ .../resource_memorystore_instance_test.go.erb | 18 +++++-- 7 files changed, 102 insertions(+), 49 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 8fb61a39d156..d30f3ca73145 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -145,9 +145,13 @@ properties: default_from_api: true - !ruby/object:Api::Type::NestedObject properties: - - !ruby/object:Api::Type::String + - !ruby/object:Api::Type::Enum name: mode - description: "Optional. Current persistence mode. \n Possible values:\n PERSISTENCE_MODE_UNSPECIFIED\nDISABLED\nRDB\nAOF" + description: "Optional. Current persistence mode. \n Possible values:\nDISABLED\nRDB\nAOF" + values: + - :DISABLED + - :RDB + - :AOF default_from_api: true - !ruby/object:Api::Type::NestedObject properties: @@ -201,14 +205,20 @@ properties: "Optional. Defines zone where all resources will be allocated with SINGLE_ZONE mode.\nIgnored for MULTI_ZONE mode. " immutable: true - - !ruby/object:Api::Type::String + - !ruby/object:Api::Type::Enum name: mode + description: | + Immutable. The mode for zone distribution for Memorystore Redis cluster. + If not provided, MULTI_ZONE will be used as default + values: + - :MULTI_ZONE + - :SINGLE_ZONE default_from_api: true description: "Optional. Current zone distribution mode. Defaults to MULTI_ZONE. \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" - immutable: true name: zoneDistributionConfig + immutable: true description: "Zone distribution configuration for allocation of instance resources. " - !ruby/object:Api::Type::Boolean name: deletionProtectionEnabled diff --git a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb index 09bdd2921333..a7839c313932 100644 --- a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb @@ -1,16 +1,44 @@ -v := res["pscAutoConnections"] - l := v.([]interface{}) - transformed := make([]interface{}, 0, len(l)) - for _, raw := range l { - original := raw.(map[string]interface{}) - if len(original) < 1 { - // Do not include empty json objects coming back from the api - continue - } +// Retrieve pscAutoConnections from API response +v, ok := res["pscAutoConnections"] +if !ok { + return nil, fmt.Errorf("pscAutoConnections field not found in API response") +} + +connections, ok := v.([]interface{}) +if !ok { + return nil, fmt.Errorf("pscAutoConnections is not an array") +} + +transformed := make([]interface{}, 0, len(connections)) +uniqueConnections := make(map[string]bool) // Track unique project+network combos + +for _, raw := range connections { + connectionData, ok := raw.(map[string]interface{}) + if !ok || len(connectionData) < 1 { + // Log the problematic connection data for debugging + log.Printf("[ERROR] Invalid or empty psc connection data: %v", raw) + continue // Skip this invalid connection and continue processing + } + + projectID, ok := connectionData["projectId"].(string) + if !ok { + return nil, fmt.Errorf("invalid project ID in psc connection: %v", connectionData) + } + + networkID, ok := connectionData["network"].(string) + if !ok { + return nil, fmt.Errorf("invalid network ID in psc connection: %v", connectionData) + } + + uniqueKey := projectID + networkID + if !uniqueConnections[uniqueKey] { // Check for uniqueness + uniqueConnections[uniqueKey] = true transformed = append(transformed, map[string]interface{}{ - "project_id": original["projectId"], - "network": original["network"], + "project_id": projectID, + "network": networkID, }) } - d.Set("desired_psc_auto_connections", transformed) - return res, nil \ No newline at end of file +} + +d.Set("desired_psc_auto_connections", transformed) +return res, nil diff --git a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb index b76635a67124..f39f4ef0d927 100644 --- a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb @@ -1,27 +1,27 @@ - v, ok := d.GetOk("desired_psc_auto_connections") - if !ok { - return obj, nil // No desired connections, nothing to update - } - l := v.([]interface{}) - req := make([]interface{}, 0, len(l)) - for _, raw := range l { - if raw == nil { - continue - } - original := raw.(map[string]interface{}) - transformed := make(map[string]interface{}) +v, ok := d.GetOk("desired_psc_auto_connections") +if !ok { + return obj, nil // No desired connections, nothing to update +} +l := v.([]interface{}) +req := make([]interface{}, 0, len(l)) +for _, raw := range l { + if raw == nil { + continue + } + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) - transformedProjectId := original["project_id"] - if val := reflect.ValueOf(transformedProjectId); val.IsValid() && !tpgresource.IsEmptyValue(val) { - transformed["projectId"] = transformedProjectId - } + transformedProjectId := original["project_id"] + if val := reflect.ValueOf(transformedProjectId); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["projectId"] = transformedProjectId + } - transformedNetwork := original["network"] - if val := reflect.ValueOf(transformedNetwork); val.IsValid() && !tpgresource.IsEmptyValue(val) { - transformed["network"] = transformedNetwork - } + transformedNetwork := original["network"] + if val := reflect.ValueOf(transformedNetwork); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["network"] = transformedNetwork + } - req = append(req, transformed) - } - obj["pscAutoConnections"] = req - return obj, nil \ No newline at end of file + req = append(req, transformed) +} +obj["pscAutoConnections"] = req +return obj, nil diff --git a/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb index 87640d36f223..fcbda24bc5bc 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb @@ -45,4 +45,4 @@ resource "google_compute_network" "producer_net" { data "google_project" "project" { provider = google-beta -} \ No newline at end of file +} diff --git a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb index 9009421501c3..35b24fb34718 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb @@ -42,7 +42,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { resource "google_network_connectivity_service_connection_policy" "default" { provider = google-beta name = "<%= ctx[:vars]['policy_name'] %>" - location = "europe-west1" + location = "us-central1" service_class = "gcp-memorystore" description = "my basic service connection policy" network = google_compute_network.producer_net.id @@ -55,7 +55,7 @@ resource "google_compute_subnetwork" "producer_subnet" { provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" - region = "europe-west1" + region = "us-central1" network = google_compute_network.producer_net.id } @@ -67,4 +67,4 @@ resource "google_compute_network" "producer_net" { data "google_project" "project" { provider = google-beta -} \ No newline at end of file +} diff --git a/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt b/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt index bc928ad729c1..05ada2da4b20 100644 --- a/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt +++ b/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt @@ -486,6 +486,11 @@ var ServicesListGa = mapOf( "displayName" to "Memcache", "path" to "./google/services/memcache" ), + "memorystore" to mapOf( + "name" to "memorystore", + "displayName" to "Memorystore", + "path" to "./google/services/memorystore" + ), "migrationcenter" to mapOf( "name" to "migrationcenter", "displayName" to "Migrationcenter", diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index be436cb659ad..335a5b18f220 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -25,7 +25,7 @@ func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { Steps: []resource.TestStep{ { // create instance with replica count 1 - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -34,13 +34,18 @@ func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { }, { // update replica count to 2 - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", ImportState: true, ImportStateVerify: true, }, + { + // clean up the resource + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled:false}), + }, + }, }) } @@ -177,6 +182,11 @@ func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) { deletionProtectionEnabled: false, }), }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -255,10 +265,10 @@ func createOrUpdateMemorystoreInstance(params *InstanceParams) string { } persistenceBlock := "" if params.persistenceMode == "RDB" { - persistenceBlock = "persistenceConfig = {mode: = \"RDB\"}" + persistenceBlock = "persistence_config {mode = \"RDB\"}" } if params.persistenceMode == "AOF" { - persistenceBlock = "persistenceConfig = {mode: \"AOF\"}" + persistenceBlock = "persistence_config {mode = \"AOF\" aof_config { append_fsync = \"EVERYSEC\" } }" } return fmt.Sprintf(` From ad9ff8efd29cd3516c4e55b00a9ae3f3add23df9 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 30 Aug 2024 22:40:00 +0000 Subject: [PATCH 13/19] minor fix --- mmv1/products/memorystore/Instance.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index d30f3ca73145..6cf42a17bee4 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -219,6 +219,7 @@ properties: \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" name: zoneDistributionConfig immutable: true + default_from_api: true description: "Zone distribution configuration for allocation of instance resources. " - !ruby/object:Api::Type::Boolean name: deletionProtectionEnabled From 8b091774cdd48842650d511091edd751b0400e1a Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 30 Aug 2024 22:55:43 +0000 Subject: [PATCH 14/19] minor fix --- mmv1/products/memorystore/Instance.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 6cf42a17bee4..631d0a10ed75 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -207,9 +207,6 @@ properties: immutable: true - !ruby/object:Api::Type::Enum name: mode - description: | - Immutable. The mode for zone distribution for Memorystore Redis cluster. - If not provided, MULTI_ZONE will be used as default values: - :MULTI_ZONE - :SINGLE_ZONE From e7d12233e83d44936ea1694d0f9b0971729f8f82 Mon Sep 17 00:00:00 2001 From: himanikh Date: Sat, 31 Aug 2024 02:34:50 +0000 Subject: [PATCH 15/19] minor fixes --- mmv1/products/memorystore/Instance.yaml | 6 ++++++ .../resource_memorystore_instance_test.go.erb | 17 +++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 631d0a10ed75..355d8edad545 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -12,6 +12,10 @@ update_verb: :PATCH update_mask: true autogen_async: true min_version: beta +timeouts: !ruby/object:Api::Timeouts + insert_minutes: 60 + update_minutes: 120 + delete_minutes: 30 custom_code: !ruby/object:Provider::Terraform::CustomCode encoder: templates/terraform/encoders/memorystore_instance.go.erb decoder: templates/terraform/decoders/memorystore_instance.go.erb @@ -178,7 +182,9 @@ properties: default_from_api: true name: aofConfig description: "Configuration for AOF based persistence. " + default_from_api: true name: persistenceConfig + default_from_api: true description: "Represents persistence configuration for a instance. " - !ruby/object:Api::Type::String name: engineVersion diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index 335a5b18f220..f789fa35fb84 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -204,7 +204,7 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { Steps: []resource.TestStep{ { // create instance with AOF enabled - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"AOF", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"AOF", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -213,7 +213,7 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { }, { // update persitence to RDB - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), }, { ResourceName: "google_memorystore_instance.test", @@ -222,7 +222,7 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, nodeType: "REDIS_STANDARD_SMALL",zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), }, }, }) @@ -268,9 +268,14 @@ func createOrUpdateMemorystoreInstance(params *InstanceParams) string { persistenceBlock = "persistence_config {mode = \"RDB\"}" } if params.persistenceMode == "AOF" { - persistenceBlock = "persistence_config {mode = \"AOF\" aof_config { append_fsync = \"EVERYSEC\" } }" - } - + persistenceBlock = ` + persistence_config { + mode = "AOF" + aof_config { + append_fsync = "EVERY_SEC" + } + }` + } return fmt.Sprintf(` resource "google_memorystore_instance" "test" { provider = google-beta From 6767f9fdca3e00041ceec0be50616661720633d1 Mon Sep 17 00:00:00 2001 From: himanikh Date: Tue, 3 Sep 2024 11:06:23 +0000 Subject: [PATCH 16/19] minor fix --- mmv1/products/memorystore/Instance.yaml | 1 + .../memorystore/resource_memorystore_instance_test.go.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 355d8edad545..15e95bc9db9e 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -174,6 +174,7 @@ properties: default_from_api: true name: rdbConfig description: "Configuration for RDB based persistence. " + default_from_api: true - !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index f789fa35fb84..92776af8877a 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -265,7 +265,7 @@ func createOrUpdateMemorystoreInstance(params *InstanceParams) string { } persistenceBlock := "" if params.persistenceMode == "RDB" { - persistenceBlock = "persistence_config {mode = \"RDB\"}" + persistenceBlock = "persistence_config {mode = \"RDB\" }" } if params.persistenceMode == "AOF" { persistenceBlock = ` From 24df9db671970f31e162f46c75ca6f6991bb7b64 Mon Sep 17 00:00:00 2001 From: himanikh Date: Tue, 3 Sep 2024 13:47:53 +0000 Subject: [PATCH 17/19] adding example for AOF --- mmv1/products/memorystore/Instance.yaml | 14 +++++++++++ ...morystore_instance_persistence_aof.tf.erb} | 23 ++++++++----------- .../resource_memorystore_instance_test.go.erb | 19 ++++++--------- 3 files changed, 30 insertions(+), 26 deletions(-) rename mmv1/templates/terraform/examples/{memorystore_instance_ha.tf.erb => memorystore_instance_persistence_aof.tf.erb} (79%) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index 15e95bc9db9e..fe0df4f2a26f 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -48,6 +48,20 @@ examples: prevent_destroy: "false" oics_vars_overrides: prevent_destroy: "false" + - !ruby/object:Provider::Terraform::Examples + name: "memorystore_instance_persistence_aof" + primary_resource_id: "instance-persistence-aof" + min_version: beta + vars: + instance_name: "aof-instance" + policy_name: "my-policy" + subnet_name: "my-subnet" + network_name: "my-network" + prevent_destroy: "true" + test_vars_overrides: + prevent_destroy: "false" + oics_vars_overrides: + prevent_destroy: "false" properties: - !ruby/object:Api::Type::String name: name diff --git a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb similarity index 79% rename from mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb rename to mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb index 86978e405f14..6282e4e1a0ce 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_ha.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb @@ -6,22 +6,17 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } - location = "europe-west1" - replica_count = 0 - node_type = "SHARED_CORE_NANO" - transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" - authorization_mode = "AUTH_DISABLED" - engine_configs = { - maxmemory-policy = "volatile-ttl" + location = "us-central1" + persistence_config { + mode = "AOF" + aof_config { + append_fsync = "EVERY_SEC" + } } - zone_distribution_config { - mode = "MULTI_ZONE" - } - deletion_protection_enabled = false depends_on = [ google_network_connectivity_service_connection_policy.default ] - + deletion_protection_enabled = false lifecycle { prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> } @@ -30,7 +25,7 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { resource "google_network_connectivity_service_connection_policy" "default" { provider = google-beta name = "<%= ctx[:vars]['policy_name'] %>" - location = "europe-west1" + location = "us-central1" service_class = "gcp-memorystore" description = "my basic service connection policy" network = google_compute_network.producer_net.id @@ -43,7 +38,7 @@ resource "google_compute_subnetwork" "producer_subnet" { provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" - region = "europe-west1" + region = "us-central1" network = google_compute_network.producer_net.id } diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index 92776af8877a..e0aa5e3e123d 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -263,18 +263,13 @@ func createOrUpdateMemorystoreInstance(params *InstanceParams) string { } `, params.zoneDistributionMode, params.zone) } - persistenceBlock := "" - if params.persistenceMode == "RDB" { - persistenceBlock = "persistence_config {mode = \"RDB\" }" - } - if params.persistenceMode == "AOF" { - persistenceBlock = ` - persistence_config { - mode = "AOF" - aof_config { - append_fsync = "EVERY_SEC" - } - }` + persistenceBlock := `` + if params.persistenceMode != "" { + persistenceBlock = fmt.Sprintf(` + persistence_config { + mode = "%s" + } + `, params.persistenceMode) } return fmt.Sprintf(` resource "google_memorystore_instance" "test" { From 033ed9758e83998e1be7d80ea843b446e7849e5a Mon Sep 17 00:00:00 2001 From: himanikh Date: Thu, 5 Sep 2024 17:15:51 +0000 Subject: [PATCH 18/19] Addressing review comments --- mmv1/products/memorystore/Instance.yaml | 16 +++++++++------- .../decoders/memorystore_instance.go.erb | 4 +--- .../encoders/memorystore_instance.go.erb | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mmv1/products/memorystore/Instance.yaml b/mmv1/products/memorystore/Instance.yaml index fe0df4f2a26f..cda74778ad22 100644 --- a/mmv1/products/memorystore/Instance.yaml +++ b/mmv1/products/memorystore/Instance.yaml @@ -82,7 +82,7 @@ properties: name: state description: "Output only. Current state of the instance. \n Possible values:\n - STATE_UNSPECIFIED\nCREATING\nACTIVE\nUPDATING\nDELETING" + CREATING\nACTIVE\nUPDATING\nDELETING" output: true - !ruby/object:Api::Type::NestedObject properties: @@ -100,8 +100,10 @@ properties: output: true name: updateInfo description: "Represents information about instance with state UPDATING. " + output: true name: stateInfo description: "Additional information about the state of the instance. " + output: true - !ruby/object:Api::Type::String name: uid description: "Output only. System assigned, unique identifier for the instance. " @@ -116,14 +118,14 @@ properties: name: authorizationMode description: "Optional. Immutable. Authorization mode of the instance. \n Possible - values:\n AUTHORIZATION_MODE_UNSPECIFIED\nAUTH_DISABLED\nIAM_AUTH" + values:\n AUTH_DISABLED\nIAM_AUTH" immutable: true default_from_api: true - !ruby/object:Api::Type::String name: transitEncryptionMode description: "Optional. Immutable. In-transit encryption mode of the instance. \n - Possible values:\n TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\nTRANSIT_ENCRYPTION_DISABLED\nSERVER_AUTHENTICATION" + Possible values:\n TRANSIT_ENCRYPTION_DISABLED\nSERVER_AUTHENTICATION" immutable: true default_from_api: true - !ruby/object:Api::Type::Integer @@ -158,7 +160,7 @@ properties: name: nodeType description: "Optional. Immutable. Machine type for individual nodes of the instance. - \n Possible values:\n NODE_TYPE_UNSPECIFIED\nSHARED_CORE_NANO\nHIGHMEM_MEDIUM\nHIGHMEM_XLARGE\nSTANDARD_SMALL" + \n Possible values:\n SHARED_CORE_NANO\nHIGHMEM_MEDIUM\nHIGHMEM_XLARGE\nSTANDARD_SMALL" immutable: true default_from_api: true - !ruby/object:Api::Type::NestedObject @@ -178,7 +180,7 @@ properties: default_from_api: true description: "Optional. Period between RDB snapshots. \n Possible values:\n - SNAPSHOT_PERIOD_UNSPECIFIED\nONE_HOUR\nSIX_HOURS\nTWELVE_HOURS\nTWENTY_FOUR_HOURS" + ONE_HOUR\nSIX_HOURS\nTWELVE_HOURS\nTWENTY_FOUR_HOURS" - !ruby/object:Api::Type::String name: rdbSnapshotStartTime description: @@ -193,7 +195,7 @@ properties: properties: - !ruby/object:Api::Type::String name: appendFsync - description: "Optional. The fsync mode. \n Possible values:\n APPEND_FSYNC_UNSPECIFIED\nNEVER\nEVERY_SEC\nALWAYS" + description: "Optional. The fsync mode. \n Possible values:\n NEVER\nEVERY_SEC\nALWAYS" default_from_api: true name: aofConfig description: "Configuration for AOF based persistence. " @@ -234,7 +236,7 @@ properties: default_from_api: true description: "Optional. Current zone distribution mode. Defaults to MULTI_ZONE. - \n Possible values:\n ZONE_DISTRIBUTION_MODE_UNSPECIFIED\nMULTI_ZONE\nSINGLE_ZONE" + \n Possible values:\n MULTI_ZONE\nSINGLE_ZONE" name: zoneDistributionConfig immutable: true default_from_api: true diff --git a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb index a7839c313932..96061ee6d183 100644 --- a/mmv1/templates/terraform/decoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/decoders/memorystore_instance.go.erb @@ -15,9 +15,7 @@ uniqueConnections := make(map[string]bool) // Track unique project+network combo for _, raw := range connections { connectionData, ok := raw.(map[string]interface{}) if !ok || len(connectionData) < 1 { - // Log the problematic connection data for debugging - log.Printf("[ERROR] Invalid or empty psc connection data: %v", raw) - continue // Skip this invalid connection and continue processing + return nil, fmt.Errorf("Invalid or empty psc connection data: %v", raw) } projectID, ok := connectionData["projectId"].(string) diff --git a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb index f39f4ef0d927..b6ab1daf78a5 100644 --- a/mmv1/templates/terraform/encoders/memorystore_instance.go.erb +++ b/mmv1/templates/terraform/encoders/memorystore_instance.go.erb @@ -8,20 +8,20 @@ for _, raw := range l { if raw == nil { continue } - original := raw.(map[string]interface{}) - transformed := make(map[string]interface{}) + desiredConnection := raw.(map[string]interface{}) + connectionReq := make(map[string]interface{}) - transformedProjectId := original["project_id"] - if val := reflect.ValueOf(transformedProjectId); val.IsValid() && !tpgresource.IsEmptyValue(val) { - transformed["projectId"] = transformedProjectId + projectId := desiredConnection["project_id"] + if val := reflect.ValueOf(projectId); val.IsValid() && !tpgresource.IsEmptyValue(val) { + connectionReq["projectId"] = projectId } - transformedNetwork := original["network"] - if val := reflect.ValueOf(transformedNetwork); val.IsValid() && !tpgresource.IsEmptyValue(val) { - transformed["network"] = transformedNetwork + network := desiredConnection["network"] + if val := reflect.ValueOf(network); val.IsValid() && !tpgresource.IsEmptyValue(val) { + connectionReq["network"] = network } - req = append(req, transformed) + req = append(req, connectionReq) } obj["pscAutoConnections"] = req return obj, nil From 3259768224acb9da1ef2c163f2e074f6e9d23538 Mon Sep 17 00:00:00 2001 From: himanikh Date: Fri, 6 Sep 2024 03:43:23 +0000 Subject: [PATCH 19/19] Addressing review comments --- .../memorystore_instance_basic.tf.erb | 26 ++-- .../examples/memorystore_instance_full.tf.erb | 38 ++--- ...emorystore_instance_persistence_aof.tf.erb | 22 +-- .../resource_memorystore_instance_test.go.erb | 141 +++++++++--------- 4 files changed, 112 insertions(+), 115 deletions(-) diff --git a/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb index fcbda24bc5bc..8d020bf4448a 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_basic.tf.erb @@ -1,44 +1,44 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta - instance_id = "<%= ctx[:vars]['instance_name'] %>" - shard_count = 3 + provider = google-beta + instance_id = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 desired_psc_auto_connections { - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } - location = "europe-west1" + location = "us-central1" deletion_protection_enabled = false depends_on = [ google_network_connectivity_service_connection_policy.default ] lifecycle { - prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + prevent_destroy = "<%= ctx[:vars]['prevent_destroy'] %>" } } resource "google_network_connectivity_service_connection_policy" "default" { - provider = google-beta - name = "<%= ctx[:vars]['policy_name'] %>" - location = "europe-west1" + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "us-central1" service_class = "gcp-memorystore" description = "my basic service connection policy" - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id psc_config { subnetworks = [google_compute_subnetwork.producer_subnet.id] } } resource "google_compute_subnetwork" "producer_subnet" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" - region = "europe-west1" + region = "us-central1" network = google_compute_network.producer_net.id } resource "google_compute_network" "producer_net" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" auto_create_subnetworks = false } diff --git a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb index 35b24fb34718..59cbc24c408a 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_full.tf.erb @@ -1,29 +1,29 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta - instance_id = "<%= ctx[:vars]['instance_name'] %>" - shard_count = 3 + provider = google-beta + instance_id = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 desired_psc_auto_connections { - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } - location = "us-central1" - replica_count = 2 - node_type = "SHARED_CORE_NANO" + location = "us-central1" + replica_count = 2 + node_type = "SHARED_CORE_NANO" transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED" - authorization_mode = "AUTH_DISABLED" + authorization_mode = "AUTH_DISABLED" engine_configs = { - maxmemory-policy = "volatile-ttl" + maxmemory-policy = "volatile-ttl" } zone_distribution_config { mode = "SINGLE_ZONE" zone = "us-central1-b" } - engine_version = "VALKEY_7_2" + engine_version = "VALKEY_7_2" deletion_protection_enabled = false persistence_config { mode = "RDB" rdb_config { - rdb_snapshot_period = "ONE_HOUR" + rdb_snapshot_period = "ONE_HOUR" rdb_snapshot_start_time = "2024-10-02T15:01:23Z" } } @@ -35,24 +35,24 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { ] lifecycle { - prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + prevent_destroy = "<%= ctx[:vars]['prevent_destroy'] %>" } } resource "google_network_connectivity_service_connection_policy" "default" { - provider = google-beta - name = "<%= ctx[:vars]['policy_name'] %>" - location = "us-central1" + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "us-central1" service_class = "gcp-memorystore" description = "my basic service connection policy" - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id psc_config { subnetworks = [google_compute_subnetwork.producer_subnet.id] } } resource "google_compute_subnetwork" "producer_subnet" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" region = "us-central1" @@ -60,11 +60,11 @@ resource "google_compute_subnetwork" "producer_subnet" { } resource "google_compute_network" "producer_net" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" auto_create_subnetworks = false } data "google_project" "project" { provider = google-beta -} +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb b/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb index 6282e4e1a0ce..6a1e9894c995 100644 --- a/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb +++ b/mmv1/templates/terraform/examples/memorystore_instance_persistence_aof.tf.erb @@ -1,9 +1,9 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta - instance_id = "<%= ctx[:vars]['instance_name'] %>" - shard_count = 3 + provider = google-beta + instance_id = "<%= ctx[:vars]['instance_name'] %>" + shard_count = 3 desired_psc_auto_connections { - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id project_id = data.google_project.project.project_id } location = "us-central1" @@ -18,24 +18,24 @@ resource "google_memorystore_instance" "<%= ctx[:primary_resource_id] %>" { ] deletion_protection_enabled = false lifecycle { - prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> + prevent_destroy = "<%= ctx[:vars]['prevent_destroy'] %>" } } resource "google_network_connectivity_service_connection_policy" "default" { - provider = google-beta - name = "<%= ctx[:vars]['policy_name'] %>" - location = "us-central1" + provider = google-beta + name = "<%= ctx[:vars]['policy_name'] %>" + location = "us-central1" service_class = "gcp-memorystore" description = "my basic service connection policy" - network = google_compute_network.producer_net.id + network = google_compute_network.producer_net.id psc_config { subnetworks = [google_compute_subnetwork.producer_subnet.id] } } resource "google_compute_subnetwork" "producer_subnet" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['subnet_name'] %>" ip_cidr_range = "10.0.0.248/29" region = "us-central1" @@ -43,7 +43,7 @@ resource "google_compute_subnetwork" "producer_subnet" { } resource "google_compute_network" "producer_net" { - provider = google-beta + provider = google-beta name = "<%= ctx[:vars]['network_name'] %>" auto_create_subnetworks = false } diff --git a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb index e0aa5e3e123d..5857a242c589 100644 --- a/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go.erb @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-provider-google/google/acctest" ) - // Validate that replica count is updated for the instance func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { t.Parallel() @@ -28,24 +27,23 @@ func TestAccMemorystoreInstance_updateReplicaCount(t *testing.T) { Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // update replica count to 2 Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, - { - // clean up the resource - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled:false}), + { + // clean up the resource + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, - }, }) } @@ -66,22 +64,22 @@ func TestAccMemorystoreInstance_updateShardCount(t *testing.T) { Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // update shard count to 5 Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // clean up the resource - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled:false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false}), }, }, }) @@ -101,49 +99,48 @@ func TestAccMemorystoreInstance_updateRedisConfigs(t *testing.T) { { // create cluster Config: createOrUpdateMemorystoreInstance(&InstanceParams{ - name: name, - shardCount: 3, + name: name, + shardCount: 3, zoneDistributionMode: "MULTI_ZONE", engineConfigs: map[string]string{ "maxmemory-policy": "volatile-ttl", }, - deletionProtectionEnabled: false}), + deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // add a new redis config key-value pair and update existing redis config Config: createOrUpdateMemorystoreInstance(&InstanceParams{ - name: name, - shardCount: 3, + name: name, + shardCount: 3, zoneDistributionMode: "MULTI_ZONE", engineConfigs: map[string]string{ "maxmemory-policy": "allkeys-lru", "maxmemory-clients": "90%", }, - deletionProtectionEnabled: false}), + deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // remove all redis configs Config: createOrUpdateMemorystoreInstance(&InstanceParams{ - name: name, - shardCount: 3, - zoneDistributionMode: "MULTI_ZONE", - engineConfigs: map[string]string{ + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", + engineConfigs: map[string]string{ "maxmemory-policy": "allkeys-lru", "maxmemory-clients": "90%", }, - deletionProtectionEnabled: false}), + deletionProtectionEnabled: false}), }, - }, }) } @@ -162,30 +159,30 @@ func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) { { // create cluster with deletion protection true Config: createOrUpdateMemorystoreInstance(&InstanceParams{ - name: name, - shardCount: 3, - zoneDistributionMode: "MULTI_ZONE", + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: true, - }), - }, + }), + }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // update cluster with deletion protection false Config: createOrUpdateMemorystoreInstance(&InstanceParams{ - name: name, - shardCount: 3, - zoneDistributionMode: "MULTI_ZONE", + name: name, + shardCount: 3, + zoneDistributionMode: "MULTI_ZONE", deletionProtectionEnabled: false, - }), - }, - { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + }), + }, + { + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, }, }) @@ -204,41 +201,41 @@ func TestAccMemorystoreInstance_updatePersistence(t *testing.T) { Steps: []resource.TestStep{ { // create instance with AOF enabled - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"AOF", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode: "AOF", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // update persitence to RDB - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE", persistenceMode: "RDB", deletionProtectionEnabled: false}), }, { - ResourceName: "google_memorystore_instance.test", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_memorystore_instance.test", + ImportState: true, + ImportStateVerify: true, }, { // clean up the resource - Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", persistenceMode:"RDB", deletionProtectionEnabled: false}), + Config: createOrUpdateMemorystoreInstance(&InstanceParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE", persistenceMode: "RDB", deletionProtectionEnabled: false}), }, }, }) } type InstanceParams struct { - name string - replicaCount int - shardCount int - preventDestroy bool - nodeType string - engineConfigs map[string]string - zoneDistributionMode string - zone string - deletionProtectionEnabled bool - persistenceMode string + name string + replicaCount int + shardCount int + preventDestroy bool + nodeType string + engineConfigs map[string]string + zoneDistributionMode string + zone string + deletionProtectionEnabled bool + persistenceMode string } func createOrUpdateMemorystoreInstance(params *InstanceParams) string {