BatchGetCollection
Returns attributes for one or more collections, including the collection endpoint and the OpenSearch Dashboards endpoint. For more information, see Creating and managing Amazon OpenSearch Serverless collections.
Request Syntax
{
"ids": [ "string
" ],
"names": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ids
-
A list of collection IDs. You can't provide names and IDs in the same request. The ID is part of the collection endpoint. You can also retrieve it using the ListCollections API.
Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 100 items.
Length Constraints: Minimum length of 3. Maximum length of 40.
Pattern:
^[a-z0-9]{3,40}$
Required: No
- names
-
A list of collection names. You can't provide names and IDs in the same request.
Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 100 items.
Length Constraints: Minimum length of 3. Maximum length of 32.
Pattern:
^[a-z][a-z0-9-]+$
Required: No
Response Syntax
{
"collectionDetails": [
{
"arn": "string",
"collectionEndpoint": "string",
"createdDate": number,
"dashboardEndpoint": "string",
"description": "string",
"id": "string",
"kmsKeyArn": "string",
"lastModifiedDate": number,
"name": "string",
"standbyReplicas": "string",
"status": "string",
"type": "string"
}
],
"collectionErrorDetails": [
{
"errorCode": "string",
"errorMessage": "string",
"id": "string",
"name": "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.
- collectionDetails
-
Details about each collection.
Type: Array of CollectionDetail objects
- collectionErrorDetails
-
Error information for the request.
Type: Array of CollectionErrorDetail objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
-
Thrown when an error internal to the service occurs while processing a request.
HTTP Status Code: 500
- ValidationException
-
Thrown when the HTTP request contains invalid input or is missing required input.
HTTP Status Code: 400
Examples
Retrieve attributes from multiple collections
The following example requests attributes from two different collections.
Sample Request
POST / HTTP/1.1
Host: aoss.<region>.<domain>
Accept-Encoding: identity
Content-Length: <PayloadSizeBytes>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.0
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>
X-Amz-Date: <Date>
X-Amz-Target: OpenSearchServerless.BatchGetCollection
{
"ids": ["1iu5usc4adj5", "1iu5usc4rame"]
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
x-amz-crc32: <Checksum>
Content-Type: application/x-amz-json-1.0
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
"collectionDetails": [
{
"arn": "arn:aws:aoss:us-east-1:123456789012:collection/07tjusf2h91cunochc",
"collectionEndpoint": "https://07tjusf2h91cunochc.us-east-1.aoss.amazonaws.com",
"createdDate": 1655422947204,
"lastModifiedDate": 1655422947204,
"dashboardEndpoint": "https://07tjusf2h91cunochc.us-east-1.aoss.amazonaws.com/_dashboards",
"kmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"type": "TIMESERIES",
"description": "Log data",
"id": "07tjusf2h91cunochc",
"name": "my-collection",
"status": "ACTIVE"
},
{
"id": "178ukvtg3i82dvopdid",
"name": "another-collection",
"status": "CREATING",
"type": "TIMESERIES",
"description": "",
"arn": "arn:aws:aoss:us-east-1:123456789012:collection/178ukvtg3i82dvopdid",
"kmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"createdDate": 1667446262828,
"lastModifiedDate": 1667446300769,
"collectionEndpoint": "https://178ukvtg3i82dvopdid.us-east-1.aoss.amazonaws.com",
"dashboardEndpoint": "https://178ukvtg3i82dvopdid.us-east-1.aoss.amazonaws.com/_dashboards"
}
],
"collectionErrorDetails": []
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: