:doc:`MediaPackage <../../mediapackage>` / Client / create_harvest_job

******************
create_harvest_job
******************



.. py:method:: MediaPackage.Client.create_harvest_job(**kwargs)

  Creates a new HarvestJob record.

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateHarvestJob>`_  


  **Request Syntax**
  ::

    response = client.create_harvest_job(
        EndTime='string',
        Id='string',
        OriginEndpointId='string',
        S3Destination={
            'BucketName': 'string',
            'ManifestKey': 'string',
            'RoleArn': 'string'
        },
        StartTime='string'
    )
    
  :type EndTime: string
  :param EndTime: **[REQUIRED]** The end of the time-window which will be harvested

  
  :type Id: string
  :param Id: **[REQUIRED]** The ID of the HarvestJob. The ID must be unique within the region and it cannot be changed after the HarvestJob is submitted

  
  :type OriginEndpointId: string
  :param OriginEndpointId: **[REQUIRED]** The ID of the OriginEndpoint that the HarvestJob will harvest from. This cannot be changed after the HarvestJob is submitted.

  
  :type S3Destination: dict
  :param S3Destination: **[REQUIRED]** Configuration parameters for where in an S3 bucket to place the harvested content

  
    - **BucketName** *(string) --* **[REQUIRED]** The name of an S3 bucket within which harvested content will be exported

    
    - **ManifestKey** *(string) --* **[REQUIRED]** The key in the specified S3 bucket where the harvested top-level manifest will be placed.

    
    - **RoleArn** *(string) --* **[REQUIRED]** The IAM role used to write to the specified S3 bucket

    
  
  :type StartTime: string
  :param StartTime: **[REQUIRED]** The start of the time-window which will be harvested

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Arn': 'string',
          'ChannelId': 'string',
          'CreatedAt': 'string',
          'EndTime': 'string',
          'Id': 'string',
          'OriginEndpointId': 'string',
          'S3Destination': {
              'BucketName': 'string',
              'ManifestKey': 'string',
              'RoleArn': 'string'
          },
          'StartTime': 'string',
          'Status': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED'
      }
      
    **Response Structure**

    

    - *(dict) --* A new HarvestJob record.
      

      - **Arn** *(string) --* The Amazon Resource Name (ARN) assigned to the HarvestJob.
      

      - **ChannelId** *(string) --* The ID of the Channel that the HarvestJob will harvest from.
      

      - **CreatedAt** *(string) --* The date and time the HarvestJob was submitted.
      

      - **EndTime** *(string) --* The end of the time-window which will be harvested.
      

      - **Id** *(string) --* The ID of the HarvestJob. The ID must be unique within the region and it cannot be changed after the HarvestJob is submitted.
      

      - **OriginEndpointId** *(string) --* The ID of the OriginEndpoint that the HarvestJob will harvest from. This cannot be changed after the HarvestJob is submitted.
      

      - **S3Destination** *(dict) --* Configuration parameters for where in an S3 bucket to place the harvested content
        

        - **BucketName** *(string) --* The name of an S3 bucket within which harvested content will be exported
        

        - **ManifestKey** *(string) --* The key in the specified S3 bucket where the harvested top-level manifest will be placed.
        

        - **RoleArn** *(string) --* The IAM role used to write to the specified S3 bucket
    
      

      - **StartTime** *(string) --* The start of the time-window which will be harvested.
      

      - **Status** *(string) --* The current status of the HarvestJob. Consider setting up a CloudWatch Event to listen for HarvestJobs as they succeed or fail. In the event of failure, the CloudWatch Event will include an explanation of why the HarvestJob failed.
  
  **Exceptions**
  
  *   :py:class:`MediaPackage.Client.exceptions.UnprocessableEntityException`

  
  *   :py:class:`MediaPackage.Client.exceptions.InternalServerErrorException`

  
  *   :py:class:`MediaPackage.Client.exceptions.ForbiddenException`

  
  *   :py:class:`MediaPackage.Client.exceptions.NotFoundException`

  
  *   :py:class:`MediaPackage.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`MediaPackage.Client.exceptions.TooManyRequestsException`

  