Creates an association between the source and the destination. A source can be associated with multiple destinations, and a destination can be associated with multiple sources. An association is a lineage tracking entity. For more information, see Amazon SageMaker ML Lineage Tracking.
Parameters:
-
source_arn
(Optional[AssociationEntityArn], default:
None
)
–
-
destination_arn
(Optional[AssociationEntityArn], default:
None
)
–
The Amazon Resource Name (ARN) of the destination.
-
association_type
(Optional[AssociationEdgeType], default:
None
)
–
The type of association. The following are suggested uses for each type. Amazon SageMaker places no restrictions on their use.
-
ContributedTo - The source contributed to the destination or had a part in enabling the destination. For example, the training data contributed to the training job.
-
AssociatedWith - The source is connected to the destination. For example, an approval workflow is associated with a model deployment.
-
DerivedFrom - The destination is a modification of the source. For example, a digest output of a channel input for a processing job is derived from the original inputs.
-
Produced - The source generated the destination. For example, a training job produced a model artifact.
Raises:
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
| def add_association(
self,
*,
config_overrides: Optional[SageMakerClientConfig] = None,
source_arn: Optional[
"capo_sagemaker.types.association_entity_arn.AssociationEntityArn"
] = None,
destination_arn: Optional[
"capo_sagemaker.types.association_entity_arn.AssociationEntityArn"
] = None,
association_type: Optional[
"capo_sagemaker.types.association_edge_type.AssociationEdgeType"
] = None,
) -> "capo_sagemaker.types.add_association_response.AddAssociationResponse":
"""<p>Creates an <i>association</i> between the source and the destination. A source can be associated with multiple destinations, and a destination can be associated with multiple sources. An association is a lineage tracking entity. 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:
source_arn: <p>The ARN of the source.</p>
destination_arn: <p>The Amazon Resource Name (ARN) of the destination.</p>
association_type: <p>The type of association. The following are suggested uses for each type. Amazon SageMaker places no restrictions on their use.</p> <ul> <li> <p>ContributedTo - The source contributed to the destination or had a part in enabling the destination. For example, the training data contributed to the training job.</p> </li> <li> <p>AssociatedWith - The source is connected to the destination. For example, an approval workflow is associated with a model deployment.</p> </li> <li> <p>DerivedFrom - The destination is a modification of the source. For example, a digest output of a channel input for a processing job is derived from the original inputs.</p> </li> <li> <p>Produced - The source generated the destination. For example, a training job produced a model artifact.</p> </li> </ul>
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.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.add_association_request.AddAssociationRequest]",
) -> OperationResponse[
"capo_sagemaker.types.add_association_response.AddAssociationResponse"
]:
import capo_sagemaker._operations.sage_maker.add_association
output, http_response = (
capo_sagemaker._operations.sage_maker.add_association.add_association(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddAssociation")
)
input_: capo_sagemaker.types.add_association_request.AddAssociationRequest = {}
if source_arn is not None:
input_["source_arn"] = source_arn
if destination_arn is not None:
input_["destination_arn"] = destination_arn
if association_type is not None:
input_["association_type"] = association_type
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|