:doc:`LexModelsV2 <../../lexv2-models>` / Client / create_export

*************
create_export
*************



.. py:method:: LexModelsV2.Client.create_export(**kwargs)

  

  Creates a zip archive containing the contents of a bot or a bot locale. The archive contains a directory structure that contains JSON files that define the bot.

   

  You can create an archive that contains the complete definition of a bot, or you can specify that the archive contain only the definition of a single bot locale.

   

  For more information about exporting bots, and about the structure of the export archive, see `Importing and exporting bots <https://docs.aws.amazon.com/lexv2/latest/dg/importing-exporting.html>`__

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/CreateExport>`_  


  **Request Syntax**
  ::

    response = client.create_export(
        resourceSpecification={
            'botExportSpecification': {
                'botId': 'string',
                'botVersion': 'string'
            },
            'botLocaleExportSpecification': {
                'botId': 'string',
                'botVersion': 'string',
                'localeId': 'string'
            },
            'customVocabularyExportSpecification': {
                'botId': 'string',
                'botVersion': 'string',
                'localeId': 'string'
            },
            'testSetExportSpecification': {
                'testSetId': 'string'
            }
        },
        fileFormat='LexJson'|'TSV'|'CSV',
        filePassword='string'
    )
    
  :type resourceSpecification: dict
  :param resourceSpecification: **[REQUIRED]** 

    Specifies the type of resource to export, either a bot or a bot locale. You can only specify one type of resource to export.

    

  
    - **botExportSpecification** *(dict) --* 

      Parameters for exporting a bot.

      

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

        The identifier of the bot assigned by Amazon Lex.

        

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

        The version of the bot that was exported. This will be either ``DRAFT`` or the version number.

        

      
    
    - **botLocaleExportSpecification** *(dict) --* 

      Parameters for exporting a bot locale.

      

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

        The identifier of the bot to create the locale for.

        

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

        The version of the bot to export.

        

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

        The identifier of the language and locale to export. The string must match one of the locales in the bot.

        

      
    
    - **customVocabularyExportSpecification** *(dict) --* 

      The parameters required to export a custom vocabulary.

      

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

        The identifier of the bot that contains the custom vocabulary to export.

        

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

        The version of the bot that contains the custom vocabulary to export.

        

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

        The locale of the bot that contains the custom vocabulary to export.

        

      
    
    - **testSetExportSpecification** *(dict) --* 

      Specifications for the test set that is exported as a resource.

      

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

        The unique identifier of the test set.

        

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

    The file format of the bot or bot locale definition files.

    

  
  :type filePassword: string
  :param filePassword: 

    An password to use to encrypt the exported archive. Using a password is optional, but you should encrypt the archive to protect the data in transit between Amazon Lex and your local computer.

    

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

    
    ::

      {
          'exportId': 'string',
          'resourceSpecification': {
              'botExportSpecification': {
                  'botId': 'string',
                  'botVersion': 'string'
              },
              'botLocaleExportSpecification': {
                  'botId': 'string',
                  'botVersion': 'string',
                  'localeId': 'string'
              },
              'customVocabularyExportSpecification': {
                  'botId': 'string',
                  'botVersion': 'string',
                  'localeId': 'string'
              },
              'testSetExportSpecification': {
                  'testSetId': 'string'
              }
          },
          'fileFormat': 'LexJson'|'TSV'|'CSV',
          'exportStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
          'creationDateTime': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **exportId** *(string) --* 

        An identifier for a specific request to create an export.

        
      

      - **resourceSpecification** *(dict) --* 

        A description of the type of resource that was exported, either a bot or a bot locale.

        
        

        - **botExportSpecification** *(dict) --* 

          Parameters for exporting a bot.

          
          

          - **botId** *(string) --* 

            The identifier of the bot assigned by Amazon Lex.

            
          

          - **botVersion** *(string) --* 

            The version of the bot that was exported. This will be either ``DRAFT`` or the version number.

            
      
        

        - **botLocaleExportSpecification** *(dict) --* 

          Parameters for exporting a bot locale.

          
          

          - **botId** *(string) --* 

            The identifier of the bot to create the locale for.

            
          

          - **botVersion** *(string) --* 

            The version of the bot to export.

            
          

          - **localeId** *(string) --* 

            The identifier of the language and locale to export. The string must match one of the locales in the bot.

            
      
        

        - **customVocabularyExportSpecification** *(dict) --* 

          The parameters required to export a custom vocabulary.

          
          

          - **botId** *(string) --* 

            The identifier of the bot that contains the custom vocabulary to export.

            
          

          - **botVersion** *(string) --* 

            The version of the bot that contains the custom vocabulary to export.

            
          

          - **localeId** *(string) --* 

            The locale of the bot that contains the custom vocabulary to export.

            
      
        

        - **testSetExportSpecification** *(dict) --* 

          Specifications for the test set that is exported as a resource.

          
          

          - **testSetId** *(string) --* 

            The unique identifier of the test set.

            
      
    
      

      - **fileFormat** *(string) --* 

        The file format used for the bot or bot locale definition files.

        
      

      - **exportStatus** *(string) --* 

        The status of the export. When the status is ``Completed``, you can use the `DescribeExport <https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html>`__ operation to get the pre-signed S3 URL link to your exported bot or bot locale.

        
      

      - **creationDateTime** *(datetime) --* 

        The date and time that the request to export a bot was created.

        
  
  **Exceptions**
  
  *   :py:class:`LexModelsV2.Client.exceptions.ThrottlingException`

  
  *   :py:class:`LexModelsV2.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`LexModelsV2.Client.exceptions.ValidationException`

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

  
  *   :py:class:`LexModelsV2.Client.exceptions.ConflictException`

  
  *   :py:class:`LexModelsV2.Client.exceptions.InternalServerException`

  