Skip to content

get_admin_account

get_admin_account(
    account_id: AccountId,
    *,
    config_overrides: Optional[NetworkSecurityManagerClientConfig] = None,
) -> GetAdminAccountResponse

Retrieves the details of the specified AWS Network Security Manager administrator account.

Parameters:

  • account_id (AccountId) –

    The AWS account ID of the administrator account to retrieve.

Raises:

  • AccessDeniedException –

    You do not have sufficient permissions to perform this action.

  • InternalServerException –

    The request processing failed because of an internal error in the service. This is a retryable error.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.

  • ThrottlingException –

    The request was denied because of request throttling. Reduce your request rate and try again.

  • ValidationException –

    The request failed validation. For details, see the reason and fieldList members of the response.

  • UnknownServiceError –

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

Examples:

Get an administrator account Retrieves the details and administrative scope of a Network Security Manager administrator account.

>>> client.get_admin_account(account_id='234567890123')
Source code in docs_src/capo_network_security_manager/_services/network_security_manager.py
def get_admin_account(
    self,
    account_id: "capo_network_security_manager.types.account_id.AccountId",
    *,
    config_overrides: Optional[NetworkSecurityManagerClientConfig] = None,
) -> "capo_network_security_manager.types.get_admin_account_response.GetAdminAccountResponse":
    """<p>Retrieves the details of the specified AWS Network Security Manager administrator account.</p>

    Args:
        account_id: <p>The AWS account ID of the administrator account to retrieve.</p>

    Raises:
        capo_network_security_manager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_network_security_manager.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an internal error in the service. This is a retryable error.</p>
        capo_network_security_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.</p>
        capo_network_security_manager.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Reduce your request rate and try again.</p>
        capo_network_security_manager.errors.validation_exception.ValidationException: <p>The request failed validation. For details, see the <code>reason</code> and <code>fieldList</code> members of the response.</p>
        capo_network_security_manager.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get an administrator account
        Retrieves the details and administrative scope of a Network Security Manager administrator account.

        >>> client.get_admin_account(account_id='234567890123')
    """

    def _handler(
        req: "OperationRequest[capo_network_security_manager.types.get_admin_account_request.GetAdminAccountRequest]",
    ) -> OperationResponse[
        "capo_network_security_manager.types.get_admin_account_response.GetAdminAccountResponse"
    ]:
        import capo_network_security_manager._operations.piccolo_customer_api_service.get_admin_account

        output, http_response = (
            capo_network_security_manager._operations.piccolo_customer_api_service.get_admin_account.get_admin_account(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_network_security_manager.types.get_admin_account_response.GetAdminAccountResponse",
    ) -> dict[str, Any]:
        import capo_network_security_manager.types.get_admin_account_response

        return capo_network_security_manager.types.get_admin_account_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetAdminAccount", redact_output=_redact_output),
    )
    input_: capo_network_security_manager.types.get_admin_account_request.GetAdminAccountRequest = {
        "account_id": account_id
    }

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