Skip to content

create_harvest_job async

create_harvest_job(
    *,
    config_overrides: Optional[AsyncMediaPackageClientConfig] = None,
    end_time: Optional[__string] = None,
    id: Optional[__string] = None,
    origin_endpoint_id: Optional[__string] = None,
    s3_destination: Optional[S3Destination] = None,
    start_time: Optional[__string] = None,
) -> CreateHarvestJobResponse

Creates a new HarvestJob record.

Parameters:

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

    The end of the time-window which will be harvested

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

    The ID of the HarvestJob. The ID must be unique within the region and it cannot be changed after the HarvestJob is submitted

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

    The ID of the OriginEndpoint that the HarvestJob will harvest from. This cannot be changed after the HarvestJob is submitted.

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

    The start of the time-window which will be harvested

Raises:

Source code in docs_src/capo_mediapackage/_services/async_media_package.py
async def create_harvest_job(
    self,
    *,
    config_overrides: Optional[AsyncMediaPackageClientConfig] = None,
    end_time: Optional["capo_mediapackage.types.__string.__string"] = None,
    id: Optional["capo_mediapackage.types.__string.__string"] = None,
    origin_endpoint_id: Optional[
        "capo_mediapackage.types.__string.__string"
    ] = None,
    s3_destination: Optional[
        "capo_mediapackage.types.s3_destination.S3Destination"
    ] = None,
    start_time: Optional["capo_mediapackage.types.__string.__string"] = None,
) -> "capo_mediapackage.types.create_harvest_job_response.CreateHarvestJobResponse":
    """Creates a new HarvestJob record.

    Args:
        end_time: The end of the time-window which will be harvested
        id: The ID of the HarvestJob. The ID must be unique within the region and it cannot be changed after the HarvestJob is submitted
        origin_endpoint_id: The ID of the OriginEndpoint that the HarvestJob will harvest from. This cannot be changed after the HarvestJob is submitted.
        start_time: The start of the time-window which will be harvested

    Raises:
        capo_mediapackage.errors.forbidden_exception.ForbiddenException: The client is not authorized to access the requested resource.
        capo_mediapackage.errors.internal_server_error_exception.InternalServerErrorException: An unexpected error occurred.
        capo_mediapackage.errors.not_found_exception.NotFoundException: The requested resource does not exist.
        capo_mediapackage.errors.service_unavailable_exception.ServiceUnavailableException: An unexpected error occurred.
        capo_mediapackage.errors.too_many_requests_exception.TooManyRequestsException: The client has exceeded their resource or throttling limits.
        capo_mediapackage.errors.unprocessable_entity_exception.UnprocessableEntityException: The parameters sent in the request are not valid.
        capo_mediapackage.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_mediapackage._operations.media_package.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_mediapackage.types.create_harvest_job_request.CreateHarvestJobRequest = {}
    if end_time is not None:
        input_["end_time"] = end_time
    if id is not None:
        input_["id"] = id
    if origin_endpoint_id is not None:
        input_["origin_endpoint_id"] = origin_endpoint_id
    if s3_destination is not None:
        input_["s3_destination"] = s3_destination
    if start_time is not None:
        input_["start_time"] = start_time

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