Updates the priority of a specified service job in an Batch job queue.
Parameters:
-
job_id
(Optional[String], default:
None
)
–
The Batch job ID of the job to update.
-
scheduling_priority
(Optional[Integer], default:
None
)
–
The scheduling priority for the job. This only affects jobs in job queues with a quota-share or fair-share scheduling policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority within a share.
The minimum supported value is 0 and the maximum supported value is 9999.
Raises:
-
ClientException
–
These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.
-
ServerException
–
These errors are usually caused by a server issue.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_batch/_services/async_batch.py
| async def update_service_job(
self,
*,
config_overrides: Optional[AsyncBatchClientConfig] = None,
job_id: Optional["capo_batch.types.string.String"] = None,
scheduling_priority: Optional["capo_batch.types.integer.Integer"] = None,
) -> "capo_batch.types.update_service_job_response.UpdateServiceJobResponse":
"""<p>Updates the priority of a specified service job in an Batch job queue.</p>
Args:
job_id: <p>The Batch job ID of the job to update.</p>
scheduling_priority: <p>The scheduling priority for the job. This only affects jobs in job queues with a quota-share or fair-share scheduling policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority within a share.</p> <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
Raises:
capo_batch.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.</p>
capo_batch.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
capo_batch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_batch.types.update_service_job_request.UpdateServiceJobRequest]",
) -> AsyncOperationResponse[
"capo_batch.types.update_service_job_response.UpdateServiceJobResponse"
]:
import capo_batch._operations.aws_batch_v20160810.update_service_job
(
output,
http_response,
) = await capo_batch._operations.aws_batch_v20160810.update_service_job.async_update_service_job(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateServiceJob")
)
input_: capo_batch.types.update_service_job_request.UpdateServiceJobRequest = {}
if job_id is not None:
input_["job_id"] = job_id
if scheduling_priority is not None:
input_["scheduling_priority"] = scheduling_priority
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|