Skip to content

create_model_card_export_job async

create_model_card_export_job(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_card_name: Optional[ModelCardNameOrArn] = None,
    model_card_version: Optional[Integer] = None,
    model_card_export_job_name: Optional[EntityName] = None,
    output_config: Optional[ModelCardExportOutputConfig] = None,
) -> CreateModelCardExportJobResponse

Creates an Amazon SageMaker Model Card export job.

Parameters:

  • model_card_name (Optional[ModelCardNameOrArn], default: None ) –

    The name or Amazon Resource Name (ARN) of the model card to export.

  • model_card_version (Optional[Integer], default: None ) –

    The version of the model card to export. If a version is not provided, then the latest version of the model card is exported.

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

    The name of the model card export job.

  • output_config (Optional[ModelCardExportOutputConfig], default: None ) –

    The model card output configuration that specifies the Amazon S3 path for exporting.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_model_card_export_job(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    model_card_name: Optional[
        "capo_sagemaker.types.model_card_name_or_arn.ModelCardNameOrArn"
    ] = None,
    model_card_version: Optional["capo_sagemaker.types.integer.Integer"] = None,
    model_card_export_job_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
    output_config: Optional[
        "capo_sagemaker.types.model_card_export_output_config.ModelCardExportOutputConfig"
    ] = None,
) -> "capo_sagemaker.types.create_model_card_export_job_response.CreateModelCardExportJobResponse":
    """<p>Creates an Amazon SageMaker Model Card export job.</p>

    Args:
        model_card_name: <p>The name or Amazon Resource Name (ARN) of the model card to export.</p>
        model_card_version: <p>The version of the model card to export. If a version is not provided, then the latest version of the model card is exported.</p>
        model_card_export_job_name: <p>The name of the model card export job.</p>
        output_config: <p>The model card output configuration that specifies the Amazon S3 path for exporting.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_model_card_export_job_request.CreateModelCardExportJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_model_card_export_job_response.CreateModelCardExportJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_model_card_export_job

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_model_card_export_job.async_create_model_card_export_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateModelCardExportJob")
    )
    input_: capo_sagemaker.types.create_model_card_export_job_request.CreateModelCardExportJobRequest = {}
    if model_card_name is not None:
        input_["model_card_name"] = model_card_name
    if model_card_version is not None:
        input_["model_card_version"] = model_card_version
    if model_card_export_job_name is not None:
        input_["model_card_export_job_name"] = model_card_export_job_name
    if output_config is not None:
        input_["output_config"] = output_config

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