Class v1.InstancesClient (3.1.2)

The Instances API. v1

Package

@google-cloud/compute

Constructors

(constructor)(opts)

constructor(opts?:ClientOptions);

Construct an instance of InstancesClient.

Parameter
NameDescription
optsClientOptions

Properties

apiEndpoint

staticgetapiEndpoint():string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth:gax.GoogleAuth;

descriptors

descriptors:Descriptors;

innerApiCalls

innerApiCalls:{[name:string]:Function;};

instancesStub

instancesStub?:Promise<{[name:string]:Function;}>;

port

staticgetport():number;

The port for this API service.

scopes

staticgetscopes():string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

staticgetservicePath():string;

The DNS address for this API service.

warn

warn:(code:string,message:string,warnType?:string)=>void;

Methods

addAccessConfig(request, options)

addAccessConfig(request?:protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Adds an access config to an instance's network interface.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const accessConfigResource = {}/**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The name of the network interface to add to this instance.   */// const networkInterface = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallAddAccessConfig(){// Construct requestconstrequest={accessConfigResource,instance,networkInterface,project,zone,};// Run requestconstresponse=awaitcomputeClient.addAccessConfig(request);console.log(response);}callAddAccessConfig();

addAccessConfig(request, options, callback)

addAccessConfig(request:protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

addAccessConfig(request, callback)

addAccessConfig(request:protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

addResourcePolicies(request, options)

addResourcePolicies(request?:protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesAddResourcePoliciesRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallAddResourcePolicies(){// Construct requestconstrequest={instance,instancesAddResourcePoliciesRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.addResourcePolicies(request);console.log(response);}callAddResourcePolicies();

addResourcePolicies(request, options, callback)

addResourcePolicies(request:protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

addResourcePolicies(request, callback)

addResourcePolicies(request:protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

aggregatedListAsync(request, options)

aggregatedListAsync(request?:protos.google.cloud.compute.v1.IAggregatedListInstancesRequest,options?:CallOptions):AsyncIterable<[string,protos.google.cloud.compute.v1.IInstancesScopedList]>;

Equivalent toaggregatedList, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAggregatedListInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
AsyncIterable<[ string, protos.google.cloud.compute.v1.IInstancesScopedList ]>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing as tuple [string, [InstancesScopedList]]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```   */// const filter = 'abc123'/**   *  Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.   */// const includeAllScopes = true/**   *  The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)   */// const maxResults = 1234/**   *  Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.   */// const orderBy = 'abc123'/**   *  Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.   */// const pageToken = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.   */// const returnPartialSuccess = true// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallAggregatedList(){// Construct requestconstrequest={project,};// Run requestconstiterable=awaitcomputeClient.aggregatedListAsync(request);forawait(const[key,value]ofiterable){console.log(response);}}callAggregatedList();

attachDisk(request, options)

attachDisk(request?:protos.google.cloud.compute.v1.IAttachDiskInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAttachDiskInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const attachedDiskResource = {}/**   *  Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.   */// const forceAttach = true/**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallAttachDisk(){// Construct requestconstrequest={attachedDiskResource,instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.attachDisk(request);console.log(response);}callAttachDisk();

attachDisk(request, options, callback)

attachDisk(request:protos.google.cloud.compute.v1.IAttachDiskInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAttachDiskInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAttachDiskInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

attachDisk(request, callback)

attachDisk(request:protos.google.cloud.compute.v1.IAttachDiskInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IAttachDiskInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IAttachDiskInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

bulkInsert(request, options)

bulkInsert(request?:protos.google.cloud.compute.v1.IBulkInsertInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Creates multiple instances. Count specifies the number of instances to create.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IBulkInsertInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const bulkInsertInstanceResourceResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallBulkInsert(){// Construct requestconstrequest={bulkInsertInstanceResourceResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.bulkInsert(request);console.log(response);}callBulkInsert();

bulkInsert(request, options, callback)

bulkInsert(request:protos.google.cloud.compute.v1.IBulkInsertInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IBulkInsertInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IBulkInsertInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

bulkInsert(request, callback)

bulkInsert(request:protos.google.cloud.compute.v1.IBulkInsertInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IBulkInsertInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IBulkInsertInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

close()

close():Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

delete(request, options)

delete(request?:protos.google.cloud.compute.v1.IDeleteInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Deletes the specified Instance resource. For more information, see Deleting an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to delete.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallDelete(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.delete(request);console.log(response);}callDelete();

delete(request, options, callback)

delete(request:protos.google.cloud.compute.v1.IDeleteInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDeleteInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

delete(request, callback)

delete(request:protos.google.cloud.compute.v1.IDeleteInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDeleteInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteAccessConfig(request, options)

deleteAccessConfig(request?:protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Deletes an access config from an instance's network interface.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The name of the access config to delete.   */// const accessConfig = 'abc123'/**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The name of the network interface.   */// const networkInterface = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallDeleteAccessConfig(){// Construct requestconstrequest={accessConfig,instance,networkInterface,project,zone,};// Run requestconstresponse=awaitcomputeClient.deleteAccessConfig(request);console.log(response);}callDeleteAccessConfig();

deleteAccessConfig(request, options, callback)

deleteAccessConfig(request:protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteAccessConfig(request, callback)

deleteAccessConfig(request:protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

detachDisk(request, options)

detachDisk(request?:protos.google.cloud.compute.v1.IDetachDiskInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Detaches a disk from an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDetachDiskInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.   */// const deviceName = 'abc123'/**   *  Instance name for this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallDetachDisk(){// Construct requestconstrequest={deviceName,instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.detachDisk(request);console.log(response);}callDetachDisk();

detachDisk(request, options, callback)

detachDisk(request:protos.google.cloud.compute.v1.IDetachDiskInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDetachDiskInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDetachDiskInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

detachDisk(request, callback)

detachDisk(request:protos.google.cloud.compute.v1.IDetachDiskInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IDetachDiskInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IDetachDiskInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

get(request, options)

get(request?:protos.google.cloud.compute.v1.IGetInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IInstance,protos.google.cloud.compute.v1.IGetInstanceRequest|undefined,{}|undefined]>;

Returns the specified Instance resource. Gets a list of available instances by making a list() request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IInstance, protos.google.cloud.compute.v1.IGetInstanceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Instance]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to return.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGet(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.get(request);console.log(response);}callGet();

get(request, options, callback)

get(request:protos.google.cloud.compute.v1.IGetInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IInstance,protos.google.cloud.compute.v1.IGetInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IInstance, protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

get(request, callback)

get(request:protos.google.cloud.compute.v1.IGetInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IInstance,protos.google.cloud.compute.v1.IGetInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IInstance, protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getEffectiveFirewalls(request, options)

getEffectiveFirewalls(request?:protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse,(protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest|undefined),{}|undefined]>;

Returns effective firewalls applied to an interface of the instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, (protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [InstancesGetEffectiveFirewallsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The name of the network interface to get the effective firewalls.   */// const networkInterface = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetEffectiveFirewalls(){// Construct requestconstrequest={instance,networkInterface,project,zone,};// Run requestconstresponse=awaitcomputeClient.getEffectiveFirewalls(request);console.log(response);}callGetEffectiveFirewalls();

getEffectiveFirewalls(request, options, callback)

getEffectiveFirewalls(request:protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse,protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getEffectiveFirewalls(request, callback)

getEffectiveFirewalls(request:protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse,protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getGuestAttributes(request, options)

getGuestAttributes(request?:protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IGuestAttributes,(protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest|undefined),{}|undefined]>;

Returns the specified guest attributes entry.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IGuestAttributes, (protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [GuestAttributes]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Specifies the guest attributes path to be queried.   */// const queryPath = 'abc123'/**   *  Specifies the key for the guest attributes entry.   */// const variableKey = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetGuestAttributes(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.getGuestAttributes(request);console.log(response);}callGetGuestAttributes();

getGuestAttributes(request, options, callback)

getGuestAttributes(request:protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IGuestAttributes,protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IGuestAttributes, protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getGuestAttributes(request, callback)

getGuestAttributes(request:protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IGuestAttributes,protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IGuestAttributes, protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options)

getIamPolicy(request?:protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest|undefined,{}|undefined]>;

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Requested IAM Policy version.   */// const optionsRequestedPolicyVersion = 1234/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Name or id of the resource for this request.   */// const resource = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetIamPolicy(){// Construct requestconstrequest={project,resource,zone,};// Run requestconstresponse=awaitcomputeClient.getIamPolicy(request);console.log(response);}callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request:protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, callback)

getIamPolicy(request:protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId():Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback:Callback<string,undefined,undefined>):void;
Parameter
NameDescription
callbackCallback<string, undefined, undefined>
Returns
TypeDescription
void

getScreenshot(request, options)

getScreenshot(request?:protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IScreenshot,protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest|undefined,{}|undefined]>;

Returns the screenshot from the specified instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetScreenshotInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IScreenshot, protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Screenshot]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetScreenshot(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.getScreenshot(request);console.log(response);}callGetScreenshot();

getScreenshot(request, options, callback)

getScreenshot(request:protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IScreenshot,protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetScreenshotInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IScreenshot, protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getScreenshot(request, callback)

getScreenshot(request:protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IScreenshot,protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetScreenshotInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IScreenshot, protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSerialPortOutput(request, options)

getSerialPortOutput(request?:protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.ISerialPortOutput,(protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest|undefined),{}|undefined]>;

Returns the last 1 MB of serial port output from the specified instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.ISerialPortOutput, (protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [SerialPortOutput]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance for this request.   */// const instance = 'abc123'/**   *  Specifies which COM or serial port to retrieve data from.   */// const port = 1234/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.   */// const start = 1234/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetSerialPortOutput(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.getSerialPortOutput(request);console.log(response);}callGetSerialPortOutput();

getSerialPortOutput(request, options, callback)

getSerialPortOutput(request:protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.ISerialPortOutput,protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.ISerialPortOutput, protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSerialPortOutput(request, callback)

getSerialPortOutput(request:protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.ISerialPortOutput,protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.ISerialPortOutput, protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getShieldedInstanceIdentity(request, options)

getShieldedInstanceIdentity(request?:protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IShieldedInstanceIdentity,(protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest|undefined),{}|undefined]>;

Returns the Shielded Instance Identity of an instance

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IShieldedInstanceIdentity, (protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [ShieldedInstanceIdentity]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name or id of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallGetShieldedInstanceIdentity(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.getShieldedInstanceIdentity(request);console.log(response);}callGetShieldedInstanceIdentity();

getShieldedInstanceIdentity(request, options, callback)

getShieldedInstanceIdentity(request:protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IShieldedInstanceIdentity,protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IShieldedInstanceIdentity, protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getShieldedInstanceIdentity(request, callback)

getShieldedInstanceIdentity(request:protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IShieldedInstanceIdentity,protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IShieldedInstanceIdentity, protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize():Promise<{[name:string]:Function;}>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]:Function; }>

{Promise} A promise that resolves to an authenticated service stub.

insert(request, options)

insert(request?:protos.google.cloud.compute.v1.IInsertInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Creates an instance resource in the specified project using the data included in the request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IInsertInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const instanceResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate   */// const sourceInstanceTemplate = 'abc123'/**   *  Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage   */// const sourceMachineImage = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallInsert(){// Construct requestconstrequest={instanceResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.insert(request);console.log(response);}callInsert();

insert(request, options, callback)

insert(request:protos.google.cloud.compute.v1.IInsertInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IInsertInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IInsertInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IInsertInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

insert(request, callback)

insert(request:protos.google.cloud.compute.v1.IInsertInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IInsertInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IInsertInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IInsertInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

list(request, options)

list(request?:protos.google.cloud.compute.v1.IListInstancesRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IInstance[],protos.google.cloud.compute.v1.IListInstancesRequest|null,protos.google.cloud.compute.v1.IInstanceList]>;

Retrieves the list of instances contained within the specified zone.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IInstance[], protos.google.cloud.compute.v1.IListInstancesRequest | null, protos.google.cloud.compute.v1.IInstanceList ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Instance]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend usinglistAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

list(request, options, callback)

list(request:protos.google.cloud.compute.v1.IListInstancesRequest,options:CallOptions,callback:PaginationCallback<protos.google.cloud.compute.v1.IListInstancesRequest,protos.google.cloud.compute.v1.IInstanceList|null|undefined,protos.google.cloud.compute.v1.IInstance>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListInstancesRequest
optionsCallOptions
callbackPaginationCallback<protos.google.cloud.compute.v1.IListInstancesRequest, protos.google.cloud.compute.v1.IInstanceList | null | undefined, protos.google.cloud.compute.v1.IInstance>
Returns
TypeDescription
void

list(request, callback)

list(request:protos.google.cloud.compute.v1.IListInstancesRequest,callback:PaginationCallback<protos.google.cloud.compute.v1.IListInstancesRequest,protos.google.cloud.compute.v1.IInstanceList|null|undefined,protos.google.cloud.compute.v1.IInstance>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListInstancesRequest
callbackPaginationCallback<protos.google.cloud.compute.v1.IListInstancesRequest, protos.google.cloud.compute.v1.IInstanceList | null | undefined, protos.google.cloud.compute.v1.IInstance>
Returns
TypeDescription
void

listAsync(request, options)

listAsync(request?:protos.google.cloud.compute.v1.IListInstancesRequest,options?:CallOptions):AsyncIterable<protos.google.cloud.compute.v1.IInstance>;

Equivalent tolist, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.compute.v1.IInstance>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Instance]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```   */// const filter = 'abc123'/**   *  The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)   */// const maxResults = 1234/**   *  Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.   */// const orderBy = 'abc123'/**   *  Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.   */// const pageToken = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.   */// const returnPartialSuccess = true/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallList(){// Construct requestconstrequest={project,zone,};// Run requestconstiterable=awaitcomputeClient.listAsync(request);forawait(constresponseofiterable){console.log(response);}}callList();

listReferrers(request, options)

listReferrers(request?:protos.google.cloud.compute.v1.IListReferrersInstancesRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IReference[],protos.google.cloud.compute.v1.IListReferrersInstancesRequest|null,protos.google.cloud.compute.v1.IInstanceListReferrers]>;

Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListReferrersInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IReference[], protos.google.cloud.compute.v1.IListReferrersInstancesRequest | null, protos.google.cloud.compute.v1.IInstanceListReferrers ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Reference]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend usinglistReferrersAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listReferrers(request, options, callback)

listReferrers(request:protos.google.cloud.compute.v1.IListReferrersInstancesRequest,options:CallOptions,callback:PaginationCallback<protos.google.cloud.compute.v1.IListReferrersInstancesRequest,protos.google.cloud.compute.v1.IInstanceListReferrers|null|undefined,protos.google.cloud.compute.v1.IReference>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListReferrersInstancesRequest
optionsCallOptions
callbackPaginationCallback<protos.google.cloud.compute.v1.IListReferrersInstancesRequest, protos.google.cloud.compute.v1.IInstanceListReferrers | null | undefined, protos.google.cloud.compute.v1.IReference>
Returns
TypeDescription
void

listReferrers(request, callback)

listReferrers(request:protos.google.cloud.compute.v1.IListReferrersInstancesRequest,callback:PaginationCallback<protos.google.cloud.compute.v1.IListReferrersInstancesRequest,protos.google.cloud.compute.v1.IInstanceListReferrers|null|undefined,protos.google.cloud.compute.v1.IReference>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListReferrersInstancesRequest
callbackPaginationCallback<protos.google.cloud.compute.v1.IListReferrersInstancesRequest, protos.google.cloud.compute.v1.IInstanceListReferrers | null | undefined, protos.google.cloud.compute.v1.IReference>
Returns
TypeDescription
void

listReferrersAsync(request, options)

listReferrersAsync(request?:protos.google.cloud.compute.v1.IListReferrersInstancesRequest,options?:CallOptions):AsyncIterable<protos.google.cloud.compute.v1.IReference>;

Equivalent tolistReferrers, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListReferrersInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.compute.v1.IReference>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Reference]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```   */// const filter = 'abc123'/**   *  Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.   */// const instance = 'abc123'/**   *  The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)   */// const maxResults = 1234/**   *  Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.   */// const orderBy = 'abc123'/**   *  Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.   */// const pageToken = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.   */// const returnPartialSuccess = true/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallListReferrers(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstiterable=awaitcomputeClient.listReferrersAsync(request);forawait(constresponseofiterable){console.log(response);}}callListReferrers();

listReferrersStream(request, options)

listReferrersStream(request?:protos.google.cloud.compute.v1.IListReferrersInstancesRequest,options?:CallOptions):Transform;

Equivalent tomethod.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListReferrersInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Reference] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend usinglistReferrersAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listStream(request, options)

listStream(request?:protos.google.cloud.compute.v1.IListInstancesRequest,options?:CallOptions):Transform;

Equivalent tomethod.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IListInstancesRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Instance] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend usinglistAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

removeResourcePolicies(request, options)

removeResourcePolicies(request?:protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Removes resource policies from an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesRemoveResourcePoliciesRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallRemoveResourcePolicies(){// Construct requestconstrequest={instance,instancesRemoveResourcePoliciesRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.removeResourcePolicies(request);console.log(response);}callRemoveResourcePolicies();

removeResourcePolicies(request, options, callback)

removeResourcePolicies(request:protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

removeResourcePolicies(request, callback)

removeResourcePolicies(request:protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

reset(request, options)

reset(request?:protos.google.cloud.compute.v1.IResetInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResetInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallReset(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.reset(request);console.log(response);}callReset();

reset(request, options, callback)

reset(request:protos.google.cloud.compute.v1.IResetInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IResetInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResetInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IResetInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

reset(request, callback)

reset(request:protos.google.cloud.compute.v1.IResetInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IResetInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResetInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IResetInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

resume(request, options)

resume(request?:protos.google.cloud.compute.v1.IResumeInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Resumes an instance that was suspended using the instances().suspend method.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResumeInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to resume.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallResume(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.resume(request);console.log(response);}callResume();

resume(request, options, callback)

resume(request:protos.google.cloud.compute.v1.IResumeInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IResumeInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResumeInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IResumeInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

resume(request, callback)

resume(request:protos.google.cloud.compute.v1.IResumeInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IResumeInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IResumeInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IResumeInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

sendDiagnosticInterrupt(request, options)

sendDiagnosticInterrupt(request?:protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse,(protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest|undefined),{}|undefined]>;

Sends diagnostic interrupt to the instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse, (protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [SendDiagnosticInterruptInstanceResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSendDiagnosticInterrupt(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.sendDiagnosticInterrupt(request);console.log(response);}callSendDiagnosticInterrupt();

sendDiagnosticInterrupt(request, options, callback)

sendDiagnosticInterrupt(request:protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse,protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse, protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

sendDiagnosticInterrupt(request, callback)

sendDiagnosticInterrupt(request:protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse,protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceResponse, protos.google.cloud.compute.v1.ISendDiagnosticInterruptInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setDeletionProtection(request, options)

setDeletionProtection(request?:protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets deletion protection on the instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Whether the resource should be protected against deletion.   */// const deletionProtection = true/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  Name or id of the resource for this request.   */// const resource = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetDeletionProtection(){// Construct requestconstrequest={project,resource,zone,};// Run requestconstresponse=awaitcomputeClient.setDeletionProtection(request);console.log(response);}callSetDeletionProtection();

setDeletionProtection(request, options, callback)

setDeletionProtection(request:protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setDeletionProtection(request, callback)

setDeletionProtection(request:protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setDiskAutoDelete(request, options)

setDiskAutoDelete(request?:protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets the auto-delete flag for a disk attached to an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Whether to auto-delete the disk when the instance is deleted.   */// const autoDelete = true/**   *  The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.   */// const deviceName = 'abc123'/**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetDiskAutoDelete(){// Construct requestconstrequest={autoDelete,deviceName,instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.setDiskAutoDelete(request);console.log(response);}callSetDiskAutoDelete();

setDiskAutoDelete(request, options, callback)

setDiskAutoDelete(request:protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setDiskAutoDelete(request, callback)

setDiskAutoDelete(request:protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, options)

setIamPolicy(request?:protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest|undefined,{}|undefined]>;

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Name or id of the resource for this request.   */// const resource = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'/**   *  The body resource for this request   */// const zoneSetPolicyRequestResource = {}// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetIamPolicy(){// Construct requestconstrequest={project,resource,zone,zoneSetPolicyRequestResource,};// Run requestconstresponse=awaitcomputeClient.setIamPolicy(request);console.log(response);}callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request:protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, callback)

setIamPolicy(request:protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IPolicy,protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IPolicy, protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setLabels(request, options)

setLabels(request?:protos.google.cloud.compute.v1.ISetLabelsInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetLabelsInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetLabelsRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetLabels(){// Construct requestconstrequest={instance,instancesSetLabelsRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setLabels(request);console.log(response);}callSetLabels();

setLabels(request, options, callback)

setLabels(request:protos.google.cloud.compute.v1.ISetLabelsInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetLabelsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetLabelsInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setLabels(request, callback)

setLabels(request:protos.google.cloud.compute.v1.ISetLabelsInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetLabelsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetLabelsInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMachineResources(request, options)

setMachineResources(request?:protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetMachineResourcesRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetMachineResources(){// Construct requestconstrequest={instance,instancesSetMachineResourcesRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setMachineResources(request);console.log(response);}callSetMachineResources();

setMachineResources(request, options, callback)

setMachineResources(request:protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMachineResources(request, callback)

setMachineResources(request:protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMachineType(request, options)

setMachineType(request?:protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Changes the machine type for a stopped instance to the machine type specified in the request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetMachineTypeRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetMachineType(){// Construct requestconstrequest={instance,instancesSetMachineTypeRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setMachineType(request);console.log(response);}callSetMachineType();

setMachineType(request, options, callback)

setMachineType(request:protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMachineType(request, callback)

setMachineType(request:protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMetadata(request, options)

setMetadata(request?:protos.google.cloud.compute.v1.ISetMetadataInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets metadata for the specified instance to the data included in the request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMetadataInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const metadataResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetMetadata(){// Construct requestconstrequest={instance,metadataResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setMetadata(request);console.log(response);}callSetMetadata();

setMetadata(request, options, callback)

setMetadata(request:protos.google.cloud.compute.v1.ISetMetadataInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMetadataInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMetadataInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMetadata(request, callback)

setMetadata(request:protos.google.cloud.compute.v1.ISetMetadataInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMetadataInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMetadataInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMinCpuPlatform(request, options)

setMinCpuPlatform(request?:protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetMinCpuPlatformRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetMinCpuPlatform(){// Construct requestconstrequest={instance,instancesSetMinCpuPlatformRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setMinCpuPlatform(request);console.log(response);}callSetMinCpuPlatform();

setMinCpuPlatform(request, options, callback)

setMinCpuPlatform(request:protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setMinCpuPlatform(request, callback)

setMinCpuPlatform(request:protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setScheduling(request, options)

setScheduling(request?:protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in aTERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM availability policies.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetSchedulingInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Instance name for this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The body resource for this request   */// const schedulingResource = {}/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetScheduling(){// Construct requestconstrequest={instance,project,schedulingResource,zone,};// Run requestconstresponse=awaitcomputeClient.setScheduling(request);console.log(response);}callSetScheduling();

setScheduling(request, options, callback)

setScheduling(request:protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetSchedulingInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setScheduling(request, callback)

setScheduling(request:protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetSchedulingInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setServiceAccount(request, options)

setServiceAccount(request?:protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to start.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetServiceAccountRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetServiceAccount(){// Construct requestconstrequest={instance,instancesSetServiceAccountRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setServiceAccount(request);console.log(response);}callSetServiceAccount();

setServiceAccount(request, options, callback)

setServiceAccount(request:protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setServiceAccount(request, callback)

setServiceAccount(request:protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setShieldedInstanceIntegrityPolicy(request, options)

setShieldedInstanceIntegrityPolicy(request?:protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name or id of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The body resource for this request   */// const shieldedInstanceIntegrityPolicyResource = {}/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetShieldedInstanceIntegrityPolicy(){// Construct requestconstrequest={instance,project,shieldedInstanceIntegrityPolicyResource,zone,};// Run requestconstresponse=awaitcomputeClient.setShieldedInstanceIntegrityPolicy(request);console.log(response);}callSetShieldedInstanceIntegrityPolicy();

setShieldedInstanceIntegrityPolicy(request, options, callback)

setShieldedInstanceIntegrityPolicy(request:protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setShieldedInstanceIntegrityPolicy(request, callback)

setShieldedInstanceIntegrityPolicy(request:protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setTags(request, options)

setTags(request?:protos.google.cloud.compute.v1.ISetTagsInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Sets network tags for the specified instance to the data included in the request.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetTagsInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The body resource for this request   */// const tagsResource = {}/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetTags(){// Construct requestconstrequest={instance,project,tagsResource,zone,};// Run requestconstresponse=awaitcomputeClient.setTags(request);console.log(response);}callSetTags();

setTags(request, options, callback)

setTags(request:protos.google.cloud.compute.v1.ISetTagsInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetTagsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetTagsInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetTagsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setTags(request, callback)

setTags(request:protos.google.cloud.compute.v1.ISetTagsInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetTagsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISetTagsInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetTagsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

simulateMaintenanceEvent(request, options)

simulateMaintenanceEvent(request?:protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSimulateMaintenanceEvent(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.simulateMaintenanceEvent(request);console.log(response);}callSimulateMaintenanceEvent();

simulateMaintenanceEvent(request, options, callback)

simulateMaintenanceEvent(request:protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

simulateMaintenanceEvent(request, callback)

simulateMaintenanceEvent(request:protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

start(request, options)

start(request?:protos.google.cloud.compute.v1.IStartInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to start.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallStart(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.start(request);console.log(response);}callStart();

start(request, options, callback)

start(request:protos.google.cloud.compute.v1.IStartInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStartInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStartInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

start(request, callback)

start(request:protos.google.cloud.compute.v1.IStartInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStartInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStartInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

startWithEncryptionKey(request, options)

startWithEncryptionKey(request?:protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to start.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesStartWithEncryptionKeyRequestResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallStartWithEncryptionKey(){// Construct requestconstrequest={instance,instancesStartWithEncryptionKeyRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.startWithEncryptionKey(request);console.log(response);}callStartWithEncryptionKey();

startWithEncryptionKey(request, options, callback)

startWithEncryptionKey(request:protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

startWithEncryptionKey(request, callback)

startWithEncryptionKey(request:protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

stop(request, options)

stop(request?:protos.google.cloud.compute.v1.IStopInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStopInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to stop.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallStop(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.stop(request);console.log(response);}callStop();

stop(request, options, callback)

stop(request:protos.google.cloud.compute.v1.IStopInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStopInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStopInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStopInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

stop(request, callback)

stop(request:protos.google.cloud.compute.v1.IStopInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IStopInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IStopInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IStopInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

suspend(request, options)

suspend(request?:protos.google.cloud.compute.v1.ISuspendInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISuspendInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to suspend.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSuspend(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.suspend(request);console.log(response);}callSuspend();

suspend(request, options, callback)

suspend(request:protos.google.cloud.compute.v1.ISuspendInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISuspendInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISuspendInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISuspendInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

suspend(request, callback)

suspend(request:protos.google.cloud.compute.v1.ISuspendInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISuspendInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ISuspendInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISuspendInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options)

testIamPermissions(request?:protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1.ITestPermissionsResponse,(protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest|undefined),{}|undefined]>;

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.compute.v1.ITestPermissionsResponse, (protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestPermissionsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Project ID for this request.   */// const project = 'my-project'/**   *  Name or id of the resource for this request.   */// const resource = 'abc123'/**   *  The body resource for this request   */// const testPermissionsRequestResource = {}/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallTestIamPermissions(){// Construct requestconstrequest={project,resource,testPermissionsRequestResource,zone,};// Run requestconstresponse=awaitcomputeClient.testIamPermissions(request);console.log(response);}callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request:protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.ITestPermissionsResponse,protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.ITestPermissionsResponse, protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, callback)

testIamPermissions(request:protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.ITestPermissionsResponse,protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.ITestPermissionsResponse, protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

update(request, options)

update(request?:protos.google.cloud.compute.v1.IUpdateInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the instance resource to update.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instanceResource = {}/**   *  Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require.   */// const minimalAction = 'abc123'/**   *  Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART.   */// const mostDisruptiveAllowedAction = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallUpdate(){// Construct requestconstrequest={instance,instanceResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.update(request);console.log(response);}callUpdate();

update(request, options, callback)

update(request:protos.google.cloud.compute.v1.IUpdateInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

update(request, callback)

update(request:protos.google.cloud.compute.v1.IUpdateInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateAccessConfig(request, options)

updateAccessConfig(request?:protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const accessConfigResource = {}/**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The name of the network interface where the access config is attached.   */// const networkInterface = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallUpdateAccessConfig(){// Construct requestconstrequest={accessConfigResource,instance,networkInterface,project,zone,};// Run requestconstresponse=awaitcomputeClient.updateAccessConfig(request);console.log(response);}callUpdateAccessConfig();

updateAccessConfig(request, options, callback)

updateAccessConfig(request:protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateAccessConfig(request, callback)

updateAccessConfig(request:protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateDisplayDevice(request, options)

updateDisplayDevice(request?:protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The body resource for this request   */// const displayDeviceResource = {}/**   *  Name of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallUpdateDisplayDevice(){// Construct requestconstrequest={displayDeviceResource,instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.updateDisplayDevice(request);console.log(response);}callUpdateDisplayDevice();

updateDisplayDevice(request, options, callback)

updateDisplayDevice(request:protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateDisplayDevice(request, callback)

updateDisplayDevice(request:protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateNetworkInterface(request, options)

updateNetworkInterface(request?:protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  The instance name for this request.   */// const instance = 'abc123'/**   *  The name of the network interface to update.   */// const networkInterface = 'abc123'/**   *  The body resource for this request   */// const networkInterfaceResource = {}/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallUpdateNetworkInterface(){// Construct requestconstrequest={instance,networkInterface,networkInterfaceResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.updateNetworkInterface(request);console.log(response);}callUpdateNetworkInterface();

updateNetworkInterface(request, options, callback)

updateNetworkInterface(request:protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateNetworkInterface(request, callback)

updateNetworkInterface(request:protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateShieldedInstanceConfig(request, options)

updateShieldedInstanceConfig(request?:protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1.IOperation,null>,protos.google.cloud.compute.v1.IOperation|undefined,{}|undefined]>;

Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.cloud.compute.v1.IOperation, null>, protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time..promise() is not supported yet.

Example
/**   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name or id of the instance scoping this request.   */// const instance = 'abc123'/**   *  Project ID for this request.   */// const project = 'my-project'/**   *  An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).   */// const requestId = 'abc123'/**   *  The body resource for this request   */// const shieldedInstanceConfigResource = {}/**   *  The name of the zone for this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallUpdateShieldedInstanceConfig(){// Construct requestconstrequest={instance,project,shieldedInstanceConfigResource,zone,};// Run requestconstresponse=awaitcomputeClient.updateShieldedInstanceConfig(request);console.log(response);}callUpdateShieldedInstanceConfig();

updateShieldedInstanceConfig(request, options, callback)

updateShieldedInstanceConfig(request:protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest
optionsCallOptions
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateShieldedInstanceConfig(request, callback)

updateShieldedInstanceConfig(request:protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestprotos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-03 UTC.