Constructor
new ConfigServiceV2Client(optionsopt)
Construct an instance of ConfigServiceV2Client.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
- Source:
(static) port
The port for this API service.
- Source:
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
- Source:
(static) servicePath
The DNS address for this API service.
- Source:
Methods
billingExclusionPath(billingAccount, exclusion) → {String}
Return a fully-qualified billing_exclusion resource name string.
Parameters:
Name | Type | Description |
---|---|---|
billingAccount |
String | |
exclusion |
String |
- Source:
billingPath(billingAccount) → {String}
Return a fully-qualified billing resource name string.
Parameters:
Name | Type | Description |
---|---|---|
billingAccount |
String |
- Source:
billingSinkPath(billingAccount, sink) → {String}
Return a fully-qualified billing_sink resource name string.
Parameters:
Name | Type | Description |
---|---|---|
billingAccount |
String | |
sink |
String |
- Source:
createExclusion(request, optionsopt, callbackopt) → {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
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedParent = client.projectPath('[PROJECT]');
const exclusion = {};
const request = {
parent: formattedParent,
exclusion: exclusion,
};
client.createExclusion(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
createSink(request, optionsopt, callbackopt) → {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
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedParent = client.projectPath('[PROJECT]');
const sink = {};
const request = {
parent: formattedParent,
sink: sink,
};
client.createSink(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
deleteExclusion(request, optionsopt, callbackopt) → {Promise}
Deletes an exclusion.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedName = client.exclusionPath('[PROJECT]', '[EXCLUSION]');
client.deleteExclusion({name: formattedName}).catch(err => {
console.error(err);
});
deleteSink(request, optionsopt, callbackopt) → {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
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedSinkName = client.sinkPath('[PROJECT]', '[SINK]');
client.deleteSink({sinkName: formattedSinkName}).catch(err => {
console.error(err);
});
exclusionPath(project, exclusion) → {String}
Return a fully-qualified exclusion resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
exclusion |
String |
- Source:
folderExclusionPath(folder, exclusion) → {String}
Return a fully-qualified folder_exclusion resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
String | |
exclusion |
String |
- Source:
folderPath(folder) → {String}
Return a fully-qualified folder resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
String |
- Source:
folderSinkPath(folder, sink) → {String}
Return a fully-qualified folder_sink resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
String | |
sink |
String |
- Source:
getExclusion(request, optionsopt, callbackopt) → {Promise}
Gets the description of an exclusion.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedName = client.exclusionPath('[PROJECT]', '[EXCLUSION]');
client.getExclusion({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
the callback to be called with the current project Id. |
- Source:
getSink(request, optionsopt, callbackopt) → {Promise}
Gets a sink.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedSinkName = client.sinkPath('[PROJECT]', '[SINK]');
client.getSink({sinkName: formattedSinkName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
listExclusions(request, optionsopt, callbackopt) → {Promise}
Lists all the exclusions in a parent resource.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of LogExclusion. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListExclusionsResponse. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');
client.listExclusions({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listExclusions(nextRequest, options).then(callback);
}
}
client.listExclusions({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listExclusionsStream(request, optionsopt) → {Stream}
Equivalent to listExclusions, but returns a NodeJS Stream object.
This fetches the paged responses for listExclusions continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedParent = client.projectPath('[PROJECT]');
client.listExclusionsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listSinks(request, optionsopt, callbackopt) → {Promise}
Lists sinks.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of LogSink. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListSinksResponse. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');
client.listSinks({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listSinks(nextRequest, options).then(callback);
}
}
client.listSinks({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listSinksStream(request, optionsopt) → {Stream}
Equivalent to listSinks, but returns a NodeJS Stream object.
This fetches the paged responses for listSinks continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedParent = client.projectPath('[PROJECT]');
client.listSinksStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
matchBillingAccountFromBillingExclusionName(billingExclusionName) → {String}
Parse the billingExclusionName from a billing_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
billingExclusionName |
String |
A fully-qualified path representing a billing_exclusion resources. |
- Source:
matchBillingAccountFromBillingName(billingName) → {String}
Parse the billingName from a billing resource.
Parameters:
Name | Type | Description |
---|---|---|
billingName |
String |
A fully-qualified path representing a billing resources. |
- Source:
matchBillingAccountFromBillingSinkName(billingSinkName) → {String}
Parse the billingSinkName from a billing_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
billingSinkName |
String |
A fully-qualified path representing a billing_sink resources. |
- Source:
matchExclusionFromBillingExclusionName(billingExclusionName) → {String}
Parse the billingExclusionName from a billing_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
billingExclusionName |
String |
A fully-qualified path representing a billing_exclusion resources. |
- Source:
matchExclusionFromExclusionName(exclusionName) → {String}
Parse the exclusionName from a exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
exclusionName |
String |
A fully-qualified path representing a exclusion resources. |
- Source:
matchExclusionFromFolderExclusionName(folderExclusionName) → {String}
Parse the folderExclusionName from a folder_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
folderExclusionName |
String |
A fully-qualified path representing a folder_exclusion resources. |
- Source:
matchExclusionFromOrganizationExclusionName(organizationExclusionName) → {String}
Parse the organizationExclusionName from a organization_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationExclusionName |
String |
A fully-qualified path representing a organization_exclusion resources. |
- Source:
matchFolderFromFolderExclusionName(folderExclusionName) → {String}
Parse the folderExclusionName from a folder_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
folderExclusionName |
String |
A fully-qualified path representing a folder_exclusion resources. |
- Source:
matchFolderFromFolderName(folderName) → {String}
Parse the folderName from a folder resource.
Parameters:
Name | Type | Description |
---|---|---|
folderName |
String |
A fully-qualified path representing a folder resources. |
- Source:
matchFolderFromFolderSinkName(folderSinkName) → {String}
Parse the folderSinkName from a folder_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
folderSinkName |
String |
A fully-qualified path representing a folder_sink resources. |
- Source:
matchOrganizationFromOrganizationExclusionName(organizationExclusionName) → {String}
Parse the organizationExclusionName from a organization_exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationExclusionName |
String |
A fully-qualified path representing a organization_exclusion resources. |
- Source:
matchOrganizationFromOrganizationName(organizationName) → {String}
Parse the organizationName from a organization resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationName |
String |
A fully-qualified path representing a organization resources. |
- Source:
matchOrganizationFromOrganizationSinkName(organizationSinkName) → {String}
Parse the organizationSinkName from a organization_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationSinkName |
String |
A fully-qualified path representing a organization_sink resources. |
- Source:
matchProjectFromExclusionName(exclusionName) → {String}
Parse the exclusionName from a exclusion resource.
Parameters:
Name | Type | Description |
---|---|---|
exclusionName |
String |
A fully-qualified path representing a exclusion resources. |
- Source:
matchProjectFromProjectName(projectName) → {String}
Parse the projectName from a project resource.
Parameters:
Name | Type | Description |
---|---|---|
projectName |
String |
A fully-qualified path representing a project resources. |
- Source:
matchProjectFromSinkName(sinkName) → {String}
Parse the sinkName from a sink resource.
Parameters:
Name | Type | Description |
---|---|---|
sinkName |
String |
A fully-qualified path representing a sink resources. |
- Source:
matchSinkFromBillingSinkName(billingSinkName) → {String}
Parse the billingSinkName from a billing_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
billingSinkName |
String |
A fully-qualified path representing a billing_sink resources. |
- Source:
matchSinkFromFolderSinkName(folderSinkName) → {String}
Parse the folderSinkName from a folder_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
folderSinkName |
String |
A fully-qualified path representing a folder_sink resources. |
- Source:
matchSinkFromOrganizationSinkName(organizationSinkName) → {String}
Parse the organizationSinkName from a organization_sink resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationSinkName |
String |
A fully-qualified path representing a organization_sink resources. |
- Source:
matchSinkFromSinkName(sinkName) → {String}
Parse the sinkName from a sink resource.
Parameters:
Name | Type | Description |
---|---|---|
sinkName |
String |
A fully-qualified path representing a sink resources. |
- Source:
organizationExclusionPath(organization, exclusion) → {String}
Return a fully-qualified organization_exclusion resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
String | |
exclusion |
String |
- Source:
organizationPath(organization) → {String}
Return a fully-qualified organization resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
String |
- Source:
organizationSinkPath(organization, sink) → {String}
Return a fully-qualified organization_sink resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
String | |
sink |
String |
- Source:
projectPath(project) → {String}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String |
- Source:
sinkPath(project, sink) → {String}
Return a fully-qualified sink resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
sink |
String |
- Source:
updateExclusion(request, optionsopt, callbackopt) → {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
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedName = client.exclusionPath('[PROJECT]', '[EXCLUSION]');
const exclusion = {};
const updateMask = {};
const request = {
name: formattedName,
exclusion: exclusion,
updateMask: updateMask,
};
client.updateExclusion(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateSink(request, optionsopt, callbackopt) → {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
|
|||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Source:
Example
const logging = require('@google-cloud/logging');
const client = new logging.v2.ConfigServiceV2Client({
// optional auth parameters.
});
const formattedSinkName = client.sinkPath('[PROJECT]', '[SINK]');
const sink = {};
const request = {
sinkName: formattedSinkName,
sink: sink,
};
client.updateSink(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});