Service to manage AssuredWorkloads. v1
Package
@google-cloud/assured-workloadsConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of AssuredWorkloadsServiceClient.
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.
assuredWorkloadsServiceStub
assuredWorkloadsServiceStub?: Promise<{
[name: string]: Function;
}>;
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
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.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
acknowledgeViolation(request, options)
acknowledgeViolation(request?: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse,
(protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | undefined),
{} | undefined
]>;
Acknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse,
(protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | 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.
*/
/**
* Required. The resource name of the Violation to acknowledge.
* Format:
* organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
*/
// const name = 'abc123'
/**
* Required. Business justification explaining the need for violation acknowledgement
*/
// const comment = 'abc123'
/**
* Optional. This field is deprecated and will be removed in future version of the API.
* Name of the OrgPolicy which was modified with non-compliant change and
* resulted in this violation.
* Format:
* projects/{project_number}/policies/{constraint_name}
* folders/{folder_id}/policies/{constraint_name}
* organizations/{organization_id}/policies/{constraint_name}
*/
// const nonCompliantOrgPolicy = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callAcknowledgeViolation() {
// Construct request
const request = {
name,
comment,
};
// Run request
const response = await assuredworkloadsClient.acknowledgeViolation(request);
console.log(response);
}
callAcknowledgeViolation();
acknowledgeViolation(request, options, callback)
acknowledgeViolation(request: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, options: CallOptions, callback: Callback<protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
acknowledgeViolation(request, callback)
acknowledgeViolation(request: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, callback: Callback<protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | 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 |
protos.google.longrunning.CancelOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
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: ''});
checkCreateWorkloadProgress(name)
checkCreateWorkloadProgress(name: string): Promise<LROperation<protos.google.cloud.assuredworkloads.v1.Workload, protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata>>;
Check the status of the long running operation returned by createWorkload()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.assuredworkloads.v1.Workload, protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata>> | {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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 name of the new Workload's parent.
* Must be of the form `organizations/{org_id}/locations/{location_id}`.
*/
// const parent = 'abc123'
/**
* Required. Assured Workload to create
*/
// const workload = {}
/**
* Optional. A identifier associated with the workload and underlying projects which
* allows for the break down of billing costs for a workload. The value
* provided for the identifier will add a label to the workload and contained
* projects with the identifier as the value.
*/
// const externalId = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callCreateWorkload() {
// Construct request
const request = {
parent,
workload,
};
// Run request
const [operation] = await assuredworkloadsClient.createWorkload(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateWorkload();
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. |
createWorkload(request, options)
createWorkload(request?: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates Assured Workload.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>,
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 resource name of the new Workload's parent.
* Must be of the form `organizations/{org_id}/locations/{location_id}`.
*/
// const parent = 'abc123'
/**
* Required. Assured Workload to create
*/
// const workload = {}
/**
* Optional. A identifier associated with the workload and underlying projects which
* allows for the break down of billing costs for a workload. The value
* provided for the identifier will add a label to the workload and contained
* projects with the identifier as the value.
*/
// const externalId = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callCreateWorkload() {
// Construct request
const request = {
parent,
workload,
};
// Run request
const [operation] = await assuredworkloadsClient.createWorkload(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateWorkload();
createWorkload(request, options, callback)
createWorkload(request: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createWorkload(request, callback)
createWorkload(request: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, callback: Callback<LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest
|
callback |
Callback<LROperation<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: 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 |
protos.google.longrunning.DeleteOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
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: ''});
deleteWorkload(request, options)
deleteWorkload(request?: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | undefined),
{} | undefined
]>;
Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | 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.
*/
/**
* Required. The `name` field is used to identify the workload.
* Format:
* organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
*/
// const name = 'abc123'
/**
* Optional. The etag of the workload.
* If this is provided, it must match the server's etag.
*/
// const etag = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callDeleteWorkload() {
// Construct request
const request = {
name,
};
// Run request
const response = await assuredworkloadsClient.deleteWorkload(request);
console.log(response);
}
callDeleteWorkload();
deleteWorkload(request, options, callback)
deleteWorkload(request: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteWorkload(request, callback)
deleteWorkload(request: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: 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 |
protos.google.longrunning.GetOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
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 |
getViolation(request, options)
getViolation(request?: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IViolation,
protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | undefined,
{} | undefined
]>;
Retrieves Assured Workload Violation based on ID.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetViolationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IViolation,
protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | 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.
*/
/**
* Required. The resource name of the Violation to fetch (ie. Violation.name).
* Format:
* organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
*/
// const name = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callGetViolation() {
// Construct request
const request = {
name,
};
// Run request
const response = await assuredworkloadsClient.getViolation(request);
console.log(response);
}
callGetViolation();
getViolation(request, options, callback)
getViolation(request: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, options: CallOptions, callback: Callback<protos.google.cloud.assuredworkloads.v1.IViolation, protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetViolationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IViolation, protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getViolation(request, callback)
getViolation(request: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, callback: Callback<protos.google.cloud.assuredworkloads.v1.IViolation, protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetViolationRequest
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IViolation, protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getWorkload(request, options)
getWorkload(request?: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload,
protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | undefined,
{} | undefined
]>;
Gets Assured Workload associated with a CRM Node
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload,
protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | 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.
*/
/**
* Required. The resource name of the Workload to fetch. This is the workload's
* relative path in the API, formatted as
* "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
* For example,
* "organizations/123/locations/us-east1/workloads/assured-workload-1".
*/
// const name = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callGetWorkload() {
// Construct request
const request = {
name,
};
// Run request
const response = await assuredworkloadsClient.getWorkload(request);
console.log(response);
}
callGetWorkload();
getWorkload(request, options, callback)
getWorkload(request: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, options: CallOptions, callback: Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getWorkload(request, callback)
getWorkload(request: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, callback: Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | 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. |
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
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 |
protos.google.longrunning.ListOperationsRequest
The request object that will be sent. |
options |
gax.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.ListOperationsResponse> | {Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listViolations(request, options)
listViolations(request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IViolation[],
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest | null,
protos.google.cloud.assuredworkloads.v1.IListViolationsResponse
]>;
Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format organizations/{org_id}/locations/{location}/workloads/-
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IViolation[],
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest | null,
protos.google.cloud.assuredworkloads.v1.IListViolationsResponse
]> | {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 |
listViolations(request, options, callback)
listViolations(request: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, protos.google.cloud.assuredworkloads.v1.IListViolationsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IViolation>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, protos.google.cloud.assuredworkloads.v1.IListViolationsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IViolation>
|
Returns | |
---|---|
Type | Description |
void |
listViolations(request, callback)
listViolations(request: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, callback: PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, protos.google.cloud.assuredworkloads.v1.IListViolationsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IViolation>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest
|
callback |
PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, protos.google.cloud.assuredworkloads.v1.IListViolationsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IViolation>
|
Returns | |
---|---|
Type | Description |
void |
listViolationsAsync(request, options)
listViolationsAsync(request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.assuredworkloads.v1.IViolation>;
Equivalent to listViolations
, 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.assuredworkloads.v1.IListViolationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.assuredworkloads.v1.IViolation> | {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.
*/
/**
* Required. The Workload name.
* Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
*/
// const parent = 'abc123'
/**
* Optional. Specifies the time window for retrieving active Violations.
* When specified, retrieves Violations that were active between start_time
* and end_time.
*/
// const interval = {}
/**
* Optional. Page size.
*/
// const pageSize = 1234
/**
* Optional. Page token returned from previous request.
*/
// const pageToken = 'abc123'
/**
* Optional. A custom filter for filtering by the Violations properties.
*/
// const filter = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callListViolations() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await assuredworkloadsClient.listViolationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListViolations();
listViolationsStream(request, options)
listViolationsStream(request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListViolationsRequest
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 |
listWorkloads(request, options)
listWorkloads(request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload[],
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest | null,
protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse
]>;
Lists Assured Workloads under a CRM Node.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload[],
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest | null,
protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse
]> | {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 |
listWorkloads(request, options, callback)
listWorkloads(request: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IWorkload>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IWorkload>
|
Returns | |
---|---|
Type | Description |
void |
listWorkloads(request, callback)
listWorkloads(request: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, callback: PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IWorkload>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest
|
callback |
PaginationCallback<protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse | null | undefined, protos.google.cloud.assuredworkloads.v1.IWorkload>
|
Returns | |
---|---|
Type | Description |
void |
listWorkloadsAsync(request, options)
listWorkloadsAsync(request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.assuredworkloads.v1.IWorkload>;
Equivalent to listWorkloads
, 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.assuredworkloads.v1.IListWorkloadsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.assuredworkloads.v1.IWorkload> | {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.
*/
/**
* Required. Parent Resource to list workloads from.
* Must be of the form `organizations/{org_id}/locations/{location}`.
*/
// const parent = 'abc123'
/**
* Page size.
*/
// const pageSize = 1234
/**
* Page token returned from previous request. Page token contains context from
* previous request. Page token needs to be passed in the second and following
* requests.
*/
// const pageToken = 'abc123'
/**
* A custom filter for filtering by properties of a workload. At this time,
* only filtering by labels is supported.
*/
// const filter = 'abc123'
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callListWorkloads() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await assuredworkloadsClient.listWorkloadsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListWorkloads();
listWorkloadsStream(request, options)
listWorkloadsStream(request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest
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 |
locationPath(organization, location)
locationPath(organization: string, location: string): string;
Return a fully-qualified location resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
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. |
matchLocationFromViolationName(violationName)
matchLocationFromViolationName(violationName: string): string | number;
Parse the location from Violation resource.
Parameter | |
---|---|
Name | Description |
violationName |
string
A fully-qualified path representing Violation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromWorkloadName(workloadName)
matchLocationFromWorkloadName(workloadName: string): string | number;
Parse the location from Workload resource.
Parameter | |
---|---|
Name | Description |
workloadName |
string
A fully-qualified path representing Workload resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchOrganizationFromLocationName(locationName)
matchOrganizationFromLocationName(locationName: string): string | number;
Parse the organization 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 organization. |
matchOrganizationFromOrganizationName(organizationName)
matchOrganizationFromOrganizationName(organizationName: string): string | number;
Parse the organization from Organization resource.
Parameter | |
---|---|
Name | Description |
organizationName |
string
A fully-qualified path representing Organization resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationFromViolationName(violationName)
matchOrganizationFromViolationName(violationName: string): string | number;
Parse the organization from Violation resource.
Parameter | |
---|---|
Name | Description |
violationName |
string
A fully-qualified path representing Violation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationFromWorkloadName(workloadName)
matchOrganizationFromWorkloadName(workloadName: string): string | number;
Parse the organization from Workload resource.
Parameter | |
---|---|
Name | Description |
workloadName |
string
A fully-qualified path representing Workload resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchViolationFromViolationName(violationName)
matchViolationFromViolationName(violationName: string): string | number;
Parse the violation from Violation resource.
Parameter | |
---|---|
Name | Description |
violationName |
string
A fully-qualified path representing Violation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the violation. |
matchWorkloadFromViolationName(violationName)
matchWorkloadFromViolationName(violationName: string): string | number;
Parse the workload from Violation resource.
Parameter | |
---|---|
Name | Description |
violationName |
string
A fully-qualified path representing Violation resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the workload. |
matchWorkloadFromWorkloadName(workloadName)
matchWorkloadFromWorkloadName(workloadName: string): string | number;
Parse the workload from Workload resource.
Parameter | |
---|---|
Name | Description |
workloadName |
string
A fully-qualified path representing Workload resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the workload. |
organizationPath(organization)
organizationPath(organization: string): string;
Return a fully-qualified organization resource name string.
Parameter | |
---|---|
Name | Description |
organization |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
restrictAllowedResources(request, options)
restrictAllowedResources(request?: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse,
(protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | undefined),
{} | undefined
]>;
Restrict the list of resources allowed in the Workload environment. The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse,
(protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | 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.
*/
/**
* Required. The resource name of the Workload. This is the workloads's
* relative path in the API, formatted as
* "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
* For example,
* "organizations/123/locations/us-east1/workloads/assured-workload-1".
*/
// const name = 'abc123'
/**
* Required. The type of restriction for using gcp products in the Workload environment.
*/
// const restrictionType = {}
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callRestrictAllowedResources() {
// Construct request
const request = {
name,
restrictionType,
};
// Run request
const response = await assuredworkloadsClient.restrictAllowedResources(request);
console.log(response);
}
callRestrictAllowedResources();
restrictAllowedResources(request, options, callback)
restrictAllowedResources(request: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, options: CallOptions, callback: Callback<protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
restrictAllowedResources(request, callback)
restrictAllowedResources(request: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, callback: Callback<protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateWorkload(request, options)
updateWorkload(request?: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, options?: CallOptions): Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload,
(protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | undefined),
{} | undefined
]>;
Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.assuredworkloads.v1.IWorkload,
(protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | 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.
*/
/**
* Required. The workload to update.
* The workload's `name` field is used to identify the workload to be updated.
* Format:
* organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
*/
// const workload = {}
/**
* Required. The list of fields to be updated.
*/
// const updateMask = {}
// Imports the Assuredworkloads library
const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1;
// Instantiates a client
const assuredworkloadsClient = new AssuredWorkloadsServiceClient();
async function callUpdateWorkload() {
// Construct request
const request = {
workload,
updateMask,
};
// Run request
const response = await assuredworkloadsClient.updateWorkload(request);
console.log(response);
}
callUpdateWorkload();
updateWorkload(request, options, callback)
updateWorkload(request: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, options: CallOptions, callback: Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateWorkload(request, callback)
updateWorkload(request: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, callback: Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest
|
callback |
Callback<protos.google.cloud.assuredworkloads.v1.IWorkload, protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
violationPath(organization, location, workload, violation)
violationPath(organization: string, location: string, workload: string, violation: string): string;
Return a fully-qualified violation resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
workload |
string
|
violation |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
workloadPath(organization, location, workload)
workloadPath(organization: string, location: string, workload: string): string;
Return a fully-qualified workload resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
workload |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |