Skip to content

update_artifact

update_artifact(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    artifact_arn: Optional[ArtifactArn] = None,
    artifact_name: Optional[ExperimentEntityName] = None,
    properties: Optional[ArtifactProperties] = None,
    properties_to_remove: Optional[ListLineageEntityParameterKey] = None,
) -> UpdateArtifactResponse

Updates an artifact.

Parameters:

Raises:

  • ConflictException –

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

  • 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/sage_maker.py
def update_artifact(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    artifact_arn: Optional["capo_sagemaker.types.artifact_arn.ArtifactArn"] = None,
    artifact_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    properties: Optional[
        "capo_sagemaker.types.artifact_properties.ArtifactProperties"
    ] = None,
    properties_to_remove: Optional[
        "capo_sagemaker.types.list_lineage_entity_parameter_key.ListLineageEntityParameterKey"
    ] = None,
) -> "capo_sagemaker.types.update_artifact_response.UpdateArtifactResponse":
    """<p>Updates an artifact.</p>

    Args:
        artifact_arn: <p>The Amazon Resource Name (ARN) of the artifact to update.</p>
        artifact_name: <p>The new name for the artifact.</p>
        properties: <p>The new list of properties. Overwrites the current property list.</p>
        properties_to_remove: <p>A list of properties to remove.</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_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.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_artifact_request.UpdateArtifactRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_artifact_response.UpdateArtifactResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_artifact

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_artifact.update_artifact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateArtifact")
    )
    input_: capo_sagemaker.types.update_artifact_request.UpdateArtifactRequest = {}
    if artifact_arn is not None:
        input_["artifact_arn"] = artifact_arn
    if artifact_name is not None:
        input_["artifact_name"] = artifact_name
    if properties is not None:
        input_["properties"] = properties
    if properties_to_remove is not None:
        input_["properties_to_remove"] = properties_to_remove

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output