Class v1beta.ProjectsClient (6.5.0) Stay organized with collections Save and categorize content based on your preferences.
The Projects API. v1beta
Package
@google-cloud/computeConstructors
(constructor)(opts, gaxInstance)
constructor(opts?:ClientOptions,gaxInstance?:typeofgax|typeofgax.fallback);Construct an instance of ProjectsClient.
| Parameters | |
|---|---|
| Name | Description |
opts | ClientOptions |
gaxInstance | typeofgax | typeoffallback: loaded instance of |
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;};port
staticgetport():number;The port for this API service.
projectsStub
projectsStub?:Promise<{[name:string]:Function;}>;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
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 | |
|---|---|
| Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
disableXpnHost(request, options)
disableXpnHost(request?:protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Disable this project as a shared VPC host project.
| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnHostProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallDisableXpnHost(){// Construct requestconstrequest={project,};// Run requestconstresponse=awaitcomputeClient.disableXpnHost(request);console.log(response);}callDisableXpnHost();disableXpnHost(request, options, callback)
disableXpnHost(request:protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnHostProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
disableXpnHost(request, callback)
disableXpnHost(request:protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnHostProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
disableXpnResource(request, options)
disableXpnResource(request?:protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Disable a service resource (also known as service project) associated with this host project.
| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnResourceProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * The body resource for this request */// const projectsDisableXpnResourceRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallDisableXpnResource(){// Construct requestconstrequest={project,projectsDisableXpnResourceRequestResource,};// Run requestconstresponse=awaitcomputeClient.disableXpnResource(request);console.log(response);}callDisableXpnResource();disableXpnResource(request, options, callback)
disableXpnResource(request:protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnResourceProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
disableXpnResource(request, callback)
disableXpnResource(request:protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IDisableXpnResourceProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
enableXpnHost(request, options)
enableXpnHost(request?:protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Enable this project as a shared VPC host project.
| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnHostProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallEnableXpnHost(){// Construct requestconstrequest={project,};// Run requestconstresponse=awaitcomputeClient.enableXpnHost(request);console.log(response);}callEnableXpnHost();enableXpnHost(request, options, callback)
enableXpnHost(request:protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnHostProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
enableXpnHost(request, callback)
enableXpnHost(request:protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnHostProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
enableXpnResource(request, options)
enableXpnResource(request?:protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnResourceProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * The body resource for this request */// const projectsEnableXpnResourceRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallEnableXpnResource(){// Construct requestconstrequest={project,projectsEnableXpnResourceRequestResource,};// Run requestconstresponse=awaitcomputeClient.enableXpnResource(request);console.log(response);}callEnableXpnResource();enableXpnResource(request, options, callback)
enableXpnResource(request:protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnResourceProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
enableXpnResource(request, callback)
enableXpnResource(request:protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IEnableXpnResourceProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
get(request, options)
get(request?:protos.google.cloud.compute.v1beta.IGetProjectRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest|undefined,{}|undefined]>;Returns the specified Project resource.
To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (thequotas field). To exclude one or more fields, set your request'sfields query parameter to only include the fields you need. For example, to only include theid andselfLink fields, add the query parameter?fields=id,selfLink to your request.
| Parameters | |
|---|---|
| Name | Description |
request | IGetProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest | 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. |
/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallGet(){// Construct requestconstrequest={project,};// Run requestconstresponse=awaitcomputeClient.get(request);console.log(response);}callGet();get(request, options, callback)
get(request:protos.google.cloud.compute.v1beta.IGetProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
get(request, callback)
get(request:protos.google.cloud.compute.v1beta.IGetProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
getProjectId()
getProjectId():Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback:Callback<string,undefined,undefined>):void;| Parameter | |
|---|---|
| Name | Description |
callback | Callback<string, undefined, undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
getXpnHost(request, options)
getXpnHost(request?:protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest|undefined,{}|undefined]>;Gets the shared VPC host project that this project links to. May be empty if no link exists.
| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnHostProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest | 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. |
/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallGetXpnHost(){// Construct requestconstrequest={project,};// Run requestconstresponse=awaitcomputeClient.getXpnHost(request);console.log(response);}callGetXpnHost();getXpnHost(request, options, callback)
getXpnHost(request:protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnHostProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
getXpnHost(request, callback)
getXpnHost(request:protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnHostProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IProject,protos.google.cloud.compute.v1beta.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
getXpnResources(request, options)
getXpnResources(request?:protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1beta.IXpnResourceId[],protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest|null,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources]>;Gets service resources (a.k.a service project) associated with this host project.
| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnResourcesProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.cloud.compute.v1beta.IXpnResourceId[],protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest | null,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources ]> | {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 using |
getXpnResources(request, options, callback)
getXpnResources(request:protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,options:CallOptions,callback:PaginationCallback<protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources|null|undefined,protos.google.cloud.compute.v1beta.IXpnResourceId>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnResourcesProjectsRequest |
options | CallOptions |
callback | PaginationCallback<protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources | null | undefined,protos.google.cloud.compute.v1beta.IXpnResourceId> |
| Returns | |
|---|---|
| Type | Description |
void | |
getXpnResources(request, callback)
getXpnResources(request:protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,callback:PaginationCallback<protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources|null|undefined,protos.google.cloud.compute.v1beta.IXpnResourceId>):void;| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnResourcesProjectsRequest |
callback | PaginationCallback<protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,protos.google.cloud.compute.v1beta.IProjectsGetXpnResources | null | undefined,protos.google.cloud.compute.v1beta.IXpnResourceId> |
| Returns | |
|---|---|
| Type | Description |
void | |
getXpnResourcesAsync(request, options)
getXpnResourcesAsync(request?:protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,options?:CallOptions):AsyncIterable<protos.google.cloud.compute.v1beta.IXpnResourceId>;Equivalent togetXpnResources, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnResourcesProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.compute.v1beta.IXpnResourceId> | {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. |
/** * 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.Most*Computeresourcessupporttwotypesoffilterexpressions:*expressionsthatsupportregularexpressionsandexpressionsthatfollow*APIimprovementproposalAIP-160.*Thesetwotypesoffilterexpressionscannotbemixedinonerequest.*IfyouwanttouseAIP-160,yourexpressionmustspecifythefieldname,an*operator,andthevaluethatyouwanttouseforfiltering.Thevalue*mustbeastring,anumber,oraboolean.Theoperator*mustbeeither`=`,`!=`,`>`,`<`,><=`, `="">=` 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 = falseto include instances only- if they are not scheduled for automatic restarts. You can use filtering
- on nested fields to filter based onresource 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
ANDexpression. However, you - can include
ANDandORexpressions 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) orne - (not equal) operator against a single un-parenthesized expression with or
- without quotes or against multiple parenthesized expressions. Examples:
fieldname eq unquoted literalfieldname 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 GoogleRE2 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 than
maxResults, - Compute Engine returns a
nextPageTokenthat can be used to get - the next page of results in subsequent list requests. Acceptable values are
0to500, inclusive. (Default:500)/// const maxResults = 1234/*- Sorts list results by a certain order. By default, results
- are returned in alphanumerical order based on the resource name.
- You can also sort results in descending order based on the creation
- timestamp using
orderBy="creationTimestamp desc". This sorts - results based on the
creationTimestampfield in - reverse chronological order (newest result first). Use this to sort
- resources like operations so that the newest operation is returned first.
- Currently, only sorting by
nameor creationTimestamp descis supported./// const orderBy = 'abc123'/*- Specifies a page token to use. Set
pageTokento the nextPageTokenreturned 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
// Imports the Compute libraryconst {ProjectsClient} = require('@google-cloud/compute').v1beta;
// Instantiates a clientconst computeClient = new ProjectsClient();
async function callGetXpnResources() {// Construct requestconst request = {project,};
// Run requestconst iterable = computeClient.getXpnResourcesAsync(request);for await (const response of iterable) { console.log(response);}}
callGetXpnResources();
getXpnResourcesStream(request, options)
getXpnResourcesStream(request?:protos.google.cloud.compute.v1beta.IGetXpnResourcesProjectsRequest,options?:CallOptions):Transform;Equivalent togetXpnResources, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request | IGetXpnResourcesProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
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 using |
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 | |
|---|---|
| Type | Description |
Promise<{ [name: string]:Function; }> | {Promise} A promise that resolves to an authenticated service stub. |
listXpnHosts(request, options)
listXpnHosts(request?:protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,options?:CallOptions):Promise<[protos.google.cloud.compute.v1beta.IProject[],protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest|null,protos.google.cloud.compute.v1beta.IXpnHostList]>;Lists all shared VPC host projects visible to the user in an organization.
| Parameters | |
|---|---|
| Name | Description |
request | IListXpnHostsProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.cloud.compute.v1beta.IProject[],protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest | null,protos.google.cloud.compute.v1beta.IXpnHostList ]> | {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 using |
listXpnHosts(request, options, callback)
listXpnHosts(request:protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,options:CallOptions,callback:PaginationCallback<protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,protos.google.cloud.compute.v1beta.IXpnHostList|null|undefined,protos.google.cloud.compute.v1beta.IProject>):void;| Parameters | |
|---|---|
| Name | Description |
request | IListXpnHostsProjectsRequest |
options | CallOptions |
callback | PaginationCallback<protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,protos.google.cloud.compute.v1beta.IXpnHostList | null | undefined,protos.google.cloud.compute.v1beta.IProject> |
| Returns | |
|---|---|
| Type | Description |
void | |
listXpnHosts(request, callback)
listXpnHosts(request:protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,callback:PaginationCallback<protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,protos.google.cloud.compute.v1beta.IXpnHostList|null|undefined,protos.google.cloud.compute.v1beta.IProject>):void;| Parameters | |
|---|---|
| Name | Description |
request | IListXpnHostsProjectsRequest |
callback | PaginationCallback<protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,protos.google.cloud.compute.v1beta.IXpnHostList | null | undefined,protos.google.cloud.compute.v1beta.IProject> |
| Returns | |
|---|---|
| Type | Description |
void | |
listXpnHostsAsync(request, options)
listXpnHostsAsync(request?:protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,options?:CallOptions):AsyncIterable<protos.google.cloud.compute.v1beta.IProject>;Equivalent tolistXpnHosts, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request | IListXpnHostsProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.compute.v1beta.IProject> | {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. |
/** * 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.Most*Computeresourcessupporttwotypesoffilterexpressions:*expressionsthatsupportregularexpressionsandexpressionsthatfollow*APIimprovementproposalAIP-160.*Thesetwotypesoffilterexpressionscannotbemixedinonerequest.*IfyouwanttouseAIP-160,yourexpressionmustspecifythefieldname,an*operator,andthevaluethatyouwanttouseforfiltering.Thevalue*mustbeastring,anumber,oraboolean.Theoperator*mustbeeither`=`,`!=`,`>`,`<`,><=`, `="">=` 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 = falseto include instances only- if they are not scheduled for automatic restarts. You can use filtering
- on nested fields to filter based onresource 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
ANDexpression. However, you - can include
ANDandORexpressions 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) orne - (not equal) operator against a single un-parenthesized expression with or
- without quotes or against multiple parenthesized expressions. Examples:
fieldname eq unquoted literalfieldname 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 GoogleRE2 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 than
maxResults, - Compute Engine returns a
nextPageTokenthat can be used to get - the next page of results in subsequent list requests. Acceptable values are
0to500, inclusive. (Default:500)/// const maxResults = 1234/*- Sorts list results by a certain order. By default, results
- are returned in alphanumerical order based on the resource name.
- You can also sort results in descending order based on the creation
- timestamp using
orderBy="creationTimestamp desc". This sorts - results based on the
creationTimestampfield in - reverse chronological order (newest result first). Use this to sort
- resources like operations so that the newest operation is returned first.
- Currently, only sorting by
nameor creationTimestamp descis supported./// const orderBy = 'abc123'/*- Specifies a page token to use. Set
pageTokento the nextPageTokenreturned by a previous list request to get- the next page of results./// const pageToken = 'abc123'/*
- Project ID for this request./// const project = 'my-project'/*
- The body resource for this request/// const projectsListXpnHostsRequestResource = {}/*
- 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
// Imports the Compute libraryconst {ProjectsClient} = require('@google-cloud/compute').v1beta;
// Instantiates a clientconst computeClient = new ProjectsClient();
async function callListXpnHosts() {// Construct requestconst request = {project,projectsListXpnHostsRequestResource,};
// Run requestconst iterable = computeClient.listXpnHostsAsync(request);for await (const response of iterable) { console.log(response);}}
callListXpnHosts();
listXpnHostsStream(request, options)
listXpnHostsStream(request?:protos.google.cloud.compute.v1beta.IListXpnHostsProjectsRequest,options?:CallOptions):Transform;Equivalent tolistXpnHosts, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request | IListXpnHostsProjectsRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
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 using |
moveDisk(request, options)
moveDisk(request?:protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Moves a persistent disk from one zone to another. *Note*: The moveDisk API will be deprecated on September 29, 2026.
Starting September 29, 2025, you can't use the moveDisk API on new projects. To move a disk to a different region or zone, follow the steps in [Change the location of a disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
Projects that already use the moveDisk API can continue usage until September 29, 2026.
Starting November 1, 2025, API responses will include a warning message in the response body about the upcoming deprecation. You can skip the message to continue using the service without interruption.
| Parameters | |
|---|---|
| Name | Description |
request | IMoveDiskProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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 diskMoveRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallMoveDisk(){// Construct requestconstrequest={diskMoveRequestResource,project,};// Run requestconstresponse=awaitcomputeClient.moveDisk(request);console.log(response);}callMoveDisk();moveDisk(request, options, callback)
moveDisk(request:protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IMoveDiskProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
moveDisk(request, callback)
moveDisk(request:protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IMoveDiskProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveDiskProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
moveInstance(request, options)
moveInstance(request?:protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Moves an instance and its attached persistent disks from one zone to another. *Note*: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the [known issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See [moving instance across zones](/compute/docs/instances/moving-instance-across-zones) instead.
| Parameters | |
|---|---|
| Name | Description |
request | IMoveInstanceProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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 instanceMoveRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallMoveInstance(){// Construct requestconstrequest={instanceMoveRequestResource,project,};// Run requestconstresponse=awaitcomputeClient.moveInstance(request);console.log(response);}callMoveInstance();moveInstance(request, options, callback)
moveInstance(request:protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IMoveInstanceProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
moveInstance(request, callback)
moveInstance(request:protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | IMoveInstanceProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setCloudArmorTier(request, options)
setCloudArmorTier(request?:protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.
| Parameters | |
|---|---|
| Name | Description |
request | ISetCloudArmorTierProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * The body resource for this request */// const projectsSetCloudArmorTierRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallSetCloudArmorTier(){// Construct requestconstrequest={project,projectsSetCloudArmorTierRequestResource,};// Run requestconstresponse=awaitcomputeClient.setCloudArmorTier(request);console.log(response);}callSetCloudArmorTier();setCloudArmorTier(request, options, callback)
setCloudArmorTier(request:protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetCloudArmorTierProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setCloudArmorTier(request, callback)
setCloudArmorTier(request:protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetCloudArmorTierProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCloudArmorTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setCommonInstanceMetadata(request, options)
setCommonInstanceMetadata(request?:protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Sets metadata common to all instances within the specified project using the data included in the request.
| Parameters | |
|---|---|
| Name | Description |
request | ISetCommonInstanceMetadataProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallSetCommonInstanceMetadata(){// Construct requestconstrequest={metadataResource,project,};// Run requestconstresponse=awaitcomputeClient.setCommonInstanceMetadata(request);console.log(response);}callSetCommonInstanceMetadata();setCommonInstanceMetadata(request, options, callback)
setCommonInstanceMetadata(request:protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetCommonInstanceMetadataProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setCommonInstanceMetadata(request, callback)
setCommonInstanceMetadata(request:protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetCommonInstanceMetadataProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setDefaultNetworkTier(request, options)
setDefaultNetworkTier(request?:protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.
| Parameters | |
|---|---|
| Name | Description |
request | ISetDefaultNetworkTierProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * The body resource for this request */// const projectsSetDefaultNetworkTierRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallSetDefaultNetworkTier(){// Construct requestconstrequest={project,projectsSetDefaultNetworkTierRequestResource,};// Run requestconstresponse=awaitcomputeClient.setDefaultNetworkTier(request);console.log(response);}callSetDefaultNetworkTier();setDefaultNetworkTier(request, options, callback)
setDefaultNetworkTier(request:protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetDefaultNetworkTierProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setDefaultNetworkTier(request, callback)
setDefaultNetworkTier(request:protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetDefaultNetworkTierProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setManagedProtectionTier(request, options)
setManagedProtectionTier(request?:protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Sets the Cloud Armor Managed Protection (CAMP) tier of the project. To set PLUS or above the billing account of the project must be subscribed to Managed Protection Plus. See Subscribing to Managed Protection Plus for more information.
| Parameters | |
|---|---|
| Name | Description |
request | ISetManagedProtectionTierProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * The body resource for this request */// const projectsSetManagedProtectionTierRequestResource = {}/** * 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'// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallSetManagedProtectionTier(){// Construct requestconstrequest={project,projectsSetManagedProtectionTierRequestResource,};// Run requestconstresponse=awaitcomputeClient.setManagedProtectionTier(request);console.log(response);}callSetManagedProtectionTier();setManagedProtectionTier(request, options, callback)
setManagedProtectionTier(request:protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetManagedProtectionTierProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setManagedProtectionTier(request, callback)
setManagedProtectionTier(request:protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetManagedProtectionTierProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetManagedProtectionTierProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setUsageExportBucket(request, options)
setUsageExportBucket(request?:protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest,options?:CallOptions):Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation,null>,protos.google.cloud.compute.v1beta.IOperation|undefined,{}|undefined]>;Enables the usage export feature and sets theusage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.
| Parameters | |
|---|---|
| Name | Description |
request | ISetUsageExportBucketProjectRequestThe request object that will be sent. |
options | CallOptionsCall options. SeeCallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[LROperation<protos.google.cloud.compute.v1beta.IOperation, null>,protos.google.cloud.compute.v1beta.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. |
/** * 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'/** * 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 usageExportLocationResource = {}// Imports the Compute libraryconst{ProjectsClient}=require('@google-cloud/compute').v1beta;// Instantiates a clientconstcomputeClient=newProjectsClient();asyncfunctioncallSetUsageExportBucket(){// Construct requestconstrequest={project,usageExportLocationResource,};// Run requestconstresponse=awaitcomputeClient.setUsageExportBucket(request);console.log(response);}callSetUsageExportBucket();setUsageExportBucket(request, options, callback)
setUsageExportBucket(request:protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest,options:CallOptions,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetUsageExportBucketProjectRequest |
options | CallOptions |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
void | |
setUsageExportBucket(request, callback)
setUsageExportBucket(request:protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest,callback:Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest|null|undefined,{}|null|undefined>):void;| Parameters | |
|---|---|
| Name | Description |
request | ISetUsageExportBucketProjectRequest |
callback | Callback<protos.google.cloud.compute.v1beta.IOperation,protos.google.cloud.compute.v1beta.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined> |
| Returns | |
|---|---|
| Type | Description |
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.