updateDirectQueryDataSource method
Updates the configuration or properties of an existing direct query data source in Amazon OpenSearch Service.
May throw BaseException.
May throw DisabledOperationException.
May throw InternalException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter dataSourceName :
A unique, user-defined label to identify the data source within your
OpenSearch Service environment.
Parameter dataSourceType :
The supported Amazon Web Services service that you want to use as the
source for direct queries in OpenSearch Service.
Parameter dataSourceAccessPolicy :
An optional IAM access policy document that defines the updated
permissions for accessing the direct query data source. The policy
document must be in valid JSON format and follow IAM policy syntax. If not
specified, the existing access policy if present remains unchanged.
Parameter description :
An optional text field for providing additional context and details about
the data source.
Parameter openSearchArns :
An optional list of Amazon Resource Names (ARNs) for the OpenSearch
collections that are associated with the direct query data source. This
field is required for CloudWatchLogs and SecurityLake datasource types.
Implementation
Future<UpdateDirectQueryDataSourceResponse> updateDirectQueryDataSource({
required String dataSourceName,
required DirectQueryDataSourceType dataSourceType,
String? dataSourceAccessPolicy,
String? description,
List<String>? openSearchArns,
}) async {
final $payload = <String, dynamic>{
'DataSourceType': dataSourceType,
if (dataSourceAccessPolicy != null)
'DataSourceAccessPolicy': dataSourceAccessPolicy,
if (description != null) 'Description': description,
if (openSearchArns != null) 'OpenSearchArns': openSearchArns,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/2021-01-01/opensearch/directQueryDataSource/${Uri.encodeComponent(dataSourceName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateDirectQueryDataSourceResponse.fromJson(response);
}