Skip to content

list_source_associations async

list_source_associations(
    *,
    config_overrides: Optional[AsyncRAMClientConfig] = None,
    resource_share_arns: Optional[ResourceShareArnList] = None,
    source_id: Optional[String] = None,
    source_type: Optional[String] = None,
    association_status: Optional[ResourceShareAssociationStatus] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxResults] = None,
) -> ListSourceAssociationsResponse

Lists source associations for resource shares. Source associations control which sources can be used with service principals in resource shares. This operation provides visibility into source associations for resource share owners.

You can filter the results by resource share Amazon Resource Name (ARN), source ID, source type, or association status. We recommend using pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • resource_share_arns (Optional[ResourceShareArnList], default: None ) –

    The Amazon Resource Names (ARNs) of the resource shares for which you want to retrieve source associations.

  • source_id (Optional[String], default: None ) –

    The identifier of the source for which you want to retrieve associations. This can be an account ID, Amazon Resource Name (ARN), organization ID, or organization path.

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

    The type of source for which you want to retrieve associations.

  • association_status (Optional[ResourceShareAssociationStatus], default: None ) –

    The status of the source associations that you want to retrieve.

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

    The pagination token that indicates the next set of results to retrieve.

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

    The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.

Raises:

Source code in docs_src/capo_ram/_services/async_ram.py
async def list_source_associations(
    self,
    *,
    config_overrides: Optional[AsyncRAMClientConfig] = None,
    resource_share_arns: Optional[
        "capo_ram.types.resource_share_arn_list.ResourceShareArnList"
    ] = None,
    source_id: Optional["capo_ram.types.string.String"] = None,
    source_type: Optional["capo_ram.types.string.String"] = None,
    association_status: Optional[
        "capo_ram.types.resource_share_association_status.ResourceShareAssociationStatus"
    ] = None,
    next_token: Optional["capo_ram.types.string.String"] = None,
    max_results: Optional["capo_ram.types.max_results.MaxResults"] = None,
) -> "capo_ram.types.list_source_associations_response.ListSourceAssociationsResponse":
    """<p>Lists source associations for resource shares. Source associations control which sources can be used with service principals in resource shares. This operation provides visibility into source associations for resource share owners.</p> <p>You can filter the results by resource share Amazon Resource Name (ARN), source ID, source type, or association status. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        resource_share_arns: <p>The Amazon Resource Names (ARNs) of the resource shares for which you want to retrieve source associations.</p>
        source_id: <p>The identifier of the source for which you want to retrieve associations. This can be an account ID, Amazon Resource Name (ARN), organization ID, or organization path.</p>
        source_type: <p>The type of source for which you want to retrieve associations.</p>
        association_status: <p>The status of the source associations that you want to retrieve.</p>
        next_token: <p>The pagination token that indicates the next set of results to retrieve.</p>
        max_results: <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>

    Raises:
        capo_ram.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The operation failed because the specified value for <code>NextToken</code> isn't valid. You must specify a value you received in the <code>NextToken</code> response of a previous call to this operation.</p>
        capo_ram.errors.invalid_parameter_exception.InvalidParameterException: <p>The operation failed because a parameter you specified isn't valid.</p>
        capo_ram.errors.malformed_arn_exception.MalformedArnException: <p>The operation failed because the specified <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> has a format that isn't valid.</p>
        capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
        capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
        capo_ram.errors.unknown_resource_exception.UnknownResourceException: <p>The operation failed because a specified resource couldn't be found.</p>
        capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ram.types.list_source_associations_request.ListSourceAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ram.types.list_source_associations_response.ListSourceAssociationsResponse"
    ]:
        import capo_ram._operations.amazon_resource_sharing.list_source_associations

        (
            output,
            http_response,
        ) = await capo_ram._operations.amazon_resource_sharing.list_source_associations.async_list_source_associations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSourceAssociations")
    )
    input_: capo_ram.types.list_source_associations_request.ListSourceAssociationsRequest = {}
    if resource_share_arns is not None:
        input_["resource_share_arns"] = resource_share_arns
    if source_id is not None:
        input_["source_id"] = source_id
    if source_type is not None:
        input_["source_type"] = source_type
    if association_status is not None:
        input_["association_status"] = association_status
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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