:doc:`OpenSearchService <../../opensearch>` / Client / add_data_source

***************
add_data_source
***************



.. py:method:: OpenSearchService.Client.add_data_source(**kwargs)

  

  Creates a new direct-query data source to the specified domain. For more information, see `Creating Amazon OpenSearch Service data source integrations with Amazon S3 <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/direct-query-s3-creating.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opensearch-2021-01-01/AddDataSource>`_  


  **Request Syntax**
  ::

    response = client.add_data_source(
        DomainName='string',
        Name='string',
        DataSourceType={
            'S3GlueDataCatalog': {
                'RoleArn': 'string'
            }
        },
        Description='string'
    )
    
  :type DomainName: string
  :param DomainName: **[REQUIRED]** 

    The name of the domain to add the data source to.

    

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

    A name for the data source.

    

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

    The type of data source.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``S3GlueDataCatalog``. 

  
    - **S3GlueDataCatalog** *(dict) --* 

      An Amazon S3 data source.

      

    
      - **RoleArn** *(string) --* 

        >The Amazon Resource Name (ARN) for the S3 Glue Data Catalog.

        

      
    
  
  :type Description: string
  :param Description: 

    A description of the data source.

    

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

    
    ::

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

    

    - *(dict) --* 

      The result of an ``AddDataSource`` operation.

      
      

      - **Message** *(string) --* 

        A message associated with creation of the data source.

        
  
  **Exceptions**
  
  *   :py:class:`OpenSearchService.Client.exceptions.BaseException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.InternalException`

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

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

  
  *   :py:class:`OpenSearchService.Client.exceptions.DisabledOperationException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.DependencyFailureException`

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

  