Skip to content

list_controls async

list_controls(
    *,
    config_overrides: Optional[AsyncControlCatalogClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxListControlsResults] = None,
    filter: Optional[ControlFilter] = None,
) -> ListControlsResponse

Returns a paginated list of all available controls in the Control Catalog library. Allows you to discover available controls. The list of controls is given as structures of type controlSummary. The ARN is returned in the global controlcatalog format, as shown in the examples.

Parameters:

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

    The pagination token that's used to fetch the next set of results.

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

    The maximum number of results on a page or for an API request call.

  • filter (Optional[ControlFilter], default: None ) –

    An optional filter that narrows the results to controls with specific implementation types or identifiers. If you don't provide a filter, the operation returns all available controls.

Raises:

Source code in docs_src/capo_controlcatalog/_services/async_control_catalog.py
async def list_controls(
    self,
    *,
    config_overrides: Optional[AsyncControlCatalogClientConfig] = None,
    next_token: Optional[
        "capo_controlcatalog.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_controlcatalog.types.max_list_controls_results.MaxListControlsResults"
    ] = None,
    filter: Optional[
        "capo_controlcatalog.types.control_filter.ControlFilter"
    ] = None,
) -> "capo_controlcatalog.types.list_controls_response.ListControlsResponse":
    """<p>Returns a paginated list of all available controls in the Control Catalog library. Allows you to discover available controls. The list of controls is given as structures of type <i>controlSummary</i>. The ARN is returned in the global <i>controlcatalog</i> format, as shown in the examples.</p>

    Args:
        next_token: <p>The pagination token that's used to fetch the next set of results.</p>
        max_results: <p>The maximum number of results on a page or for an API request call.</p>
        filter: <p>An optional filter that narrows the results to controls with specific implementation types or identifiers. If you don't provide a filter, the operation returns all available controls.</p>

    Raises:
        capo_controlcatalog.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_controlcatalog.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred during the processing of your request. Try again later.</p>
        capo_controlcatalog.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_controlcatalog.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_controlcatalog.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_controlcatalog.types.list_controls_request.ListControlsRequest]",
    ) -> AsyncOperationResponse[
        "capo_controlcatalog.types.list_controls_response.ListControlsResponse"
    ]:
        import capo_controlcatalog._operations.control_catalog.list_controls

        (
            output,
            http_response,
        ) = await capo_controlcatalog._operations.control_catalog.list_controls.async_list_controls(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListControls")
    )
    input_: capo_controlcatalog.types.list_controls_request.ListControlsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filter is not None:
        input_["filter"] = filter

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