Class v1.CloudControlsPartnerMonitoringClient (0.1.0)

Service describing handlers for resources v1

Package

@google-cloud/cloudcontrolspartner

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of CloudControlsPartnerMonitoringClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudControlsPartnerMonitoringClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

cloudControlsPartnerMonitoringStub

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

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [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.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

accessApprovalRequestPath(organization, location, customer, workload, accessApprovalRequest)

accessApprovalRequestPath(organization: string, location: string, customer: string, workload: string, accessApprovalRequest: string): string;

Return a fully-qualified accessApprovalRequest resource name string.

Parameters
NameDescription
organization string
location string
customer string
workload string
accessApprovalRequest string
Returns
TypeDescription
string

{string} Resource name string.

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.

customerPath(organization, location, customer)

customerPath(organization: string, location: string, customer: string): string;

Return a fully-qualified customer resource name string.

Parameters
NameDescription
organization string
location string
customer string
Returns
TypeDescription
string

{string} Resource name string.

ekmConnectionsPath(organization, location, customer, workload)

ekmConnectionsPath(organization: string, location: string, customer: string, workload: string): string;

Return a fully-qualified ekmConnections resource name string.

Parameters
NameDescription
organization string
location string
customer string
workload string
Returns
TypeDescription
string

{string} Resource name string.

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

getViolation(request, options)

getViolation(request?: protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest, options?: CallOptions): Promise<[
        protos.google.cloud.cloudcontrolspartner.v1.IViolation,
        (protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single Violation.

Parameters
NameDescription
request IGetViolationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.cloudcontrolspartner.v1.IViolation, (protos.google.cloud.cloudcontrolspartner.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 for more details and examples.

Example

  /**
   * 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. Format:
   *  `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
   */
  // const name = 'abc123'

  // Imports the Cloudcontrolspartner library
  const {CloudControlsPartnerMonitoringClient} = require('@google-cloud/cloudcontrolspartner').v1;

  // Instantiates a client
  const cloudcontrolspartnerClient = new CloudControlsPartnerMonitoringClient();

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

    // Run request
    const response = await cloudcontrolspartnerClient.getViolation(request);
    console.log(response);
  }

  callGetViolation();

getViolation(request, options, callback)

getViolation(request: protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest, options: CallOptions, callback: Callback<protos.google.cloud.cloudcontrolspartner.v1.IViolation, protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetViolationRequest
options CallOptions
callback Callback<protos.google.cloud.cloudcontrolspartner.v1.IViolation, protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getViolation(request, callback)

getViolation(request: protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest, callback: Callback<protos.google.cloud.cloudcontrolspartner.v1.IViolation, protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetViolationRequest
callback Callback<protos.google.cloud.cloudcontrolspartner.v1.IViolation, protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest | null | undefined, {} | null | 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.

listViolations(request, options)

listViolations(request?: protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.cloudcontrolspartner.v1.IViolation[],
        protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest | null,
        protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse
    ]>;

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
NameDescription
request IListViolationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.cloudcontrolspartner.v1.IViolation[], protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest | null, protos.google.cloud.cloudcontrolspartner.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 listViolationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listViolations(request, options, callback)

listViolations(request: protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse | null | undefined, protos.google.cloud.cloudcontrolspartner.v1.IViolation>): void;
Parameters
NameDescription
request IListViolationsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse | null | undefined, protos.google.cloud.cloudcontrolspartner.v1.IViolation>
Returns
TypeDescription
void

listViolations(request, callback)

listViolations(request: protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, callback: PaginationCallback<protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse | null | undefined, protos.google.cloud.cloudcontrolspartner.v1.IViolation>): void;
Parameters
NameDescription
request IListViolationsRequest
callback PaginationCallback<protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse | null | undefined, protos.google.cloud.cloudcontrolspartner.v1.IViolation>
Returns
TypeDescription
void

listViolationsAsync(request, options)

listViolationsAsync(request?: protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.cloudcontrolspartner.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
NameDescription
request IListViolationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.cloudcontrolspartner.v1.IViolation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * 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
   *  Format
   *  `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of customers row to return. The service may
   *  return fewer than this value. If unspecified, at most 10 customers will be
   *  returned.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `ListViolations` call.
   *  Provide this to retrieve the subsequent page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results
   */
  // const orderBy = 'abc123'
  /**
   *  Optional. Specifies the interval for retrieving violations.
   *  if unspecified, all violations will be returned.
   */
  // const interval = {}

  // Imports the Cloudcontrolspartner library
  const {CloudControlsPartnerMonitoringClient} = require('@google-cloud/cloudcontrolspartner').v1;

  // Instantiates a client
  const cloudcontrolspartnerClient = new CloudControlsPartnerMonitoringClient();

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

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

  callListViolations();

listViolationsStream(request, options)

listViolationsStream(request?: protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListViolationsRequest

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 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 listViolationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchAccessApprovalRequestFromAccessApprovalRequestName(accessApprovalRequestName)

matchAccessApprovalRequestFromAccessApprovalRequestName(accessApprovalRequestName: string): string | number;

Parse the access_approval_request from AccessApprovalRequest resource.

Parameter
NameDescription
accessApprovalRequestName string

A fully-qualified path representing AccessApprovalRequest resource.

Returns
TypeDescription
string | number

{string} A string representing the access_approval_request.

matchCustomerFromAccessApprovalRequestName(accessApprovalRequestName)

matchCustomerFromAccessApprovalRequestName(accessApprovalRequestName: string): string | number;

Parse the customer from AccessApprovalRequest resource.

Parameter
NameDescription
accessApprovalRequestName string

A fully-qualified path representing AccessApprovalRequest resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromCustomerName(customerName)

matchCustomerFromCustomerName(customerName: string): string | number;

Parse the customer from Customer resource.

Parameter
NameDescription
customerName string

A fully-qualified path representing Customer resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromEkmConnectionsName(ekmConnectionsName)

matchCustomerFromEkmConnectionsName(ekmConnectionsName: string): string | number;

Parse the customer from EkmConnections resource.

Parameter
NameDescription
ekmConnectionsName string

A fully-qualified path representing EkmConnections resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromPartnerPermissionsName(partnerPermissionsName)

matchCustomerFromPartnerPermissionsName(partnerPermissionsName: string): string | number;

Parse the customer from PartnerPermissions resource.

Parameter
NameDescription
partnerPermissionsName string

A fully-qualified path representing PartnerPermissions resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromViolationName(violationName)

matchCustomerFromViolationName(violationName: string): string | number;

Parse the customer from Violation resource.

Parameter
NameDescription
violationName string

A fully-qualified path representing Violation resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromWorkloadName(workloadName)

matchCustomerFromWorkloadName(workloadName: string): string | number;

Parse the customer from Workload resource.

Parameter
NameDescription
workloadName string

A fully-qualified path representing Workload resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchLocationFromAccessApprovalRequestName(accessApprovalRequestName)

matchLocationFromAccessApprovalRequestName(accessApprovalRequestName: string): string | number;

Parse the location from AccessApprovalRequest resource.

Parameter
NameDescription
accessApprovalRequestName string

A fully-qualified path representing AccessApprovalRequest resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromCustomerName(customerName)

matchLocationFromCustomerName(customerName: string): string | number;

Parse the location from Customer resource.

Parameter
NameDescription
customerName string

A fully-qualified path representing Customer resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromEkmConnectionsName(ekmConnectionsName)

matchLocationFromEkmConnectionsName(ekmConnectionsName: string): string | number;

Parse the location from EkmConnections resource.

Parameter
NameDescription
ekmConnectionsName string

A fully-qualified path representing EkmConnections resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromPartnerName(partnerName)

matchLocationFromPartnerName(partnerName: string): string | number;

Parse the location from Partner resource.

Parameter
NameDescription
partnerName string

A fully-qualified path representing Partner resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromPartnerPermissionsName(partnerPermissionsName)

matchLocationFromPartnerPermissionsName(partnerPermissionsName: string): string | number;

Parse the location from PartnerPermissions resource.

Parameter
NameDescription
partnerPermissionsName string

A fully-qualified path representing PartnerPermissions resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromViolationName(violationName)

matchLocationFromViolationName(violationName: string): string | number;

Parse the location from Violation resource.

Parameter
NameDescription
violationName string

A fully-qualified path representing Violation resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromWorkloadName(workloadName)

matchLocationFromWorkloadName(workloadName: string): string | number;

Parse the location from Workload resource.

Parameter
NameDescription
workloadName string

A fully-qualified path representing Workload resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchOrganizationFromAccessApprovalRequestName(accessApprovalRequestName)

matchOrganizationFromAccessApprovalRequestName(accessApprovalRequestName: string): string | number;

Parse the organization from AccessApprovalRequest resource.

Parameter
NameDescription
accessApprovalRequestName string

A fully-qualified path representing AccessApprovalRequest resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromCustomerName(customerName)

matchOrganizationFromCustomerName(customerName: string): string | number;

Parse the organization from Customer resource.

Parameter
NameDescription
customerName string

A fully-qualified path representing Customer resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromEkmConnectionsName(ekmConnectionsName)

matchOrganizationFromEkmConnectionsName(ekmConnectionsName: string): string | number;

Parse the organization from EkmConnections resource.

Parameter
NameDescription
ekmConnectionsName string

A fully-qualified path representing EkmConnections resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromPartnerName(partnerName)

matchOrganizationFromPartnerName(partnerName: string): string | number;

Parse the organization from Partner resource.

Parameter
NameDescription
partnerName string

A fully-qualified path representing Partner resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromPartnerPermissionsName(partnerPermissionsName)

matchOrganizationFromPartnerPermissionsName(partnerPermissionsName: string): string | number;

Parse the organization from PartnerPermissions resource.

Parameter
NameDescription
partnerPermissionsName string

A fully-qualified path representing PartnerPermissions resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromViolationName(violationName)

matchOrganizationFromViolationName(violationName: string): string | number;

Parse the organization from Violation resource.

Parameter
NameDescription
violationName string

A fully-qualified path representing Violation resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromWorkloadName(workloadName)

matchOrganizationFromWorkloadName(workloadName: string): string | number;

Parse the organization from Workload resource.

Parameter
NameDescription
workloadName string

A fully-qualified path representing Workload resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchViolationFromViolationName(violationName)

matchViolationFromViolationName(violationName: string): string | number;

Parse the violation from Violation resource.

Parameter
NameDescription
violationName string

A fully-qualified path representing Violation resource.

Returns
TypeDescription
string | number

{string} A string representing the violation.

matchWorkloadFromAccessApprovalRequestName(accessApprovalRequestName)

matchWorkloadFromAccessApprovalRequestName(accessApprovalRequestName: string): string | number;

Parse the workload from AccessApprovalRequest resource.

Parameter
NameDescription
accessApprovalRequestName string

A fully-qualified path representing AccessApprovalRequest resource.

Returns
TypeDescription
string | number

{string} A string representing the workload.

matchWorkloadFromEkmConnectionsName(ekmConnectionsName)

matchWorkloadFromEkmConnectionsName(ekmConnectionsName: string): string | number;

Parse the workload from EkmConnections resource.

Parameter
NameDescription
ekmConnectionsName string

A fully-qualified path representing EkmConnections resource.

Returns
TypeDescription
string | number

{string} A string representing the workload.

matchWorkloadFromPartnerPermissionsName(partnerPermissionsName)

matchWorkloadFromPartnerPermissionsName(partnerPermissionsName: string): string | number;

Parse the workload from PartnerPermissions resource.

Parameter
NameDescription
partnerPermissionsName string

A fully-qualified path representing PartnerPermissions resource.

Returns
TypeDescription
string | number

{string} A string representing the workload.

matchWorkloadFromViolationName(violationName)

matchWorkloadFromViolationName(violationName: string): string | number;

Parse the workload from Violation resource.

Parameter
NameDescription
violationName string

A fully-qualified path representing Violation resource.

Returns
TypeDescription
string | number

{string} A string representing the workload.

matchWorkloadFromWorkloadName(workloadName)

matchWorkloadFromWorkloadName(workloadName: string): string | number;

Parse the workload from Workload resource.

Parameter
NameDescription
workloadName string

A fully-qualified path representing Workload resource.

Returns
TypeDescription
string | number

{string} A string representing the workload.

partnerPath(organization, location)

partnerPath(organization: string, location: string): string;

Return a fully-qualified partner resource name string.

Parameters
NameDescription
organization string
location string
Returns
TypeDescription
string

{string} Resource name string.

partnerPermissionsPath(organization, location, customer, workload)

partnerPermissionsPath(organization: string, location: string, customer: string, workload: string): string;

Return a fully-qualified partnerPermissions resource name string.

Parameters
NameDescription
organization string
location string
customer string
workload string
Returns
TypeDescription
string

{string} Resource name string.

violationPath(organization, location, customer, workload, violation)

violationPath(organization: string, location: string, customer: string, workload: string, violation: string): string;

Return a fully-qualified violation resource name string.

Parameters
NameDescription
organization string
location string
customer string
workload string
violation string
Returns
TypeDescription
string

{string} Resource name string.

workloadPath(organization, location, customer, workload)

workloadPath(organization: string, location: string, customer: string, workload: string): string;

Return a fully-qualified workload resource name string.

Parameters
NameDescription
organization string
location string
customer string
workload string
Returns
TypeDescription
string

{string} Resource name string.