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 options have the following properties:

Parameter

credentials

Optional

object

Credentials object.

credentials.client_email

Optional

string

credentials.private_key

Optional

string

email

Optional

string

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

keyFilename

Optional

string

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 above is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port

Optional

number

The port on which to connect to the remote host.

projectId

Optional

string

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.

promise

Optional

function()

Custom promise module to use instead of native Promises.

servicePath

Optional

string

The domain name of the API remote host.

Properties

port

static

The port for this API service.

scopes

static

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

servicePath

static

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 request have the following properties:

Parameter

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

Object

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

This object should have the same structure as LogExclusion

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedParent = client.projectPath('[PROJECT]');
var exclusion = {};
var request = {
  parent: formattedParent,
  exclusion: exclusion,
};
client.createExclusion(request)
  .then(responses => {
    var 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 current time is outside the sink's start and end times or 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 request have the following properties:

Parameter

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

Object

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

This object should have the same structure as LogSink

uniqueWriterIdentity

Optional

boolean

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 Stackdriver 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

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedParent = client.projectPath('[PROJECT]');
var sink = {};
var request = {
  parent: formattedParent,
  sink: sink,
};
client.createSink(request)
  .then(responses => {
    var 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 request have the following properties:

Parameter

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

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var 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 request have the following properties:

Parameter

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

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var 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 

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 request have the following properties:

Parameter

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

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedName = client.exclusionPath('[PROJECT]', '[EXCLUSION]');
client.getExclusion({name: formattedName})
  .then(responses => {
    var 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.

getSink

getSink(request, options, callback) returns Promise

Gets a sink.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedSinkName = client.sinkPath('[PROJECT]', '[SINK]');
client.getSink({sinkName: formattedSinkName})
  .then(responses => {
    var 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 request have the following properties:

Parameter

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]"

pageSize

Optional

number

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

// Iterate over all elements.
var formattedParent = client.projectPath('[PROJECT]');

client.listExclusions({parent: formattedParent})
  .then(responses => {
    var 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.
var formattedParent = client.projectPath('[PROJECT]');


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var 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 request have the following properties:

Parameter

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]"

pageSize

Optional

number

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var 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 request have the following properties:

Parameter

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]"

pageSize

Optional

number

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

// Iterate over all elements.
var formattedParent = client.projectPath('[PROJECT]');

client.listSinks({parent: formattedParent})
  .then(responses => {
    var 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.
var formattedParent = client.projectPath('[PROJECT]');


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var 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 request have the following properties:

Parameter

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]"

pageSize

Optional

number

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var 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.

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.

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.

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 

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 request have the following properties:

Parameter

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

Object

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

This object should have the same structure as LogExclusion

updateMask

Object

Required. A nonempty 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".

This object should have the same structure as FieldMask

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedName = client.exclusionPath('[PROJECT]', '[EXCLUSION]');
var exclusion = {};
var updateMask = {};
var request = {
  name: formattedName,
  exclusion: exclusion,
  updateMask: updateMask,
};
client.updateExclusion(request)
  .then(responses => {
    var 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, filter, output_version_format, start_time, and end_time. 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 request have the following properties:

Parameter

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

Object

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

This object should have the same structure as LogSink

uniqueWriterIdentity

Optional

boolean

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.

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');

var client = new logging.v2.ConfigServiceV2Client({
  // optional auth parameters.
});

var formattedSinkName = client.sinkPath('[PROJECT]', '[SINK]');
var sink = {};
var request = {
  sinkName: formattedSinkName,
  sink: sink,
};
client.updateSink(request)
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });