Device Provisioning

This section describes the local PDU API commands used to register a device with Synaccess Cloud and verify cloud connectivity. These endpoints are useful for scripting enrollment, recovery, and validation workflows.


PDU Cloud API These calls are made directly against the PDU’s local web API. They require an authenticated local session cookie, shown below as SPID=$SPID.

Register Hosted Cloud Credentials
POST /api/system/cloudRegistration

Use this when the script has the Synaccess Cloud username/password and wants the PDU to exchange them for cloud credentials.

Request:

{
  "cloudUsername": "[email protected]",
  "cloudPw": "cloud-password"
}

Example:

curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"cloudUsername":"[email protected]","cloudPw":"cloud-password"}' \
  "https://<pdu-host>/api/system/cloudRegistration"

Success:

HTTP 200

Behavior:

  • Restarts the hosted cloud processes.
  • On failure, clears stored hosted-cloud credentials.

Errors:

422 Missing Username/Password in request.
422 Invalid Data Types.
422 Cloud registration failed. Check credentials and network connection
403 No Permission

To clear cloud credentials, submit an empty username:

curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"cloudUsername":"","cloudPw":""}' \
  "https://<pdu-host>/api/system/cloudRegistration"

Important: cloudRegistration updates credentials, but does not necessarily enable hosted cloud. If needed, enable cloud separately:

curl -k --cookie "SPID=$SPID" \
  -H "Content-Type: application/json" \
  -d '{"network":{"cloudEnabled":true}}' \
  "https://<pdu-host>/api/conf"

Depending on firmware/API shape, {"cloudEnabled":true} may also be accepted by /api/conf.

Check Cloud Status GET /api/cloudStatus

Example:

curl -k --cookie "SPID=$SPID" \
  "https://<pdu-host>/api/cloudStatus"

Success:

{
  "status": "OK"
}

Status behavior:

  • HTTP 200 + {"status":"OK"} means the PDU is cloud-connected.
  • HTTP 422 + {"status":"<reason>"} means cloud is not connected and includes the device-side reason.
  • HTTP 500 means the PDU could not determine cloud status.
  • HTTP 403 means the local session lacks network-settings permission.

Recommended Polling Do not assume registration is complete just because cloudRegistration returns 200. Poll cloudStatus.

for i in $(seq 1 60); do
  code=$(curl -k -s -o /tmp/cloud_status.json -w "%{http_code}" \
    --cookie "SPID=$SPID" \
    "https://<pdu-host>/api/cloudStatus")

  if [ "$code" = "200" ] && grep -q '"status":"OK"' /tmp/cloud_status.json; then
    echo "Cloud connected"
    exit 0
  fi

  sleep 5
done

echo "Cloud did not report OK"
cat /tmp/cloud_status.json
exit 1