Cancels the requested policy generation.
Parameters:
-
job_id
(JobId)
–
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
Raises:
Source code in docs_src/capo_accessanalyzer/_services/access_analyzer.py
| def cancel_policy_generation(
self,
job_id: "capo_accessanalyzer.types.job_id.JobId",
*,
config_overrides: Optional[AccessAnalyzerClientConfig] = None,
) -> "capo_accessanalyzer.types.cancel_policy_generation_response.CancelPolicyGenerationResponse":
"""<p>Cancels the requested policy generation.</p>
Args:
job_id: <p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>
Raises:
capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_accessanalyzer.types.cancel_policy_generation_request.CancelPolicyGenerationRequest]",
) -> OperationResponse[
"capo_accessanalyzer.types.cancel_policy_generation_response.CancelPolicyGenerationResponse"
]:
import capo_accessanalyzer._operations.access_analyzer.cancel_policy_generation
output, http_response = (
capo_accessanalyzer._operations.access_analyzer.cancel_policy_generation.cancel_policy_generation(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelPolicyGeneration")
)
input_: capo_accessanalyzer.types.cancel_policy_generation_request.CancelPolicyGenerationRequest = {
"job_id": job_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|