Skip to content

describe_standards async

describe_standards(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    providers: Optional[StandardsProviders] = None,
) -> DescribeStandardsResponse

Returns a list of the available standards in Security Hub CSPM.

For each standard, the results include the standard ARN, the name, and a description.

Parameters:

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

    The token that is required for pagination. On your first call to the DescribeStandards 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 standards to return.

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

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

Raises:

Examples:

To get available Azure security standards The following example returns a list of available security standards from a specified provider.

>>> await client.describe_standards(providers=['Azure'])
To get available Security Hub standards
The following example returns a list of available security standards in Security Hub.
>>> await client.describe_standards()
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def describe_standards(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = 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.describe_standards_response.DescribeStandardsResponse":
    """<p>Returns a list of the available standards in Security Hub CSPM.</p> <p>For each standard, the results include the standard ARN, the name, and a description. </p>

    Args:
        next_token: <p>The token that is required for pagination. On your first call to the <code>DescribeStandards</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 standards to return.</p>
        providers: <p>A list of cloud providers to filter the standards by. For example, specify <code>Azure</code> to return only 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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get available Azure security standards
        The following example returns a list of available security standards from a specified provider.

        >>> await client.describe_standards(providers=['Azure'])
        To get available Security Hub standards
        The following example returns a list of available security standards in Security Hub.

        >>> await client.describe_standards()
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.describe_standards_request.DescribeStandardsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.describe_standards_response.DescribeStandardsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.describe_standards

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeStandards")
    )
    input_: capo_securityhub.types.describe_standards_request.DescribeStandardsRequest = {}
    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