You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.CodeStarNotifications

Inherits:
AWS.Service show all
Identifier:
codestarnotifications
API Version:
2019-10-15
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the operations and data types for the AWS CodeStar Notifications API. You can use the AWS CodeStar Notifications API to work with the following objects:

Notification rules, by calling the following:

Targets, by calling the following:

  • DeleteTarget, which removes a notification rule target (SNS topic) from a notification rule.

  • ListTargets, which lists the targets associated with a notification rule.

Events, by calling the following:

  • ListEventTypes, which lists the event types you can include in a notification rule.

Tags, by calling the following:

  • ListTagsForResource, which lists the tags already associated with a notification rule in your account.

  • TagResource, which associates a tag you provide with a notification rule in your account.

  • UntagResource, which removes a tag from a notification rule in your account.

For information about how to use AWS CodeStar Notifications, see link in the CodeStarNotifications User Guide.

Sending a Request Using CodeStarNotifications

var codestarnotifications = new AWS.CodeStarNotifications();
codestarnotifications.deleteTarget(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the CodeStarNotifications object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var codestarnotifications = new AWS.CodeStarNotifications({apiVersion: '2019-10-15'});

You can also set the API version globally in AWS.config.apiVersions using the codestarnotifications service identifier:

AWS.config.apiVersions = {
  codestarnotifications: '2019-10-15',
  // other service API versions
};

var codestarnotifications = new AWS.CodeStarNotifications();

Version:

  • 2019-10-15

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.CodeStarNotifications(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a CodeStarNotifications object

var codestarnotifications = new AWS.CodeStarNotifications({apiVersion: '2019-10-15'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.CodeStarNotifications.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.CodeStarNotifications.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.CodeStarNotifications.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createNotificationRule(params = {}, callback) ⇒ AWS.Request

Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.

Service Reference:

Examples:

Calling the createNotificationRule operation

var params = {
  DetailType: BASIC | FULL, /* required */
  EventTypeIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  Name: 'STRING_VALUE', /* required */
  Resource: 'STRING_VALUE', /* required */
  Targets: [ /* required */
    {
      TargetAddress: 'STRING_VALUE',
      TargetType: 'STRING_VALUE'
    },
    /* more items */
  ],
  ClientRequestToken: 'STRING_VALUE',
  Status: ENABLED | DISABLED,
  Tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
codestarnotifications.createNotificationRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name for the notification rule. Notifictaion rule names must be unique in your AWS account.

    • EventTypeIds — (Array<String>)

      A list of event types associated with this notification rule. For a list of allowed events, see EventTypeSummary.

    • Resource — (String)

      The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline, repositories in AWS CodeCommit, and build projects in AWS CodeBuild.

    • Targets — (Array<map>)

      A list of Amazon Resource Names (ARNs) of SNS topics to associate with the notification rule.

      • TargetType — (String)

        The target type. Can be an Amazon SNS topic.

      • TargetAddress — (String)

        The Amazon Resource Name (ARN) of the SNS topic.

    • DetailType — (String)

      The level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.

      Possible values include:
      • "BASIC"
      • "FULL"
    • ClientRequestToken — (String)

      A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request with the same parameters is received and a token is included, the request returns information about the initial request that used that token.

      Note: The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, an idempotency token is created for you.
      If a token is not provided, the SDK will use a version 4 UUID.
    • Tags — (map<String>)

      A list of tags to apply to this notification rule. Key names cannot start with "aws".

    • Status — (String)

      The status of the notification rule. The default value is ENABLED. If the status is set to DISABLED, notifications aren't sent for the notification rule.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the notification rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNotificationRule(params = {}, callback) ⇒ AWS.Request

Deletes a notification rule for a resource.

Service Reference:

Examples:

Calling the deleteNotificationRule operation

var params = {
  Arn: 'STRING_VALUE' /* required */
};
codestarnotifications.deleteNotificationRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the deleted notification rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTarget(params = {}, callback) ⇒ AWS.Request

Deletes a specified target for notifications.

Service Reference:

Examples:

Calling the deleteTarget operation

var params = {
  TargetAddress: 'STRING_VALUE', /* required */
  ForceUnsubscribeAll: true || false
};
codestarnotifications.deleteTarget(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetAddress — (String)

      The Amazon Resource Name (ARN) of the SNS topic to delete.

    • ForceUnsubscribeAll — (Boolean)

      A Boolean value that can be used to delete all associations with this SNS topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your AWS account are deleted.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeNotificationRule(params = {}, callback) ⇒ AWS.Request

Returns information about a specified notification rule.

Service Reference:

Examples:

Calling the describeNotificationRule operation

var params = {
  Arn: 'STRING_VALUE' /* required */
};
codestarnotifications.describeNotificationRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the notification rule.

      • Name — (String)

        The name of the notification rule.

      • EventTypes — (Array<map>)

        A list of the event types associated with the notification rule.

        • EventTypeId — (String)

          The system-generated ID of the event.

        • ServiceName — (String)

          The name of the service for which the event applies.

        • EventTypeName — (String)

          The name of the event.

        • ResourceType — (String)

          The resource type of the event.

      • Resource — (String)

        The Amazon Resource Name (ARN) of the resource associated with the notification rule.

      • Targets — (Array<map>)

        A list of the SNS topics associated with the notification rule.

        • TargetAddress — (String)

          The Amazon Resource Name (ARN) of the SNS topic.

        • TargetType — (String)

          The type of the target (for example, SNS).

        • TargetStatus — (String)

          The status of the target.

          Possible values include:
          • "PENDING"
          • "ACTIVE"
          • "UNREACHABLE"
          • "INACTIVE"
          • "DEACTIVATED"
      • DetailType — (String)

        The level of detail included in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.

        Possible values include:
        • "BASIC"
        • "FULL"
      • CreatedBy — (String)

        The name or email alias of the person who created the notification rule.

      • Status — (String)

        The status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications).

        Possible values include:
        • "ENABLED"
        • "DISABLED"
      • CreatedTimestamp — (Date)

        The date and time the notification rule was created, in timestamp format.

      • LastModifiedTimestamp — (Date)

        The date and time the notification rule was most recently updated, in timestamp format.

      • Tags — (map<String>)

        The tags associated with the notification rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listEventTypes(params = {}, callback) ⇒ AWS.Request

Returns information about the event types available for configuring notifications.

Service Reference:

Examples:

Calling the listEventTypes operation

var params = {
  Filters: [
    {
      Name: RESOURCE_TYPE | SERVICE_NAME, /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
codestarnotifications.listEventTypes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      The filters to use to return information by service or resource type.

      • Namerequired — (String)

        The system-generated name of the filter type you want to filter by.

        Possible values include:
        • "RESOURCE_TYPE"
        • "SERVICE_NAME"
      • Valuerequired — (String)

        The name of the resource type (for example, pipeline) or service name (for example, CodePipeline) that you want to filter by.

    • NextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • MaxResults — (Integer)

      A non-negative integer used to limit the number of returned results. The default number is 50. The maximum number of results that can be returned is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • EventTypes — (Array<map>)

        Information about each event, including service name, resource type, event ID, and event name.

        • EventTypeId — (String)

          The system-generated ID of the event.

        • ServiceName — (String)

          The name of the service for which the event applies.

        • EventTypeName — (String)

          The name of the event.

        • ResourceType — (String)

          The resource type of the event.

      • NextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listNotificationRules(params = {}, callback) ⇒ AWS.Request

Returns a list of the notification rules for an AWS account.

Service Reference:

Examples:

Calling the listNotificationRules operation

var params = {
  Filters: [
    {
      Name: EVENT_TYPE_ID | CREATED_BY | RESOURCE | TARGET_ADDRESS, /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
codestarnotifications.listNotificationRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      The filters to use to return information by service or resource type. For valid values, see ListNotificationRulesFilter.

      Note: A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.
      • Namerequired — (String)

        The name of the attribute you want to use to filter the returned notification rules.

        Possible values include:
        • "EVENT_TYPE_ID"
        • "CREATED_BY"
        • "RESOURCE"
        • "TARGET_ADDRESS"
      • Valuerequired — (String)

        The value of the attribute you want to use to filter the returned notification rules. For example, if you specify filtering by RESOURCE in Name, you might specify the ARN of a pipeline in AWS CodePipeline for the value.

    • NextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • MaxResults — (Integer)

      A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

      • NotificationRules — (Array<map>)

        The list of notification rules for the AWS account, by Amazon Resource Name (ARN) and ID.

        • Id — (String)

          The unique ID of the notification rule.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the notification rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Returns a list of the tags associated with a notification rule.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  Arn: 'STRING_VALUE' /* required */
};
codestarnotifications.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) for the notification rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (map<String>)

        The tags associated with the notification rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTargets(params = {}, callback) ⇒ AWS.Request

Returns a list of the notification rule targets for an AWS account.

Service Reference:

Examples:

Calling the listTargets operation

var params = {
  Filters: [
    {
      Name: TARGET_TYPE | TARGET_ADDRESS | TARGET_STATUS, /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
codestarnotifications.listTargets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.

      Note: A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.
      • Namerequired — (String)

        The name of the attribute you want to use to filter the returned targets.

        Possible values include:
        • "TARGET_TYPE"
        • "TARGET_ADDRESS"
        • "TARGET_STATUS"
      • Valuerequired — (String)

        The value of the attribute you want to use to filter the returned targets. For example, if you specify SNS for the Target type, you could specify an Amazon Resource Name (ARN) for a topic as the value.

    • NextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • MaxResults — (Integer)

      A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Targets — (Array<map>)

        The list of notification rule targets.

        • TargetAddress — (String)

          The Amazon Resource Name (ARN) of the SNS topic.

        • TargetType — (String)

          The type of the target (for example, SNS).

        • TargetStatus — (String)

          The status of the target.

          Possible values include:
          • "PENDING"
          • "ACTIVE"
          • "UNREACHABLE"
          • "INACTIVE"
          • "DEACTIVATED"
      • NextToken — (String)

        An enumeration token that can be used in a request to return the next batch of results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

subscribe(params = {}, callback) ⇒ AWS.Request

Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.

Service Reference:

Examples:

Calling the subscribe operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  Target: { /* required */
    TargetAddress: 'STRING_VALUE',
    TargetType: 'STRING_VALUE'
  },
  ClientRequestToken: 'STRING_VALUE'
};
codestarnotifications.subscribe(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.

    • Target — (map)

      Information about the SNS topics associated with a notification rule.

      • TargetType — (String)

        The target type. Can be an Amazon SNS topic.

      • TargetAddress — (String)

        The Amazon Resource Name (ARN) of the SNS topic.

    • ClientRequestToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the notification rule for which you have created assocations.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Associates a set of provided tags with a notification rule.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  Tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
codestarnotifications.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule to tag.

    • Tags — (map<String>)

      The list of tags to associate with the resource. Tag key names cannot start with "aws".

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (map<String>)

        The list of tags associated with the resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

unsubscribe(params = {}, callback) ⇒ AWS.Request

Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.

Service Reference:

Examples:

Calling the unsubscribe operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  TargetAddress: 'STRING_VALUE' /* required */
};
codestarnotifications.unsubscribe(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule.

    • TargetAddress — (String)

      The ARN of the SNS topic to unsubscribe from the notification rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes the association between one or more provided tags and a notification rule.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codestarnotifications.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule from which to remove the tags.

    • TagKeys — (Array<String>)

      The key names of the tags to remove.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateNotificationRule(params = {}, callback) ⇒ AWS.Request

Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.

Note: To add or remove tags for a notification rule, you must use TagResource and UntagResource.

Service Reference:

Examples:

Calling the updateNotificationRule operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  DetailType: BASIC | FULL,
  EventTypeIds: [
    'STRING_VALUE',
    /* more items */
  ],
  Name: 'STRING_VALUE',
  Status: ENABLED | DISABLED,
  Targets: [
    {
      TargetAddress: 'STRING_VALUE',
      TargetType: 'STRING_VALUE'
    },
    /* more items */
  ]
};
codestarnotifications.updateNotificationRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The Amazon Resource Name (ARN) of the notification rule.

    • Name — (String)

      The name of the notification rule.

    • Status — (String)

      The status of the notification rule. Valid statuses include enabled (sending notifications) or disabled (not sending notifications).

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • EventTypeIds — (Array<String>)

      A list of event types associated with this notification rule.

    • Targets — (Array<map>)

      The address and type of the targets to receive notifications from this notification rule.

      • TargetType — (String)

        The target type. Can be an Amazon SNS topic.

      • TargetAddress — (String)

        The Amazon Resource Name (ARN) of the SNS topic.

    • DetailType — (String)

      The level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.

      Possible values include:
      • "BASIC"
      • "FULL"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.