Skip to content

list_resources_in_protection_group async

list_resources_in_protection_group(
    protection_group_id: ProtectionGroupId,
    *,
    config_overrides: Optional[AsyncShieldClientConfig] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[MaxResults] = None,
) -> ListResourcesInProtectionGroupResponse

Retrieves the resources that are included in the protection group.

Parameters:

  • protection_group_id (ProtectionGroupId) –

    The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.

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

    When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a NextToken value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.

    You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the MaxResults setting. Shield Advanced will not return more than MaxResults objects, but may return fewer, even if more objects are still available.

    Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a NextToken value.

    On your first call to a list operation, leave this setting empty.

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

    The greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a NextToken value in the response.

    The default setting is 20.

Raises:

  • InternalErrorException –

    Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

  • InvalidPaginationTokenException –

    Exception that indicates that the NextToken specified in the request is invalid. Submit the request using the NextToken value that was returned in the prior response.

  • ResourceNotFoundException –

    Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.

  • UnknownServiceError –

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

Source code in docs_src/capo_shield/_services/async_shield.py
async def list_resources_in_protection_group(
    self,
    protection_group_id: "capo_shield.types.protection_group_id.ProtectionGroupId",
    *,
    config_overrides: Optional[AsyncShieldClientConfig] = None,
    next_token: Optional["capo_shield.types.token.Token"] = None,
    max_results: Optional["capo_shield.types.max_results.MaxResults"] = None,
) -> "capo_shield.types.list_resources_in_protection_group_response.ListResourcesInProtectionGroupResponse":
    """<p>Retrieves the resources that are included in the protection group. </p>

    Args:
        protection_group_id: <p>The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it. </p>
        next_token: <p>When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a <code>NextToken</code> value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request. </p> <p>You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the <code>MaxResults</code> setting. Shield Advanced will not return more than <code>MaxResults</code> objects, but may return fewer, even if more objects are still available.</p> <p>Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a <code>NextToken</code> value.</p> <p>On your first call to a list operation, leave this setting empty.</p>
        max_results: <p>The greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a <code>NextToken</code> value in the response.</p> <p>The default setting is 20.</p>

    Raises:
        capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
        capo_shield.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>Exception that indicates that the <code>NextToken</code> specified in the request is invalid. Submit the request using the <code>NextToken</code> value that was returned in the prior response.</p>
        capo_shield.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties. </p>
        capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_shield.types.list_resources_in_protection_group_request.ListResourcesInProtectionGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.list_resources_in_protection_group_response.ListResourcesInProtectionGroupResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.list_resources_in_protection_group

        (
            output,
            http_response,
        ) = await capo_shield._operations.aws_shield_20160616.list_resources_in_protection_group.async_list_resources_in_protection_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListResourcesInProtectionGroup")
    )
    input_: capo_shield.types.list_resources_in_protection_group_request.ListResourcesInProtectionGroupRequest = {
        "protection_group_id": protection_group_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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