Proxy configuration
Relay a charger's OCPP connection to another charging platform. Describe the target, switch the charger to it on its next reconnect, and roll it back.
This page is for operators who move a charger to, or test it against, another charging platform, and for developers who script that. A proxy configuration tells Voltra where to relay a charger's OCPP connection and how to sign in there. The charger keeps the connection URL and credentials it already has; Voltra decides what answers it.
The examples read VOLTRA_KEY, VOLTRA_ORG, VOLTRA_PROJECT, and CONFIG_ID (the id of a configuration). All calls go to https:.
How routing works
Two things are kept apart:
- The configuration describes the target: its URL, the charger's ID there and how to authenticate. Creating or changing it does not change how the charger is handled.
- The route is the switch. Activating it makes the charger's next WebSocket connection go to the target. Rolling it back makes the next connection come to Voltra again.
A route change never touches a connection that is open. It applies when the charger next connects, so reboot the charger or wait for it to reconnect. GET shows the route you asked for, with effective_on: "next_reconnect"; it does not say whether the charger has reconnected yet.
A route has a mode (local or proxy) and a generation, a counter that goes up on every activation and rollback. generation 0 with local means the route was never activated. activated_at and activated_by say when, and by which user or API key.
Voltra does not apply load management to a charger on a proxy route. Activating one removes the charger's open load management session; see Load management.
The configuration
| Field | Meaning |
|---|---|
id | The configuration's UUID. |
charge_box_id | The charger. Set at creation and not changeable. |
target_ | Your name for the target platform. Required. |
target_websocket_url | Where to connect. Required. See the rules below. |
target_charge_box_id | The charger's ID on the target platform. It defaults to charge_box_id. |
target_ | None, Basic or ClientCertificate. Required. |
target_ | Write only. Required with Basic. Never returned. |
target_ | The ID of one of your organization's certificates, for ClientCertificate. |
proxy_url | Generated by Voltra. Read only. |
route | mode, generation, activated_at, activated_by. Returned by create, get and list. |
inserted_at, updated_at | Timestamps. |
The create response also carries password, which is always an empty string. No proxy password is issued.
Target URL rules. A URL that breaks one is refused with 400 and a message under error..
- It must start with
wss:, have a host, and have no user name or password and no query string./ / - The host must not be
localhost, end in.,svc .orcluster. local ., or be a loopback, private, link-local or carrier-grade NAT address.internal - It must not point at Voltra:
voltra.,com voltra.and their subdomains are refused, and so is Voltra's own OCPP host. Activation answers 400 "refusing to create a proxy loop" for that last case.sh
Voltra lowercases the host, removes a trailing slash and removes a last path segment equal to the charger ID, then appends the target charger ID to the path when it connects. To place the ID elsewhere, put {charge_box_id} or {target_charge_box_id} in the URL; Voltra then does not append it. {organization_uuid} is also replaced.
Authentication. With Basic, Voltra signs in with the target charger ID as the user name and your password, which it stores encrypted. With ClientCertificate, the certificate ID must belong to your organization, otherwise the request is refused with "certificate not found for this organization". With None Voltra sends no credential; the charger's own credentials are never passed on.
Move a charger to a target and back
- Create the configuration.
curl -s -X POST "https://api.voltra.com/csms/v2/proxy-configuration" \
-H "x-api-key: $VOLTRA_KEY" -H "x-organization-id: $VOLTRA_ORG" \
-H "x-project-id: $VOLTRA_PROJECT" -H "content-type: application/json" \
-d '{
"charge_box_id": "CHARGER_001",
"target_platform_identifier": "Other platform",
"target_websocket_url": "wss://ocpp.example.com/v16",
"target_authentication_method": "Basic",
"target_auth_basic_password": "…"
}'
The 201 response has proxy_configuration (with id and a route of mode: "local", generation: 0) and password: "". A second configuration with the same charger and target_ is refused with 400.
- Activate the route:
POST, no body. The 200 response has/ proxy-configuration/ $CONFIG_ID/ route/ activate routewithmode: "proxy",generation: 1andeffective_on: "next_reconnect". - Reconnect the charger. From then on its OCPP traffic goes to the target.
- To return, call
POST. The route becomes/ proxy-configuration/ $CONFIG_ID/ route/ rollback localwith the nextgeneration, and the charger is handled by Voltra when it next connects. The configuration is kept.
Activation is refused with 409 while the charger has a transaction that started in the last 24 hours and has not stopped. The message lists the transaction IDs; retry when they finish. It is refused with 404 when the charger is archived or no longer exists in the project.
If a route's target stops passing the URL rules, or no longer matches its charger, Voltra handles the charger itself instead of refusing the connection.
Change and delete
PUTchanges the target fields. Send only what changes; leave/ proxy-configuration/ {id} target_out to keep the stored password. The response has the configuration withoutauth_ basic_ password route; callgetProxyRoutefor that.DELETEis refused with 409 while the configuration has an active route. Roll the route back first./ proxy-configuration/ {id} GETlists every configuration in the organization. It is not paged./ proxy-configuration
Headers and access
Send x-api-key, x-organization-id and x-project-id on every call. A key restricted to projects that sends no x-project-id gets 403 platform.; a wrong or missing x-organization-id gets 401 platform.. See Fix 401 and 403 errors.
A key with no projects selected can be refused by the charger API with 401 "Invalid API key". Select the project on the key; see Fix 401 and 403 errors.
Errors
These calls use the charger API's error bodies; see Errors.
| Status | When |
|---|---|
| 400 | Create or update: a rule above is broken, a required field is missing, the charger is not found in the project (error. "charge box not found"), or the charger and name already have a configuration. Get one configuration: the ID is unknown. Activate: the target URL is not allowed or would loop back to Voltra. |
| 404 | Update, delete, route read, activate or rollback: no configuration with that ID in your organization. Activate, route read and rollback also answer 404 when the charger does not exist in the project or is archived. |
| 409 | Delete: the route is active. Activate: the charger has a transaction in progress. |
Identifiers
id- The proxy configuration's UUID, assigned when you create it. Use it in every path.
charge_box_id- The OCPP identity of the charger the configuration belongs to. Create is refused with 400 and `error.charge_box_id` "charge box not found" when no charger with that OCPP identity exists in the project. An archived charger passes create, but activate, route read and rollback then answer 404.
target_platform_identifier- A name you give the target platform. A charger can have one configuration per name.
States
local- Voltra handles the charger's next OCPP connection. This is the state of every configuration until you activate it, and again after a rollback.
proxy- The charger's next OCPP connection is relayed to the target platform.
Endpoints
- POST/proxy-configuration/Create a proxy configuration
- GET/proxy-configuration/List proxy configurations
- GET/proxy-configuration/{id}Get a proxy configuration by ID
- PUT/proxy-configuration/{id}Update a proxy configuration
- DELETE/proxy-configuration/{id}Delete a proxy configuration
- GET/proxy-configuration/{id}/routeGet the desired route for a proxy configuration's charger
- POST/proxy-configuration/{id}/route/activateRoute the charger to this proxy target on its next reconnect
- POST/proxy-configuration/{id}/route/rollbackRoute the charger back to Fulminata on its next reconnect
Used in flows
Not used in any flow yet.