Skip to content

list_harvest_jobs

list_harvest_jobs(
    channel_group_name: ResourceName,
    *,
    config_overrides: Optional[MediaPackageV2ClientConfig] = None,
    channel_name: Optional[ResourceName] = None,
    origin_endpoint_name: Optional[ResourceName] = None,
    status: Optional[HarvestJobStatus] = None,
    max_results: Optional[ListResourceMaxResults] = None,
    next_token: Optional[str] = None,
) -> ListHarvestJobsResponse

Retrieves a list of harvest jobs that match the specified criteria.

Parameters:

  • channel_group_name (ResourceName) –

    The name of the channel group to filter the harvest jobs by. If specified, only harvest jobs associated with channels in this group will be returned.

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

    The name of the channel to filter the harvest jobs by. If specified, only harvest jobs associated with this channel will be returned.

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

    The name of the origin endpoint to filter the harvest jobs by. If specified, only harvest jobs associated with this origin endpoint will be returned.

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

    The status to filter the harvest jobs by. If specified, only harvest jobs with this status will be returned.

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

    The maximum number of harvest jobs to return in a single request. If not specified, a default value will be used.

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

    A token used for pagination. Provide this value in subsequent requests to retrieve the next set of results.

Raises:

  • AccessDeniedException –

    Access is denied because either you don't have permissions to perform the requested operation or MediaPackage is getting throttling errors with CDN authorization. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. Or, if you're using CDN authorization, you will receive this exception if MediaPackage receives a throttling error from Secrets Manager.

  • InternalServerException –

    Indicates that an error from the service occurred while trying to process a request.

  • ResourceNotFoundException –

    The specified resource doesn't exist.

  • ThrottlingException –

    The request throughput limit was exceeded.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

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

Examples:

ListHarvestJobs: Specify ChannelGroup only

>>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup')
ListHarvestJobs: Specify ChannelGroup, Channel only
>>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName')
ListHarvestJobs: Specify ChannelGroup, Channel, OriginEndpoint
>>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName')
ListHarvestJobs: Specify ChannelGroup, Channel, OriginEndpoint + Status filter
>>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', status='QUEUED')
ListHarvestJobs: Empty response
>>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName')
Source code in docs_src/capo_mediapackagev2/_services/media_package_v2.py
def list_harvest_jobs(
    self,
    channel_group_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[MediaPackageV2ClientConfig] = None,
    channel_name: Optional[
        "capo_mediapackagev2.types.resource_name.ResourceName"
    ] = None,
    origin_endpoint_name: Optional[
        "capo_mediapackagev2.types.resource_name.ResourceName"
    ] = None,
    status: Optional[
        "capo_mediapackagev2.types.harvest_job_status.HarvestJobStatus"
    ] = None,
    max_results: Optional[
        "capo_mediapackagev2.types.list_resource_max_results.ListResourceMaxResults"
    ] = None,
    next_token: Optional[str] = None,
) -> "capo_mediapackagev2.types.list_harvest_jobs_response.ListHarvestJobsResponse":
    """<p>Retrieves a list of harvest jobs that match the specified criteria.</p>

    Args:
        channel_group_name: <p>The name of the channel group to filter the harvest jobs by. If specified, only harvest jobs associated with channels in this group will be returned.</p>
        channel_name: <p>The name of the channel to filter the harvest jobs by. If specified, only harvest jobs associated with this channel will be returned.</p>
        origin_endpoint_name: <p>The name of the origin endpoint to filter the harvest jobs by. If specified, only harvest jobs associated with this origin endpoint will be returned.</p>
        status: <p>The status to filter the harvest jobs by. If specified, only harvest jobs with this status will be returned.</p>
        max_results: <p>The maximum number of harvest jobs to return in a single request. If not specified, a default value will be used.</p>
        next_token: <p>A token used for pagination. Provide this value in subsequent requests to retrieve the next set of results.</p>

    Raises:
        capo_mediapackagev2.errors.access_denied_exception.AccessDeniedException: <p>Access is denied because either you don't have permissions to perform the requested operation or MediaPackage is getting throttling errors with CDN authorization. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. Or, if you're using CDN authorization, you will receive this exception if MediaPackage receives a throttling error from Secrets Manager.</p>
        capo_mediapackagev2.errors.internal_server_exception.InternalServerException: <p>Indicates that an error from the service occurred while trying to process a request.</p>
        capo_mediapackagev2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_mediapackagev2.errors.throttling_exception.ThrottlingException: <p>The request throughput limit was exceeded.</p>
        capo_mediapackagev2.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service.</p>
        capo_mediapackagev2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ListHarvestJobs: Specify ChannelGroup only

        >>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup')
        ListHarvestJobs: Specify ChannelGroup, Channel only

        >>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName')
        ListHarvestJobs: Specify ChannelGroup, Channel, OriginEndpoint

        >>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName')
        ListHarvestJobs: Specify ChannelGroup, Channel, OriginEndpoint + Status filter

        >>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', status='QUEUED')
        ListHarvestJobs: Empty response

        >>> client.list_harvest_jobs(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName')
    """

    def _handler(
        req: "OperationRequest[capo_mediapackagev2.types.list_harvest_jobs_request.ListHarvestJobsRequest]",
    ) -> OperationResponse[
        "capo_mediapackagev2.types.list_harvest_jobs_response.ListHarvestJobsResponse"
    ]:
        import capo_mediapackagev2._operations.mediapackagev2.list_harvest_jobs

        output, http_response = (
            capo_mediapackagev2._operations.mediapackagev2.list_harvest_jobs.list_harvest_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListHarvestJobs")
    )
    input_: capo_mediapackagev2.types.list_harvest_jobs_request.ListHarvestJobsRequest = {
        "channel_group_name": channel_group_name
    }
    if channel_name is not None:
        input_["channel_name"] = channel_name
    if origin_endpoint_name is not None:
        input_["origin_endpoint_name"] = origin_endpoint_name
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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