Class v1.OsConfigServiceClient

OS Config API

The OS Config service is a server-side component that you can use to manage package installations and patch jobs for virtual machine instances. v1

Package

@google-cloud/os-config

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of OsConfigServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

osConfigServiceStub

osConfigServiceStub?: Promise<{
        [name: string]: Function;
    }>;

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

cancelPatchJob(request, options)

cancelPatchJob(request?: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | undefined, {} | undefined]>;

Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICancelPatchJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PatchJob]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the patch in the form `projects/* /patchJobs/*`
   */
  // const name = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callCancelPatchJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await osconfigClient.cancelPatchJob(request);
    console.log(response);
  }

  callCancelPatchJob();

cancelPatchJob(request, options, callback)

cancelPatchJob(request: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICancelPatchJobRequest
options CallOptions
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelPatchJob(request, callback)

cancelPatchJob(request: protos.google.cloud.osconfig.v1.ICancelPatchJobRequest, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICancelPatchJobRequest
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.ICancelPatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createPatchDeployment(request, options)

createPatchDeployment(request?: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | undefined, {} | undefined]>;

Create an OS Config patch deployment.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PatchDeployment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project to apply this patch deployment to in the form
   *  `projects/*`.
   */
  // const parent = 'abc123'
  /**
   *  Required. A name for the patch deployment in the project. When creating a
   *  name the following rules apply:
   *  * Must contain only lowercase letters, numbers, and hyphens.
   *  * Must start with a letter.
   *  * Must be between 1-63 characters.
   *  * Must end with a number or a letter.
   *  * Must be unique within the project.
   */
  // const patchDeploymentId = 'abc123'
  /**
   *  Required. The patch deployment to create.
   */
  // const patchDeployment = {}

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callCreatePatchDeployment() {
    // Construct request
    const request = {
      parent,
      patchDeploymentId,
      patchDeployment,
    };

    // Run request
    const response = await osconfigClient.createPatchDeployment(request);
    console.log(response);
  }

  callCreatePatchDeployment();

createPatchDeployment(request, options, callback)

createPatchDeployment(request: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, options: CallOptions, callback: Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest
options CallOptions
callback Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createPatchDeployment(request, callback)

createPatchDeployment(request: protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest, callback: Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest
callback Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.ICreatePatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deletePatchDeployment(request, options)

deletePatchDeployment(request?: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | undefined, {} | undefined]>;

Delete an OS Config patch deployment.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the patch deployment in the form
   *  `projects/* /patchDeployments/*`.
   */
  // const name = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callDeletePatchDeployment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await osconfigClient.deletePatchDeployment(request);
    console.log(response);
  }

  callDeletePatchDeployment();

deletePatchDeployment(request, options, callback)

deletePatchDeployment(request: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deletePatchDeployment(request, callback)

deletePatchDeployment(request: protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.osconfig.v1.IDeletePatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

executePatchJob(request, options)

executePatchJob(request?: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | undefined, {} | undefined]>;

Patch VM instances by creating and running a patch job.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IExecutePatchJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PatchJob]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project in which to run this patch in the form `projects/*`
   */
  // const parent = 'abc123'
  /**
   *  Description of the patch job. Length of the description is limited
   *  to 1024 characters.
   */
  // const description = 'abc123'
  /**
   *  Required. Instances to patch, either explicitly or filtered by some
   *  criteria such as zone or labels.
   */
  // const instanceFilter = {}
  /**
   *  Patch configuration being applied. If omitted, instances are
   *  patched using the default configurations.
   */
  // const patchConfig = {}
  /**
   *  Duration of the patch job. After the duration ends, the patch job
   *  times out.
   */
  // const duration = {}
  /**
   *  If this patch is a dry-run only, instances are contacted but
   *  will do nothing.
   */
  // const dryRun = true
  /**
   *  Display name for this patch job. This does not have to be unique.
   */
  // const displayName = 'abc123'
  /**
   *  Rollout strategy of the patch job.
   */
  // const rollout = {}

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callExecutePatchJob() {
    // Construct request
    const request = {
      parent,
      instanceFilter,
    };

    // Run request
    const response = await osconfigClient.executePatchJob(request);
    console.log(response);
  }

  callExecutePatchJob();

executePatchJob(request, options, callback)

executePatchJob(request: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IExecutePatchJobRequest
options CallOptions
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

executePatchJob(request, callback)

executePatchJob(request: protos.google.cloud.osconfig.v1.IExecutePatchJobRequest, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IExecutePatchJobRequest
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IExecutePatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getPatchDeployment(request, options)

getPatchDeployment(request?: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | undefined, {} | undefined]>;

Get an OS Config patch deployment.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PatchDeployment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the patch deployment in the form
   *  `projects/* /patchDeployments/*`.
   */
  // const name = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callGetPatchDeployment() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await osconfigClient.getPatchDeployment(request);
    console.log(response);
  }

  callGetPatchDeployment();

getPatchDeployment(request, options, callback)

getPatchDeployment(request: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, options: CallOptions, callback: Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest
options CallOptions
callback Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getPatchDeployment(request, callback)

getPatchDeployment(request: protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest, callback: Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest
callback Callback<protos.google.cloud.osconfig.v1.IPatchDeployment, protos.google.cloud.osconfig.v1.IGetPatchDeploymentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getPatchJob(request, options)

getPatchJob(request?: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | undefined, {} | undefined]>;

Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PatchJob]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the patch in the form `projects/* /patchJobs/*`
   */
  // const name = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callGetPatchJob() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await osconfigClient.getPatchJob(request);
    console.log(response);
  }

  callGetPatchJob();

getPatchJob(request, options, callback)

getPatchJob(request: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchJobRequest
options CallOptions
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getPatchJob(request, callback)

getPatchJob(request: protos.google.cloud.osconfig.v1.IGetPatchJobRequest, callback: Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IGetPatchJobRequest
callback Callback<protos.google.cloud.osconfig.v1.IPatchJob, protos.google.cloud.osconfig.v1.IGetPatchJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

inventoryPath(project, location, instance)

inventoryPath(project: string, location: string, instance: string): string;

Return a fully-qualified inventory resource name string.

Parameters
NameDescription
project string
location string
instance string
Returns
TypeDescription
string

{string} Resource name string.

listPatchDeployments(request, options)

listPatchDeployments(request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment[], protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest | null, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse]>;

Get a page of OS Config patch deployments.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchDeployment[], protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest | null, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [PatchDeployment]. 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 listPatchDeploymentsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listPatchDeployments(request, options, callback)

listPatchDeployments(request: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchDeployment>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchDeployment>
Returns
TypeDescription
void

listPatchDeployments(request, callback)

listPatchDeployments(request: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchDeployment>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, protos.google.cloud.osconfig.v1.IListPatchDeploymentsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchDeployment>
Returns
TypeDescription
void

listPatchDeploymentsAsync(request, options)

listPatchDeploymentsAsync(request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.osconfig.v1.IPatchDeployment>;

Equivalent to listPatchDeployments, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.osconfig.v1.IPatchDeployment>

{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 [PatchDeployment]. 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.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the parent in the form `projects/*`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of patch deployments to return. Default is
   *  100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A pagination token returned from a previous call to
   *  ListPatchDeployments that indicates where this listing should continue
   *  from.
   */
  // const pageToken = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callListPatchDeployments() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await osconfigClient.listPatchDeploymentsAsync(request);
    for await (const response of iterable) {
      console.log(response);
    }
  }

  callListPatchDeployments();

listPatchDeploymentsStream(request, options)

listPatchDeploymentsStream(request?: protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchDeploymentsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [PatchDeployment] 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 listPatchDeploymentsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listPatchJobInstanceDetails(request, options)

listPatchJobInstanceDetails(request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[], protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest | null, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse]>;

Get a list of instance details for a given patch job.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails[], protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest | null, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [PatchJobInstanceDetails]. 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 listPatchJobInstanceDetailsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listPatchJobInstanceDetails(request, options, callback)

listPatchJobInstanceDetails(request: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>
Returns
TypeDescription
void

listPatchJobInstanceDetails(request, callback)

listPatchJobInstanceDetails(request: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>
Returns
TypeDescription
void

listPatchJobInstanceDetailsAsync(request, options)

listPatchJobInstanceDetailsAsync(request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>;

Equivalent to listPatchJobInstanceDetails, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.osconfig.v1.IPatchJobInstanceDetails>

{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 [PatchJobInstanceDetails]. 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.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent for the instances are in the form of
   *  `projects/* /patchJobs/*`.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of instance details records to return.  Default is 100.
   */
  // const pageSize = 1234
  /**
   *  A pagination token returned from a previous call
   *  that indicates where this listing should continue from.
   */
  // const pageToken = 'abc123'
  /**
   *  A filter expression that filters results listed in the response. This
   *  field supports filtering results by instance zone, name, state, or
   *  `failure_reason`.
   */
  // const filter = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callListPatchJobInstanceDetails() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await osconfigClient.listPatchJobInstanceDetailsAsync(
      request
    );
    for await (const response of iterable) {
      console.log(response);
    }
  }

  callListPatchJobInstanceDetails();

listPatchJobInstanceDetailsStream(request, options)

listPatchJobInstanceDetailsStream(request?: protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobInstanceDetailsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [PatchJobInstanceDetails] 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 listPatchJobInstanceDetailsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listPatchJobs(request, options)

listPatchJobs(request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, options?: CallOptions): Promise<[protos.google.cloud.osconfig.v1.IPatchJob[], protos.google.cloud.osconfig.v1.IListPatchJobsRequest | null, protos.google.cloud.osconfig.v1.IListPatchJobsResponse]>;

Get a list of patch jobs.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.osconfig.v1.IPatchJob[], protos.google.cloud.osconfig.v1.IListPatchJobsRequest | null, protos.google.cloud.osconfig.v1.IListPatchJobsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [PatchJob]. 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 listPatchJobsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listPatchJobs(request, options, callback)

listPatchJobs(request: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobsRequest, protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJob>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobsRequest, protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJob>
Returns
TypeDescription
void

listPatchJobs(request, callback)

listPatchJobs(request: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, callback: PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobsRequest, protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJob>): void;
Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobsRequest
callback PaginationCallback<protos.google.cloud.osconfig.v1.IListPatchJobsRequest, protos.google.cloud.osconfig.v1.IListPatchJobsResponse | null | undefined, protos.google.cloud.osconfig.v1.IPatchJob>
Returns
TypeDescription
void

listPatchJobsAsync(request, options)

listPatchJobsAsync(request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.osconfig.v1.IPatchJob>;

Equivalent to listPatchJobs, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.osconfig.v1.IPatchJob>

{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 [PatchJob]. 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.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. In the form of `projects/*`
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of instance status to return.
   */
  // const pageSize = 1234
  /**
   *  A pagination token returned from a previous call
   *  that indicates where this listing should continue from.
   */
  // const pageToken = 'abc123'
  /**
   *  If provided, this field specifies the criteria that must be met by patch
   *  jobs to be included in the response.
   *  Currently, filtering is only available on the patch_deployment field.
   */
  // const filter = 'abc123'

  // Imports the Osconfig library
  const {OsConfigServiceClient} = require('@google-cloud/os-config').v1;

  // Instantiates a client
  const osconfigClient = new OsConfigServiceClient();

  async function callListPatchJobs() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await osconfigClient.listPatchJobsAsync(request);
    for await (const response of iterable) {
      console.log(response);
    }
  }

  callListPatchJobs();

listPatchJobsStream(request, options)

listPatchJobsStream(request?: protos.google.cloud.osconfig.v1.IListPatchJobsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.osconfig.v1.IListPatchJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [PatchJob] 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 listPatchJobsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchAssignmentFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName)

matchAssignmentFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName: string): string | number;

Parse the assignment from OSPolicyAssignmentReport resource.

Parameter
NameDescription
oSPolicyAssignmentReportName string

A fully-qualified path representing OSPolicyAssignmentReport resource.

Returns
TypeDescription
string | number

{string} A string representing the assignment.

matchInstanceFromInventoryName(inventoryName)

matchInstanceFromInventoryName(inventoryName: string): string | number;

Parse the instance from Inventory resource.

Parameter
NameDescription
inventoryName string

A fully-qualified path representing Inventory resource.

Returns
TypeDescription
string | number

{string} A string representing the instance.

matchInstanceFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName)

matchInstanceFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName: string): string | number;

Parse the instance from OSPolicyAssignmentReport resource.

Parameter
NameDescription
oSPolicyAssignmentReportName string

A fully-qualified path representing OSPolicyAssignmentReport resource.

Returns
TypeDescription
string | number

{string} A string representing the instance.

matchInstanceFromVulnerabilityReportName(vulnerabilityReportName)

matchInstanceFromVulnerabilityReportName(vulnerabilityReportName: string): string | number;

Parse the instance from VulnerabilityReport resource.

Parameter
NameDescription
vulnerabilityReportName string

A fully-qualified path representing VulnerabilityReport resource.

Returns
TypeDescription
string | number

{string} A string representing the instance.

matchLocationFromInventoryName(inventoryName)

matchLocationFromInventoryName(inventoryName: string): string | number;

Parse the location from Inventory resource.

Parameter
NameDescription
inventoryName string

A fully-qualified path representing Inventory resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromOSPolicyAssignmentName(oSPolicyAssignmentName)

matchLocationFromOSPolicyAssignmentName(oSPolicyAssignmentName: string): string | number;

Parse the location from OSPolicyAssignment resource.

Parameter
NameDescription
oSPolicyAssignmentName string

A fully-qualified path representing OSPolicyAssignment resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName)

matchLocationFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName: string): string | number;

Parse the location from OSPolicyAssignmentReport resource.

Parameter
NameDescription
oSPolicyAssignmentReportName string

A fully-qualified path representing OSPolicyAssignmentReport resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromVulnerabilityReportName(vulnerabilityReportName)

matchLocationFromVulnerabilityReportName(vulnerabilityReportName: string): string | number;

Parse the location from VulnerabilityReport resource.

Parameter
NameDescription
vulnerabilityReportName string

A fully-qualified path representing VulnerabilityReport resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchOsPolicyAssignmentFromOSPolicyAssignmentName(oSPolicyAssignmentName)

matchOsPolicyAssignmentFromOSPolicyAssignmentName(oSPolicyAssignmentName: string): string | number;

Parse the os_policy_assignment from OSPolicyAssignment resource.

Parameter
NameDescription
oSPolicyAssignmentName string

A fully-qualified path representing OSPolicyAssignment resource.

Returns
TypeDescription
string | number

{string} A string representing the os_policy_assignment.

matchPatchDeploymentFromPatchDeploymentName(patchDeploymentName)

matchPatchDeploymentFromPatchDeploymentName(patchDeploymentName: string): string | number;

Parse the patch_deployment from PatchDeployment resource.

Parameter
NameDescription
patchDeploymentName string

A fully-qualified path representing PatchDeployment resource.

Returns
TypeDescription
string | number

{string} A string representing the patch_deployment.

matchPatchJobFromPatchJobName(patchJobName)

matchPatchJobFromPatchJobName(patchJobName: string): string | number;

Parse the patch_job from PatchJob resource.

Parameter
NameDescription
patchJobName string

A fully-qualified path representing PatchJob resource.

Returns
TypeDescription
string | number

{string} A string representing the patch_job.

matchProjectFromInventoryName(inventoryName)

matchProjectFromInventoryName(inventoryName: string): string | number;

Parse the project from Inventory resource.

Parameter
NameDescription
inventoryName string

A fully-qualified path representing Inventory resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromOSPolicyAssignmentName(oSPolicyAssignmentName)

matchProjectFromOSPolicyAssignmentName(oSPolicyAssignmentName: string): string | number;

Parse the project from OSPolicyAssignment resource.

Parameter
NameDescription
oSPolicyAssignmentName string

A fully-qualified path representing OSPolicyAssignment resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName)

matchProjectFromOSPolicyAssignmentReportName(oSPolicyAssignmentReportName: string): string | number;

Parse the project from OSPolicyAssignmentReport resource.

Parameter
NameDescription
oSPolicyAssignmentReportName string

A fully-qualified path representing OSPolicyAssignmentReport resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromPatchDeploymentName(patchDeploymentName)

matchProjectFromPatchDeploymentName(patchDeploymentName: string): string | number;

Parse the project from PatchDeployment resource.

Parameter
NameDescription
patchDeploymentName string

A fully-qualified path representing PatchDeployment resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromPatchJobName(patchJobName)

matchProjectFromPatchJobName(patchJobName: string): string | number;

Parse the project from PatchJob resource.

Parameter
NameDescription
patchJobName string

A fully-qualified path representing PatchJob resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromVulnerabilityReportName(vulnerabilityReportName)

matchProjectFromVulnerabilityReportName(vulnerabilityReportName: string): string | number;

Parse the project from VulnerabilityReport resource.

Parameter
NameDescription
vulnerabilityReportName string

A fully-qualified path representing VulnerabilityReport resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

oSPolicyAssignmentPath(project, location, osPolicyAssignment)

oSPolicyAssignmentPath(project: string, location: string, osPolicyAssignment: string): string;

Return a fully-qualified oSPolicyAssignment resource name string.

Parameters
NameDescription
project string
location string
osPolicyAssignment string
Returns
TypeDescription
string

{string} Resource name string.

oSPolicyAssignmentReportPath(project, location, instance, assignment)

oSPolicyAssignmentReportPath(project: string, location: string, instance: string, assignment: string): string;

Return a fully-qualified oSPolicyAssignmentReport resource name string.

Parameters
NameDescription
project string
location string
instance string
assignment string
Returns
TypeDescription
string

{string} Resource name string.

patchDeploymentPath(project, patchDeployment)

patchDeploymentPath(project: string, patchDeployment: string): string;

Return a fully-qualified patchDeployment resource name string.

Parameters
NameDescription
project string
patchDeployment string
Returns
TypeDescription
string

{string} Resource name string.

patchJobPath(project, patchJob)

patchJobPath(project: string, patchJob: string): string;

Return a fully-qualified patchJob resource name string.

Parameters
NameDescription
project string
patchJob string
Returns
TypeDescription
string

{string} Resource name string.

vulnerabilityReportPath(project, location, instance)

vulnerabilityReportPath(project: string, location: string, instance: string): string;

Return a fully-qualified vulnerabilityReport resource name string.

Parameters
NameDescription
project string
location string
instance string
Returns
TypeDescription
string

{string} Resource name string.