putIntegration method
- required String integrationName,
- required IntegrationType integrationType,
- required ResourceConfig resourceConfig,
Creates an integration between CloudWatch Logs and another service in this account. Currently, only integrations with OpenSearch Service are supported, and currently you can have only one integration in your account.
Integrating with OpenSearch Service makes it possible for you to create curated vended logs dashboards, powered by OpenSearch Service analytics. For more information, see Vended log dashboards powered by Amazon OpenSearch Service.
You can use this operation only to create a new integration. You can't modify an existing integration.
May throw InvalidParameterException.
May throw LimitExceededException.
May throw ServiceUnavailableException.
May throw ValidationException.
Parameter integrationName :
A name for the integration.
Parameter integrationType :
The type of integration. Currently, the only supported type is
OPENSEARCH.
Parameter resourceConfig :
A structure that contains configuration information for the integration
that you are creating.
Implementation
Future<PutIntegrationResponse> putIntegration({
required String integrationName,
required IntegrationType integrationType,
required ResourceConfig resourceConfig,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Logs_20140328.PutIntegration'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'integrationName': integrationName,
'integrationType': integrationType.value,
'resourceConfig': resourceConfig,
},
);
return PutIntegrationResponse.fromJson(jsonResponse.body);
}