v2. ConfigServiceV2Client
Service for configuring sinks used to export log entries out of Logging.
Constructor
ConfigServiceV2Client
new ConfigServiceV2Client(options)
Construct an instance of ConfigServiceV2Client.
Parameter |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Optional object The configuration object. See the subsequent parameters for more details. Values in
|
Constructor
ConfigServiceV2Client
new ConfigServiceV2Client(options)
Construct an instance of ConfigServiceV2Client.
Parameter |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Optional object The configuration object. See the subsequent parameters for more details. Values in
|
Properties
port
The port for this API service.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
servicePath
The DNS address for this API service.
Methods
createExclusion
createExclusion(request, options, callback) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
createExclusion
createExclusion(request, options, callback) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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
createSink(request, options, callback) returns 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.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
createSink
createSink(request, options, callback) returns 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.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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
deleteExclusion(request, options, callback) returns Promise
Deletes an exclusion.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error) The function which will be called with the result of the API call. |
- Returns
-
Promise
- The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
deleteExclusion
deleteExclusion(request, options, callback) returns Promise
Deletes an exclusion.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error) The function which will be called with the result of the API call. |
- Returns
-
Promise
- The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
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
deleteSink(request, options, callback) returns Promise
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also deleted.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error) The function which will be called with the result of the API call. |
- Returns
-
Promise
- The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
deleteSink
deleteSink(request, options, callback) returns Promise
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also deleted.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error) The function which will be called with the result of the API call. |
- Returns
-
Promise
- The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
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
exclusionPath(project, exclusion) returns String
Return a fully-qualified exclusion resource name string.
Parameter |
|
---|---|
project |
String |
exclusion |
String |
- Returns
-
String
exclusionPath
exclusionPath(project, exclusion) returns String
Return a fully-qualified exclusion resource name string.
Parameter |
|
---|---|
project |
String |
exclusion |
String |
- Returns
-
String
getExclusion
getExclusion(request, options, callback) returns Promise
Gets the description of an exclusion.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
getExclusion
getExclusion(request, options, callback) returns Promise
Gets the description of an exclusion.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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
getProjectId(callback)
Return the project ID used by this class.
Parameter |
|
---|---|
callback |
function(Error, string) the callback to be called with the current project Id. |
getProjectId
getProjectId(callback)
Return the project ID used by this class.
Parameter |
|
---|---|
callback |
function(Error, string) the callback to be called with the current project Id. |
getSink
getSink(request, options, callback) returns Promise
Gets a sink.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
getSink
getSink(request, options, callback) returns Promise
Gets a sink.
Parameter |
|||||
---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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
listExclusions(request, options, callback) returns Promise
Lists all the exclusions in a parent resource.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Array, nullable Object, nullable Object) 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. |
- Returns
-
Promise
-
The promise which resolves to an array. The first element of the array is Array of LogExclusion.
When autoPaginate: false is specified through options, the array has three elements. The first element is Array of LogExclusion in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListExclusionsResponse.
The promise has a method named "cancel" which cancels the ongoing API call.
-
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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i])
}
})
.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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i]);
}
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);
});
listExclusions
listExclusions(request, options, callback) returns Promise
Lists all the exclusions in a parent resource.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Array, nullable Object, nullable Object) 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. |
- Returns
-
Promise
-
The promise which resolves to an array. The first element of the array is Array of LogExclusion.
When autoPaginate: false is specified through options, the array has three elements. The first element is Array of LogExclusion in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListExclusionsResponse.
The promise has a method named "cancel" which cancels the ongoing API call.
-
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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i])
}
})
.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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i]);
}
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
listExclusionsStream(request, options) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- See also
- https://nodejs.org/api/stream.html
- Returns
-
Stream
An object stream which emits an object representing LogExclusion on 'data' event.
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);
});
listExclusionsStream
listExclusionsStream(request, options) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- See also
- https://nodejs.org/api/stream.html
- Returns
-
Stream
An object stream which emits an object representing LogExclusion on 'data' event.
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
listSinks(request, options, callback) returns Promise
Lists sinks.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Array, nullable Object, nullable Object) 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. |
- Returns
-
Promise
-
The promise which resolves to an array. The first element of the array is Array of LogSink.
When autoPaginate: false is specified through options, the array has three elements. The first element is Array of LogSink in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListSinksResponse.
The promise has a method named "cancel" which cancels the ongoing API call.
-
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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i])
}
})
.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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i]);
}
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);
});
listSinks
listSinks(request, options, callback) returns Promise
Lists sinks.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
Optional function(nullable Error, nullable Array, nullable Object, nullable Object) 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. |
- Returns
-
Promise
-
The promise which resolves to an array. The first element of the array is Array of LogSink.
When autoPaginate: false is specified through options, the array has three elements. The first element is Array of LogSink in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListSinksResponse.
The promise has a method named "cancel" which cancels the ongoing API call.
-
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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i])
}
})
.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 (let i = 0; i < resources.length; i += 1) {
// doThingsWith(resources[i]);
}
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
listSinksStream(request, options) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- See also
- https://nodejs.org/api/stream.html
- Returns
-
Stream
An object stream which emits an object representing LogSink on 'data' event.
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);
});
listSinksStream
listSinksStream(request, options) returns 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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- See also
- https://nodejs.org/api/stream.html
- Returns
-
Stream
An object stream which emits an object representing LogSink on 'data' event.
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);
});
matchExclusionFromExclusionName
matchExclusionFromExclusionName(exclusionName) returns String
Parse the exclusionName from a exclusion resource.
Parameter |
|
---|---|
exclusionName |
String A fully-qualified path representing a exclusion resources. |
- Returns
-
String
- A string representing the exclusion.
matchExclusionFromExclusionName
matchExclusionFromExclusionName(exclusionName) returns String
Parse the exclusionName from a exclusion resource.
Parameter |
|
---|---|
exclusionName |
String A fully-qualified path representing a exclusion resources. |
- Returns
-
String
- A string representing the exclusion.
matchProjectFromExclusionName
matchProjectFromExclusionName(exclusionName) returns String
Parse the exclusionName from a exclusion resource.
Parameter |
|
---|---|
exclusionName |
String A fully-qualified path representing a exclusion resources. |
- Returns
-
String
- A string representing the project.
matchProjectFromExclusionName
matchProjectFromExclusionName(exclusionName) returns String
Parse the exclusionName from a exclusion resource.
Parameter |
|
---|---|
exclusionName |
String A fully-qualified path representing a exclusion resources. |
- Returns
-
String
- A string representing the project.
matchProjectFromProjectName
matchProjectFromProjectName(projectName) returns String
Parse the projectName from a project resource.
Parameter |
|
---|---|
projectName |
String A fully-qualified path representing a project resources. |
- Returns
-
String
- A string representing the project.
matchProjectFromProjectName
matchProjectFromProjectName(projectName) returns String
Parse the projectName from a project resource.
Parameter |
|
---|---|
projectName |
String A fully-qualified path representing a project resources. |
- Returns
-
String
- A string representing the project.
matchProjectFromSinkName
matchProjectFromSinkName(sinkName) returns String
Parse the sinkName from a sink resource.
Parameter |
|
---|---|
sinkName |
String A fully-qualified path representing a sink resources. |
- Returns
-
String
- A string representing the project.
matchProjectFromSinkName
matchProjectFromSinkName(sinkName) returns String
Parse the sinkName from a sink resource.
Parameter |
|
---|---|
sinkName |
String A fully-qualified path representing a sink resources. |
- Returns
-
String
- A string representing the project.
matchSinkFromSinkName
matchSinkFromSinkName(sinkName) returns String
Parse the sinkName from a sink resource.
Parameter |
|
---|---|
sinkName |
String A fully-qualified path representing a sink resources. |
- Returns
-
String
- A string representing the sink.
matchSinkFromSinkName
matchSinkFromSinkName(sinkName) returns String
Parse the sinkName from a sink resource.
Parameter |
|
---|---|
sinkName |
String A fully-qualified path representing a sink resources. |
- Returns
-
String
- A string representing the sink.
projectPath
projectPath(project) returns String
Return a fully-qualified project resource name string.
Parameter |
|
---|---|
project |
String |
- Returns
-
String
projectPath
projectPath(project) returns String
Return a fully-qualified project resource name string.
Parameter |
|
---|---|
project |
String |
- Returns
-
String
sinkPath
sinkPath(project, sink) returns String
Return a fully-qualified sink resource name string.
Parameter |
|
---|---|
project |
String |
sink |
String |
- Returns
-
String
sinkPath
sinkPath(project, sink) returns String
Return a fully-qualified sink resource name string.
Parameter |
|
---|---|
project |
String |
sink |
String |
- Returns
-
String
updateExclusion
updateExclusion(request, options, callback) returns Promise
Changes one or more properties of an existing exclusion.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
updateExclusion
updateExclusion(request, options, callback) returns Promise
Changes one or more properties of an existing exclusion.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogExclusion. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogExclusion. The promise has a method named "cancel" which cancels the ongoing API call.
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
updateSink(request, options, callback) returns 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.
Parameter |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});
updateSink
updateSink(request, options, callback) returns 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.
Parameter |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object The request object that will be sent. Values in
|
||||||||||
options |
Optional Object Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||
callback |
Optional function(nullable Error, nullable Object) The function which will be called with the result of the API call. The second parameter to the callback is an object representing LogSink. |
- Returns
-
Promise
- The promise which resolves to an array. The first element of the array is an object representing LogSink. The promise has a method named "cancel" which cancels the ongoing API call.
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);
});