Skip to content

get_enabled_standards async

get_enabled_standards(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_subscription_arns: Optional[StandardsSubscriptionArns] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    providers: Optional[StandardsProviders] = None,
) -> GetEnabledStandardsResponse

Returns a list of the standards that are currently enabled.

Parameters:

  • standards_subscription_arns (Optional[StandardsSubscriptionArns], default: None ) –

    The list of the standards subscription ARNs for the standards to retrieve.

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

    The token that is required for pagination. On your first call to the GetEnabledStandards operation, set the value of this parameter to NULL.

    For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

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

    The maximum number of results to return in the response.

  • providers (Optional[StandardsProviders], default: None ) –

    A list of cloud providers to filter the enabled standards by. For example, specify Azure to return only enabled standards that evaluate Azure resources.

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • UnknownServiceError –

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

Examples:

To return a list of enabled standards The following example returns a list of Security Hub standards that are currently enabled in your account.

>>> await client.get_enabled_standards(standards_subscription_arns=['arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1'])
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def get_enabled_standards(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_subscription_arns: Optional[
        "capo_securityhub.types.standards_subscription_arns.StandardsSubscriptionArns"
    ] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
    max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
    providers: Optional[
        "capo_securityhub.types.standards_providers.StandardsProviders"
    ] = None,
) -> "capo_securityhub.types.get_enabled_standards_response.GetEnabledStandardsResponse":
    """<p>Returns a list of the standards that are currently enabled.</p>

    Args:
        standards_subscription_arns: <p>The list of the standards subscription ARNs for the standards to retrieve.</p>
        next_token: <p>The token that is required for pagination. On your first call to the <code>GetEnabledStandards</code> operation, set the value of this parameter to <code>NULL</code>.</p> <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
        max_results: <p>The maximum number of results to return in the response.</p>
        providers: <p>A list of cloud providers to filter the enabled standards by. For example, specify <code>Azure</code> to return only enabled standards that evaluate Azure resources.</p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To return a list of enabled standards
        The following example returns a list of Security Hub standards that are currently enabled in your account.

        >>> await client.get_enabled_standards(standards_subscription_arns=['arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.get_enabled_standards_request.GetEnabledStandardsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.get_enabled_standards_response.GetEnabledStandardsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.get_enabled_standards

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.get_enabled_standards.async_get_enabled_standards(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetEnabledStandards")
    )
    input_: capo_securityhub.types.get_enabled_standards_request.GetEnabledStandardsRequest = {}
    if standards_subscription_arns is not None:
        input_["standards_subscription_arns"] = standards_subscription_arns
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if providers is not None:
        input_["providers"] = providers

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