Skip to content

create_queue

create_queue(
    farm_id: FarmId,
    display_name: ResourceName,
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    default_budget_action: Optional[DefaultQueueBudgetAction] = None,
    job_attachment_settings: Optional[JobAttachmentSettings] = None,
    role_arn: Optional[IamRoleArn] = None,
    job_run_as_user: Optional[JobRunAsUser] = None,
    required_file_system_location_names: Optional[
        RequiredFileSystemLocationNames
    ] = None,
    allowed_storage_profile_ids: Optional[AllowedStorageProfileIds] = None,
    tags: Optional[Tags] = None,
    scheduling_configuration: Optional[SchedulingConfiguration] = None,
) -> CreateQueueResponse

Creates a queue to coordinate the order in which jobs run on a farm. A queue can also specify where to pull resources and indicate where to output completed jobs.

Parameters:

  • farm_id (FarmId) –

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

  • 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 queue.

    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 queue.

    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.

  • default_budget_action (Optional[DefaultQueueBudgetAction], default: None ) –

    The default action to take on a queue if a budget isn't configured.

  • job_attachment_settings (Optional[JobAttachmentSettings], default: None ) –

    The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.

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

    The IAM role ARN that workers will use while running jobs for this queue.

  • job_run_as_user (Optional[JobRunAsUser], default: None ) –

    The jobs in the queue run as the specified POSIX user.

  • required_file_system_location_names (Optional[RequiredFileSystemLocationNames], default: None ) –

    The file system location name to include in the queue.

  • allowed_storage_profile_ids (Optional[AllowedStorageProfileIds], default: None ) –

    The storage profile IDs to include in the queue.

  • 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.

  • scheduling_configuration (Optional[SchedulingConfiguration], default: None ) –

    The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.

    If not specified, the queue defaults to the priorityFifo scheduling configuration.

Raises:

Source code in docs_src/capo_deadline/_services/deadline.py
def create_queue(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    display_name: "capo_deadline.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional["capo_deadline.types.client_token.ClientToken"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    default_budget_action: Optional[
        "capo_deadline.types.default_queue_budget_action.DefaultQueueBudgetAction"
    ] = None,
    job_attachment_settings: Optional[
        "capo_deadline.types.job_attachment_settings.JobAttachmentSettings"
    ] = None,
    role_arn: Optional["capo_deadline.types.iam_role_arn.IamRoleArn"] = None,
    job_run_as_user: Optional[
        "capo_deadline.types.job_run_as_user.JobRunAsUser"
    ] = None,
    required_file_system_location_names: Optional[
        "capo_deadline.types.required_file_system_location_names.RequiredFileSystemLocationNames"
    ] = None,
    allowed_storage_profile_ids: Optional[
        "capo_deadline.types.allowed_storage_profile_ids.AllowedStorageProfileIds"
    ] = None,
    tags: Optional["capo_deadline.types.tags.Tags"] = None,
    scheduling_configuration: Optional[
        "capo_deadline.types.scheduling_configuration.SchedulingConfiguration"
    ] = None,
) -> "capo_deadline.types.create_queue_response.CreateQueueResponse":
    """<p>Creates a queue to coordinate the order in which jobs run on a farm. A queue can also specify where to pull resources and indicate where to output completed jobs.</p>

    Args:
        farm_id: <p>The farm ID of the farm to connect to the queue.</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 queue.</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 queue.</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>
        default_budget_action: <p>The default action to take on a queue if a budget isn't configured.</p>
        job_attachment_settings: <p>The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.</p>
        role_arn: <p>The IAM role ARN that workers will use while running jobs for this queue.</p>
        job_run_as_user: <p>The jobs in the queue run as the specified POSIX user.</p>
        required_file_system_location_names: <p>The file system location name to include in the queue.</p>
        allowed_storage_profile_ids: <p>The storage profile IDs to include in the queue.</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>
        scheduling_configuration: <p>The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.</p> <p>If not specified, the queue defaults to the <code>priorityFifo</code> scheduling configuration.</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_queue_request.CreateQueueRequest]",
    ) -> OperationResponse[
        "capo_deadline.types.create_queue_response.CreateQueueResponse"
    ]:
        import capo_deadline._operations.deadline.create_queue

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

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

        return capo_deadline.types.create_queue_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateQueue", redact_input=_redact_input),
    )
    input_: capo_deadline.types.create_queue_request.CreateQueueRequest = {
        "farm_id": farm_id,
        "display_name": display_name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if default_budget_action is not None:
        input_["default_budget_action"] = default_budget_action
    if job_attachment_settings is not None:
        input_["job_attachment_settings"] = job_attachment_settings
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if job_run_as_user is not None:
        input_["job_run_as_user"] = job_run_as_user
    if required_file_system_location_names is not None:
        input_["required_file_system_location_names"] = (
            required_file_system_location_names
        )
    if allowed_storage_profile_ids is not None:
        input_["allowed_storage_profile_ids"] = allowed_storage_profile_ids
    if tags is not None:
        input_["tags"] = tags
    if scheduling_configuration is not None:
        input_["scheduling_configuration"] = scheduling_configuration

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