Skip to content

search_jobs

search_jobs(
    *,
    config_overrides: Optional[MediaConvertClientConfig] = None,
    input_file: Optional[__string] = None,
    max_results: Optional[__integerMin1Max20] = None,
    next_token: Optional[__string] = None,
    order: Optional[Order] = None,
    queue: Optional[__string] = None,
    status: Optional[JobStatus] = None,
) -> SearchJobsResponse

Retrieve a JSON array that includes job details for up to twenty of your most recent jobs. Optionally filter results further according to input file, queue, or status. To retrieve the twenty next most recent jobs, use the nextToken string returned with the array.

Parameters:

  • input_file (Optional[__string], default: None ) –

    Optional. Provide your input file URL or your partial input file name. The maximum length for an input file is 300 characters.

  • max_results (Optional[__integerMin1Max20], default: None ) –

    Optional. Number of jobs, up to twenty, that will be returned at one time.

  • next_token (Optional[__string], default: None ) –

    Optional. Use this string, provided with the response to a previous request, to request the next batch of jobs.

  • order (Optional[Order], default: None ) –

    Optional. When you request lists of resources, you can specify whether they are sorted in ASCENDING or DESCENDING order. Default varies by resource.

  • queue (Optional[__string], default: None ) –

    Optional. Provide a queue name, or a queue ARN, to return only jobs from that queue.

  • status (Optional[JobStatus], default: None ) –

    Optional. A job's status can be SUBMITTED, PROGRESSING, COMPLETE, CANCELED, or ERROR.

Raises:

  • BadRequestException –

    The service can't process your request because of a problem in the request. Please check your request form and syntax.

  • ConflictException –

    The service couldn't complete your request because there is a conflict with the current state of the resource.

  • ForbiddenException –

    You don't have permissions for this action with the credentials you sent.

  • InternalServerErrorException –

    The service encountered an unexpected condition and can't fulfill your request.

  • NotFoundException –

    The resource you requested doesn't exist.

  • ServiceQuotaExceededException –

    You attempted to create more resources than the service allows based on service quotas.

  • TooManyRequestsException –

    Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mediaconvert/_services/media_convert.py
def search_jobs(
    self,
    *,
    config_overrides: Optional[MediaConvertClientConfig] = None,
    input_file: Optional["capo_mediaconvert.types.__string.__string"] = None,
    max_results: Optional[
        "capo_mediaconvert.types.__integer_min1_max20.__integerMin1Max20"
    ] = None,
    next_token: Optional["capo_mediaconvert.types.__string.__string"] = None,
    order: Optional["capo_mediaconvert.types.order.Order"] = None,
    queue: Optional["capo_mediaconvert.types.__string.__string"] = None,
    status: Optional["capo_mediaconvert.types.job_status.JobStatus"] = None,
) -> "capo_mediaconvert.types.search_jobs_response.SearchJobsResponse":
    """Retrieve a JSON array that includes job details for up to twenty of your most recent jobs. Optionally filter results further according to input file, queue, or status. To retrieve the twenty next most recent jobs, use the nextToken string returned with the array.

    Args:
        input_file: Optional. Provide your input file URL or your partial input file name. The maximum length for an input file is 300 characters.
        max_results: Optional. Number of jobs, up to twenty, that will be returned at one time.
        next_token: Optional. Use this string, provided with the response to a previous request, to request the next batch of jobs.
        order: Optional. When you request lists of resources, you can specify whether they are sorted in ASCENDING or DESCENDING order. Default varies by resource.
        queue: Optional. Provide a queue name, or a queue ARN, to return only jobs from that queue.
        status: Optional. A job's status can be SUBMITTED, PROGRESSING, COMPLETE, CANCELED, or ERROR.

    Raises:
        capo_mediaconvert.errors.bad_request_exception.BadRequestException: The service can't process your request because of a problem in the request. Please check your request form and syntax.
        capo_mediaconvert.errors.conflict_exception.ConflictException: The service couldn't complete your request because there is a conflict with the current state of the resource.
        capo_mediaconvert.errors.forbidden_exception.ForbiddenException: You don't have permissions for this action with the credentials you sent.
        capo_mediaconvert.errors.internal_server_error_exception.InternalServerErrorException: The service encountered an unexpected condition and can't fulfill your request.
        capo_mediaconvert.errors.not_found_exception.NotFoundException: The resource you requested doesn't exist.
        capo_mediaconvert.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: You attempted to create more resources than the service allows based on service quotas.
        capo_mediaconvert.errors.too_many_requests_exception.TooManyRequestsException: Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.
        capo_mediaconvert.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediaconvert.types.search_jobs_request.SearchJobsRequest]",
    ) -> OperationResponse[
        "capo_mediaconvert.types.search_jobs_response.SearchJobsResponse"
    ]:
        import capo_mediaconvert._operations.media_convert.search_jobs

        output, http_response = (
            capo_mediaconvert._operations.media_convert.search_jobs.search_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchJobs")
    )
    input_: capo_mediaconvert.types.search_jobs_request.SearchJobsRequest = {}
    if input_file is not None:
        input_["input_file"] = input_file
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if order is not None:
        input_["order"] = order
    if queue is not None:
        input_["queue"] = queue
    if status is not None:
        input_["status"] = status

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