Skip to content

cancel_harvest_job

cancel_harvest_job(
    channel_group_name: ResourceName,
    channel_name: ResourceName,
    origin_endpoint_name: ResourceName,
    harvest_job_name: ResourceName,
    *,
    config_overrides: Optional[MediaPackageV2ClientConfig] = None,
    e_tag: Optional[EntityTag] = None,
) -> CancelHarvestJobResponse

Cancels an in-progress harvest job.

Parameters:

  • channel_group_name (ResourceName) –

    The name of the channel group containing the channel from which the harvest job is running.

  • channel_name (ResourceName) –

    The name of the channel from which the harvest job is running.

  • origin_endpoint_name (ResourceName) –

    The name of the origin endpoint that the harvest job is harvesting from. This cannot be changed after the harvest job is submitted.

  • harvest_job_name (ResourceName) –

    The name of the harvest job to cancel. This name must be unique within the channel and cannot be changed after the harvest job is submitted.

  • e_tag (Optional[EntityTag], default: None ) –

    The current Entity Tag (ETag) associated with the harvest job. Used for concurrency control.

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.

  • ConflictException –

    Updating or deleting this resource can cause an inconsistent state.

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

Cancel a Harvest Job

>>> client.cancel_harvest_job(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', harvest_job_name='HarvestJobName')
Source code in docs_src/capo_mediapackagev2/_services/media_package_v2.py
def cancel_harvest_job(
    self,
    channel_group_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    channel_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    origin_endpoint_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    harvest_job_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[MediaPackageV2ClientConfig] = None,
    e_tag: Optional["capo_mediapackagev2.types.entity_tag.EntityTag"] = None,
) -> (
    "capo_mediapackagev2.types.cancel_harvest_job_response.CancelHarvestJobResponse"
):
    """<p>Cancels an in-progress harvest job.</p>

    Args:
        channel_group_name: <p>The name of the channel group containing the channel from which the harvest job is running.</p>
        channel_name: <p>The name of the channel from which the harvest job is running.</p>
        origin_endpoint_name: <p>The name of the origin endpoint that the harvest job is harvesting from. This cannot be changed after the harvest job is submitted.</p>
        harvest_job_name: <p>The name of the harvest job to cancel. This name must be unique within the channel and cannot be changed after the harvest job is submitted.</p>
        e_tag: <p>The current Entity Tag (ETag) associated with the harvest job. Used for concurrency control.</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.conflict_exception.ConflictException: <p>Updating or deleting this resource can cause an inconsistent state.</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:
        Cancel a Harvest Job

        >>> client.cancel_harvest_job(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', harvest_job_name='HarvestJobName')
    """

    def _handler(
        req: "OperationRequest[capo_mediapackagev2.types.cancel_harvest_job_request.CancelHarvestJobRequest]",
    ) -> OperationResponse[
        "capo_mediapackagev2.types.cancel_harvest_job_response.CancelHarvestJobResponse"
    ]:
        import capo_mediapackagev2._operations.mediapackagev2.cancel_harvest_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelHarvestJob")
    )
    input_: capo_mediapackagev2.types.cancel_harvest_job_request.CancelHarvestJobRequest = {
        "channel_group_name": channel_group_name,
        "channel_name": channel_name,
        "origin_endpoint_name": origin_endpoint_name,
        "harvest_job_name": harvest_job_name,
    }
    if e_tag is not None:
        input_["e_tag"] = e_tag

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