Files
wlan-cloud-ucentralgw/TEST_CURL.md
2021-05-26 22:06:55 -07:00

5.4 KiB

curl based test script

This script is built on top of curl and jq. You must set the global variable UCENTRALGW in order to use it.

cli help

The commands

getdevice

Get the device JSON document.

deletedevice

Delete the device.

createdevice

Create a device using the default configuration.

  • serial: device serial number
  • cfg: JSON config file name
  • MAC: string MAC Address

getdevicestatus

Get the device status JSON document.

  • serial: device serial number

getstats

Get statistics for the device.

  • serial: device serial number

gethealthchecks

Get healthchecks for a device.

  • serial: device serial number

newesthealthchecks

Get newest healthchecks for a device.

  • serial: device serial number

lasthealthcheck

Get the last healthcheck

  • serial: device serial number

getcapababilities

Get the device capabilities JSON document.

  • serial: device serial number

deletecapababilities

Delete the device capabilities JSON.

  • serial: device serial number

reboot

Reboot the device.

  • serial: device serial number

upgrade

Do firmware upgrade for a device.

  • serial: device serial number
  • URI: complete URI where the upgrade file exists. No validation is performed.

leds

Activate LEDs a device.

  • serial: device serial number
  • pattern: on/off/blink
  • duration: number in seconds

configure

Change configuration for a device.

  • serial: device serial number
  • cfg: JSON config file name

factory <keep_redirector>

Do factory reset for device.

  • serial: device serial number
  • keep_redirector: true=keep redirector, false=reset redirector

request

Force a message from the device.

  • serial: device serial number
  • message: state or healthcheck

wifiscan

Do wifiscan for a device.

  • serial: device serial number
  • verbose: verbose=true/false

trace

Launch a remote trace for a device.

  • serial: device serial number
  • duration: number in seconds
  • network: which network to perform trace on: lan or wan

getcommand

Get the command JSON document.

  • command-uuid: command UUID

deletecommand

Delete the command.

  • command-uuid: command UUID

newestcommands

Get the newest commands for a device.

  • serial: device serial number

listdevices

List devices.

listcommands

List commands for a specific device.

  • serial: device serial number

deletecommands

Delete commands for a device.

  • serial: device serial number

getlogs

Get logs for the device.

  • serial: device serial number

newestlogs

Get the latest logs for the device.

  • serial: device serial number

deletelogs

Delete logs for the device.

  • serial: device serial number

eventqueue

Request event queue for the device.

  • serial: device serial number

listdefaultconfigs

List default configurations.

createdefaultconfig

Create a default configuration

  • name: unique name, no spaces
  • ids: comma separated list of models
  • cfg: JSON config file name

addblacklistdevice

Add a device to the black list

  • serial: serial number of the device to add
  • reason: reason for blacklisting

getblacklist

List all blacklisted devices

deleteblacklistdevice

Add a device to the black list.

  • serial: device serial number

devicecount

Get the number of devices in the DB.

deviceserialnumbers

Get only the serial numbers.

selectdevices <serial_list>

Get a list of devices based on a list.

  • serial_list: serial numbers (must be comma separated).

deviceswithstatus

Get devices with their status.

setloglevel

Set the logging system level for individual subsystems.

  • sys: ufileuploader/websocket/storage/restapi/commandmanager/auth/deviceregistry/all
  • level: level:none/fatal/critical/error/warning/notice/information/debug/trace

getfile

Get the file associated with trace command .

  • uuid: UUID of file to retrieve

rtty

Get the details for an rtty session.

  • serial: device serial number

lifetimestats

Get the lifetime stats counters for a device

  • serial: device serial number

laststats

Get the last statistics for a device.

  • serial: device serial number

neweststats

Get the newest statistics for a device.

  • serial: device serial number

Notes

To pass additional flags to the CURL command, create an environment variable called FLAGS and git ve the values you want. For example, for force all call to use IPv6, set FLAGS="-6", for verbose mode and IPv6, set FLAGS="-6 -v"

Dates

All dates are expressed in UNIX time UTC in seconds. If you are using JS or other languages, please make sure that you convert your UTC time to seconds (some languages use microseconds or milliseconds).