Retrieves the cost anomaly subscription objects for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs).
Parameters:
-
subscription_arn_list
(Optional[Values], default:
None
)
–
A list of cost anomaly subscription ARNs.
-
monitor_arn
(Optional[GenericString], default:
None
)
–
Cost anomaly monitor ARNs.
-
next_page_token
(Optional[NextPageToken], default:
None
)
–
The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
-
max_results
(Optional[PageSize], default:
None
)
–
The number of entries a paginated response contains.
Raises:
Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
| async def get_anomaly_subscriptions(
self,
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
subscription_arn_list: Optional[
"capo_cost_explorer.types.values.Values"
] = None,
monitor_arn: Optional[
"capo_cost_explorer.types.generic_string.GenericString"
] = None,
next_page_token: Optional[
"capo_cost_explorer.types.next_page_token.NextPageToken"
] = None,
max_results: Optional["capo_cost_explorer.types.page_size.PageSize"] = None,
) -> "capo_cost_explorer.types.get_anomaly_subscriptions_response.GetAnomalySubscriptionsResponse":
"""<p>Retrieves the cost anomaly subscription objects for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). </p>
Args:
subscription_arn_list: <p>A list of cost anomaly subscription ARNs. </p>
monitor_arn: <p>Cost anomaly monitor ARNs. </p>
next_page_token: <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size. </p>
max_results: <p>The number of entries a paginated response contains. </p>
Raises:
capo_cost_explorer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid. Try again without a pagination token.</p>
capo_cost_explorer.errors.limit_exceeded_exception.LimitExceededException: <p>You made too many calls in a short period of time. Try again later.</p>
capo_cost_explorer.errors.unknown_subscription_exception.UnknownSubscriptionException: <p>The cost anomaly subscription does not exist for the account. </p>
capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cost_explorer.types.get_anomaly_subscriptions_request.GetAnomalySubscriptionsRequest]",
) -> AsyncOperationResponse[
"capo_cost_explorer.types.get_anomaly_subscriptions_response.GetAnomalySubscriptionsResponse"
]:
import capo_cost_explorer._operations.aws_insights_index_service.get_anomaly_subscriptions
(
output,
http_response,
) = await capo_cost_explorer._operations.aws_insights_index_service.get_anomaly_subscriptions.async_get_anomaly_subscriptions(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetAnomalySubscriptions")
)
input_: capo_cost_explorer.types.get_anomaly_subscriptions_request.GetAnomalySubscriptionsRequest = {}
if subscription_arn_list is not None:
input_["subscription_arn_list"] = subscription_arn_list
if monitor_arn is not None:
input_["monitor_arn"] = monitor_arn
if next_page_token is not None:
input_["next_page_token"] = next_page_token
if max_results is not None:
input_["max_results"] = max_results
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|