Skip to content

Commit

Permalink
feat(redis): update the API
Browse files Browse the repository at this point in the history
#### redis:v1
The following keys were added:
- resources.projects.resources.locations.resources.instances.methods.getAuthString.description
- resources.projects.resources.locations.resources.instances.methods.getAuthString.flatPath
- resources.projects.resources.locations.resources.instances.methods.getAuthString.httpMethod
- resources.projects.resources.locations.resources.instances.methods.getAuthString.id
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameterOrder
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameters.name.description
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameters.name.location
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameters.name.pattern
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameters.name.required
- resources.projects.resources.locations.resources.instances.methods.getAuthString.parameters.name.type
- resources.projects.resources.locations.resources.instances.methods.getAuthString.path
- resources.projects.resources.locations.resources.instances.methods.getAuthString.response.$ref
- resources.projects.resources.locations.resources.instances.methods.getAuthString.scopes
- schemas.Instance.properties.authEnabled.description
- schemas.Instance.properties.authEnabled.type
- schemas.InstanceAuthString.description
- schemas.InstanceAuthString.id
- schemas.InstanceAuthString.properties.authString.description
- schemas.InstanceAuthString.properties.authString.type
- schemas.InstanceAuthString.type
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Nov 9, 2020
1 parent 4660be5 commit 342b570
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 1 deletion.
42 changes: 41 additions & 1 deletion discovery/redis-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,31 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"getAuthString": {
"description": "Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}/authString",
"httpMethod": "GET",
"id": "redis.projects.locations.instances.getAuthString",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}/authString",
"response": {
"$ref": "InstanceAuthString"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"import": {
"description": "Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:import",
Expand Down Expand Up @@ -571,7 +596,7 @@
}
}
},
"revision": "20200928",
"revision": "20201104",
"rootUrl": "https://redis.googleapis.com/",
"schemas": {
"Empty": {
Expand Down Expand Up @@ -722,6 +747,10 @@
"description": "Optional. Only applicable to STANDARD_HA tier which protects the instance against zonal failures by provisioning it across two zones. If provided, it must be a different zone from the one provided in location_id.",
"type": "string"
},
"authEnabled": {
"description": "Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If set to \"true\" AUTH is enabled on the instance. Default value is \"false\" meaning AUTH is disabled.",
"type": "boolean"
},
"authorizedNetwork": {
"description": "Optional. The full name of the Google Compute Engine [network](https://cloud.google.com/vpc/docs/vpc) to which the instance is connected. If left unspecified, the `default` network will be used.",
"type": "string"
Expand Down Expand Up @@ -855,6 +884,17 @@
},
"type": "object"
},
"InstanceAuthString": {
"description": "Instance AUTH string details.",
"id": "InstanceAuthString",
"properties": {
"authString": {
"description": "AUTH string set on the instance.",
"type": "string"
}
},
"type": "object"
},
"ListInstancesResponse": {
"description": "Response for ListInstances.",
"id": "ListInstancesResponse",
Expand Down
157 changes: 157 additions & 0 deletions src/apis/redis/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ export namespace redis_v1 {
* Optional. Only applicable to STANDARD_HA tier which protects the instance against zonal failures by provisioning it across two zones. If provided, it must be a different zone from the one provided in location_id.
*/
alternativeLocationId?: string | null;
/**
* Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If set to "true" AUTH is enabled on the instance. Default value is "false" meaning AUTH is disabled.
*/
authEnabled?: boolean | null;
/**
* Optional. The full name of the Google Compute Engine [network](https://cloud.google.com/vpc/docs/vpc) to which the instance is connected. If left unspecified, the `default` network will be used.
*/
Expand Down Expand Up @@ -310,6 +314,15 @@ export namespace redis_v1 {
*/
tier?: string | null;
}
/**
* Instance AUTH string details.
*/
export interface Schema$InstanceAuthString {
/**
* AUTH string set on the instance.
*/
authString?: string | null;
}
/**
* Response for ListInstances.
*/
Expand Down Expand Up @@ -802,6 +815,7 @@ export namespace redis_v1 {
* // request body parameters
* // {
* // "alternativeLocationId": "my_alternativeLocationId",
* // "authEnabled": false,
* // "authorizedNetwork": "my_authorizedNetwork",
* // "connectMode": "my_connectMode",
* // "createTime": "my_createTime",
Expand Down Expand Up @@ -1370,6 +1384,7 @@ export namespace redis_v1 {
* // Example response
* // {
* // "alternativeLocationId": "my_alternativeLocationId",
* // "authEnabled": false,
* // "authorizedNetwork": "my_authorizedNetwork",
* // "connectMode": "my_connectMode",
* // "createTime": "my_createTime",
Expand Down Expand Up @@ -1479,6 +1494,140 @@ export namespace redis_v1 {
}
}

/**
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/redis.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const redis = google.redis('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await redis.projects.locations.instances.getAuthString({
* // Required. Redis instance resource name using the form: `projects/{project_id\}/locations/{location_id\}/instances/{instance_id\}` where `location_id` refers to a GCP region.
* name: 'projects/my-project/locations/my-location/instances/my-instance',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "authString": "my_authString"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
getAuthString(
params: Params$Resource$Projects$Locations$Instances$Getauthstring,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getAuthString(
params?: Params$Resource$Projects$Locations$Instances$Getauthstring,
options?: MethodOptions
): GaxiosPromise<Schema$InstanceAuthString>;
getAuthString(
params: Params$Resource$Projects$Locations$Instances$Getauthstring,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getAuthString(
params: Params$Resource$Projects$Locations$Instances$Getauthstring,
options: MethodOptions | BodyResponseCallback<Schema$InstanceAuthString>,
callback: BodyResponseCallback<Schema$InstanceAuthString>
): void;
getAuthString(
params: Params$Resource$Projects$Locations$Instances$Getauthstring,
callback: BodyResponseCallback<Schema$InstanceAuthString>
): void;
getAuthString(
callback: BodyResponseCallback<Schema$InstanceAuthString>
): void;
getAuthString(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Instances$Getauthstring
| BodyResponseCallback<Schema$InstanceAuthString>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$InstanceAuthString>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$InstanceAuthString>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$InstanceAuthString>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Instances$Getauthstring;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Instances$Getauthstring;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://redis.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}/authString').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$InstanceAuthString>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$InstanceAuthString>(parameters);
}
}

/**
* Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
* @example
Expand Down Expand Up @@ -1794,6 +1943,7 @@ export namespace redis_v1 {
* // request body parameters
* // {
* // "alternativeLocationId": "my_alternativeLocationId",
* // "authEnabled": false,
* // "authorizedNetwork": "my_authorizedNetwork",
* // "connectMode": "my_connectMode",
* // "createTime": "my_createTime",
Expand Down Expand Up @@ -2111,6 +2261,13 @@ export namespace redis_v1 {
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Instances$Getauthstring
extends StandardParameters {
/**
* Required. Redis instance resource name using the form: `projects/{project_id\}/locations/{location_id\}/instances/{instance_id\}` where `location_id` refers to a GCP region.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Instances$Import
extends StandardParameters {
/**
Expand Down

0 comments on commit 342b570

Please sign in to comment.