Skip to content

describe_trusts

describe_trusts(
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
    directory_id: Optional[DirectoryId] = None,
    trust_ids: Optional[TrustIds] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[Limit] = None,
) -> DescribeTrustsResult

Obtains information about the trust relationships for this account.

If no input parameters are provided, such as DirectoryId or TrustIds, this request describes all the trust relationships belonging to the account.

Parameters:

  • directory_id (Optional[DirectoryId], default: None ) –

    The Directory ID of the Amazon Web Services directory that is a part of the requested trust relationship.

  • trust_ids (Optional[TrustIds], default: None ) –

    A list of identifiers of the trust relationships for which to obtain the information. If this member is null, all trust relationships that belong to the current account are returned.

    An empty list results in an InvalidParameterException being thrown.

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

    The DescribeTrustsResult.NextToken value from a previous call to DescribeTrusts. Pass null if this is the first call.

  • limit (Optional[Limit], default: None ) –

    The maximum number of objects to return.

Raises:

Examples:

To describe a trust The following example obtains information about the trust relationship for a specified directory.

>>> client.describe_trusts(directory_id='d-92654abfed', trust_ids=['t-9267353df0'], limit=0)
Source code in docs_src/capo_directory_service/_services/directory_service.py
def describe_trusts(
    self,
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
    directory_id: Optional[
        "capo_directory_service.types.directory_id.DirectoryId"
    ] = None,
    trust_ids: Optional["capo_directory_service.types.trust_ids.TrustIds"] = None,
    next_token: Optional[
        "capo_directory_service.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_directory_service.types.limit.Limit"] = None,
) -> "capo_directory_service.types.describe_trusts_result.DescribeTrustsResult":
    """<p>Obtains information about the trust relationships for this account.</p> <p>If no input parameters are provided, such as DirectoryId or TrustIds, this request describes all the trust relationships belonging to the account.</p>

    Args:
        directory_id: <p>The Directory ID of the Amazon Web Services directory that is a part of the requested trust relationship.</p>
        trust_ids: <p>A list of identifiers of the trust relationships for which to obtain the information. If this member is null, all trust relationships that belong to the current account are returned.</p> <p>An empty list results in an <code>InvalidParameterException</code> being thrown.</p>
        next_token: <p>The <i>DescribeTrustsResult.NextToken</i> value from a previous call to <a>DescribeTrusts</a>. Pass null if this is the first call.</p>
        limit: <p>The maximum number of objects to return.</p>

    Raises:
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
        capo_directory_service.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> value is not valid.</p>
        capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
        capo_directory_service.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The operation is not supported.</p>
        capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a trust
        The following example obtains information about the trust relationship for a specified directory.

        >>> client.describe_trusts(directory_id='d-92654abfed', trust_ids=['t-9267353df0'], limit=0)
    """

    def _handler(
        req: "OperationRequest[capo_directory_service.types.describe_trusts_request.DescribeTrustsRequest]",
    ) -> OperationResponse[
        "capo_directory_service.types.describe_trusts_result.DescribeTrustsResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.describe_trusts

        output, http_response = (
            capo_directory_service._operations.directory_service_20150416.describe_trusts.describe_trusts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTrusts")
    )
    input_: capo_directory_service.types.describe_trusts_request.DescribeTrustsRequest = {}
    if directory_id is not None:
        input_["directory_id"] = directory_id
    if trust_ids is not None:
        input_["trust_ids"] = trust_ids
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

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