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

*************
list_versions
*************



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

  

  Lists all versions of OpenSearch and Elasticsearch that Amazon OpenSearch Service supports.

  

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


  **Request Syntax**
  ::

    response = client.list_versions(
        MaxResults=123,
        NextToken='string'
    )
    
  :type MaxResults: integer
  :param MaxResults: 

    An optional parameter that specifies the maximum number of results to return. You can use ``nextToken`` to get the next page of results.

    

  
  :type NextToken: string
  :param NextToken: 

    If your initial ``ListVersions`` operation returns a ``nextToken``, you can include the returned ``nextToken`` in subsequent ``ListVersions`` operations, which returns results in the next page.

    

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

    
    ::

      {
          'Versions': [
              'string',
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Container for the parameters for response received from the ``ListVersions`` operation.

      
      

      - **Versions** *(list) --* 

        A list of all versions of OpenSearch and Elasticsearch that Amazon OpenSearch Service supports.

        
        

        - *(string) --* 
    
      

      - **NextToken** *(string) --* 

        When ``nextToken`` is returned, there are more results available. The value of ``nextToken`` is a unique pagination token for each page. Send the request again using the returned token to retrieve the next page.

        
  
  **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`

  