Skip to content

get_key_group async

get_key_group(
    id: string, *, config_overrides: Optional[AsyncCloudFrontClientConfig] = None
) -> GetKeyGroupResult

Gets a key group, including the date and time when the key group was last modified.

To get a key group, you must provide the key group's identifier. If the key group is referenced in a distribution's cache behavior, you can get the key group's identifier using ListDistributions or GetDistribution. If the key group is not referenced in a cache behavior, you can get the identifier using ListKeyGroups.

Parameters:

  • id (string) –

    The identifier of the key group that you are getting. To get the identifier, use ListKeyGroups.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def get_key_group(
    self,
    id: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.get_key_group_result.GetKeyGroupResult":
    """<p>Gets a key group, including the date and time when the key group was last modified.</p> <p>To get a key group, you must provide the key group's identifier. If the key group is referenced in a distribution's cache behavior, you can get the key group's identifier using <code>ListDistributions</code> or <code>GetDistribution</code>. If the key group is not referenced in a cache behavior, you can get the identifier using <code>ListKeyGroups</code>.</p>

    Args:
        id: <p>The identifier of the key group that you are getting. To get the identifier, use <code>ListKeyGroups</code>.</p>

    Raises:
        capo_cloudfront.errors.no_such_resource.NoSuchResource: <p>A resource that was specified is not valid.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.get_key_group_request.GetKeyGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.get_key_group_result.GetKeyGroupResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.get_key_group

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.get_key_group.async_get_key_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetKeyGroup")
    )
    input_: capo_cloudfront.types.get_key_group_request.GetKeyGroupRequest = {
        "id": id
    }

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