Skip to content

list_rule_groups_namespaces

list_rule_groups_namespaces(
    workspace_id: WorkspaceId,
    *,
    config_overrides: Optional[ampClientConfig] = None,
    name: Optional[RuleGroupsNamespaceName] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[int] = None,
) -> ListRuleGroupsNamespacesResponse

Returns a list of rule groups namespaces in a workspace.

Parameters:

  • workspace_id (WorkspaceId) –

    The ID of the workspace containing the rule groups namespaces.

  • name (Optional[RuleGroupsNamespaceName], default: None ) –

    Use this parameter to filter the rule groups namespaces that are returned. Only the namespaces with names that begin with the value that you specify are returned.

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

    The token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call.

    For example, if your initial request has maxResults of 10, and there are 12 rule groups namespaces to return, then your initial request will return 10 and a nextToken. Using the next token in a subsequent call will return the remaining 2 namespaces.

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

    The maximum number of results to return. The default is 100.

Raises:

Source code in docs_src/capo_amp/_services/amp.py
def list_rule_groups_namespaces(
    self,
    workspace_id: "capo_amp.types.workspace_id.WorkspaceId",
    *,
    config_overrides: Optional[ampClientConfig] = None,
    name: Optional[
        "capo_amp.types.rule_groups_namespace_name.RuleGroupsNamespaceName"
    ] = None,
    next_token: Optional["capo_amp.types.pagination_token.PaginationToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_amp.types.list_rule_groups_namespaces_response.ListRuleGroupsNamespacesResponse":
    """<p>Returns a list of rule groups namespaces in a workspace.</p>

    Args:
        workspace_id: <p>The ID of the workspace containing the rule groups namespaces.</p>
        name: <p>Use this parameter to filter the rule groups namespaces that are returned. Only the namespaces with names that begin with the value that you specify are returned.</p>
        next_token: <p>The token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call.</p> <p>For example, if your initial request has <code>maxResults</code> of 10, and there are 12 rule groups namespaces to return, then your initial request will return 10 and a <code>nextToken</code>. Using the next token in a subsequent call will return the remaining 2 namespaces.</p>
        max_results: <p>The maximum number of results to return. The default is 100.</p>

    Raises:
        capo_amp.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_amp.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_amp.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resources that doesn't exist.</p>
        capo_amp.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_amp.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_amp.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amp.types.list_rule_groups_namespaces_request.ListRuleGroupsNamespacesRequest]",
    ) -> OperationResponse[
        "capo_amp.types.list_rule_groups_namespaces_response.ListRuleGroupsNamespacesResponse"
    ]:
        import capo_amp._operations.amazon_prometheus_service.list_rule_groups_namespaces

        output, http_response = (
            capo_amp._operations.amazon_prometheus_service.list_rule_groups_namespaces.list_rule_groups_namespaces(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRuleGroupsNamespaces")
    )
    input_: capo_amp.types.list_rule_groups_namespaces_request.ListRuleGroupsNamespacesRequest = {
        "workspace_id": workspace_id
    }
    if name is not None:
        input_["name"] = name
    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