Skip to content

update_fleet async

update_fleet(
    farm_id: FarmId,
    fleet_id: FleetId,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    display_name: Optional[ResourceName] = None,
    description: Optional[Description] = None,
    role_arn: Optional[IamRoleArn] = None,
    min_worker_count: Optional[MinZeroMaxInteger] = None,
    max_worker_count: Optional[MinZeroMaxInteger] = None,
    configuration: Optional[FleetConfiguration] = None,
    host_configuration: Optional[HostConfiguration] = None,
) -> UpdateFleetResponse

Updates a fleet.

Workers that are running when you call UpdateFleet keep the instance type and capabilities that they launched with until they scale in. Deadline Cloud can schedule jobs that you submit after the update on these existing workers, so the new configuration might not take effect immediately. To make sure that all workers use the new configuration, set maxWorkerCount to 0, use the ListWorkers operation to confirm that the fleet has no workers, and then restore maxWorkerCount.

Parameters:

  • farm_id (FarmId) –

    The farm ID to update.

  • fleet_id (FleetId) –

    The fleet ID to update.

  • client_token (Optional[ClientToken], default: None ) –

    The unique token which the server uses to recognize retries of the same request.

  • display_name (Optional[ResourceName], default: None ) –

    The display name of the fleet to update.

    This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.

  • description (Optional[Description], default: None ) –

    The description of the fleet to update.

    This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.

  • role_arn (Optional[IamRoleArn], default: None ) –

    The IAM role ARN that the fleet's workers assume while running jobs.

  • min_worker_count (Optional[MinZeroMaxInteger], default: None ) –

    The minimum number of workers in the fleet.

  • max_worker_count (Optional[MinZeroMaxInteger], default: None ) –

    The maximum number of workers in the fleet.

    Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to CreateWorker before the field updates, you might exceed your fleet's maximum worker count. For example, if your maxWorkerCount is 10 and you currently have 9 workers, making two quick CreateWorker calls might successfully create 2 workers instead of 1, resulting in 11 total workers.

  • configuration (Optional[FleetConfiguration], default: None ) –

    The fleet configuration to update.

  • host_configuration (Optional[HostConfiguration], default: None ) –

    Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.

Raises:

Source code in docs_src/capo_deadline/_services/async_deadline.py
async def update_fleet(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    fleet_id: "capo_deadline.types.fleet_id.FleetId",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    client_token: Optional["capo_deadline.types.client_token.ClientToken"] = None,
    display_name: Optional["capo_deadline.types.resource_name.ResourceName"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    role_arn: Optional["capo_deadline.types.iam_role_arn.IamRoleArn"] = None,
    min_worker_count: Optional[
        "capo_deadline.types.min_zero_max_integer.MinZeroMaxInteger"
    ] = None,
    max_worker_count: Optional[
        "capo_deadline.types.min_zero_max_integer.MinZeroMaxInteger"
    ] = None,
    configuration: Optional[
        "capo_deadline.types.fleet_configuration.FleetConfiguration"
    ] = None,
    host_configuration: Optional[
        "capo_deadline.types.host_configuration.HostConfiguration"
    ] = None,
) -> "capo_deadline.types.update_fleet_response.UpdateFleetResponse":
    """<p>Updates a fleet.</p> <note> <p>Workers that are running when you call <code>UpdateFleet</code> keep the instance type and capabilities that they launched with until they scale in. Deadline Cloud can schedule jobs that you submit after the update on these existing workers, so the new configuration might not take effect immediately. To make sure that all workers use the new configuration, set <code>maxWorkerCount</code> to 0, use the <code>ListWorkers</code> operation to confirm that the fleet has no workers, and then restore <code>maxWorkerCount</code>.</p> </note>

    Args:
        farm_id: <p>The farm ID to update.</p>
        fleet_id: <p>The fleet ID to update.</p>
        client_token: <p>The unique token which the server uses to recognize retries of the same request.</p>
        display_name: <p>The display name of the fleet to update.</p> <important> <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p> </important>
        description: <p>The description of the fleet to update.</p> <important> <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p> </important>
        role_arn: <p>The IAM role ARN that the fleet's workers assume while running jobs.</p>
        min_worker_count: <p>The minimum number of workers in the fleet.</p>
        max_worker_count: <p>The maximum number of workers in the fleet.</p> <p>Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to <code>CreateWorker</code> before the field updates, you might exceed your fleet's maximum worker count. For example, if your <code>maxWorkerCount</code> is 10 and you currently have 9 workers, making two quick <code>CreateWorker</code> calls might successfully create 2 workers instead of 1, resulting in 11 total workers.</p>
        configuration: <p>The fleet configuration to update.</p>
        host_configuration: <p>Provides a script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.</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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_deadline.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_deadline.types.update_fleet_request.UpdateFleetRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.update_fleet_response.UpdateFleetResponse"
    ]:
        import capo_deadline._operations.deadline.update_fleet

        (
            output,
            http_response,
        ) = await capo_deadline._operations.deadline.update_fleet.async_update_fleet(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_deadline.types.update_fleet_request.UpdateFleetRequest",
    ) -> dict[str, Any]:
        import capo_deadline.types.update_fleet_request

        return capo_deadline.types.update_fleet_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateFleet", redact_input=_redact_input),
    )
    input_: capo_deadline.types.update_fleet_request.UpdateFleetRequest = {
        "farm_id": farm_id,
        "fleet_id": fleet_id,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if min_worker_count is not None:
        input_["min_worker_count"] = min_worker_count
    if max_worker_count is not None:
        input_["max_worker_count"] = max_worker_count
    if configuration is not None:
        input_["configuration"] = configuration
    if host_configuration is not None:
        input_["host_configuration"] = host_configuration

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output