The Projects API. v1
Package
@google-cloud/computeConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of ProjectsClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
port
static get port(): number;
The port for this API service.
projectsStub
projectsStub?: Promise<{
[name: string]: Function;
}>;
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
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.v1.IDisableXpnHostProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Disable this project as a shared VPC host project.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callDisableXpnHost() {
// Construct request
const request = {
project,
};
// Run request
const response = await computeClient.disableXpnHost(request);
console.log(response);
}
callDisableXpnHost();
disableXpnHost(request, options, callback)
disableXpnHost(request: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
disableXpnHost(request, callback)
disableXpnHost(request: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
disableXpnResource(request, options)
disableXpnResource(request?: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Disable a service resource (also known as service project) associated with this host project.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callDisableXpnResource() {
// Construct request
const request = {
project,
projectsDisableXpnResourceRequestResource,
};
// Run request
const response = await computeClient.disableXpnResource(request);
console.log(response);
}
callDisableXpnResource();
disableXpnResource(request, options, callback)
disableXpnResource(request: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
disableXpnResource(request, callback)
disableXpnResource(request: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableXpnHost(request, options)
enableXpnHost(request?: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Enable this project as a shared VPC host project.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callEnableXpnHost() {
// Construct request
const request = {
project,
};
// Run request
const response = await computeClient.enableXpnHost(request);
console.log(response);
}
callEnableXpnHost();
enableXpnHost(request, options, callback)
enableXpnHost(request: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableXpnHost(request, callback)
enableXpnHost(request: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableXpnResource(request, options)
enableXpnResource(request?: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.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 |
protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callEnableXpnResource() {
// Construct request
const request = {
project,
projectsEnableXpnResourceRequestResource,
};
// Run request
const response = await computeClient.enableXpnResource(request);
console.log(response);
}
callEnableXpnResource();
enableXpnResource(request, options, callback)
enableXpnResource(request: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
enableXpnResource(request, callback)
enableXpnResource(request: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
get(request, options)
get(request?: protos.google.cloud.compute.v1.IGetProjectRequest, options?: CallOptions): Promise<[
protos.google.cloud.compute.v1.IProject,
protos.google.cloud.compute.v1.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 (the quotas
field). To exclude one or more fields, set your request's fields
query parameter to only include the fields you need. For example, to only include the id
and selfLink
fields, add the query parameter ?fields=id,selfLink
to your request.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.compute.v1.IProject,
protos.google.cloud.compute.v1.IGetProjectRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callGet() {
// Construct request
const request = {
project,
};
// Run request
const response = await computeClient.get(request);
console.log(response);
}
callGet();
get(request, options, callback)
get(request: protos.google.cloud.compute.v1.IGetProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
get(request, callback)
get(request: protos.google.cloud.compute.v1.IGetProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.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.v1.IGetXpnHostProjectRequest, options?: CallOptions): Promise<[
protos.google.cloud.compute.v1.IProject,
protos.google.cloud.compute.v1.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 |
protos.google.cloud.compute.v1.IGetXpnHostProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.compute.v1.IProject,
protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callGetXpnHost() {
// Construct request
const request = {
project,
};
// Run request
const response = await computeClient.getXpnHost(request);
console.log(response);
}
callGetXpnHost();
getXpnHost(request, options, callback)
getXpnHost(request: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnHostProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getXpnHost(request, callback)
getXpnHost(request: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnHostProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IProject, protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getXpnResources(request, options)
getXpnResources(request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, options?: CallOptions): Promise<[
protos.google.cloud.compute.v1.IXpnResourceId[],
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest | null,
protos.google.cloud.compute.v1.IProjectsGetXpnResources
]>;
Gets service resources (a.k.a service project) associated with this host project.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.compute.v1.IXpnResourceId[],
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest | null,
protos.google.cloud.compute.v1.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.v1.IGetXpnResourcesProjectsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, protos.google.cloud.compute.v1.IProjectsGetXpnResources | null | undefined, protos.google.cloud.compute.v1.IXpnResourceId>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, protos.google.cloud.compute.v1.IProjectsGetXpnResources | null | undefined, protos.google.cloud.compute.v1.IXpnResourceId>
|
Returns | |
---|---|
Type | Description |
void |
getXpnResources(request, callback)
getXpnResources(request: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, callback: PaginationCallback<protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, protos.google.cloud.compute.v1.IProjectsGetXpnResources | null | undefined, protos.google.cloud.compute.v1.IXpnResourceId>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest
|
callback |
PaginationCallback<protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, protos.google.cloud.compute.v1.IProjectsGetXpnResources | null | undefined, protos.google.cloud.compute.v1.IXpnResourceId>
|
Returns | |
---|---|
Type | Description |
void |
getXpnResourcesAsync(request, options)
getXpnResourcesAsync(request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.compute.v1.IXpnResourceId>;
Equivalent to getXpnResources
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.compute.v1.IXpnResourceId> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* 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.
*/
/**
* A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: labels.owner:*
(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)
/ // const filter = 'abc123' /*
- The maximum number of results per page that should be returned. If the number of available results is larger than
maxResults
, Compute Engine returns 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 using
orderBy="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. Set
pageToken
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. */ // const returnPartialSuccess = true
// Imports the Compute library const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client const computeClient = new ProjectsClient();
async function callGetXpnResources() { // Construct request const request = { project, };
// Run request const iterable = await computeClient.getXpnResourcesAsync(request); for await (const response of iterable) { console.log(response); } }
callGetXpnResources();
getXpnResourcesStream(request, options)
getXpnResourcesStream(request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions 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.v1.IListXpnHostsProjectsRequest, options?: CallOptions): Promise<[
protos.google.cloud.compute.v1.IProject[],
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest | null,
protos.google.cloud.compute.v1.IXpnHostList
]>;
Lists all shared VPC host projects visible to the user in an organization.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.compute.v1.IProject[],
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest | null,
protos.google.cloud.compute.v1.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.v1.IListXpnHostsProjectsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, protos.google.cloud.compute.v1.IXpnHostList | null | undefined, protos.google.cloud.compute.v1.IProject>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, protos.google.cloud.compute.v1.IXpnHostList | null | undefined, protos.google.cloud.compute.v1.IProject>
|
Returns | |
---|---|
Type | Description |
void |
listXpnHosts(request, callback)
listXpnHosts(request: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, callback: PaginationCallback<protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, protos.google.cloud.compute.v1.IXpnHostList | null | undefined, protos.google.cloud.compute.v1.IProject>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest
|
callback |
PaginationCallback<protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, protos.google.cloud.compute.v1.IXpnHostList | null | undefined, protos.google.cloud.compute.v1.IProject>
|
Returns | |
---|---|
Type | Description |
void |
listXpnHostsAsync(request, options)
listXpnHostsAsync(request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.compute.v1.IProject>;
Equivalent to listXpnHosts
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.compute.v1.IProject> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* 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.
*/
/**
* A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`,><=`, `="">=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: labels.owner:*
(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)
/ // const filter = 'abc123' /*
- The maximum number of results per page that should be returned. If the number of available results is larger than
maxResults
, Compute Engine returns 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 using
orderBy="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. Set
pageToken
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' /*
- 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. */ // const returnPartialSuccess = true
// Imports the Compute library const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client const computeClient = new ProjectsClient();
async function callListXpnHosts() { // Construct request const request = { project, projectsListXpnHostsRequestResource, };
// Run request const iterable = await computeClient.listXpnHostsAsync(request); for await (const response of iterable) { console.log(response); } }
callListXpnHosts();
listXpnHostsStream(request, options)
listXpnHostsStream(request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions 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.v1.IMoveDiskProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Moves a persistent disk from one zone to another.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveDiskProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callMoveDisk() {
// Construct request
const request = {
diskMoveRequestResource,
project,
};
// Run request
const response = await computeClient.moveDisk(request);
console.log(response);
}
callMoveDisk();
moveDisk(request, options, callback)
moveDisk(request: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveDiskProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
moveDisk(request, callback)
moveDisk(request: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveDiskProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
moveInstance(request, options)
moveInstance(request?: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.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).
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveInstanceProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callMoveInstance() {
// Construct request
const request = {
instanceMoveRequestResource,
project,
};
// Run request
const response = await computeClient.moveInstance(request);
console.log(response);
}
callMoveInstance();
moveInstance(request, options, callback)
moveInstance(request: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveInstanceProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
moveInstance(request, callback)
moveInstance(request: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.IMoveInstanceProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setCommonInstanceMetadata(request, options)
setCommonInstanceMetadata(request?: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Sets metadata common to all instances within the specified project using the data included in the request.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callSetCommonInstanceMetadata() {
// Construct request
const request = {
metadataResource,
project,
};
// Run request
const response = await computeClient.setCommonInstanceMetadata(request);
console.log(response);
}
callSetCommonInstanceMetadata();
setCommonInstanceMetadata(request, options, callback)
setCommonInstanceMetadata(request: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setCommonInstanceMetadata(request, callback)
setCommonInstanceMetadata(request: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setDefaultNetworkTier(request, options)
setDefaultNetworkTier(request?: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.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 |
protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callSetDefaultNetworkTier() {
// Construct request
const request = {
project,
projectsSetDefaultNetworkTierRequestResource,
};
// Run request
const response = await computeClient.setDefaultNetworkTier(request);
console.log(response);
}
callSetDefaultNetworkTier();
setDefaultNetworkTier(request, options, callback)
setDefaultNetworkTier(request: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setDefaultNetworkTier(request, callback)
setDefaultNetworkTier(request: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setUsageExportBucket(request, options)
setUsageExportBucket(request?: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]>;
Enables the usage export feature and sets the usage 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 |
protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.compute.v1.IOperation, null>,
protos.google.cloud.compute.v1.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. This method is considered to be in beta. This means while stable it is still a work-in-progress and under active development, and might get backwards-incompatible changes at any time. |
/**
* 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 library
const {ProjectsClient} = require('@google-cloud/compute').v1;
// Instantiates a client
const computeClient = new ProjectsClient();
async function callSetUsageExportBucket() {
// Construct request
const request = {
project,
usageExportLocationResource,
};
// Run request
const response = await computeClient.setUsageExportBucket(request);
console.log(response);
}
callSetUsageExportBucket();
setUsageExportBucket(request, options, callback)
setUsageExportBucket(request: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setUsageExportBucket(request, callback)
setUsageExportBucket(request: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, callback: Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest
|
callback |
Callback<protos.google.cloud.compute.v1.IOperation, protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |