:doc:`AppConfig <../../appconfig>` / Client / get_configuration

*****************
get_configuration
*****************



.. py:method:: AppConfig.Client.get_configuration(**kwargs)

  

  (Deprecated) Retrieves the latest deployed configuration.

   

  .. warning::

     

    Note the following important information.

     

    
    * This API action is deprecated. Calls to receive configuration data should use the `StartConfigurationSession <https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html>`__ and `GetLatestConfiguration <https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html>`__ APIs instead.
     
    *  GetConfiguration is a priced call. For more information, see `Pricing <https://aws.amazon.com/systems-manager/pricing/>`__.
    

    

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appconfig-2019-10-09/GetConfiguration>`_  


  **Request Syntax**
  ::

    response = client.get_configuration(
        Application='string',
        Environment='string',
        Configuration='string',
        ClientId='string',
        ClientConfigurationVersion='string'
    )
    
  :type Application: string
  :param Application: **[REQUIRED]** 

    The application to get. Specify either the application name or the application ID.

    

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

    The environment to get. Specify either the environment name or the environment ID.

    

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

    The configuration to get. Specify either the configuration name or the configuration ID.

    

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

    The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AppConfig to deploy the configuration in intervals, as defined in the deployment strategy.

    

  
  :type ClientConfigurationVersion: string
  :param ClientConfigurationVersion: 

    The configuration version returned in the most recent  GetConfiguration response.

     

    .. warning::

       

      AppConfig uses the value of the ``ClientConfigurationVersion`` parameter to identify the configuration version on your clients. If you don’t send ``ClientConfigurationVersion`` with each call to  GetConfiguration, your clients receive the current configuration. You are charged each time your clients receive a configuration.

       

      To avoid excess charges, we recommend you use the `StartConfigurationSession <https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html>`__ and `GetLatestConfiguration <https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html>`__ APIs, which track the client configuration version on your behalf. If you choose to continue using  GetConfiguration, we recommend that you include the ``ClientConfigurationVersion`` value with every call to  GetConfiguration. The value to use for ``ClientConfigurationVersion`` comes from the ``ConfigurationVersion`` attribute returned by  GetConfiguration when there is new or updated data, and should be saved for subsequent calls to  GetConfiguration.

       

     

    For more information about working with configurations, see `Retrieving feature flags and configuration data in AppConfig <http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html>`__ in the *AppConfig User Guide*.

    

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

    
    ::

      {
          'Content': StreamingBody(),
          'ConfigurationVersion': 'string',
          'ContentType': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Content** (:class:`.StreamingBody`) -- 

        The content of the configuration or the configuration data.

         

        .. warning::

           

          The ``Content`` attribute only contains data if the system finds new or updated configuration data. If there is no new or updated data and ``ClientConfigurationVersion`` matches the version of the current configuration, AppConfig returns a ``204 No Content`` HTTP response code and the ``Content`` value will be empty.

          

        
      

      - **ConfigurationVersion** *(string) --* 

        The configuration version.

        
      

      - **ContentType** *(string) --* 

        A standard MIME type describing the format of the configuration content. For more information, see `Content-Type <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>`__.

        
  
  **Exceptions**
  
  *   :py:class:`AppConfig.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`AppConfig.Client.exceptions.BadRequestException`

  

  **Examples**

  The following get-configuration example returns the configuration details of the example application. On subsequent calls to get-configuration, use the client-configuration-version parameter to only update the configuration of your application if the version has changed. Only updating the configuration when the version has changed avoids excess charges incurred by calling get-configuration.
  ::

    response = client.get_configuration(
        Application='example-application',
        ClientId='example-id',
        Configuration='Example-Configuration-Profile',
        Environment='Example-Environment',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ConfigurationVersion': '1',
        'ContentType': 'application/octet-stream',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  