Skip to content

get_group_query async

get_group_query(
    *,
    config_overrides: Optional[AsyncResourceGroupsClientConfig] = None,
    group_name: Optional[GroupName] = None,
    group: Optional[GroupString] = None,
) -> GetGroupQueryOutput

Retrieves the resource query associated with the specified resource group. For more information about resource queries, see Create a tag-based group in Resource Groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetGroupQuery

Parameters:

  • group_name (Optional[GroupName], default: None ) –

    Don't use this parameter. Use Group instead.

  • group (Optional[GroupString], default: None ) –

    The name or the Amazon resource name (ARN) of the resource group to query.

Raises:

Source code in docs_src/capo_resource_groups/_services/async_resource_groups.py
async def get_group_query(
    self,
    *,
    config_overrides: Optional[AsyncResourceGroupsClientConfig] = None,
    group_name: Optional["capo_resource_groups.types.group_name.GroupName"] = None,
    group: Optional["capo_resource_groups.types.group_string.GroupString"] = None,
) -> "capo_resource_groups.types.get_group_query_output.GetGroupQueryOutput":
    """<p>Retrieves the resource query associated with the specified resource group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p> <p> <b>Minimum permissions</b> </p> <p>To run this command, you must have the following permissions:</p> <ul> <li> <p> <code>resource-groups:GetGroupQuery</code> </p> </li> </ul>

    Args:
        group_name: <p>Don't use this parameter. Use <code>Group</code> instead.</p>
        group: <p>The name or the Amazon resource name (ARN) of the resource group to query.</p>

    Raises:
        capo_resource_groups.errors.bad_request_exception.BadRequestException: <p>The request includes one or more parameters that violate validation rules.</p>
        capo_resource_groups.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request. Check permissions.</p>
        capo_resource_groups.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal error occurred while processing the request. Try again later.</p>
        capo_resource_groups.errors.method_not_allowed_exception.MethodNotAllowedException: <p>The request uses an HTTP method that isn't allowed for the specified resource.</p>
        capo_resource_groups.errors.not_found_exception.NotFoundException: <p>One or more of the specified resources don't exist.</p>
        capo_resource_groups.errors.too_many_requests_exception.TooManyRequestsException: <p>You've exceeded throttling limits by making too many requests in a period of time.</p>
        capo_resource_groups.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resource_groups.types.get_group_query_input.GetGroupQueryInput]",
    ) -> AsyncOperationResponse[
        "capo_resource_groups.types.get_group_query_output.GetGroupQueryOutput"
    ]:
        import capo_resource_groups._operations.ardi.get_group_query

        (
            output,
            http_response,
        ) = await capo_resource_groups._operations.ardi.get_group_query.async_get_group_query(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetGroupQuery")
    )
    input_: capo_resource_groups.types.get_group_query_input.GetGroupQueryInput = {}
    if group_name is not None:
        input_["group_name"] = group_name
    if group is not None:
        input_["group"] = group

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