The reference solution is not a closed appliance: everything it collects and controls is reachable through open, standards-based interfaces. This tutorial shows how to build your own applications on top of it using the OPC UA Web API exposed by UA Cloud Action.
In addition to the MQTT-based feedback loop, UA Cloud Action exposes an OPC UA Web API — a RESTful, OpenAPI-based HTTP interface to the standard OPC UA services defined in IEC 62541-4. This lets you build custom applications — dashboards, mobile apps, analytics jobs, or backend integrations — that talk to the edge's OPC UA servers over plain HTTP/JSON, without embedding a native OPC UA stack.
Implemented services: this reference deployment implements the
Read,HistoryRead(historical read), andBrowseservices of the OPC UA Web API. Other services (Write,Call, etc.) are not implemented due to security considerations — requests to them are not available. Use UA Cloud Commander (the MQTT command path) forWrite/Calloperations in the meantime.
Note: the Web API is being implemented in UA Cloud Action. The endpoints and auth described below track the OPC UA Web API specification; confirm the exact routes against the running service's OpenAPI/Swagger document.
The API is served by the ua-cloudaction container and reachable through its
Service at:
http://<device-ip>:8082
- The OpenAPI/Swagger definition (e.g.
http://<device-ip>:8082/swagger) describes every available route and schema — point your tooling at it to explore or generate clients. In the interactive Swagger UI, use the Authorize button to supply the Basic credentials before invoking the/opcua/readand/opcua/historyreadoperations. - Authentication is mandatory. The UA Cloud Action web UI and Web API require
HTTP Basic authentication on every request — there is no anonymous access.
Supply the
IOT_USERNAME/IOT_PASSWORDcredentials (set via the manifest'sADMIN_USERNAME/ADMIN_PASSWORD) in the HTTPAuthorization: Basic <base64>header. Unauthenticated requests receive401 Unauthorizedwith aWWW-Authenticate: Basicchallenge.The OPC UA Web API specification also allows bearer/JWT tokens in the
Authorizationheader (the reference gateway uses OAuth2 JWTs); Basic auth is what this reference deployment mandates. - The API is rate limited per client IP using a fixed window. The limit and
window are configurable via the
RATE_LIMIT_PERMITandRATE_LIMIT_WINDOW_SECONDSenvironment variables (defaulting to 60 requests per 60 seconds incloud.yaml). Requests exceeding the limit receive429 Too Many Requests. - Behind the OPC UA Web API, UA Cloud Action forwards the requested service to the
target OPC UA server (e.g. the Edge Translator at
opc.tcp://ua-edgetranslator.edge.svc.cluster.local:4840).
Use the OPC Foundation
UA Web API Starter Kit
as the starting point. Its UaWebApiClient folder contains ready-to-run sample
clients in several environments that call the OPC UA Web API using pre-built
stubs (classes/constants for the OPC UA services, BrowseNames, and
NodeIds):
| Sample client | Language / stubs |
|---|---|
UaWebApiClient/csharp |
C# — DotNet stubs |
UaWebApiClient/nodejs |
JavaScript — TypeScript stubs |
UaWebApiClient/react |
TypeScript (browser) — TypeScript stubs |
UaWebApiClient/python |
Python — Python stubs |
Typical workflow to build your own app:
- Clone the starter kit and pick the sample client that matches your stack:
git clone https://github.com/OPCFoundation/UA-WebApi-StarterKit.git cd UA-WebApi-StarterKit/UaWebApiClient - Point the client at your Web API endpoint — set its base URL to
http://<device-ip>:8082(the UA Cloud Action Web API) and set theAuthorization: Basic <base64(user:pass)>header (mandatory) using yourIOT_USERNAME/IOT_PASSWORD. - Use the pre-built stubs to invoke OPC UA services with typed
requests/responses instead of hand-crafting JSON. In this deployment the
available operations are
Read,HistoryRead, andBrowse(reading current and historical variable values and browsing the address space);WriteandCallare not yet exposed by the Web API. - (Optional) Generate model-specific classes. For DataTypes from a custom information model, convert its NodeSet to an OpenAPI schema with the Opc.Ua.ModelCompiler, then generate typed classes with the OpenAPI Generator — exactly as the starter kit does — so your app understands the model's structured values.
- Iterate from a sample — start from the closest
UaWebApiClientsample and extend it into your own dashboard, service, or integration.
Because the interface is standard OpenAPI, you can also generate a client in any other language supported by the OpenAPI Generator directly from the service's OpenAPI document, rather than using the pre-built stubs.