Skip to content

list_admin_accounts_for_organization

list_admin_accounts_for_organization(
    *,
    config_overrides: Optional[FMSClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[PaginationMaxResults] = None,
) -> ListAdminAccountsForOrganizationResponse

Returns a AdminAccounts object that lists the Firewall Manager administrators within the organization that are onboarded to Firewall Manager by AssociateAdminAccount.

This operation can be called only from the organization's management account.

Parameters:

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

    When you request a list of objects with a MaxResults setting, if the number of objects that are still available for retrieval exceeds the maximum you requested, Firewall Manager returns a NextToken value in the response. To retrieve the next batch of objects, use the token returned from the prior request in your next request.

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

    The maximum number of objects that you want Firewall Manager to return for this request. If more objects are available, in the response, Firewall Manager provides a NextToken value that you can use in a subsequent call to get the next batch of objects.

Raises:

  • InternalErrorException –

    The operation failed because of a system problem, even though the request was valid. Retry your request.

  • InvalidOperationException –

    The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an AssociateAdminAccount request for an account ID that was already set as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Organizations before you can access it.

  • LimitExceededException –

    The operation exceeds a resource limit, for example, the maximum number of policy objects that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits in the WAF Developer Guide.

  • ResourceNotFoundException –

    The specified resource was not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fms/_services/fms.py
def list_admin_accounts_for_organization(
    self,
    *,
    config_overrides: Optional[FMSClientConfig] = None,
    next_token: Optional["capo_fms.types.pagination_token.PaginationToken"] = None,
    max_results: Optional[
        "capo_fms.types.pagination_max_results.PaginationMaxResults"
    ] = None,
) -> "capo_fms.types.list_admin_accounts_for_organization_response.ListAdminAccountsForOrganizationResponse":
    """<p>Returns a <code>AdminAccounts</code> object that lists the Firewall Manager administrators within the organization that are onboarded to Firewall Manager by <a>AssociateAdminAccount</a>.</p> <p>This operation can be called only from the organization's management account.</p>

    Args:
        next_token: <p>When you request a list of objects with a <code>MaxResults</code> setting, if the number of objects that are still available for retrieval exceeds the maximum you requested, Firewall Manager returns a <code>NextToken</code> value in the response. To retrieve the next batch of objects, use the token returned from the prior request in your next request.</p>
        max_results: <p>The maximum number of objects that you want Firewall Manager to return for this request. If more objects are available, in the response, Firewall Manager provides a <code>NextToken</code> value that you can use in a subsequent call to get the next batch of objects.</p>

    Raises:
        capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_fms.errors.invalid_operation_exception.InvalidOperationException: <p>The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an <code>AssociateAdminAccount</code> request for an account ID that was already set as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Organizations before you can access it.</p>
        capo_fms.errors.limit_exceeded_exception.LimitExceededException: <p>The operation exceeds a resource limit, for example, the maximum number of <code>policy</code> objects that you can create for an Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html">Firewall Manager Limits</a> in the <i>WAF Developer Guide</i>.</p>
        capo_fms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_fms.types.list_admin_accounts_for_organization_request.ListAdminAccountsForOrganizationRequest]",
    ) -> OperationResponse[
        "capo_fms.types.list_admin_accounts_for_organization_response.ListAdminAccountsForOrganizationResponse"
    ]:
        import capo_fms._operations.awsfms_20180101.list_admin_accounts_for_organization

        output, http_response = (
            capo_fms._operations.awsfms_20180101.list_admin_accounts_for_organization.list_admin_accounts_for_organization(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAdminAccountsForOrganization")
    )
    input_: capo_fms.types.list_admin_accounts_for_organization_request.ListAdminAccountsForOrganizationRequest = {}
    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