ConfigServiceV2Client

v2. ConfigServiceV2Client

Service for configuring sinks used to route log entries.

Constructor

new ConfigServiceV2Client(optionsopt, fallback)

Construct an instance of ConfigServiceV2Client.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

client configuration override. TODO(@alexander-fenster): link to gax documentation.

fallback boolean

Use HTTP fallback mode. In fallback mode, a special browser-compatible transport implementation is used instead of gRPC transport. In browser context (if the window object is defined) the fallback mode is enabled automatically; set options.fallback to false if you need to override this behavior.

Members

apiEndpoint

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

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

billingAccountCmekSettingsPath(billing_account) → {string}

Return a fully-qualified billingAccountCmekSettings resource name string.

Parameters:
Name Type Description
billing_account string
Returns:
Type Description
string

Resource name string.

billingAccountExclusionPath(billing_account, exclusion) → {string}

Return a fully-qualified billingAccountExclusion resource name string.

Parameters:
Name Type Description
billing_account string
exclusion string
Returns:
Type Description
string

Resource name string.

billingAccountLocationBucketPath(billing_account, location, bucket) → {string}

Return a fully-qualified billingAccountLocationBucket resource name string.

Parameters:
Name Type Description
billing_account string
location string
bucket string
Returns:
Type Description
string

Resource name string.

billingAccountLogPath(billing_account, log) → {string}

Return a fully-qualified billingAccountLog resource name string.

Parameters:
Name Type Description
billing_account string
log string
Returns:
Type Description
string

Resource name string.

billingAccountSinkPath(billing_account, sink) → {string}

Return a fully-qualified billingAccountSink resource name string.

Parameters:
Name Type Description
billing_account string
sink string
Returns:
Type Description
string

Resource name string.

close() → {Promise}

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

A promise that resolves when the client is closed.

createExclusion(request, optionsopt) → {Promise}

Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The parent resource in which to create the exclusion:

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"

Examples: "projects/my-logging-project", "organizations/123456789".

exclusion google.logging.v2.LogExclusion

Required. The new exclusion, whose name parameter is an exclusion name that is not already used in the parent resource.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogExclusion. Please see the documentation for more details and examples.
Example
const [response] = await client.createExclusion(request);

createSink(request, optionsopt) → {Promise}

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The resource in which to create the sink:

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"

Examples: "projects/my-logging-project", "organizations/123456789".

sink google.logging.v2.LogSink

Required. The new sink, whose name parameter is a sink identifier that is not already in use.

uniqueWriterIdentity boolean <optional>

Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.

If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogSink. Please see the documentation for more details and examples.
Example
const [response] = await client.createSink(request);

deleteExclusion(request, optionsopt) → {Promise}

Deletes an exclusion.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The resource name of an existing exclusion to delete:

  "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
  "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
  "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"

Example: "projects/my-project-id/exclusions/my-exclusion-id".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.
Example
const [response] = await client.deleteExclusion(request);

deleteSink(request, optionsopt) → {Promise}

Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
sinkName string

Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:

  "projects/[PROJECT_ID]/sinks/[SINK_ID]"
  "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
  "folders/[FOLDER_ID]/sinks/[SINK_ID]"

Example: "projects/my-project-id/sinks/my-sink-id".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.
Example
const [response] = await client.deleteSink(request);

folderCmekSettingsPath(folder) → {string}

Return a fully-qualified folderCmekSettings resource name string.

Parameters:
Name Type Description
folder string
Returns:
Type Description
string

Resource name string.

folderExclusionPath(folder, exclusion) → {string}

Return a fully-qualified folderExclusion resource name string.

Parameters:
Name Type Description
folder string
exclusion string
Returns:
Type Description
string

Resource name string.

folderLocationBucketPath(folder, location, bucket) → {string}

Return a fully-qualified folderLocationBucket resource name string.

Parameters:
Name Type Description
folder string
location string
bucket string
Returns:
Type Description
string

Resource name string.

folderLogPath(folder, log) → {string}

Return a fully-qualified folderLog resource name string.

Parameters:
Name Type Description
folder string
log string
Returns:
Type Description
string

Resource name string.

folderSinkPath(folder, sink) → {string}

Return a fully-qualified folderSink resource name string.

Parameters:
Name Type Description
folder string
sink string
Returns:
Type Description
string

Resource name string.

getBucket(request, optionsopt) → {Promise}

Gets a bucket (Beta).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The resource name of the bucket:

  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogBucket. Please see the documentation for more details and examples.
Example
const [response] = await client.getBucket(request);

getCmekSettings(request, optionsopt) → {Promise}

Gets the Logs Router CMEK settings for the given resource.

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

See Enabling CMEK for Logs Router for more information.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The resource for which to retrieve CMEK settings.

  "projects/[PROJECT_ID]/cmekSettings"
  "organizations/[ORGANIZATION_ID]/cmekSettings"
  "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
  "folders/[FOLDER_ID]/cmekSettings"

Example: "organizations/12345/cmekSettings".

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing CmekSettings. Please see the documentation for more details and examples.
Example
const [response] = await client.getCmekSettings(request);

getExclusion(request, optionsopt) → {Promise}

Gets the description of an exclusion.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The resource name of an existing exclusion:

  "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
  "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
  "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"

Example: "projects/my-project-id/exclusions/my-exclusion-id".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogExclusion. Please see the documentation for more details and examples.
Example
const [response] = await client.getExclusion(request);

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

getSink(request, optionsopt) → {Promise}

Gets a sink.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
sinkName string

Required. The resource name of the sink:

  "projects/[PROJECT_ID]/sinks/[SINK_ID]"
  "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
  "folders/[FOLDER_ID]/sinks/[SINK_ID]"

Example: "projects/my-project-id/sinks/my-sink-id".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogSink. Please see the documentation for more details and examples.
Example
const [response] = await client.getSink(request);

initialize() → {Promise}

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

A promise that resolves to an authenticated service stub.

listBuckets(request, optionsopt) → {Promise}

Lists buckets (Beta).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose buckets are to be listed:

  "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
  "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
  "folders/[FOLDER_ID]/locations/[LOCATION_ID]"

Note: The locations portion of the resource must be specified, but supplying the character - in place of [LOCATION_ID] will return all buckets.

pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of LogBucket. 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 listBucketsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listBucketsAsync(request, optionsopt) → {Object}

Equivalent to listBuckets, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose buckets are to be listed:

  "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
  "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
  "folders/[FOLDER_ID]/locations/[LOCATION_ID]"

Note: The locations portion of the resource must be specified, but supplying the character - in place of [LOCATION_ID] will return all buckets.

pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing LogBucket. 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
const iterable = client.listBucketsAsync(request);
for await (const response of iterable) {
  // process response
}

listBucketsStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose buckets are to be listed:

  "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
  "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
  "folders/[FOLDER_ID]/locations/[LOCATION_ID]"

Note: The locations portion of the resource must be specified, but supplying the character - in place of [LOCATION_ID] will return all buckets.

pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing LogBucket 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 listBucketsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listExclusions(request, optionsopt) → {Promise}

Lists all the exclusions in a parent resource.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose exclusions are to be listed.

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of LogExclusion. 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 listExclusionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listExclusionsAsync(request, optionsopt) → {Object}

Equivalent to listExclusions, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose exclusions are to be listed.

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing LogExclusion. 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
const iterable = client.listExclusionsAsync(request);
for await (const response of iterable) {
  // process response
}

listExclusionsStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose exclusions are to be listed.

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing LogExclusion 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 listExclusionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSinks(request, optionsopt) → {Promise}

Lists sinks.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose sinks are to be listed:

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is Array of LogSink. 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 listSinksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSinksAsync(request, optionsopt) → {Object}

Equivalent to listSinks, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose sinks are to be listed:

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing LogSink. 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
const iterable = client.listSinksAsync(request);
for await (const response of iterable) {
  // process response
}

listSinksStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The parent resource whose sinks are to be listed:

  "projects/[PROJECT_ID]"
  "organizations/[ORGANIZATION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]"
  "folders/[FOLDER_ID]"
pageToken string <optional>

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

pageSize number <optional>

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing LogSink 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 listSinksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location) → {string}

Return a fully-qualified location resource name string.

Parameters:
Name Type Description
project string
location string
Returns:
Type Description
string

Resource name string.

logMetricPath(project, metric) → {string}

Return a fully-qualified logMetric resource name string.

Parameters:
Name Type Description
project string
metric string
Returns:
Type Description
string

Resource name string.

matchBillingAccountFromBillingAccountCmekSettingsName(billingAccountCmekSettingsName) → {string}

Parse the billing_account from BillingAccountCmekSettings resource.

Parameters:
Name Type Description
billingAccountCmekSettingsName string

A fully-qualified path representing billing_account_cmekSettings resource.

Returns:
Type Description
string

A string representing the billing_account.

matchBillingAccountFromBillingAccountExclusionName(billingAccountExclusionName) → {string}

Parse the billing_account from BillingAccountExclusion resource.

Parameters:
Name Type Description
billingAccountExclusionName string

A fully-qualified path representing billing_account_exclusion resource.

Returns:
Type Description
string

A string representing the billing_account.

matchBillingAccountFromBillingAccountLocationBucketName(billingAccountLocationBucketName) → {string}

Parse the billing_account from BillingAccountLocationBucket resource.

Parameters:
Name Type Description
billingAccountLocationBucketName string

A fully-qualified path representing billing_account_location_bucket resource.

Returns:
Type Description
string

A string representing the billing_account.

matchBillingAccountFromBillingAccountLogName(billingAccountLogName) → {string}

Parse the billing_account from BillingAccountLog resource.

Parameters:
Name Type Description
billingAccountLogName string

A fully-qualified path representing billing_account_log resource.

Returns:
Type Description
string

A string representing the billing_account.

matchBillingAccountFromBillingAccountSinkName(billingAccountSinkName) → {string}

Parse the billing_account from BillingAccountSink resource.

Parameters:
Name Type Description
billingAccountSinkName string

A fully-qualified path representing billing_account_sink resource.

Returns:
Type Description
string

A string representing the billing_account.

matchBucketFromBillingAccountLocationBucketName(billingAccountLocationBucketName) → {string}

Parse the bucket from BillingAccountLocationBucket resource.

Parameters:
Name Type Description
billingAccountLocationBucketName string

A fully-qualified path representing billing_account_location_bucket resource.

Returns:
Type Description
string

A string representing the bucket.

matchBucketFromFolderLocationBucketName(folderLocationBucketName) → {string}

Parse the bucket from FolderLocationBucket resource.

Parameters:
Name Type Description
folderLocationBucketName string

A fully-qualified path representing folder_location_bucket resource.

Returns:
Type Description
string

A string representing the bucket.

matchBucketFromOrganizationLocationBucketName(organizationLocationBucketName) → {string}

Parse the bucket from OrganizationLocationBucket resource.

Parameters:
Name Type Description
organizationLocationBucketName string

A fully-qualified path representing organization_location_bucket resource.

Returns:
Type Description
string

A string representing the bucket.

matchBucketFromProjectLocationBucketName(projectLocationBucketName) → {string}

Parse the bucket from ProjectLocationBucket resource.

Parameters:
Name Type Description
projectLocationBucketName string

A fully-qualified path representing project_location_bucket resource.

Returns:
Type Description
string

A string representing the bucket.

matchExclusionFromBillingAccountExclusionName(billingAccountExclusionName) → {string}

Parse the exclusion from BillingAccountExclusion resource.

Parameters:
Name Type Description
billingAccountExclusionName string

A fully-qualified path representing billing_account_exclusion resource.

Returns:
Type Description
string

A string representing the exclusion.

matchExclusionFromFolderExclusionName(folderExclusionName) → {string}

Parse the exclusion from FolderExclusion resource.

Parameters:
Name Type Description
folderExclusionName string

A fully-qualified path representing folder_exclusion resource.

Returns:
Type Description
string

A string representing the exclusion.

matchExclusionFromOrganizationExclusionName(organizationExclusionName) → {string}

Parse the exclusion from OrganizationExclusion resource.

Parameters:
Name Type Description
organizationExclusionName string

A fully-qualified path representing organization_exclusion resource.

Returns:
Type Description
string

A string representing the exclusion.

matchExclusionFromProjectExclusionName(projectExclusionName) → {string}

Parse the exclusion from ProjectExclusion resource.

Parameters:
Name Type Description
projectExclusionName string

A fully-qualified path representing project_exclusion resource.

Returns:
Type Description
string

A string representing the exclusion.

matchFolderFromFolderCmekSettingsName(folderCmekSettingsName) → {string}

Parse the folder from FolderCmekSettings resource.

Parameters:
Name Type Description
folderCmekSettingsName string

A fully-qualified path representing folder_cmekSettings resource.

Returns:
Type Description
string

A string representing the folder.

matchFolderFromFolderExclusionName(folderExclusionName) → {string}

Parse the folder from FolderExclusion resource.

Parameters:
Name Type Description
folderExclusionName string

A fully-qualified path representing folder_exclusion resource.

Returns:
Type Description
string

A string representing the folder.

matchFolderFromFolderLocationBucketName(folderLocationBucketName) → {string}

Parse the folder from FolderLocationBucket resource.

Parameters:
Name Type Description
folderLocationBucketName string

A fully-qualified path representing folder_location_bucket resource.

Returns:
Type Description
string

A string representing the folder.

matchFolderFromFolderLogName(folderLogName) → {string}

Parse the folder from FolderLog resource.

Parameters:
Name Type Description
folderLogName string

A fully-qualified path representing folder_log resource.

Returns:
Type Description
string

A string representing the folder.

matchFolderFromFolderSinkName(folderSinkName) → {string}

Parse the folder from FolderSink resource.

Parameters:
Name Type Description
folderSinkName string

A fully-qualified path representing folder_sink resource.

Returns:
Type Description
string

A string representing the folder.

matchLocationFromBillingAccountLocationBucketName(billingAccountLocationBucketName) → {string}

Parse the location from BillingAccountLocationBucket resource.

Parameters:
Name Type Description
billingAccountLocationBucketName string

A fully-qualified path representing billing_account_location_bucket resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromFolderLocationBucketName(folderLocationBucketName) → {string}

Parse the location from FolderLocationBucket resource.

Parameters:
Name Type Description
folderLocationBucketName string

A fully-qualified path representing folder_location_bucket resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromLocationName(locationName) → {string}

Parse the location from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromOrganizationLocationBucketName(organizationLocationBucketName) → {string}

Parse the location from OrganizationLocationBucket resource.

Parameters:
Name Type Description
organizationLocationBucketName string

A fully-qualified path representing organization_location_bucket resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromProjectLocationBucketName(projectLocationBucketName) → {string}

Parse the location from ProjectLocationBucket resource.

Parameters:
Name Type Description
projectLocationBucketName string

A fully-qualified path representing project_location_bucket resource.

Returns:
Type Description
string

A string representing the location.

matchLogFromBillingAccountLogName(billingAccountLogName) → {string}

Parse the log from BillingAccountLog resource.

Parameters:
Name Type Description
billingAccountLogName string

A fully-qualified path representing billing_account_log resource.

Returns:
Type Description
string

A string representing the log.

matchLogFromFolderLogName(folderLogName) → {string}

Parse the log from FolderLog resource.

Parameters:
Name Type Description
folderLogName string

A fully-qualified path representing folder_log resource.

Returns:
Type Description
string

A string representing the log.

matchLogFromOrganizationLogName(organizationLogName) → {string}

Parse the log from OrganizationLog resource.

Parameters:
Name Type Description
organizationLogName string

A fully-qualified path representing organization_log resource.

Returns:
Type Description
string

A string representing the log.

matchLogFromProjectLogName(projectLogName) → {string}

Parse the log from ProjectLog resource.

Parameters:
Name Type Description
projectLogName string

A fully-qualified path representing project_log resource.

Returns:
Type Description
string

A string representing the log.

matchMetricFromLogMetricName(logMetricName) → {string}

Parse the metric from LogMetric resource.

Parameters:
Name Type Description
logMetricName string

A fully-qualified path representing LogMetric resource.

Returns:
Type Description
string

A string representing the metric.

matchOrganizationFromOrganizationCmekSettingsName(organizationCmekSettingsName) → {string}

Parse the organization from OrganizationCmekSettings resource.

Parameters:
Name Type Description
organizationCmekSettingsName string

A fully-qualified path representing organization_cmekSettings resource.

Returns:
Type Description
string

A string representing the organization.

matchOrganizationFromOrganizationExclusionName(organizationExclusionName) → {string}

Parse the organization from OrganizationExclusion resource.

Parameters:
Name Type Description
organizationExclusionName string

A fully-qualified path representing organization_exclusion resource.

Returns:
Type Description
string

A string representing the organization.

matchOrganizationFromOrganizationLocationBucketName(organizationLocationBucketName) → {string}

Parse the organization from OrganizationLocationBucket resource.

Parameters:
Name Type Description
organizationLocationBucketName string

A fully-qualified path representing organization_location_bucket resource.

Returns:
Type Description
string

A string representing the organization.

matchOrganizationFromOrganizationLogName(organizationLogName) → {string}

Parse the organization from OrganizationLog resource.

Parameters:
Name Type Description
organizationLogName string

A fully-qualified path representing organization_log resource.

Returns:
Type Description
string

A string representing the organization.

matchOrganizationFromOrganizationSinkName(organizationSinkName) → {string}

Parse the organization from OrganizationSink resource.

Parameters:
Name Type Description
organizationSinkName string

A fully-qualified path representing organization_sink resource.

Returns:
Type Description
string

A string representing the organization.

matchProjectFromLocationName(locationName) → {string}

Parse the project from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromLogMetricName(logMetricName) → {string}

Parse the project from LogMetric resource.

Parameters:
Name Type Description
logMetricName string

A fully-qualified path representing LogMetric resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectCmekSettingsName(projectCmekSettingsName) → {string}

Parse the project from ProjectCmekSettings resource.

Parameters:
Name Type Description
projectCmekSettingsName string

A fully-qualified path representing project_cmekSettings resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectExclusionName(projectExclusionName) → {string}

Parse the project from ProjectExclusion resource.

Parameters:
Name Type Description
projectExclusionName string

A fully-qualified path representing project_exclusion resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectLocationBucketName(projectLocationBucketName) → {string}

Parse the project from ProjectLocationBucket resource.

Parameters:
Name Type Description
projectLocationBucketName string

A fully-qualified path representing project_location_bucket resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectLogName(projectLogName) → {string}

Parse the project from ProjectLog resource.

Parameters:
Name Type Description
projectLogName string

A fully-qualified path representing project_log resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectName(projectName) → {string}

Parse the project from Project resource.

Parameters:
Name Type Description
projectName string

A fully-qualified path representing Project resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectSinkName(projectSinkName) → {string}

Parse the project from ProjectSink resource.

Parameters:
Name Type Description
projectSinkName string

A fully-qualified path representing project_sink resource.

Returns:
Type Description
string

A string representing the project.

matchSinkFromBillingAccountSinkName(billingAccountSinkName) → {string}

Parse the sink from BillingAccountSink resource.

Parameters:
Name Type Description
billingAccountSinkName string

A fully-qualified path representing billing_account_sink resource.

Returns:
Type Description
string

A string representing the sink.

matchSinkFromFolderSinkName(folderSinkName) → {string}

Parse the sink from FolderSink resource.

Parameters:
Name Type Description
folderSinkName string

A fully-qualified path representing folder_sink resource.

Returns:
Type Description
string

A string representing the sink.

matchSinkFromOrganizationSinkName(organizationSinkName) → {string}

Parse the sink from OrganizationSink resource.

Parameters:
Name Type Description
organizationSinkName string

A fully-qualified path representing organization_sink resource.

Returns:
Type Description
string

A string representing the sink.

matchSinkFromProjectSinkName(projectSinkName) → {string}

Parse the sink from ProjectSink resource.

Parameters:
Name Type Description
projectSinkName string

A fully-qualified path representing project_sink resource.

Returns:
Type Description
string

A string representing the sink.

organizationCmekSettingsPath(organization) → {string}

Return a fully-qualified organizationCmekSettings resource name string.

Parameters:
Name Type Description
organization string
Returns:
Type Description
string

Resource name string.

organizationExclusionPath(organization, exclusion) → {string}

Return a fully-qualified organizationExclusion resource name string.

Parameters:
Name Type Description
organization string
exclusion string
Returns:
Type Description
string

Resource name string.

organizationLocationBucketPath(organization, location, bucket) → {string}

Return a fully-qualified organizationLocationBucket resource name string.

Parameters:
Name Type Description
organization string
location string
bucket string
Returns:
Type Description
string

Resource name string.

organizationLogPath(organization, log) → {string}

Return a fully-qualified organizationLog resource name string.

Parameters:
Name Type Description
organization string
log string
Returns:
Type Description
string

Resource name string.

organizationSinkPath(organization, sink) → {string}

Return a fully-qualified organizationSink resource name string.

Parameters:
Name Type Description
organization string
sink string
Returns:
Type Description
string

Resource name string.

projectCmekSettingsPath(project) → {string}

Return a fully-qualified projectCmekSettings resource name string.

Parameters:
Name Type Description
project string
Returns:
Type Description
string

Resource name string.

projectExclusionPath(project, exclusion) → {string}

Return a fully-qualified projectExclusion resource name string.

Parameters:
Name Type Description
project string
exclusion string
Returns:
Type Description
string

Resource name string.

projectLocationBucketPath(project, location, bucket) → {string}

Return a fully-qualified projectLocationBucket resource name string.

Parameters:
Name Type Description
project string
location string
bucket string
Returns:
Type Description
string

Resource name string.

projectLogPath(project, log) → {string}

Return a fully-qualified projectLog resource name string.

Parameters:
Name Type Description
project string
log string
Returns:
Type Description
string

Resource name string.

projectPath(project) → {string}

Return a fully-qualified project resource name string.

Parameters:
Name Type Description
project string
Returns:
Type Description
string

Resource name string.

projectSinkPath(project, sink) → {string}

Return a fully-qualified projectSink resource name string.

Parameters:
Name Type Description
project string
sink string
Returns:
Type Description
string

Resource name string.

updateBucket(request, optionsopt) → {Promise}

Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_period

If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.

If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.

A buckets region may not be modified after it is created. This method is in Beta.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The full resource name of the bucket to update.

  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
  "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property

bucket google.logging.v2.LogBucket

Required. The updated bucket.

updateMask google.protobuf.FieldMask

Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

Example: updateMask=retention_days.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogBucket. Please see the documentation for more details and examples.
Example
const [response] = await client.updateBucket(request);

updateCmekSettings(request, optionsopt) → {Promise}

Updates the Logs Router CMEK settings for the given resource.

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.

See Enabling CMEK for Logs Router for more information.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
name string

Required. The resource name for the CMEK settings to update.

  "projects/[PROJECT_ID]/cmekSettings"
  "organizations/[ORGANIZATION_ID]/cmekSettings"
  "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
  "folders/[FOLDER_ID]/cmekSettings"

Example: "organizations/12345/cmekSettings".

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

cmekSettings google.logging.v2.CmekSettings

Required. The CMEK settings to update.

See Enabling CMEK for Logs Router for more information.

updateMask google.protobuf.FieldMask <optional>

Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.

See FieldMask for more information.

Example: "updateMask=kmsKeyName"

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing CmekSettings. Please see the documentation for more details and examples.
Example
const [response] = await client.updateCmekSettings(request);

updateExclusion(request, optionsopt) → {Promise}

Changes one or more properties of an existing exclusion.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The resource name of the exclusion to update:

  "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
  "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
  "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"

Example: "projects/my-project-id/exclusions/my-exclusion-id".

exclusion google.logging.v2.LogExclusion

Required. New values for the existing exclusion. Only the fields specified in update_mask are relevant.

updateMask google.protobuf.FieldMask

Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.

For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description".

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogExclusion. Please see the documentation for more details and examples.
Example
const [response] = await client.updateExclusion(request);

updateSink(request, optionsopt) → {Promise}

Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.

The updated sink might also have a new writer_identity; see the unique_writer_identity field.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
sinkName string

Required. The full resource name of the sink to update, including the parent resource and the sink identifier:

  "projects/[PROJECT_ID]/sinks/[SINK_ID]"
  "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
  "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
  "folders/[FOLDER_ID]/sinks/[SINK_ID]"

Example: "projects/my-project-id/sinks/my-sink-id".

sink google.logging.v2.LogSink

Required. The updated sink, whose name is the same identifier that appears as part of sink_name.

uniqueWriterIdentity boolean <optional>

Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:

  • If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.
  • If the old value is false and the new value is true, then writer_identity is changed to a unique service account.
  • It is an error if the old value is true and the new value is set to false or defaulted to false.
updateMask google.protobuf.FieldMask <optional>

Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

Example: updateMask=filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing LogSink. Please see the documentation for more details and examples.
Example
const [response] = await client.updateSink(request);