Skip to content

create_harvest_job async

create_harvest_job(
    channel_group_name: ResourceName,
    channel_name: ResourceName,
    origin_endpoint_name: ResourceName,
    harvested_manifests: HarvestedManifests,
    schedule_configuration: HarvesterScheduleConfiguration,
    destination: Destination,
    *,
    config_overrides: Optional[AsyncMediaPackageV2ClientConfig] = None,
    description: Optional[ResourceDescription] = None,
    client_token: Optional[IdempotencyToken] = None,
    harvest_job_name: Optional[ResourceName] = None,
    tags: Optional[TagMap] = None,
) -> CreateHarvestJobResponse

Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.

Parameters:

  • channel_group_name (ResourceName) –

    The name of the channel group containing the channel from which to harvest content.

  • channel_name (ResourceName) –

    The name of the channel from which to harvest content.

  • origin_endpoint_name (ResourceName) –

    The name of the origin endpoint from which to harvest content.

  • description (Optional[ResourceDescription], default: None ) –

    An optional description for the harvest job.

  • harvested_manifests (HarvestedManifests) –

    A list of manifests to be harvested.

  • schedule_configuration (HarvesterScheduleConfiguration) –

    The configuration for when the harvest job should run, including start and end times.

  • destination (Destination) –

    The S3 destination where the harvested content will be placed.

  • client_token (Optional[IdempotencyToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

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

    A name for the harvest job. This name must be unique within the channel.

  • tags (Optional[TagMap], default: None ) –

    A collection of tags associated with the harvest job.

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.

  • ServiceQuotaExceededException –

    The request would cause a service quota to be exceeded.

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

Creating a Harvest Job

>>> await client.create_harvest_job(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', description='Example HarvestJob description', harvested_manifests={'HlsManifests': [{'ManifestName': 'HlsManifest'}], 'DashManifests': [{'ManifestName': 'DashManifest'}], 'LowLatencyHlsManifests': [{'ManifestName': 'LowLatencyHlsManifest'}]}, schedule_configuration={'StartTime': '2024-05-28T06:00:00.00Z', 'EndTime': '2024-05-28T12:00:00.00Z'}, destination={'S3Destination': {'BucketName': 'harvestJobS3DestinationBucket', 'DestinationPath': 'manifests'}})
Source code in docs_src/capo_mediapackagev2/_services/async_media_package_v2.py
async def create_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",
    harvested_manifests: "capo_mediapackagev2.types.harvested_manifests.HarvestedManifests",
    schedule_configuration: "capo_mediapackagev2.types.harvester_schedule_configuration.HarvesterScheduleConfiguration",
    destination: "capo_mediapackagev2.types.destination.Destination",
    *,
    config_overrides: Optional[AsyncMediaPackageV2ClientConfig] = None,
    description: Optional[
        "capo_mediapackagev2.types.resource_description.ResourceDescription"
    ] = None,
    client_token: Optional[
        "capo_mediapackagev2.types.idempotency_token.IdempotencyToken"
    ] = None,
    harvest_job_name: Optional[
        "capo_mediapackagev2.types.resource_name.ResourceName"
    ] = None,
    tags: Optional["capo_mediapackagev2.types.tag_map.TagMap"] = None,
) -> (
    "capo_mediapackagev2.types.create_harvest_job_response.CreateHarvestJobResponse"
):
    """<p>Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.</p>

    Args:
        channel_group_name: <p>The name of the channel group containing the channel from which to harvest content.</p>
        channel_name: <p>The name of the channel from which to harvest content.</p>
        origin_endpoint_name: <p>The name of the origin endpoint from which to harvest content.</p>
        description: <p>An optional description for the harvest job.</p>
        harvested_manifests: <p>A list of manifests to be harvested.</p>
        schedule_configuration: <p>The configuration for when the harvest job should run, including start and end times.</p>
        destination: <p>The S3 destination where the harvested content will be placed.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        harvest_job_name: <p>A name for the harvest job. This name must be unique within the channel.</p>
        tags: <p>A collection of tags associated with the harvest job.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded.</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:
        Creating a Harvest Job

        >>> await client.create_harvest_job(channel_group_name='exampleChannelGroup', channel_name='exampleChannelName', origin_endpoint_name='exampleOriginEndpointName', description='Example HarvestJob description', harvested_manifests={'HlsManifests': [{'ManifestName': 'HlsManifest'}], 'DashManifests': [{'ManifestName': 'DashManifest'}], 'LowLatencyHlsManifests': [{'ManifestName': 'LowLatencyHlsManifest'}]}, schedule_configuration={'StartTime': '2024-05-28T06:00:00.00Z', 'EndTime': '2024-05-28T12:00:00.00Z'}, destination={'S3Destination': {'BucketName': 'harvestJobS3DestinationBucket', 'DestinationPath': 'manifests'}})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediapackagev2.types.create_harvest_job_request.CreateHarvestJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediapackagev2.types.create_harvest_job_response.CreateHarvestJobResponse"
    ]:
        import capo_mediapackagev2._operations.mediapackagev2.create_harvest_job

        (
            output,
            http_response,
        ) = await capo_mediapackagev2._operations.mediapackagev2.create_harvest_job.async_create_harvest_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateHarvestJob")
    )
    input_: capo_mediapackagev2.types.create_harvest_job_request.CreateHarvestJobRequest = {
        "channel_group_name": channel_group_name,
        "channel_name": channel_name,
        "origin_endpoint_name": origin_endpoint_name,
        "harvested_manifests": harvested_manifests,
        "schedule_configuration": schedule_configuration,
        "destination": destination,
    }
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if harvest_job_name is not None:
        input_["harvest_job_name"] = harvest_job_name
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output