Retrieves multiple workers in a single request. This is a batch version of the GetWorker API.
The result of getting each worker is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.
Parameters:
-
identifiers
(BatchGetWorkerIdentifiers)
–
The list of worker identifiers to retrieve. You can specify up to 100 identifiers per request.
Raises:
Examples:
Get multiple workers in a single request
>>> client.batch_get_worker(identifiers=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'fleetId': 'fleet-1234567890abcdef1234567890abcdef', 'workerId': 'worker-1234567890abcdef1234567890abcdef'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'fleetId': 'fleet-1234567890abcdef1234567890abcdef', 'workerId': 'worker-234567890abcdef1234567890abcdef1'}])
Source code in docs_src/capo_deadline/_services/deadline.py
| def batch_get_worker(
self,
identifiers: "capo_deadline.types.batch_get_worker_identifiers.BatchGetWorkerIdentifiers",
*,
config_overrides: Optional[deadlineClientConfig] = None,
) -> "capo_deadline.types.batch_get_worker_response.BatchGetWorkerResponse":
"""<p>Retrieves multiple workers in a single request. This is a batch version of the <code>GetWorker</code> API.</p> <p>The result of getting each worker is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.</p>
Args:
identifiers: <p>The list of worker identifiers to retrieve. You can specify up to 100 identifiers per request.</p>
Raises:
capo_deadline.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: <p>Deadline Cloud can't process your request right now. Try again later.</p>
capo_deadline.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota.</p>
capo_deadline.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Get multiple workers in a single request
>>> client.batch_get_worker(identifiers=[{'farmId': 'farm-1234567890abcdef1234567890abcdef', 'fleetId': 'fleet-1234567890abcdef1234567890abcdef', 'workerId': 'worker-1234567890abcdef1234567890abcdef'}, {'farmId': 'farm-1234567890abcdef1234567890abcdef', 'fleetId': 'fleet-1234567890abcdef1234567890abcdef', 'workerId': 'worker-234567890abcdef1234567890abcdef1'}])
"""
def _handler(
req: "OperationRequest[capo_deadline.types.batch_get_worker_request.BatchGetWorkerRequest]",
) -> OperationResponse[
"capo_deadline.types.batch_get_worker_response.BatchGetWorkerResponse"
]:
import capo_deadline._operations.deadline.batch_get_worker
output, http_response = (
capo_deadline._operations.deadline.batch_get_worker.batch_get_worker(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchGetWorker")
)
input_: capo_deadline.types.batch_get_worker_request.BatchGetWorkerRequest = {
"identifiers": identifiers
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|