Skip to content

create_artifact async

create_artifact(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    artifact_name: Optional[ExperimentEntityName] = None,
    source: Optional[ArtifactSource] = None,
    artifact_type: Optional[String256] = None,
    properties: Optional[ArtifactProperties] = None,
    metadata_properties: Optional[MetadataProperties] = None,
    tags: Optional[TagList] = None,
) -> CreateArtifactResponse

Creates an artifact. An artifact is a lineage tracking entity that represents a URI addressable object or data. Some examples are the S3 URI of a dataset and the ECR registry path of an image. For more information, see Amazon SageMaker ML Lineage Tracking.

Parameters:

Raises:

  • ResourceLimitExceeded –

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

  • 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_artifact(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    artifact_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    source: Optional["capo_sagemaker.types.artifact_source.ArtifactSource"] = None,
    artifact_type: Optional["capo_sagemaker.types.string256.String256"] = None,
    properties: Optional[
        "capo_sagemaker.types.artifact_properties.ArtifactProperties"
    ] = None,
    metadata_properties: Optional[
        "capo_sagemaker.types.metadata_properties.MetadataProperties"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_artifact_response.CreateArtifactResponse":
    """<p>Creates an <i>artifact</i>. An artifact is a lineage tracking entity that represents a URI addressable object or data. Some examples are the S3 URI of a dataset and the ECR registry path of an image. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html">Amazon SageMaker ML Lineage Tracking</a>.</p>

    Args:
        artifact_name: <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
        source: <p>The ID, ID type, and URI of the source.</p>
        artifact_type: <p>The artifact type.</p>
        properties: <p>A list of properties to add to the artifact.</p>
        tags: <p>A list of tags to apply to the artifact.</p>

    Raises:
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_artifact_request.CreateArtifactRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_artifact_response.CreateArtifactResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_artifact

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateArtifact")
    )
    input_: capo_sagemaker.types.create_artifact_request.CreateArtifactRequest = {}
    if artifact_name is not None:
        input_["artifact_name"] = artifact_name
    if source is not None:
        input_["source"] = source
    if artifact_type is not None:
        input_["artifact_type"] = artifact_type
    if properties is not None:
        input_["properties"] = properties
    if metadata_properties is not None:
        input_["metadata_properties"] = metadata_properties
    if tags is not None:
        input_["tags"] = tags

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