updateGatewayCapabilityConfiguration method
Updates a gateway capability configuration or defines a new capability configuration. Each gateway capability defines data sources for a gateway.
Important workflow notes:
Each gateway capability defines data sources for a gateway. This is the namespace of the gateway capability.
. The namespace follows the format
service:capability:version, where:
-
service- The service providing the capability, oriotsitewise. -
capability- The specific capability type. Options include:opcuacollectorfor the OPC UA data source collector, orpublisherfor data publisher capability. -
version- The version number of the capability. Option include2for Classic streams, V2 gateways, and3for MQTT-enabled, V3 gateways.
OUT_OF_SYNC until the gateway processes the configuration.Use
DescribeGatewayCapabilityConfiguration to check the sync
status and verify the configuration was applied.
A gateway can have multiple capability configurations with different namespaces.
May throw ConflictingOperationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter capabilityConfiguration :
The JSON document that defines the configuration for the gateway
capability. For more information, see Configuring
data sources (CLI) in the IoT SiteWise User Guide.
Parameter capabilityNamespace :
The namespace of the gateway capability configuration to be updated. For
example, if you configure OPC UA sources for an MQTT-enabled gateway, your
OPC-UA capability configuration has the namespace
iotsitewise:opcuacollector:3.
Parameter gatewayId :
The ID of the gateway to be updated.
Implementation
Future<UpdateGatewayCapabilityConfigurationResponse>
updateGatewayCapabilityConfiguration({
required String capabilityConfiguration,
required String capabilityNamespace,
required String gatewayId,
}) async {
final $payload = <String, dynamic>{
'capabilityConfiguration': capabilityConfiguration,
'capabilityNamespace': capabilityNamespace,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/20200301/gateways/${Uri.encodeComponent(gatewayId)}/capability',
exceptionFnMap: _exceptionFns,
);
return UpdateGatewayCapabilityConfigurationResponse.fromJson(response);
}