:doc:`IoTSiteWise <../../iotsitewise>` / Client / create_dataset

**************
create_dataset
**************



.. py:method:: IoTSiteWise.Client.create_dataset(**kwargs)

  

  Creates a dataset to connect an external datasource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iotsitewise-2019-12-02/CreateDataset>`_  


  **Request Syntax**
  ::

    response = client.create_dataset(
        datasetId='string',
        datasetName='string',
        datasetDescription='string',
        datasetSource={
            'sourceType': 'KENDRA',
            'sourceFormat': 'KNOWLEDGE_BASE',
            'sourceDetail': {
                'kendra': {
                    'knowledgeBaseArn': 'string',
                    'roleArn': 'string'
                }
            }
        },
        clientToken='string',
        tags={
            'string': 'string'
        }
    )
    
  :type datasetId: string
  :param datasetId: 

    The ID of the dataset.

    

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

    The name of the dataset.

    

  
  :type datasetDescription: string
  :param datasetDescription: 

    A description about the dataset, and its functionality.

    

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

    The data source for the dataset.

    

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

      The type of data source for the dataset.

      

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

      The format of the dataset source associated with the dataset.

      

    
    - **sourceDetail** *(dict) --* 

      The details of the dataset source associated with the dataset.

      

    
      - **kendra** *(dict) --* 

        Contains details about the Kendra dataset source.

        

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

          The ``knowledgeBaseArn`` details for the Kendra dataset source.

          

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

          The ``roleARN`` details for the Kendra dataset source.

          

        
      
    
  
  :type clientToken: string
  :param clientToken: 

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

  
  :type tags: dict
  :param tags: 

    A list of key-value pairs that contain metadata for the access policy. For more information, see `Tagging your IoT SiteWise resources <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html>`__ in the *IoT SiteWise User Guide*.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'datasetId': 'string',
          'datasetArn': 'string',
          'datasetStatus': {
              'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED',
              'error': {
                  'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE',
                  'message': 'string',
                  'details': [
                      {
                          'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION',
                          'message': 'string'
                      },
                  ]
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **datasetId** *(string) --* 

        The ID of the dataset.

        
      

      - **datasetArn** *(string) --* 

        The `ARN <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html>`__ of the dataset. The format is ``arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}``.

        
      

      - **datasetStatus** *(dict) --* 

        The status of the dataset. This contains the state and any error messages. State is ``CREATING`` after a successfull call to this API, and any associated error message. The state is ``ACTIVE`` when ready to use.

        
        

        - **state** *(string) --* 

          The current status of the dataset.

          
        

        - **error** *(dict) --* 

          Contains the details of an IoT SiteWise error.

          
          

          - **code** *(string) --* 

            The error code.

            
          

          - **message** *(string) --* 

            The error message.

            
          

          - **details** *(list) --* 

            A list of detailed errors.

            
            

            - *(dict) --* 

              Contains detailed error information.

              
              

              - **code** *(string) --* 

                The error code.

                
              

              - **message** *(string) --* 

                The error message.

                
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`IoTSiteWise.Client.exceptions.InvalidRequestException`

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

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

  
  *   :py:class:`IoTSiteWise.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ThrottlingException`

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

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ConflictingOperationException`

  