updateGatewayCapabilityConfiguration method

Future<UpdateGatewayCapabilityConfigurationResponse> updateGatewayCapabilityConfiguration({
  1. required String capabilityConfiguration,
  2. required String capabilityNamespace,
  3. required String gatewayId,
})

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, or iotsitewise.
  • capability - The specific capability type. Options include: opcuacollector for the OPC UA data source collector, or publisher for data publisher capability.
  • version - The version number of the capability. Option include 2 for Classic streams, V2 gateways, and 3 for MQTT-enabled, V3 gateways.
After updating a capability configuration, the sync status becomes 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);
}