Add up to 2 anomaly notifications channels for a profiling group.
Parameters:
-
profiling_group_name
(ProfilingGroupName)
–
The name of the profiling group that we are setting up notifications for.
-
channels
(Channels)
–
One or 2 channels to report to when anomalies are detected.
Raises:
Source code in docs_src/capo_codeguruprofiler/_services/code_guru_profiler.py
| def add_notification_channels(
self,
profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
channels: "capo_codeguruprofiler.types.channels.Channels",
*,
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
) -> "capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse":
"""<p>Add up to 2 anomaly notifications channels for a profiling group.</p>
Args:
profiling_group_name: <p>The name of the profiling group that we are setting up notifications for.</p>
channels: <p>One or 2 channels to report to when anomalies are detected.</p>
Raises:
capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>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. </p>
capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html">Service Quotas</a> to request a service quota increase. </p>
capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest]",
) -> OperationResponse[
"capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse"
]:
import capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels
output, http_response = (
capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels.add_notification_channels(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddNotificationChannels")
)
input_: capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest = {
"profiling_group_name": profiling_group_name,
"channels": channels,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|