DeadlineCloud / Client / search_jobs

search_jobs#

DeadlineCloud.Client.search_jobs(**kwargs)#

Searches for jobs.

See also: AWS API Documentation

Request Syntax

response = client.search_jobs(
    farmId='string',
    queueIds=[
        'string',
    ],
    filterExpressions={
        'filters': [
            {
                'dateTimeFilter': {
                    'name': 'string',
                    'operator': 'EQUAL'|'NOT_EQUAL'|'GREATER_THAN_EQUAL_TO'|'GREATER_THAN'|'LESS_THAN_EQUAL_TO'|'LESS_THAN',
                    'dateTime': datetime(2015, 1, 1)
                },
                'parameterFilter': {
                    'name': 'string',
                    'operator': 'EQUAL'|'NOT_EQUAL'|'GREATER_THAN_EQUAL_TO'|'GREATER_THAN'|'LESS_THAN_EQUAL_TO'|'LESS_THAN',
                    'value': 'string'
                },
                'searchTermFilter': {
                    'searchTerm': 'string'
                },
                'stringFilter': {
                    'name': 'string',
                    'operator': 'EQUAL'|'NOT_EQUAL'|'GREATER_THAN_EQUAL_TO'|'GREATER_THAN'|'LESS_THAN_EQUAL_TO'|'LESS_THAN',
                    'value': 'string'
                },
                'groupFilter': {'... recursive ...'}
            },
        ],
        'operator': 'AND'|'OR'
    },
    sortExpressions=[
        {
            'userJobsFirst': {
                'userIdentityId': 'string'
            },
            'fieldSort': {
                'sortOrder': 'ASCENDING'|'DESCENDING',
                'name': 'string'
            },
            'parameterSort': {
                'sortOrder': 'ASCENDING'|'DESCENDING',
                'name': 'string'
            }
        },
    ],
    itemOffset=123,
    pageSize=123
)
Parameters:
  • farmId (string) –

    [REQUIRED]

    The farm ID of the job.

  • queueIds (list) –

    [REQUIRED]

    The queue ID to use in the job search.

    • (string) –

  • filterExpressions (dict) –

    The filter expression, AND or OR, to use when searching among a group of search strings in a resource.

    You can use two groupings per search each within parenthesis ().

    • filters (list) – [REQUIRED]

      The filters to use for the search.

      • (dict) –

        The type of search filter to apply.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: dateTimeFilter, parameterFilter, searchTermFilter, stringFilter, groupFilter.

        • dateTimeFilter (dict) –

          Filters based on date and time.

          • name (string) – [REQUIRED]

            The name of the date-time field to filter on.

          • operator (string) – [REQUIRED]

            The type of comparison to use to filter the results.

          • dateTime (datetime) – [REQUIRED]

            The date and time.

        • parameterFilter (dict) –

          Filters by parameter.

          • name (string) – [REQUIRED]

            The name of the parameter to filter on.

          • operator (string) – [REQUIRED]

            The type of comparison to use to filter results.

          • value (string) – [REQUIRED]

            The parameter’s value.

        • searchTermFilter (dict) –

          Filters by a specified search term.

          • searchTerm (string) – [REQUIRED]

            The term to search for.

        • stringFilter (dict) –

          Filters by a string.

          • name (string) – [REQUIRED]

            The field name to search.

          • operator (string) – [REQUIRED]

            The type of comparison to use for this search.

          • value (string) – [REQUIRED]

            The string to search for.

        • groupFilter (dict) –

          Filters by group.

    • operator (string) – [REQUIRED]

      The operators to include in the search.

  • sortExpressions (list) –

    The search terms for a resource.

    • (dict) –

      The resources to search.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: userJobsFirst, fieldSort, parameterSort.

      • userJobsFirst (dict) –

        Options for sorting a particular user’s jobs first.

        • userIdentityId (string) – [REQUIRED]

          The user’s ID.

      • fieldSort (dict) –

        Options for sorting by a field.

        • sortOrder (string) – [REQUIRED]

          The sort order for the field.

        • name (string) – [REQUIRED]

          The name of the field.

      • parameterSort (dict) –

        Options for sorting by a parameter.

        • sortOrder (string) – [REQUIRED]

          The sort order for the parameter.

        • name (string) – [REQUIRED]

          The parameter name to sort by.

  • itemOffset (integer) –

    [REQUIRED]

    Defines how far into the scrollable list to start the return of results.

  • pageSize (integer) – Specifies the number of items per page for the resource.

Return type:

dict

Returns:

Response Syntax

{
    'jobs': [
        {
            'jobId': 'string',
            'queueId': 'string',
            'name': 'string',
            'lifecycleStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'UPLOAD_IN_PROGRESS'|'UPLOAD_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_SUCCEEDED'|'ARCHIVED',
            'lifecycleStatusMessage': 'string',
            'taskRunStatus': 'PENDING'|'READY'|'ASSIGNED'|'STARTING'|'SCHEDULED'|'INTERRUPTING'|'RUNNING'|'SUSPENDED'|'CANCELED'|'FAILED'|'SUCCEEDED'|'NOT_COMPATIBLE',
            'targetTaskRunStatus': 'READY'|'FAILED'|'SUCCEEDED'|'CANCELED'|'SUSPENDED'|'PENDING',
            'taskRunStatusCounts': {
                'string': 123
            },
            'priority': 123,
            'maxFailedTasksCount': 123,
            'maxRetriesPerTask': 123,
            'createdBy': 'string',
            'createdAt': datetime(2015, 1, 1),
            'endedAt': datetime(2015, 1, 1),
            'startedAt': datetime(2015, 1, 1),
            'jobParameters': {
                'string': {
                    'int': 'string',
                    'float': 'string',
                    'string': 'string',
                    'path': 'string'
                }
            },
            'sourceJobId': 'string'
        },
    ],
    'nextItemOffset': 123,
    'totalResults': 123
}

Response Structure

  • (dict) –

    • jobs (list) –

      The jobs in the search.

      • (dict) –

        The details of a job search.

        • jobId (string) –

          The job ID.

        • queueId (string) –

          The queue ID.

        • name (string) –

          The job name.

        • lifecycleStatus (string) –

          The life cycle status.

        • lifecycleStatusMessage (string) –

          The life cycle status message.

        • taskRunStatus (string) –

          The task run status for the job.

          • PENDING–pending and waiting for resources.

          • READY–ready to be processed.

          • ASSIGNED–assigned and will run next on a worker.

          • SCHEDULED–scheduled to be run on a worker.

          • INTERRUPTING–being interrupted.

          • RUNNING–running on a worker.

          • SUSPENDED–the task is suspended.

          • CANCELED–the task has been canceled.

          • FAILED–the task has failed.

          • SUCCEEDED–the task has succeeded.

        • targetTaskRunStatus (string) –

          The task status to start with on the job.

        • taskRunStatusCounts (dict) –

          The number of tasks running on the job.

          • (string) –

            • (integer) –

        • priority (integer) –

          The job priority.

        • maxFailedTasksCount (integer) –

          The number of task failures before the job stops running and is marked as FAILED.

        • maxRetriesPerTask (integer) –

          The maximum number of retries for a job.

        • createdBy (string) –

          The user or system that created this resource.

        • createdAt (datetime) –

          The date and time the resource was created.

        • endedAt (datetime) –

          The date and time the resource ended running.

        • startedAt (datetime) –

          The date and time the resource started running.

        • jobParameters (dict) –

          The job parameters.

          • (string) –

            • (dict) –

              The details of job parameters.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: int, float, string, path. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • int (string) –

                A signed integer represented as a string.

              • float (string) –

                A double precision IEEE-754 floating point number represented as a string.

              • string (string) –

                A UTF-8 string.

              • path (string) –

                A file system path represented as a string.

        • sourceJobId (string) –

          The job ID for the source job.

    • nextItemOffset (integer) –

      The next incremental starting point after the defined itemOffset.

    • totalResults (integer) –

      The total number of results in the search.

Exceptions