Skip to content

Commit

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

The following keys were added:
- resources.projects.resources.locations.resources.instances.methods.stop.description
- resources.projects.resources.locations.resources.instances.methods.stop.flatPath
- resources.projects.resources.locations.resources.instances.methods.stop.httpMethod
- resources.projects.resources.locations.resources.instances.methods.stop.id
- resources.projects.resources.locations.resources.instances.methods.stop.parameterOrder
- resources.projects.resources.locations.resources.instances.methods.stop.parameters.name.description
- resources.projects.resources.locations.resources.instances.methods.stop.parameters.name.location
- resources.projects.resources.locations.resources.instances.methods.stop.parameters.name.pattern
- resources.projects.resources.locations.resources.instances.methods.stop.parameters.name.required
- resources.projects.resources.locations.resources.instances.methods.stop.parameters.name.type
- resources.projects.resources.locations.resources.instances.methods.stop.path
- resources.projects.resources.locations.resources.instances.methods.stop.request.$ref
- resources.projects.resources.locations.resources.instances.methods.stop.response.$ref
- resources.projects.resources.locations.resources.instances.methods.stop.scopes
- schemas.Instance.properties.osImage.description
- schemas.Instance.properties.osImage.type
- schemas.StopInstanceRequest.description
- schemas.StopInstanceRequest.id
- schemas.StopInstanceRequest.type
- schemas.Volume.properties.emergencySizeGib.description
- schemas.Volume.properties.emergencySizeGib.format
- schemas.Volume.properties.emergencySizeGib.type

The following keys were changed:
- resources.projects.resources.locations.resources.instances.methods.patch.parameters.updateMask.description
- schemas.ProvisioningConfig.properties.state.enum
- schemas.ProvisioningConfig.properties.state.enumDescriptions
  • Loading branch information
yoshi-automation authored and sofisl committed May 6, 2022
1 parent 0095b13 commit 04b0ae4
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 7 deletions.
59 changes: 55 additions & 4 deletions discovery/baremetalsolution-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"type": "string"
},
"updateMask": {
"description": "The list of fields to update. The only currently supported fields are: `labels`",
"description": "The list of fields to update. The only currently supported fields are: `labels` `hyperthreading_enabled`",
"format": "google-fieldmask",
"location": "query",
"type": "string"
Expand Down Expand Up @@ -362,6 +362,34 @@
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"stop": {
"description": "Stop a running server.",
"flatPath": "v2/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:stop",
"httpMethod": "POST",
"id": "baremetalsolution.projects.locations.instances.stop",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Name of the resource.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v2/{+name}:stop",
"request": {
"$ref": "StopInstanceRequest"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
},
Expand Down Expand Up @@ -1251,7 +1279,7 @@
}
}
},
"revision": "20220405",
"revision": "20220418",
"rootUrl": "https://baremetalsolution.googleapis.com/",
"schemas": {
"AllowedClient": {
Expand Down Expand Up @@ -1371,6 +1399,10 @@
},
"type": "array"
},
"osImage": {
"description": "The OS image currently installed on the server.",
"type": "string"
},
"state": {
"description": "The state of the server.",
"enum": [
Expand Down Expand Up @@ -2269,12 +2301,20 @@
"enum": [
"STATE_UNSPECIFIED",
"DRAFT",
"SUBMITTED"
"SUBMITTED",
"PROVISIONING",
"PROVISIONED",
"VALIDATED",
"CANCELLED"
],
"enumDescriptions": [
"State wasn't specified.",
"ProvisioningConfig is a draft and can be freely modified.",
"ProvisioningConfig was already submitted and cannot be modified."
"ProvisioningConfig was already submitted and cannot be modified.",
"ProvisioningConfig was in the provisioning state. Initially this state comes from the work order table in big query when SNOW is used. Later this field can be set by the work order API.",
"ProvisioningConfig was provisioned, meaning the resources exist.",
"ProvisioningConfig was validated. A validation tool will be run to set this state.",
"ProvisioningConfig was canceled."
],
"readOnly": true,
"type": "string"
Expand Down Expand Up @@ -2535,6 +2575,12 @@
},
"type": "object"
},
"StopInstanceRequest": {
"description": "Message requesting to stop a server.",
"id": "StopInstanceRequest",
"properties": {},
"type": "object"
},
"SubmitProvisioningConfigRequest": {
"description": "Request for SubmitProvisioningConfig.",
"id": "SubmitProvisioningConfigRequest",
Expand Down Expand Up @@ -2631,6 +2677,11 @@
"format": "int64",
"type": "string"
},
"emergencySizeGib": {
"description": "Additional emergency size that was requested for this Volume, in GiB. current_size_gib includes this value.",
"format": "int64",
"type": "string"
},
"id": {
"description": "An identifier for the `Volume`, generated by the backend.",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/apis/baremetalsolution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# baremetalsolution

> Provides ways to manage Bare Metal Solution hardware installed in a regional extension located near a Google Cloud data center.
> Bare Metal Solution provides hardware to run specialized workloads with low latency on Google Cloud.
## Installation

Expand Down
169 changes: 167 additions & 2 deletions src/apis/baremetalsolution/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export namespace baremetalsolution_v2 {
* List of networks associated with this server.
*/
networks?: Schema$Network[];
/**
* The OS image currently installed on the server.
*/
osImage?: string | null;
/**
* The state of the server.
*/
Expand Down Expand Up @@ -993,6 +997,10 @@ export namespace baremetalsolution_v2 {
*/
message?: string | null;
}
/**
* Message requesting to stop a server.
*/
export interface Schema$StopInstanceRequest {}
/**
* Request for SubmitProvisioningConfig.
*/
Expand Down Expand Up @@ -1044,6 +1052,10 @@ export namespace baremetalsolution_v2 {
* The current size of this storage volume, in GiB, including space reserved for snapshots. This size might be different than the requested size if the storage volume has been configured with auto grow or auto shrink.
*/
currentSizeGib?: string | null;
/**
* Additional emergency size that was requested for this Volume, in GiB. current_size_gib includes this value.
*/
emergencySizeGib?: string | null;
/**
* An identifier for the `Volume`, generated by the backend.
*/
Expand Down Expand Up @@ -1733,6 +1745,7 @@ export namespace baremetalsolution_v2 {
* // "machineType": "my_machineType",
* // "name": "my_name",
* // "networks": [],
* // "osImage": "my_osImage",
* // "state": "my_state",
* // "updateTime": "my_updateTime"
* // }
Expand Down Expand Up @@ -1999,7 +2012,7 @@ export namespace baremetalsolution_v2 {
* const res = await baremetalsolution.projects.locations.instances.patch({
* // Output only. The resource name of this `Instance`. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: `projects/{project\}/locations/{location\}/instances/{instance\}`
* name: 'projects/my-project/locations/my-location/instances/my-instance',
* // The list of fields to update. The only currently supported fields are: `labels`
* // The list of fields to update. The only currently supported fields are: `labels` `hyperthreading_enabled`
* updateMask: 'placeholder-value',
*
* // Request body metadata
Expand All @@ -2015,6 +2028,7 @@ export namespace baremetalsolution_v2 {
* // "machineType": "my_machineType",
* // "name": "my_name",
* // "networks": [],
* // "osImage": "my_osImage",
* // "state": "my_state",
* // "updateTime": "my_updateTime"
* // }
Expand Down Expand Up @@ -2394,6 +2408,143 @@ export namespace baremetalsolution_v2 {
return createAPIRequest<Schema$Operation>(parameters);
}
}

/**
* Stop a running server.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/baremetalsolution.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 baremetalsolution = google.baremetalsolution('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/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 baremetalsolution.projects.locations.instances.stop({
* // Required. Name of the resource.
* name: 'projects/my-project/locations/my-location/instances/my-instance',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {}
* },
* });
* 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.
*/
stop(
params: Params$Resource$Projects$Locations$Instances$Stop,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
stop(
params?: Params$Resource$Projects$Locations$Instances$Stop,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
stop(
params: Params$Resource$Projects$Locations$Instances$Stop,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
stop(
params: Params$Resource$Projects$Locations$Instances$Stop,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
stop(
params: Params$Resource$Projects$Locations$Instances$Stop,
callback: BodyResponseCallback<Schema$Operation>
): void;
stop(callback: BodyResponseCallback<Schema$Operation>): void;
stop(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Instances$Stop
| 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$Locations$Instances$Stop;
let options = (optionsOrCallback || {}) as MethodOptions;

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

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

const rootUrl =
options.rootUrl || 'https://baremetalsolution.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v2/{+name}:stop').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
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);
}
}
}

export interface Params$Resource$Projects$Locations$Instances$Get
Expand Down Expand Up @@ -2429,7 +2580,7 @@ export namespace baremetalsolution_v2 {
*/
name?: string;
/**
* The list of fields to update. The only currently supported fields are: `labels`
* The list of fields to update. The only currently supported fields are: `labels` `hyperthreading_enabled`
*/
updateMask?: string;

Expand Down Expand Up @@ -2462,6 +2613,18 @@ export namespace baremetalsolution_v2 {
*/
requestBody?: Schema$StartInstanceRequest;
}
export interface Params$Resource$Projects$Locations$Instances$Stop
extends StandardParameters {
/**
* Required. Name of the resource.
*/
name?: string;

/**
* Request body metadata
*/
requestBody?: Schema$StopInstanceRequest;
}

export class Resource$Projects$Locations$Networks {
context: APIRequestContext;
Expand Down Expand Up @@ -5259,6 +5422,7 @@ export namespace baremetalsolution_v2 {
* // {
* // "autoGrownSizeGib": "my_autoGrownSizeGib",
* // "currentSizeGib": "my_currentSizeGib",
* // "emergencySizeGib": "my_emergencySizeGib",
* // "id": "my_id",
* // "labels": {},
* // "name": "my_name",
Expand Down Expand Up @@ -5541,6 +5705,7 @@ export namespace baremetalsolution_v2 {
* // {
* // "autoGrownSizeGib": "my_autoGrownSizeGib",
* // "currentSizeGib": "my_currentSizeGib",
* // "emergencySizeGib": "my_emergencySizeGib",
* // "id": "my_id",
* // "labels": {},
* // "name": "my_name",
Expand Down

0 comments on commit 04b0ae4

Please sign in to comment.