async def create_job_template(
self,
name: "capo_emr_containers.types.resource_name_string.ResourceNameString",
client_token: "capo_emr_containers.types.client_token.ClientToken",
job_template_data: "capo_emr_containers.types.job_template_data.JobTemplateData",
*,
config_overrides: Optional[AsyncEMRcontainersClientConfig] = None,
tags: Optional["capo_emr_containers.types.tag_map.TagMap"] = None,
kms_key_arn: Optional["capo_emr_containers.types.kms_key_arn.KmsKeyArn"] = None,
) -> "capo_emr_containers.types.create_job_template_response.CreateJobTemplateResponse":
"""<p>Creates a job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request.</p>
Args:
name: <p>The specified name of the job template.</p>
client_token: <p>The client token of the job template.</p>
job_template_data: <p>The job template data which holds values of StartJobRun API request.</p>
tags: <p>The tags that are associated with the job template.</p>
kms_key_arn: <p>The KMS key ARN used to encrypt the job template.</p>
Raises:
capo_emr_containers.errors.internal_server_exception.InternalServerException: <p>This is an internal server exception.</p>
capo_emr_containers.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_emr_containers.errors.validation_exception.ValidationException: <p>There are invalid parameters in the client request.</p>
capo_emr_containers.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_emr_containers.types.create_job_template_request.CreateJobTemplateRequest]",
) -> AsyncOperationResponse[
"capo_emr_containers.types.create_job_template_response.CreateJobTemplateResponse"
]:
import capo_emr_containers._operations.aws_chicago_web_service.create_job_template
(
output,
http_response,
) = await capo_emr_containers._operations.aws_chicago_web_service.create_job_template.async_create_job_template(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_emr_containers.types.create_job_template_request.CreateJobTemplateRequest",
) -> dict[str, Any]:
import capo_emr_containers.types.create_job_template_request
return (
capo_emr_containers.types.create_job_template_request.redact_sensitive(
input_
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreateJobTemplate", redact_input=_redact_input),
)
input_: capo_emr_containers.types.create_job_template_request.CreateJobTemplateRequest = {
"name": name,
"client_token": client_token,
"job_template_data": job_template_data,
}
if tags is not None:
input_["tags"] = tags
if kms_key_arn is not None:
input_["kms_key_arn"] = kms_key_arn
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output