Returns a paginated list of all data source attachments for an OpenSearch application, including attachments in all states (PENDING, ATTACHED, and FAILED).
Parameters:
-
id
(Id)
–
The unique identifier or name of the OpenSearch application to list attachments for.
-
next_token
(Optional[String], default:
None
)
–
The pagination token from a previous call to retrieve the next set of results.
-
max_results
(Optional[Integer], default:
None
)
–
The maximum number of results to return per page. The default is 50.
Raises:
Source code in docs_src/capo_opensearch/_services/open_search.py
| def list_data_source_attachments(
self,
id: "capo_opensearch.types.id.Id",
*,
config_overrides: Optional[OpenSearchClientConfig] = None,
next_token: Optional["capo_opensearch.types.string.String"] = None,
max_results: Optional["capo_opensearch.types.integer.Integer"] = None,
) -> "capo_opensearch.types.list_data_source_attachments_response.ListDataSourceAttachmentsResponse":
"""<p>Returns a paginated list of all data source attachments for an OpenSearch application, including attachments in all states (<code>PENDING</code>, <code>ATTACHED</code>, and <code>FAILED</code>).</p>
Args:
id: <p>The unique identifier or name of the OpenSearch application to list attachments for.</p>
next_token: <p>The pagination token from a previous call to retrieve the next set of results.</p>
max_results: <p>The maximum number of results to return per page. The default is 50.</p>
Raises:
capo_opensearch.errors.access_denied_exception.AccessDeniedException: <p>An error occurred because you don't have permissions to access the resource.</p>
capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_opensearch.types.list_data_source_attachments_request.ListDataSourceAttachmentsRequest]",
) -> OperationResponse[
"capo_opensearch.types.list_data_source_attachments_response.ListDataSourceAttachmentsResponse"
]:
import capo_opensearch._operations.amazon_open_search_service.list_data_source_attachments
output, http_response = (
capo_opensearch._operations.amazon_open_search_service.list_data_source_attachments.list_data_source_attachments(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListDataSourceAttachments")
)
input_: capo_opensearch.types.list_data_source_attachments_request.ListDataSourceAttachmentsRequest = {
"id": id
}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|