Returns attributes for one or more collections, including the collection endpoint, the OpenSearch Dashboards endpoint, and FIPS-compliant endpoints. For more information, see Creating and managing Amazon OpenSearch Serverless collections.
Parameters:
-
ids
(Optional[CollectionIds], default:
None
)
–
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.
-
names
(Optional[CollectionNames], default:
None
)
–
A list of collection names. You can't provide names and IDs in the same request.
Raises:
Source code in docs_src/capo_opensearchserverless/_services/open_search_serverless.py
| def batch_get_collection(
self,
*,
config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
ids: Optional[
"capo_opensearchserverless.types.collection_ids.CollectionIds"
] = None,
names: Optional[
"capo_opensearchserverless.types.collection_names.CollectionNames"
] = None,
) -> "capo_opensearchserverless.types.batch_get_collection_response.BatchGetCollectionResponse":
"""<p>Returns attributes for one or more collections, including the collection endpoint, the OpenSearch Dashboards endpoint, and FIPS-compliant endpoints. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html">Creating and managing Amazon OpenSearch Serverless collections</a>.</p>
Args:
ids: <p>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 <a href="https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListCollections.html">ListCollections</a> API.</p>
names: <p>A list of collection names. You can't provide names and IDs in the same request.</p>
Raises:
capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_opensearchserverless.types.batch_get_collection_request.BatchGetCollectionRequest]",
) -> OperationResponse[
"capo_opensearchserverless.types.batch_get_collection_response.BatchGetCollectionResponse"
]:
import capo_opensearchserverless._operations.open_search_serverless.batch_get_collection
output, http_response = (
capo_opensearchserverless._operations.open_search_serverless.batch_get_collection.batch_get_collection(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchGetCollection")
)
input_: capo_opensearchserverless.types.batch_get_collection_request.BatchGetCollectionRequest = {}
if ids is not None:
input_["ids"] = ids
if names is not None:
input_["names"] = names
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|