ListVersions - Amazon OpenSearch Service

ListVersions

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

Request Syntax

GET /2021-01-01/opensearch/versions?maxResults=MaxResults&nextToken=NextToken HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

MaxResults

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

Valid Range: Maximum value of 100.

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.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "NextToken": "string", "Versions": [ "string" ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

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.

Type: String

Versions

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

Type: Array of strings

Length Constraints: Minimum length of 14. Maximum length of 18.

Pattern: ^Elasticsearch_[0-9]{1}\.[0-9]{1,2}$|^OpenSearch_[0-9]{1,2}\.[0-9]{1,2}$

Errors

For information about the errors that are common to all actions, see Common Errors.

BaseException

An error occurred while processing the request.

HTTP Status Code: 400

InternalException

Request processing failed because of an unknown error, exception, or internal failure.

HTTP Status Code: 500

ResourceNotFoundException

An exception for accessing or deleting a resource that doesn't exist.

HTTP Status Code: 409

ValidationException

An exception for accessing or deleting a resource that doesn't exist.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ListVersions.

Sample Request

GET /2021-01-01/opensearch/versions HTTP/1.1 Host: es.us-east-1.amazonaws.com Accept-Encoding: identity User-Agent: aws-cli/2.15.13 Python/3.11.6 Windows/10 exe/AMD64 prompt/off command/opensearch.list-versions X-Amz-Date: 20240205T211126Z X-Amz-Security-Token: IQoJb3JpZ2luX2VjEI3wEaCXVz== Authorization: AWS4-HMAC-SHA256 Credential=ASIAU/20240205/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=10e4bd0052c108fb022e79d4f122329d00a6d376054dadefcd81bb8df728d808

Sample Response

{ "NextToken":null, "Versions":[ "OpenSearch_2.11", "OpenSearch_2.9", "OpenSearch_2.7", "OpenSearch_2.5", "OpenSearch_2.3", "OpenSearch_1.3", "OpenSearch_1.2", "OpenSearch_1.1", "OpenSearch_1.0", "Elasticsearch_7.10", "Elasticsearch_7.9", "Elasticsearch_7.8", "Elasticsearch_7.7", "Elasticsearch_7.4", "Elasticsearch_7.1", "Elasticsearch_6.8", "Elasticsearch_6.7", "Elasticsearch_6.5", "Elasticsearch_6.4", "Elasticsearch_6.3", "Elasticsearch_6.2", "Elasticsearch_6.0", "Elasticsearch_5.6", "Elasticsearch_5.5", "Elasticsearch_5.3", "Elasticsearch_5.1", "Elasticsearch_2.3", "Elasticsearch_1.5" ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: