Skip to content

list_associations

list_associations(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    source_arn: Optional[AssociationEntityArn] = None,
    destination_arn: Optional[AssociationEntityArn] = None,
    source_type: Optional[String256] = None,
    destination_type: Optional[String256] = None,
    association_type: Optional[AssociationEdgeType] = None,
    created_after: Optional[Timestamp] = None,
    created_before: Optional[Timestamp] = None,
    sort_by: Optional[SortAssociationsBy] = None,
    sort_order: Optional[SortOrder] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListAssociationsResponse

Lists the associations in your account and their properties.

Parameters:

  • source_arn (Optional[AssociationEntityArn], default: None ) –

    A filter that returns only associations with the specified source ARN.

  • destination_arn (Optional[AssociationEntityArn], default: None ) –

    A filter that returns only associations with the specified destination Amazon Resource Name (ARN).

  • source_type (Optional[String256], default: None ) –

    A filter that returns only associations with the specified source type.

  • destination_type (Optional[String256], default: None ) –

    A filter that returns only associations with the specified destination type.

  • association_type (Optional[AssociationEdgeType], default: None ) –

    A filter that returns only associations of the specified type.

  • created_after (Optional[Timestamp], default: None ) –

    A filter that returns only associations created on or after the specified time.

  • created_before (Optional[Timestamp], default: None ) –

    A filter that returns only associations created on or before the specified time.

  • sort_by (Optional[SortAssociationsBy], default: None ) –

    The property used to sort results. The default value is CreationTime.

  • sort_order (Optional[SortOrder], default: None ) –

    The sort order. The default value is Descending.

  • next_token (Optional[NextToken], default: None ) –

    If the previous call to ListAssociations didn't return the full set of associations, the call returns a token for getting the next set of associations.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of associations to return in the response. The default value is 10.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_associations(
    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,
    source_type: Optional["capo_sagemaker.types.string256.String256"] = None,
    destination_type: Optional["capo_sagemaker.types.string256.String256"] = None,
    association_type: Optional[
        "capo_sagemaker.types.association_edge_type.AssociationEdgeType"
    ] = None,
    created_after: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    created_before: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.sort_associations_by.SortAssociationsBy"
    ] = None,
    sort_order: Optional["capo_sagemaker.types.sort_order.SortOrder"] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
) -> "capo_sagemaker.types.list_associations_response.ListAssociationsResponse":
    """<p>Lists the associations in your account and their properties.</p>

    Args:
        source_arn: <p>A filter that returns only associations with the specified source ARN.</p>
        destination_arn: <p>A filter that returns only associations with the specified destination Amazon Resource Name (ARN).</p>
        source_type: <p>A filter that returns only associations with the specified source type.</p>
        destination_type: <p>A filter that returns only associations with the specified destination type.</p>
        association_type: <p>A filter that returns only associations of the specified type.</p>
        created_after: <p>A filter that returns only associations created on or after the specified time.</p>
        created_before: <p>A filter that returns only associations created on or before the specified time.</p>
        sort_by: <p>The property used to sort results. The default value is <code>CreationTime</code>.</p>
        sort_order: <p>The sort order. The default value is <code>Descending</code>.</p>
        next_token: <p>If the previous call to <code>ListAssociations</code> didn't return the full set of associations, the call returns a token for getting the next set of associations.</p>
        max_results: <p>The maximum number of associations to return in the response. The default value is 10.</p>

    Raises:
        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.list_associations_request.ListAssociationsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_associations_response.ListAssociationsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_associations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAssociations")
    )
    input_: capo_sagemaker.types.list_associations_request.ListAssociationsRequest = {}
    if source_arn is not None:
        input_["source_arn"] = source_arn
    if destination_arn is not None:
        input_["destination_arn"] = destination_arn
    if source_type is not None:
        input_["source_type"] = source_type
    if destination_type is not None:
        input_["destination_type"] = destination_type
    if association_type is not None:
        input_["association_type"] = association_type
    if created_after is not None:
        input_["created_after"] = created_after
    if created_before is not None:
        input_["created_before"] = created_before
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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