AddNotificationChannelsCommand

Add up to 2 anomaly notifications channels for a profiling group.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CodeGuruProfilerClient, AddNotificationChannelsCommand } from "@aws-sdk/client-codeguruprofiler"; // ES Modules import
// const { CodeGuruProfilerClient, AddNotificationChannelsCommand } = require("@aws-sdk/client-codeguruprofiler"); // CommonJS import
const client = new CodeGuruProfilerClient(config);
const input = { // AddNotificationChannelsRequest
  profilingGroupName: "STRING_VALUE", // required
  channels: [ // Channels // required
    { // Channel
      id: "STRING_VALUE",
      uri: "STRING_VALUE", // required
      eventPublishers: [ // EventPublishers // required
        "STRING_VALUE",
      ],
    },
  ],
};
const command = new AddNotificationChannelsCommand(input);
const response = await client.send(command);
// { // AddNotificationChannelsResponse
//   notificationConfiguration: { // NotificationConfiguration
//     channels: [ // Channels
//       { // Channel
//         id: "STRING_VALUE",
//         uri: "STRING_VALUE", // required
//         eventPublishers: [ // EventPublishers // required
//           "STRING_VALUE",
//         ],
//       },
//     ],
//   },
// };

AddNotificationChannelsCommand Input

Parameter
Type
Description
channels
Required
Channel[] | undefined

One or 2 channels to report to when anomalies are detected.

profilingGroupName
Required
string | undefined

The name of the profiling group that we are setting up notifications for.

AddNotificationChannelsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
notificationConfiguration
NotificationConfiguration | undefined

The new notification configuration for this profiling group.

Throws

Name
Fault
Details
ConflictException
client

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

InternalServerException
server

The server encountered an internal error and is unable to complete the request.

ResourceNotFoundException
client

The resource specified in the request does not exist.

ServiceQuotaExceededException
client

You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas  to request a service quota increase.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The parameter is not valid.

CodeGuruProfilerServiceException
Base exception class for all service exceptions from CodeGuruProfiler service.