Skip to content

list_domain_access_grants_for_organization

list_domain_access_grants_for_organization(
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    domain_id: Optional[DomainId] = None,
    principal_id: Optional[PrincipalId] = None,
    principal_type: Optional[OrganizationGrantPrincipalType] = None,
    permission: Optional[OrganizationGrantPermission] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListDomainAccessGrantsForOrganizationOutput

Returns organization-level domain access grants, with optional filtering by domain, principal, or permission. A grant is returned only when it matches every filter supplied. With no filters, returns the grants for the caller's organization.

Parameters:

  • domain_id (Optional[DomainId], default: None ) –

    Filter by domain ID.

  • principal_id (Optional[PrincipalId], default: None ) –

    Filter by principal ID.

  • principal_type (Optional[OrganizationGrantPrincipalType], default: None ) –

    Filter by principal type.

  • permission (Optional[OrganizationGrantPermission], default: None ) –

    Filter by permission level.

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

    A token to retrieve the next page of results. Supply the same filters used on the request that returned it. Tokens expire after 24 hours.

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

    The maximum number of access grants to return per page. Defaults to 100. A page can contain fewer results than this value even when more results remain; continue while nextToken is present.

Raises:

Examples:

List organization domain access grants The following example lists the first page of organization domain access grants and returns a nextToken to retrieve the next page. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.list_domain_access_grants_for_organization(domain_id='d-1a2b3c4d5e', max_results=50)
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def list_domain_access_grants_for_organization(
    self,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    domain_id: Optional["capo_cloudwatchomni.types.domain_id.DomainId"] = None,
    principal_id: Optional[
        "capo_cloudwatchomni.types.principal_id.PrincipalId"
    ] = None,
    principal_type: Optional[
        "capo_cloudwatchomni.types.organization_grant_principal_type.OrganizationGrantPrincipalType"
    ] = None,
    permission: Optional[
        "capo_cloudwatchomni.types.organization_grant_permission.OrganizationGrantPermission"
    ] = None,
    next_token: Optional["capo_cloudwatchomni.types.next_token.NextToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_cloudwatchomni.types.list_domain_access_grants_for_organization_output.ListDomainAccessGrantsForOrganizationOutput":
    """Returns organization-level domain access grants, with optional filtering by domain, principal, or permission. A grant is returned only when it matches every filter supplied. With no filters, returns the grants for the caller's organization.

    Args:
        domain_id: Filter by domain ID.
        principal_id: Filter by principal ID.
        principal_type: Filter by principal type.
        permission: Filter by permission level.
        next_token: A token to retrieve the next page of results. Supply the same filters used on the request that returned it. Tokens expire after 24 hours.
        max_results: The maximum number of access grants to return per page. Defaults to 100. A page can contain fewer results than this value even when more results remain; continue while nextToken is present.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List organization domain access grants
        The following example lists the first page of organization domain access grants and returns a nextToken to retrieve the next page. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.list_domain_access_grants_for_organization(domain_id='d-1a2b3c4d5e', max_results=50)
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.list_domain_access_grants_for_organization_input.ListDomainAccessGrantsForOrganizationInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.list_domain_access_grants_for_organization_output.ListDomainAccessGrantsForOrganizationOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_domain_access_grants_for_organization

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_domain_access_grants_for_organization.list_domain_access_grants_for_organization(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDomainAccessGrantsForOrganization")
    )
    input_: capo_cloudwatchomni.types.list_domain_access_grants_for_organization_input.ListDomainAccessGrantsForOrganizationInput = {}
    if domain_id is not None:
        input_["domain_id"] = domain_id
    if principal_id is not None:
        input_["principal_id"] = principal_id
    if principal_type is not None:
        input_["principal_type"] = principal_type
    if permission is not None:
        input_["permission"] = permission
    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