detachDataSource method
Removes a data source from an OpenSearch application. The application must
be in the ACTIVE state. This operation removes the data
source saved object from the application and deletes the attachment
record. Throws a ConflictException if the specified data
source has a PENDING attachment, and a
ResourceNotFoundException if the data source is not currently
attached to the application.
May throw AccessDeniedException.
May throw ConflictException.
May throw DisabledOperationException.
May throw InternalException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter id :
The unique identifier or name of the OpenSearch application to detach the
data source from.
Implementation
Future<DetachDataSourceResponse> detachDataSource({
required String dataSourceArn,
required String id,
}) async {
final $payload = <String, dynamic>{
'dataSourceArn': dataSourceArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/2021-01-01/opensearch/application/${Uri.encodeComponent(id)}/detachDataSource',
exceptionFnMap: _exceptionFns,
);
return DetachDataSourceResponse.fromJson(response);
}