Class v1.InstancesClient (4.9.0)

The Instances API. v1

Package

@google-cloud/compute

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?:ClientOptions,gaxInstance?:typeofgax|typeofgax.fallback);

Construct an instance of InstancesClient.

Parameters
NameDescription
optsClientOptions
gaxInstancetypeofgax | typeoffallback

: loaded instance ofgoogle-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new InstancesClient({fallback: true}, gax); ```

Properties

apiEndpoint

getapiEndpoint():string;

The DNS address for this API service.

apiEndpoint

staticgetapiEndpoint():string;

The DNS address for this API service - same as servicePath.

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.

universeDomain

getuniverseDomain():string;

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
requestIAddAccessConfigInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIAddAccessConfigInstanceRequest
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
requestIAddAccessConfigInstanceRequest
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
requestIAddResourcePoliciesInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIAddResourcePoliciesInstanceRequest
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
requestIAddResourcePoliciesInstanceRequest
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]>;

Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set thereturnPartialSuccess parameter totrue.

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

Parameters
NameDescription
requestIAggregatedListInstancesRequest

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 allowsasync iteration. 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 thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//***Afilterexpressionthatfiltersresourceslistedintheresponse.MostComputeresourcessupporttwotypesoffilterexpressions:expressionsthatsupportregularexpressionsandexpressionsthatfollowAPIimprovementproposalAIP-160.Thesetwotypesoffilterexpressionscannotbemixedinonerequest.IfyouwanttouseAIP-160,yourexpressionmustspecifythefieldname,anoperator,andthevaluethatyouwanttouseforfiltering.Thevaluemustbeastring,anumber,oraboolean.Theoperatormustbeeither`=`,`!=`,`>`,`<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name!=example-instance`. 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)
If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.

/ // 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 thanmaxResults, Compute Engine returns anextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are0 to500, 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 usingorderBy="creationTimestamp desc". This sorts results based on thecreationTimestamp 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 byname orcreationTimestamp desc is supported./// const orderBy = 'abc123'/*
  • Specifies a page token to use. SetpageToken to thenextPageToken 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code./// const returnPartialSuccess = true/*
  • The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.*/// const serviceProjectNumber = 1234

    // Imports the Compute libraryconst {InstancesClient} = require('@google-cloud/compute').v1;

    // Instantiates a clientconst computeClient = new InstancesClient();

    async function callAggregatedList() {// Construct requestconst request = {project,};

    // Run requestconst iterable = computeClient.aggregatedListAsync(request);for await (const [key, value] of iterable) { 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
requestIAttachDiskInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIAttachDiskInstanceRequest
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
requestIAttachDiskInstanceRequest
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. For more information, see About bulk creation of VMs.

Parameters
NameDescription
requestIBulkInsertInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIBulkInsertInstanceRequest
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
requestIBulkInsertInstanceRequest
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
requestIDeleteInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIDeleteInstanceRequest
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
requestIDeleteInstanceRequest
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
requestIDeleteAccessConfigInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIDeleteAccessConfigInstanceRequest
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
requestIDeleteAccessConfigInstanceRequest
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
requestIDetachDiskInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIDetachDiskInstanceRequest
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
requestIDetachDiskInstanceRequest
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.

Parameters
NameDescription
requestIGetInstanceRequest

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 . Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetInstanceRequest
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
requestIGetInstanceRequest
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
requestIGetEffectiveFirewallsInstanceRequest

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 representingInstancesGetEffectiveFirewallsResponse. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetEffectiveFirewallsInstanceRequest
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
requestIGetEffectiveFirewallsInstanceRequest
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
requestIGetGuestAttributesInstanceRequest

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 representingGuestAttributes. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetGuestAttributesInstanceRequest
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
requestIGetGuestAttributesInstanceRequest
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
requestIGetIamPolicyInstanceRequest

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 representingPolicy. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetIamPolicyInstanceRequest
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
requestIGetIamPolicyInstanceRequest
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
requestIGetScreenshotInstanceRequest

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 representingScreenshot. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetScreenshotInstanceRequest
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
requestIGetScreenshotInstanceRequest
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
requestIGetSerialPortOutputInstanceRequest

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 representingSerialPortOutput. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size.   */// 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
requestIGetSerialPortOutputInstanceRequest
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
requestIGetSerialPortOutputInstanceRequest
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
requestIGetShieldedInstanceIdentityInstanceRequest

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 representingShieldedInstanceIdentity. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIGetShieldedInstanceIdentityInstanceRequest
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
requestIGetShieldedInstanceIdentityInstanceRequest
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
requestIInsertInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIInsertInstanceRequest
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
requestIInsertInstanceRequest
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
requestIListInstancesRequest

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 . 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 thedocumentation 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
requestIListInstancesRequest
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
requestIListInstancesRequest
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
requestIListInstancesRequest

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 allowsasync iteration. When you iterate the returned iterable, each element will be an object representing . 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 thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//***Afilterexpressionthatfiltersresourceslistedintheresponse.MostComputeresourcessupporttwotypesoffilterexpressions:expressionsthatsupportregularexpressionsandexpressionsthatfollowAPIimprovementproposalAIP-160.Thesetwotypesoffilterexpressionscannotbemixedinonerequest.IfyouwanttouseAIP-160,yourexpressionmustspecifythefieldname,anoperator,andthevaluethatyouwanttouseforfiltering.Thevaluemustbeastring,anumber,oraboolean.Theoperatormustbeeither`=`,`!=`,`>`,`<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name!=example-instance`. 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)
If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.

/ // const filter = 'abc123' /*

  • The maximum number of results per page that should be returned. If the number of available results is larger thanmaxResults, Compute Engine returns anextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are0 to500, 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 usingorderBy="creationTimestamp desc". This sorts results based on thecreationTimestamp 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 byname orcreationTimestamp desc is supported./// const orderBy = 'abc123'/*
  • Specifies a page token to use. SetpageToken to thenextPageToken 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code./// 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 clientconst computeClient = new InstancesClient();

    async function callList() {// Construct requestconst request = {project,zone,};

    // Run requestconst iterable = computeClient.listAsync(request);for await (const response of iterable) { 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
requestIListReferrersInstancesRequest

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 ofReference. 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 thedocumentation 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
requestIListReferrersInstancesRequest
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
requestIListReferrersInstancesRequest
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
requestIListReferrersInstancesRequest

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 allowsasync iteration. When you iterate the returned iterable, each element will be an object representingReference. 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 thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//***Afilterexpressionthatfiltersresourceslistedintheresponse.MostComputeresourcessupporttwotypesoffilterexpressions:expressionsthatsupportregularexpressionsandexpressionsthatfollowAPIimprovementproposalAIP-160.Thesetwotypesoffilterexpressionscannotbemixedinonerequest.IfyouwanttouseAIP-160,yourexpressionmustspecifythefieldname,anoperator,andthevaluethatyouwanttouseforfiltering.Thevaluemustbeastring,anumber,oraboolean.Theoperatormustbeeither`=`,`!=`,`>`,`<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name!=example-instance`. 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)
If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.

/ // 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 thanmaxResults, Compute Engine returns anextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are0 to500, 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 usingorderBy="creationTimestamp desc". This sorts results based on thecreationTimestamp 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 byname orcreationTimestamp desc is supported./// const orderBy = 'abc123'/*
  • Specifies a page token to use. SetpageToken to thenextPageToken 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code./// 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 clientconst computeClient = new InstancesClient();

    async function callListReferrers() {// Construct requestconst request = {instance,project,zone,};

    // Run requestconst iterable = computeClient.listReferrersAsync(request);for await (const response of iterable) { 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
requestIListReferrersInstancesRequest

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 representingReference 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 thedocumentation 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
requestIListInstancesRequest

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 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 thedocumentation for more details and examples.

performMaintenance(request, options)

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

Perform a manual maintenance on the instance.

Parameters
NameDescription
requestIPerformMaintenanceInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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();asyncfunctioncallPerformMaintenance(){// Construct requestconstrequest={instance,project,zone,};// Run requestconstresponse=awaitcomputeClient.performMaintenance(request);console.log(response);}callPerformMaintenance();

performMaintenance(request, options, callback)

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

performMaintenance(request, callback)

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

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
requestIRemoveResourcePoliciesInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIRemoveResourcePoliciesInstanceRequest
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
requestIRemoveResourcePoliciesInstanceRequest
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
requestIResetInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIResetInstanceRequest
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
requestIResetInstanceRequest
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
requestIResumeInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIResumeInstanceRequest
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
requestIResumeInstanceRequest
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
requestISendDiagnosticInterruptInstanceRequest

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 representingSendDiagnosticInterruptInstanceResponse. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISendDiagnosticInterruptInstanceRequest
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
requestISendDiagnosticInterruptInstanceRequest
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
requestISetDeletionProtectionInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetDeletionProtectionInstanceRequest
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
requestISetDeletionProtectionInstanceRequest
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
requestISetDiskAutoDeleteInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetDiskAutoDeleteInstanceRequest
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
requestISetDiskAutoDeleteInstanceRequest
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
requestISetIamPolicyInstanceRequest

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 representingPolicy. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetIamPolicyInstanceRequest
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
requestISetIamPolicyInstanceRequest
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
requestISetLabelsInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetLabelsInstanceRequest
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
requestISetLabelsInstanceRequest
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
requestISetMachineResourcesInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetMachineResourcesInstanceRequest
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
requestISetMachineResourcesInstanceRequest
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
requestISetMachineTypeInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetMachineTypeInstanceRequest
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
requestISetMachineTypeInstanceRequest
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
requestISetMetadataInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetMetadataInstanceRequest
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
requestISetMetadataInstanceRequest
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
requestISetMinCpuPlatformInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetMinCpuPlatformInstanceRequest
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
requestISetMinCpuPlatformInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setName(request, options)

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

Sets name of an instance.

Parameters
NameDescription
requestISetNameInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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 instancesSetNameRequestResource = {}/**   *  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();asyncfunctioncallSetName(){// Construct requestconstrequest={instance,instancesSetNameRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setName(request);console.log(response);}callSetName();

setName(request, options, callback)

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

setName(request, callback)

setName(request:protos.google.cloud.compute.v1.ISetNameInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetNameInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestISetNameInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetNameInstanceRequest | 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 host maintenance policy.

Parameters
NameDescription
requestISetSchedulingInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetSchedulingInstanceRequest
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
requestISetSchedulingInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setSecurityPolicy(request, options)

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

Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview

Parameters
NameDescription
requestISetSecurityPolicyInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035.   */// const instance = 'abc123'/**   *  The body resource for this request   */// const instancesSetSecurityPolicyRequestResource = {}/**   *  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 of the zone scoping this request.   */// const zone = 'abc123'// Imports the Compute libraryconst{InstancesClient}=require('@google-cloud/compute').v1;// Instantiates a clientconstcomputeClient=newInstancesClient();asyncfunctioncallSetSecurityPolicy(){// Construct requestconstrequest={instance,instancesSetSecurityPolicyRequestResource,project,zone,};// Run requestconstresponse=awaitcomputeClient.setSecurityPolicy(request);console.log(response);}callSetSecurityPolicy();

setSecurityPolicy(request, options, callback)

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

setSecurityPolicy(request, callback)

setSecurityPolicy(request:protos.google.cloud.compute.v1.ISetSecurityPolicyInstanceRequest,callback:Callback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetSecurityPolicyInstanceRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestISetSecurityPolicyInstanceRequest
callbackCallback<protos.google.cloud.compute.v1.IOperation,protos.google.cloud.compute.v1.ISetSecurityPolicyInstanceRequest | 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
requestISetServiceAccountInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetServiceAccountInstanceRequest
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
requestISetServiceAccountInstanceRequest
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
requestISetShieldedInstanceIntegrityPolicyInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetShieldedInstanceIntegrityPolicyInstanceRequest
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
requestISetShieldedInstanceIntegrityPolicyInstanceRequest
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
requestISetTagsInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestISetTagsInstanceRequest
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
requestISetTagsInstanceRequest
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
requestISimulateMaintenanceEventInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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'/**   *  Determines whether the customers receive notifications before migration. Only applicable to SF vms.   */// const withExtendedNotifications = 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();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
requestISimulateMaintenanceEventInstanceRequest
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
requestISimulateMaintenanceEventInstanceRequest
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
requestIStartInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIStartInstanceRequest
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
requestIStartInstanceRequest
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
requestIStartWithEncryptionKeyInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIStartWithEncryptionKeyInstanceRequest
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
requestIStartWithEncryptionKeyInstanceRequest
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
requestIStopInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded.   */// const discardLocalSsd = true/**   *  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
requestIStopInstanceRequest
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
requestIStopInstanceRequest
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
requestISuspendInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded.   */// const discardLocalSsd = true/**   *  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
requestISuspendInstanceRequest
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
requestISuspendInstanceRequest
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
requestITestIamPermissionsInstanceRequest

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 representingTestPermissionsResponse. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestITestIamPermissionsInstanceRequest
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
requestITestIamPermissionsInstanceRequest
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
requestIUpdateInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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.   *  Check the MinimalAction enum for the list of possible values.   */// 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.   *  Check the MostDisruptiveAllowedAction enum for the list of possible values.   */// 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
requestIUpdateInstanceRequest
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
requestIUpdateInstanceRequest
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
requestIUpdateAccessConfigInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIUpdateAccessConfigInstanceRequest
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
requestIUpdateAccessConfigInstanceRequest
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
requestIUpdateDisplayDeviceInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIUpdateDisplayDeviceInstanceRequest
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
requestIUpdateDisplayDeviceInstanceRequest
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
requestIUpdateNetworkInterfaceInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIUpdateNetworkInterfaceInstanceRequest
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
requestIUpdateNetworkInterfaceInstanceRequest
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
requestIUpdateShieldedInstanceConfigInstanceRequest

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 thedocumentation 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
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * 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
requestIUpdateShieldedInstanceConfigInstanceRequest
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
requestIUpdateShieldedInstanceConfigInstanceRequest
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.