Skip to content

create_fleet

create_fleet(
    farm_id: FarmId,
    display_name: ResourceName,
    role_arn: IamRoleArn,
    max_worker_count: MinZeroMaxInteger,
    configuration: FleetConfiguration,
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    min_worker_count: Optional[MinZeroMaxInteger] = None,
    tags: Optional[Tags] = None,
    host_configuration: Optional[HostConfiguration] = None,
) -> CreateFleetResponse

Creates a fleet. Fleets gather information relating to compute, or capacity, for renders within your farms. You can choose to manage your own capacity or opt to have fleets fully managed by Deadline Cloud.

Parameters:

  • farm_id (FarmId) –

    The farm ID of the farm to connect to the fleet.

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

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

  • display_name (ResourceName) –

    The display name of the fleet.

    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.

    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 (IamRoleArn) –

    The IAM role ARN for the role that the fleet's workers will use.

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

    The minimum number of workers for the fleet.

  • max_worker_count (MinZeroMaxInteger) –

    The maximum number of workers for 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 (FleetConfiguration) –

    The configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.

  • tags (Optional[Tags], default: None ) –

    Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.

  • 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/deadline.py
def create_fleet(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    display_name: "capo_deadline.types.resource_name.ResourceName",
    role_arn: "capo_deadline.types.iam_role_arn.IamRoleArn",
    max_worker_count: "capo_deadline.types.min_zero_max_integer.MinZeroMaxInteger",
    configuration: "capo_deadline.types.fleet_configuration.FleetConfiguration",
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional["capo_deadline.types.client_token.ClientToken"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    min_worker_count: Optional[
        "capo_deadline.types.min_zero_max_integer.MinZeroMaxInteger"
    ] = None,
    tags: Optional["capo_deadline.types.tags.Tags"] = None,
    host_configuration: Optional[
        "capo_deadline.types.host_configuration.HostConfiguration"
    ] = None,
) -> "capo_deadline.types.create_fleet_response.CreateFleetResponse":
    """<p>Creates a fleet. Fleets gather information relating to compute, or capacity, for renders within your farms. You can choose to manage your own capacity or opt to have fleets fully managed by Deadline Cloud.</p>

    Args:
        farm_id: <p>The farm ID of the farm to connect to the fleet.</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.</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.</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 for the role that the fleet's workers will use.</p>
        min_worker_count: <p>The minimum number of workers for the fleet.</p>
        max_worker_count: <p>The maximum number of workers for 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 configuration settings for the fleet. Customer managed fleets are self-managed. Service managed Amazon EC2 fleets are managed by Deadline Cloud.</p>
        tags: <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</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.
    """

    def _handler(
        req: "OperationRequest[capo_deadline.types.create_fleet_request.CreateFleetRequest]",
    ) -> OperationResponse[
        "capo_deadline.types.create_fleet_response.CreateFleetResponse"
    ]:
        import capo_deadline._operations.deadline.create_fleet

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

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

        return capo_deadline.types.create_fleet_request.redact_sensitive(input_)

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

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