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/cloud_front.py
| def get_key_group(
self,
id: "capo_cloudfront.types.string.string",
*,
config_overrides: Optional[CloudFrontClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_cloudfront.types.get_key_group_request.GetKeyGroupRequest]",
) -> OperationResponse[
"capo_cloudfront.types.get_key_group_result.GetKeyGroupResult"
]:
import capo_cloudfront._operations.cloudfront2020_05_31.get_key_group
output, http_response = (
capo_cloudfront._operations.cloudfront2020_05_31.get_key_group.get_key_group(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|