Skip to content

Commit

Permalink
feat(bigtableadmin): update the API
Browse files Browse the repository at this point in the history
#### bigtableadmin:v2

The following keys were added:
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.description
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.flatPath
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.httpMethod
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.id
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameterOrder
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.name.description
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.name.location
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.name.pattern
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.name.required
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.name.type
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.updateMask.description
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.updateMask.format
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.updateMask.location
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.parameters.updateMask.type
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.path
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.request.$ref
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.response.$ref
- resources.projects.resources.instances.resources.clusters.methods.partialUpdateCluster.scopes

The following keys were changed:
- resources.projects.resources.instances.resources.clusters.methods.update.description
- resources.projects.resources.instances.resources.tables.methods.get.parameters.view.enumDescriptions
- resources.projects.resources.instances.resources.tables.methods.list.parameters.view.enumDescriptions
  • Loading branch information
yoshi-automation authored and bcoe committed May 3, 2021
1 parent d060bea commit 9159143
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 5 deletions.
47 changes: 43 additions & 4 deletions discovery/bigtableadmin-v2.json
Expand Up @@ -923,8 +923,47 @@
"https://www.googleapis.com/auth/cloud-platform.read-only"
]
},
"partialUpdateCluster": {
"description": "Partially updates a cluster within a project. This method is the preferred way to update a Cluster. ",
"flatPath": "v2/projects/{projectsId}/instances/{instancesId}/clusters/{clustersId}",
"httpMethod": "PATCH",
"id": "bigtableadmin.projects.instances.clusters.partialUpdateCluster",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.",
"location": "path",
"pattern": "^projects/[^/]+/instances/[^/]+/clusters/[^/]+$",
"required": true,
"type": "string"
},
"updateMask": {
"description": "Required. The subset of Cluster fields which should be replaced. Must be explicitly set.",
"format": "google-fieldmask",
"location": "query",
"type": "string"
}
},
"path": "v2/{+name}",
"request": {
"$ref": "Cluster"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/bigtable.admin",
"https://www.googleapis.com/auth/bigtable.admin.cluster",
"https://www.googleapis.com/auth/bigtable.admin.instance",
"https://www.googleapis.com/auth/cloud-bigtable.admin",
"https://www.googleapis.com/auth/cloud-bigtable.admin.cluster",
"https://www.googleapis.com/auth/cloud-platform"
]
},
"update": {
"description": "Updates a cluster within an instance.",
"description": "Updates a cluster within an instance. UpdateCluster is deprecated. Please use PartialUpdateCluster instead.",
"flatPath": "v2/projects/{projectsId}/instances/{instancesId}/clusters/{clustersId}",
"httpMethod": "PUT",
"id": "bigtableadmin.projects.instances.clusters.update",
Expand Down Expand Up @@ -1433,7 +1472,7 @@
"Only populates `name`.",
"Only populates `name` and fields related to the table's schema.",
"Only populates `name` and fields related to the table's replication state.",
"Only populates 'name' and fields related to the table's encryption state.",
"Only populates `name` and fields related to the table's encryption state.",
"Populates all fields."
],
"location": "query",
Expand Down Expand Up @@ -1527,7 +1566,7 @@
"Only populates `name`.",
"Only populates `name` and fields related to the table's schema.",
"Only populates `name` and fields related to the table's replication state.",
"Only populates 'name' and fields related to the table's encryption state.",
"Only populates `name` and fields related to the table's encryption state.",
"Populates all fields."
],
"location": "query",
Expand Down Expand Up @@ -1764,7 +1803,7 @@
}
}
},
"revision": "20210326",
"revision": "20210405",
"rootUrl": "https://bigtableadmin.googleapis.com/",
"schemas": {
"AppProfile": {
Expand Down
175 changes: 174 additions & 1 deletion src/apis/bigtableadmin/v2.ts
Expand Up @@ -4523,7 +4523,164 @@ export namespace bigtableadmin_v2 {
}

/**
* Updates a cluster within an instance.
* Partially updates a cluster within a project. This method is the preferred way to update a Cluster.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2');
*
* 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/bigtable.admin',
* 'https://www.googleapis.com/auth/bigtable.admin.cluster',
* 'https://www.googleapis.com/auth/bigtable.admin.instance',
* 'https://www.googleapis.com/auth/cloud-bigtable.admin',
* 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster',
* '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 bigtableadmin.projects.instances.clusters.partialUpdateCluster(
* {
* // The unique name of the cluster. Values are of the form `projects/{project\}/instances/{instance\}/clusters/a-z*`.
* name: 'projects/my-project/instances/my-instance/clusters/my-cluster',
* // Required. The subset of Cluster fields which should be replaced. Must be explicitly set.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "defaultStorageType": "my_defaultStorageType",
* // "encryptionConfig": {},
* // "location": "my_location",
* // "name": "my_name",
* // "serveNodes": 0,
* // "state": "my_state"
* // }
* },
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
partialUpdateCluster(
params: Params$Resource$Projects$Instances$Clusters$Partialupdatecluster,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
partialUpdateCluster(
params?: Params$Resource$Projects$Instances$Clusters$Partialupdatecluster,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
partialUpdateCluster(
params: Params$Resource$Projects$Instances$Clusters$Partialupdatecluster,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
partialUpdateCluster(
params: Params$Resource$Projects$Instances$Clusters$Partialupdatecluster,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
partialUpdateCluster(
params: Params$Resource$Projects$Instances$Clusters$Partialupdatecluster,
callback: BodyResponseCallback<Schema$Operation>
): void;
partialUpdateCluster(
callback: BodyResponseCallback<Schema$Operation>
): void;
partialUpdateCluster(
paramsOrCallback?:
| Params$Resource$Projects$Instances$Clusters$Partialupdatecluster
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Instances$Clusters$Partialupdatecluster;
let options = (optionsOrCallback || {}) as MethodOptions;

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

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

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

/**
* Updates a cluster within an instance. UpdateCluster is deprecated. Please use PartialUpdateCluster instead.
* @example
* ```js
* // Before running the sample:
Expand Down Expand Up @@ -4715,6 +4872,22 @@ export namespace bigtableadmin_v2 {
*/
parent?: string;
}
export interface Params$Resource$Projects$Instances$Clusters$Partialupdatecluster
extends StandardParameters {
/**
* The unique name of the cluster. Values are of the form `projects/{project\}/instances/{instance\}/clusters/a-z*`.
*/
name?: string;
/**
* Required. The subset of Cluster fields which should be replaced. Must be explicitly set.
*/
updateMask?: string;

/**
* Request body metadata
*/
requestBody?: Schema$Cluster;
}
export interface Params$Resource$Projects$Instances$Clusters$Update
extends StandardParameters {
/**
Expand Down

0 comments on commit 9159143

Please sign in to comment.