Retrieves a governance environment by ARN or domain. Provide exactly one of environmentArn or domain.
Parameters:
Raises:
Examples:
Get a governance environment
Retrieves the payments team's governance environment by ARN to review its PCI-DSS assessment configuration.
>>> await client.get_environment(lookup={'environmentArn': 'arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111'})
Source code in docs_src/capo_assurance/_services/async_assurance.py
| async def get_environment(
self,
lookup: "capo_assurance.types.environment_lookup.EnvironmentLookup",
*,
config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> "capo_assurance.types.get_environment_output.GetEnvironmentOutput":
"""<p>Retrieves a governance environment by ARN or domain. Provide exactly one of <code>environmentArn</code> or <code>domain</code>.</p>
Args:
lookup: <p>The lookup criteria used to resolve the item.</p>
Raises:
capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Get a governance environment
Retrieves the payments team's governance environment by ARN to review its PCI-DSS assessment configuration.
>>> await client.get_environment(lookup={'environmentArn': 'arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111'})
"""
async def _handler(
req: "AsyncOperationRequest[capo_assurance.types.get_environment_input.GetEnvironmentInput]",
) -> AsyncOperationResponse[
"capo_assurance.types.get_environment_output.GetEnvironmentOutput"
]:
import capo_assurance._operations.assurance.get_environment
(
output,
http_response,
) = await capo_assurance._operations.assurance.get_environment.async_get_environment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetEnvironment")
)
input_: capo_assurance.types.get_environment_input.GetEnvironmentInput = {
"lookup": lookup
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|