:doc:`Personalize <../../personalize>` / Client / create_batch_segment_job

************************
create_batch_segment_job
************************



.. py:method:: Personalize.Client.create_batch_segment_job(**kwargs)

  

  Creates a batch segment job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see `Getting batch recommendations and user segments <https://docs.aws.amazon.com/personalize/latest/dg/recommendations-batch.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateBatchSegmentJob>`_  


  **Request Syntax**
  ::

    response = client.create_batch_segment_job(
        jobName='string',
        solutionVersionArn='string',
        filterArn='string',
        numResults=123,
        jobInput={
            's3DataSource': {
                'path': 'string',
                'kmsKeyArn': 'string'
            }
        },
        jobOutput={
            's3DataDestination': {
                'path': 'string',
                'kmsKeyArn': 'string'
            }
        },
        roleArn='string',
        tags=[
            {
                'tagKey': 'string',
                'tagValue': 'string'
            },
        ]
    )
    
  :type jobName: string
  :param jobName: **[REQUIRED]** 

    The name of the batch segment job to create.

    

  
  :type solutionVersionArn: string
  :param solutionVersionArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the solution version you want the batch segment job to use to generate batch segments.

    

  
  :type filterArn: string
  :param filterArn: 

    The ARN of the filter to apply to the batch segment job. For more information on using filters, see `Filtering batch recommendations <https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html>`__.

    

  
  :type numResults: integer
  :param numResults: 

    The number of predicted users generated by the batch segment job for each line of input data. The maximum number of users per segment is 5 million.

    

  
  :type jobInput: dict
  :param jobInput: **[REQUIRED]** 

    The Amazon S3 path for the input data used to generate the batch segment job.

    

  
    - **s3DataSource** *(dict) --* **[REQUIRED]** 

      The configuration details of an Amazon S3 input or output bucket.

      

    
      - **path** *(string) --* **[REQUIRED]** 

        The file path of the Amazon S3 bucket.

        

      
      - **kmsKeyArn** *(string) --* 

        The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

        

      
    
  
  :type jobOutput: dict
  :param jobOutput: **[REQUIRED]** 

    The Amazon S3 path for the bucket where the job's output will be stored.

    

  
    - **s3DataDestination** *(dict) --* **[REQUIRED]** 

      The configuration details of an Amazon S3 input or output bucket.

      

    
      - **path** *(string) --* **[REQUIRED]** 

        The file path of the Amazon S3 bucket.

        

      
      - **kmsKeyArn** *(string) --* 

        The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

        

      
    
  
  :type roleArn: string
  :param roleArn: **[REQUIRED]** 

    The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.

    

  
  :type tags: list
  :param tags: 

    A list of `tags <https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html>`__ to apply to the batch segment job.

    

  
    - *(dict) --* 

      The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see `Tagging Amazon Personalize resources <https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html>`__.

      

    
      - **tagKey** *(string) --* **[REQUIRED]** 

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

        

      
      - **tagValue** *(string) --* **[REQUIRED]** 

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

        

      
    

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

    
    ::

      {
          'batchSegmentJobArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **batchSegmentJobArn** *(string) --* 

        The ARN of the batch segment job.

        
  
  **Exceptions**
  
  *   :py:class:`Personalize.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceAlreadyExistsException`

  
  *   :py:class:`Personalize.Client.exceptions.LimitExceededException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceInUseException`

  
  *   :py:class:`Personalize.Client.exceptions.TooManyTagsException`

  