ListDomainNamesCommand

Returns the names of all Amazon OpenSearch Service domains owned by the current user in the active Region.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { OpenSearchClient, ListDomainNamesCommand } from "@aws-sdk/client-opensearch"; // ES Modules import
// const { OpenSearchClient, ListDomainNamesCommand } = require("@aws-sdk/client-opensearch"); // CommonJS import
const client = new OpenSearchClient(config);
const input = { // ListDomainNamesRequest
  EngineType: "OpenSearch" || "Elasticsearch",
};
const command = new ListDomainNamesCommand(input);
const response = await client.send(command);
// { // ListDomainNamesResponse
//   DomainNames: [ // DomainInfoList
//     { // DomainInfo
//       DomainName: "STRING_VALUE",
//       EngineType: "OpenSearch" || "Elasticsearch",
//     },
//   ],
// };

ListDomainNamesCommand Input

See ListDomainNamesCommandInput for more details

Parameter
Type
Description
EngineType
EngineType | undefined

Filters the output by domain engine type.

ListDomainNamesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DomainNames
DomainInfo[] | undefined

The names of all OpenSearch Service domains owned by the current user and their respective engine types.

Throws

Name
Fault
Details
BaseException
client

An error occurred while processing the request.

ValidationException
client

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

OpenSearchServiceException
Base exception class for all service exceptions from OpenSearch service.