Skip to content

start_metrics_export async

start_metrics_export(
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    bucket_name: Optional[EntityName] = None,
    client_token: Optional[ClientToken] = None,
) -> StartMetricsExportResponse

Initiates the export task of metrics.

Parameters:

  • bucket_name (Optional[EntityName], default: None ) –

    (Optional) Specifies the name of the Amazon Simple Storage Service bucket where the exported metrics will be stored.

  • client_token (Optional[ClientToken], default: None ) –

    Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

  • ConflictException –

    This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Resilience Hub service.

  • ServiceQuotaExceededException –

    This exception occurs when 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 –

    This exception occurs when you have exceeded the limit on the number of requests per second.

  • ValidationException –

    This exception occurs when a request is not valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_resiliencehub/_services/async_resiliencehub.py
async def start_metrics_export(
    self,
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    bucket_name: Optional["capo_resiliencehub.types.entity_name.EntityName"] = None,
    client_token: Optional[
        "capo_resiliencehub.types.client_token.ClientToken"
    ] = None,
) -> "capo_resiliencehub.types.start_metrics_export_response.StartMetricsExportResponse":
    """<p>Initiates the export task of metrics.</p>

    Args:
        bucket_name: <p>(Optional) Specifies the name of the Amazon Simple Storage Service bucket where the exported metrics will be stored.</p>
        client_token: <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>

    Raises:
        capo_resiliencehub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.</p>
        capo_resiliencehub.errors.conflict_exception.ConflictException: <p>This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_resiliencehub.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Resilience Hub service.</p>
        capo_resiliencehub.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception occurs when 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.</p>
        capo_resiliencehub.errors.throttling_exception.ThrottlingException: <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
        capo_resiliencehub.errors.validation_exception.ValidationException: <p>This exception occurs when a request is not valid.</p>
        capo_resiliencehub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehub.types.start_metrics_export_request.StartMetricsExportRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehub.types.start_metrics_export_response.StartMetricsExportResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.start_metrics_export

        (
            output,
            http_response,
        ) = await capo_resiliencehub._operations.aws_resilience_hub.start_metrics_export.async_start_metrics_export(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMetricsExport")
    )
    input_: capo_resiliencehub.types.start_metrics_export_request.StartMetricsExportRequest = {}
    if bucket_name is not None:
        input_["bucket_name"] = bucket_name
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output