Cloud Run WorkerPool Control Plane API. v2
Package
@google-cloud/runConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of WorkerPoolsClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;descriptors
descriptors: Descriptors;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};locationsClient
locationsClient: LocationsClient;operationsClient
operationsClient: gax.OperationsClient;pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};port
static get port(): number;The port for this API service.
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.
universeDomain
get universeDomain(): string;warn
warn: (code: string, message: string, warnType?: string) => void;workerPoolsStub
workerPoolsStub?: Promise<{
[name: string]: Function;
}>;Methods
cancelOperation(request, optionsOrCallback, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.
| Parameters | |
|---|---|
| Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
|
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkCreateWorkerPoolProgress(name)
checkCreateWorkerPoolProgress(name: string): Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>>;Check the status of the long running operation returned by createWorkerPool().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation 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.
*/
/**
* Required. The location and project in which this worker pool should be
* created. Format: `projects/{project}/locations/{location}`, where
* `{project}` can be project id or number. Only lowercase characters, digits,
* and hyphens.
*/
// const parent = 'abc123'
/**
* Required. The WorkerPool instance to create.
*/
// const workerPool = {}
/**
* Required. The unique identifier for the WorkerPool. It must begin with
* letter, and cannot end with hyphen; must contain fewer than 50 characters.
* The name of the worker pool becomes
* `{parent}/workerPools/{worker_pool_id}`.
*/
// const workerPoolId = 'abc123'
/**
* Optional. Indicates that the request should be validated and default values
* populated, without persisting the request or creating any resources.
*/
// const validateOnly = true
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callCreateWorkerPool() {
// Construct request
const request = {
parent,
workerPool,
workerPoolId,
};
// Run request
const [operation] = await runClient.createWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateWorkerPool();
checkDeleteWorkerPoolProgress(name)
checkDeleteWorkerPoolProgress(name: string): Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>>;Check the status of the long running operation returned by deleteWorkerPool().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation 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.
*/
/**
* Required. The full name of the WorkerPool.
* Format:
* `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
* `{project}` can be project id or number.
*/
// const name = 'abc123'
/**
* Optional. Indicates that the request should be validated without actually
* deleting any resources.
*/
// const validateOnly = true
/**
* A system-generated fingerprint for this version of the
* resource. May be used to detect modification conflict during updates.
*/
// const etag = 'abc123'
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callDeleteWorkerPool() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await runClient.deleteWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteWorkerPool();
checkUpdateWorkerPoolProgress(name)
checkUpdateWorkerPoolProgress(name: string): Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>>;Check the status of the long running operation returned by updateWorkerPool().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.run.v2.WorkerPool, protos.google.cloud.run.v2.WorkerPool>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation 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.
*/
/**
* Optional. The list of fields to be updated.
*/
// const updateMask = {}
/**
* Required. The WorkerPool to be updated.
*/
// const workerPool = {}
/**
* Optional. Indicates that the request should be validated and default values
* populated, without persisting the request or updating any resources.
*/
// const validateOnly = true
/**
* Optional. If set to true, and if the WorkerPool does not exist, it will
* create a new one. The caller must have 'run.workerpools.create' permissions
* if this is set to true and the WorkerPool does not exist.
*/
// const allowMissing = true
/**
* Optional. If set to true, a new revision will be created from the template
* even if the system doesn't detect any changes from the previously deployed
* revision.
* This may be useful for cases where the underlying resources need to be
* recreated or reinitialized. For example if the image is specified by label,
* but the underlying image digest has changed) or if the container performs
* deployment initialization work that needs to be performed again.
*/
// const forceNewRevision = true
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callUpdateWorkerPool() {
// Construct request
const request = {
workerPool,
};
// Run request
const [operation] = await runClient.updateWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateWorkerPool();
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. |
createWorkerPool(request, options)
createWorkerPool(request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Creates a new WorkerPool in a given project and location.
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateWorkerPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.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. Its |
/**
* 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.
*/
/**
* Required. The location and project in which this worker pool should be
* created. Format: `projects/{project}/locations/{location}`, where
* `{project}` can be project id or number. Only lowercase characters, digits,
* and hyphens.
*/
// const parent = 'abc123'
/**
* Required. The WorkerPool instance to create.
*/
// const workerPool = {}
/**
* Required. The unique identifier for the WorkerPool. It must begin with
* letter, and cannot end with hyphen; must contain fewer than 50 characters.
* The name of the worker pool becomes
* `{parent}/workerPools/{worker_pool_id}`.
*/
// const workerPoolId = 'abc123'
/**
* Optional. Indicates that the request should be validated and default values
* populated, without persisting the request or creating any resources.
*/
// const validateOnly = true
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callCreateWorkerPool() {
// Construct request
const request = {
parent,
workerPool,
workerPoolId,
};
// Run request
const [operation] = await runClient.createWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateWorkerPool();
createWorkerPool(request, options, callback)
createWorkerPool(request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateWorkerPoolRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createWorkerPool(request, callback)
createWorkerPool(request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateWorkerPoolRequest
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteOperation(request, optionsOrCallback, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deleteWorkerPool(request, options)
deleteWorkerPool(request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Deletes a WorkerPool.
| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteWorkerPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.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. Its |
/**
* 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.
*/
/**
* Required. The full name of the WorkerPool.
* Format:
* `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
* `{project}` can be project id or number.
*/
// const name = 'abc123'
/**
* Optional. Indicates that the request should be validated without actually
* deleting any resources.
*/
// const validateOnly = true
/**
* A system-generated fingerprint for this version of the
* resource. May be used to detect modification conflict during updates.
*/
// const etag = 'abc123'
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callDeleteWorkerPool() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await runClient.deleteWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteWorkerPool();
deleteWorkerPool(request, options, callback)
deleteWorkerPool(request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteWorkerPoolRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteWorkerPool(request, callback)
deleteWorkerPool(request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteWorkerPoolRequest
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
executionPath(project, location, job, execution)
executionPath(project: string, location: string, job: string, execution: string): string;Return a fully-qualified execution resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
job |
string
|
execution |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;Gets the IAM Access Control policy currently in effect for the given Cloud Run WorkerPool. This result does not include any inherited policies.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. Please see the documentation 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.
*/
/**
* REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
*/
// const options = {}
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callGetIamPolicy() {
// Construct request
const request = {
resource,
};
// Run request
const response = await runClient.getIamPolicy(request);
console.log(response);
}
callGetIamPolicy();
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;Gets information about a location.
| Parameters | |
|---|---|
| Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
Promise<google.cloud.location.ILocation> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, optionsOrCallback, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
| Parameters | |
|---|---|
| Name | Description |
request |
GetOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.longrunning.Operation]> |
|
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
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 |
|
getWorkerPool(request, options)
getWorkerPool(request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, options?: CallOptions): Promise<[
protos.google.cloud.run.v2.IWorkerPool,
protos.google.cloud.run.v2.IGetWorkerPoolRequest | undefined,
{} | undefined
]>;Gets information about a WorkerPool.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetWorkerPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.run.v2.IWorkerPool,
protos.google.cloud.run.v2.IGetWorkerPoolRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing WorkerPool. Please see the documentation 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.
*/
/**
* Required. The full name of the WorkerPool.
* Format:
* `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
* `{project}` can be project id or number.
*/
// const name = 'abc123'
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callGetWorkerPool() {
// Construct request
const request = {
name,
};
// Run request
const response = await runClient.getWorkerPool(request);
console.log(response);
}
callGetWorkerPool();
getWorkerPool(request, options, callback)
getWorkerPool(request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, options: CallOptions, callback: Callback<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IGetWorkerPoolRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetWorkerPoolRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IGetWorkerPoolRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getWorkerPool(request, callback)
getWorkerPool(request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, callback: Callback<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IGetWorkerPoolRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetWorkerPoolRequest
|
callback |
Callback<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IGetWorkerPoolRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
instancePath(project, location, instance)
instancePath(project: string, location: string, instance: string): string;Return a fully-qualified instance resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
jobPath(project, location, job)
jobPath(project: string, location: string, job: string): string;Return a fully-qualified job resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
job |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;Lists information about the supported locations for this service. Returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<google.cloud.location.ILocation> |
{Object} An iterable Object that allows async 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 the documentation for more details and examples. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.longrunning.IOperation> |
{Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listWorkerPools(request, options)
listWorkerPools(request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, options?: CallOptions): Promise<[
protos.google.cloud.run.v2.IWorkerPool[],
protos.google.cloud.run.v2.IListWorkerPoolsRequest | null,
protos.google.cloud.run.v2.IListWorkerPoolsResponse
]>;Lists WorkerPools. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
request |
IListWorkerPoolsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.run.v2.IWorkerPool[],
protos.google.cloud.run.v2.IListWorkerPoolsRequest | null,
protos.google.cloud.run.v2.IListWorkerPoolsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of WorkerPool. 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 |
listWorkerPools(request, options, callback)
listWorkerPools(request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.run.v2.IListWorkerPoolsRequest, protos.google.cloud.run.v2.IListWorkerPoolsResponse | null | undefined, protos.google.cloud.run.v2.IWorkerPool>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListWorkerPoolsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.run.v2.IListWorkerPoolsRequest, protos.google.cloud.run.v2.IListWorkerPoolsResponse | null | undefined, protos.google.cloud.run.v2.IWorkerPool>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listWorkerPools(request, callback)
listWorkerPools(request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, callback: PaginationCallback<protos.google.cloud.run.v2.IListWorkerPoolsRequest, protos.google.cloud.run.v2.IListWorkerPoolsResponse | null | undefined, protos.google.cloud.run.v2.IWorkerPool>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListWorkerPoolsRequest
|
callback |
PaginationCallback<protos.google.cloud.run.v2.IListWorkerPoolsRequest, protos.google.cloud.run.v2.IListWorkerPoolsResponse | null | undefined, protos.google.cloud.run.v2.IWorkerPool>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listWorkerPoolsAsync(request, options)
listWorkerPoolsAsync(request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.run.v2.IWorkerPool>;Equivalent to listWorkerPools, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListWorkerPoolsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.run.v2.IWorkerPool> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing WorkerPool. 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 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.
*/
/**
* Required. The location and project to list resources on.
* Location must be a valid Google Cloud region, and cannot be the "-"
* wildcard. Format: `projects/{project}/locations/{location}`, where
* `{project}` can be project id or number.
*/
// const parent = 'abc123'
/**
* Maximum number of WorkerPools to return in this call.
*/
// const pageSize = 1234
/**
* A page token received from a previous call to ListWorkerPools.
* All other parameters must match.
*/
// const pageToken = 'abc123'
/**
* If true, returns deleted (but unexpired) resources along with active ones.
*/
// const showDeleted = true
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callListWorkerPools() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = runClient.listWorkerPoolsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListWorkerPools();
listWorkerPoolsStream(request, options)
listWorkerPoolsStream(request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, options?: CallOptions): Transform;Equivalent to listWorkerPools, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListWorkerPoolsRequest
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 WorkerPool 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 |
locationPath(project, location)
locationPath(project: string, location: string): string;Return a fully-qualified location resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
matchExecutionFromExecutionName(executionName)
matchExecutionFromExecutionName(executionName: string): string | number;Parse the execution from Execution resource.
| Parameter | |
|---|---|
| Name | Description |
executionName |
string
A fully-qualified path representing Execution resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the execution. |
matchExecutionFromTaskName(taskName)
matchExecutionFromTaskName(taskName: string): string | number;Parse the execution from Task resource.
| Parameter | |
|---|---|
| Name | Description |
taskName |
string
A fully-qualified path representing Task resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the execution. |
matchInstanceFromInstanceName(instanceName)
matchInstanceFromInstanceName(instanceName: string): string | number;Parse the instance from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the instance. |
matchJobFromExecutionName(executionName)
matchJobFromExecutionName(executionName: string): string | number;Parse the job from Execution resource.
| Parameter | |
|---|---|
| Name | Description |
executionName |
string
A fully-qualified path representing Execution resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the job. |
matchJobFromJobName(jobName)
matchJobFromJobName(jobName: string): string | number;Parse the job from Job resource.
| Parameter | |
|---|---|
| Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the job. |
matchJobFromTaskName(taskName)
matchJobFromTaskName(taskName: string): string | number;Parse the job from Task resource.
| Parameter | |
|---|---|
| Name | Description |
taskName |
string
A fully-qualified path representing Task resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the job. |
matchLocationFromExecutionName(executionName)
matchLocationFromExecutionName(executionName: string): string | number;Parse the location from Execution resource.
| Parameter | |
|---|---|
| Name | Description |
executionName |
string
A fully-qualified path representing Execution resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromInstanceName(instanceName)
matchLocationFromInstanceName(instanceName: string): string | number;Parse the location from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromJobName(jobName)
matchLocationFromJobName(jobName: string): string | number;Parse the location from Job resource.
| Parameter | |
|---|---|
| Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;Parse the location from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromRevisionName(revisionName)
matchLocationFromRevisionName(revisionName: string): string | number;Parse the location from Revision resource.
| Parameter | |
|---|---|
| Name | Description |
revisionName |
string
A fully-qualified path representing Revision resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromServiceName(serviceName)
matchLocationFromServiceName(serviceName: string): string | number;Parse the location from Service resource.
| Parameter | |
|---|---|
| Name | Description |
serviceName |
string
A fully-qualified path representing Service resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromTaskName(taskName)
matchLocationFromTaskName(taskName: string): string | number;Parse the location from Task resource.
| Parameter | |
|---|---|
| Name | Description |
taskName |
string
A fully-qualified path representing Task resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromWorkerPoolName(workerPoolName)
matchLocationFromWorkerPoolName(workerPoolName: string): string | number;Parse the location from WorkerPool resource.
| Parameter | |
|---|---|
| Name | Description |
workerPoolName |
string
A fully-qualified path representing WorkerPool resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromExecutionName(executionName)
matchProjectFromExecutionName(executionName: string): string | number;Parse the project from Execution resource.
| Parameter | |
|---|---|
| Name | Description |
executionName |
string
A fully-qualified path representing Execution resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromInstanceName(instanceName)
matchProjectFromInstanceName(instanceName: string): string | number;Parse the project from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromJobName(jobName)
matchProjectFromJobName(jobName: string): string | number;Parse the project from Job resource.
| Parameter | |
|---|---|
| Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;Parse the project from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromRevisionName(revisionName)
matchProjectFromRevisionName(revisionName: string): string | number;Parse the project from Revision resource.
| Parameter | |
|---|---|
| Name | Description |
revisionName |
string
A fully-qualified path representing Revision resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromServiceName(serviceName)
matchProjectFromServiceName(serviceName: string): string | number;Parse the project from Service resource.
| Parameter | |
|---|---|
| Name | Description |
serviceName |
string
A fully-qualified path representing Service resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromTaskName(taskName)
matchProjectFromTaskName(taskName: string): string | number;Parse the project from Task resource.
| Parameter | |
|---|---|
| Name | Description |
taskName |
string
A fully-qualified path representing Task resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromWorkerPoolName(workerPoolName)
matchProjectFromWorkerPoolName(workerPoolName: string): string | number;Parse the project from WorkerPool resource.
| Parameter | |
|---|---|
| Name | Description |
workerPoolName |
string
A fully-qualified path representing WorkerPool resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchRevisionFromRevisionName(revisionName)
matchRevisionFromRevisionName(revisionName: string): string | number;Parse the revision from Revision resource.
| Parameter | |
|---|---|
| Name | Description |
revisionName |
string
A fully-qualified path representing Revision resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the revision. |
matchServiceFromRevisionName(revisionName)
matchServiceFromRevisionName(revisionName: string): string | number;Parse the service from Revision resource.
| Parameter | |
|---|---|
| Name | Description |
revisionName |
string
A fully-qualified path representing Revision resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the service. |
matchServiceFromServiceName(serviceName)
matchServiceFromServiceName(serviceName: string): string | number;Parse the service from Service resource.
| Parameter | |
|---|---|
| Name | Description |
serviceName |
string
A fully-qualified path representing Service resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the service. |
matchTaskFromTaskName(taskName)
matchTaskFromTaskName(taskName: string): string | number;Parse the task from Task resource.
| Parameter | |
|---|---|
| Name | Description |
taskName |
string
A fully-qualified path representing Task resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the task. |
matchWorkerPoolFromWorkerPoolName(workerPoolName)
matchWorkerPoolFromWorkerPoolName(workerPoolName: string): string | number;Parse the worker_pool from WorkerPool resource.
| Parameter | |
|---|---|
| Name | Description |
workerPoolName |
string
A fully-qualified path representing WorkerPool resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the worker_pool. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
revisionPath(project, location, service, revision)
revisionPath(project: string, location: string, service: string, revision: string): string;Return a fully-qualified revision resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
service |
string
|
revision |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
servicePath(project, location, service)
servicePath(project: string, location: string, service: string): string;Return a fully-qualified service resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
service |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;Sets the IAM Access control policy for the specified WorkerPool. Overwrites any existing policy.
| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. Please see the documentation 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.
*/
/**
* REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* REQUIRED: The complete policy to be applied to the `resource`. The size of
* the policy is limited to a few 10s of KB. An empty policy is a
* valid policy but certain Cloud Platform services (such as Projects)
* might reject them.
*/
// const policy = {}
/**
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used:
* `paths: "bindings, etag"`
*/
// const updateMask = {}
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callSetIamPolicy() {
// Construct request
const request = {
resource,
policy,
};
// Run request
const response = await runClient.setIamPolicy(request);
console.log(response);
}
callSetIamPolicy();
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
taskPath(project, location, job, execution, task)
taskPath(project: string, location: string, job: string, execution: string, task: string): string;Return a fully-qualified task resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
job |
string
|
execution |
string
|
task |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;Returns permissions that a caller has on the specified Project.
There are no permissions required for making this API call.
| Parameters | |
|---|---|
| Name | Description |
request |
ITestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse. Please see the documentation 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.
*/
/**
* REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
*/
// const permissions = ['abc','def']
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callTestIamPermissions() {
// Construct request
const request = {
resource,
permissions,
};
// Run request
const response = await runClient.testIamPermissions(request);
console.log(response);
}
callTestIamPermissions();
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ITestIamPermissionsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ITestIamPermissionsRequest
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
updateWorkerPool(request, options)
updateWorkerPool(request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Updates a WorkerPool.
| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateWorkerPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>,
protos.google.longrunning.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. Its |
/**
* 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.
*/
/**
* Optional. The list of fields to be updated.
*/
// const updateMask = {}
/**
* Required. The WorkerPool to be updated.
*/
// const workerPool = {}
/**
* Optional. Indicates that the request should be validated and default values
* populated, without persisting the request or updating any resources.
*/
// const validateOnly = true
/**
* Optional. If set to true, and if the WorkerPool does not exist, it will
* create a new one. The caller must have 'run.workerpools.create' permissions
* if this is set to true and the WorkerPool does not exist.
*/
// const allowMissing = true
/**
* Optional. If set to true, a new revision will be created from the template
* even if the system doesn't detect any changes from the previously deployed
* revision.
* This may be useful for cases where the underlying resources need to be
* recreated or reinitialized. For example if the image is specified by label,
* but the underlying image digest has changed) or if the container performs
* deployment initialization work that needs to be performed again.
*/
// const forceNewRevision = true
// Imports the Run library
const {WorkerPoolsClient} = require('@google-cloud/run').v2;
// Instantiates a client
const runClient = new WorkerPoolsClient();
async function callUpdateWorkerPool() {
// Construct request
const request = {
workerPool,
};
// Run request
const [operation] = await runClient.updateWorkerPool(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateWorkerPool();
updateWorkerPool(request, options, callback)
updateWorkerPool(request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateWorkerPoolRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
updateWorkerPool(request, callback)
updateWorkerPool(request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, callback: Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateWorkerPoolRequest
|
callback |
Callback<LROperation<protos.google.cloud.run.v2.IWorkerPool, protos.google.cloud.run.v2.IWorkerPool>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
workerPoolPath(project, location, workerPool)
workerPoolPath(project: string, location: string, workerPool: string): string;Return a fully-qualified workerPool resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
workerPool |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |