Skip to content

update_worker

update_worker(
    farm_id: FarmId,
    fleet_id: FleetId,
    worker_id: WorkerId,
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    status: Optional[UpdatedWorkerStatus] = None,
    capabilities: Optional[WorkerCapabilities] = None,
    host_properties: Optional[HostPropertiesRequest] = None,
) -> UpdateWorkerResponse

Updates a worker.

Parameters:

Raises:

Source code in docs_src/capo_deadline/_services/deadline.py
def update_worker(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    fleet_id: "capo_deadline.types.fleet_id.FleetId",
    worker_id: "capo_deadline.types.worker_id.WorkerId",
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    status: Optional[
        "capo_deadline.types.updated_worker_status.UpdatedWorkerStatus"
    ] = None,
    capabilities: Optional[
        "capo_deadline.types.worker_capabilities.WorkerCapabilities"
    ] = None,
    host_properties: Optional[
        "capo_deadline.types.host_properties_request.HostPropertiesRequest"
    ] = None,
) -> "capo_deadline.types.update_worker_response.UpdateWorkerResponse":
    """Updates a worker.

    Args:
        farm_id: The farm ID to update.
        fleet_id: The fleet ID to update.
        worker_id: The worker ID to update.
        status: The worker status to update.
        capabilities: The worker capabilities to update.
        host_properties: The host properties to update.

    Raises:
        capo_deadline.errors.access_denied_exception.AccessDeniedException: You don't have permission to perform the action.
        capo_deadline.errors.conflict_exception.ConflictException: Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.
        capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: Deadline Cloud can't process your request right now. Try again later.
        capo_deadline.errors.resource_not_found_exception.ResourceNotFoundException: The requested resource can't be found.
        capo_deadline.errors.throttling_exception.ThrottlingException: Your request exceeded a request rate quota.
        capo_deadline.errors.validation_exception.ValidationException: The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.
        capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_deadline.types.update_worker_request.UpdateWorkerRequest]",
    ) -> OperationResponse[
        "capo_deadline.types.update_worker_response.UpdateWorkerResponse"
    ]:
        import capo_deadline._operations.deadline.update_worker

        output, http_response = (
            capo_deadline._operations.deadline.update_worker.update_worker(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_deadline.types.update_worker_response.UpdateWorkerResponse",
    ) -> dict[str, Any]:
        import capo_deadline.types.update_worker_response

        return capo_deadline.types.update_worker_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateWorker", redact_output=_redact_output),
    )
    input_: capo_deadline.types.update_worker_request.UpdateWorkerRequest = {
        "farm_id": farm_id,
        "fleet_id": fleet_id,
        "worker_id": worker_id,
    }
    if status is not None:
        input_["status"] = status
    if capabilities is not None:
        input_["capabilities"] = capabilities
    if host_properties is not None:
        input_["host_properties"] = host_properties

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output