Chute Management

Install and manage chutes on the host.

Endpoints for these functions can be found under /api/v1/chutes.

GET /api/v1/chutes/

List installed chutes.

Example request:

GET /api/v1/chutes/

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "environment": {},
    "name": "hello-world",
    "allocation": {
      "cpu_shares": 1024,
      "prioritize_traffic": false
    },
    "state": "running",
    "version": "x1511808778",
    "resources": null
  }
]
GET /api/v1/chutes/(chute)/networks/(network)/stations/(mac)

Get detailed information about a connected station.

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi/stations/5c:59:48:7d:b9:e6

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "rx_packets": "230",
  "tdls_peer": "no",
  "authenticated": "yes",
  "rx_bytes": "12511",
  "tx_bitrate": "1.0 MBit/s",
  "tx_retries": "0",
  "signal": "-45 [-49, -48] dBm",
  "authorized": "yes",
  "rx_bitrate": "65.0 MBit/s MCS 7",
  "mfp": "no",
  "tx_failed": "0",
  "inactive_time": "4688 ms",
  "mac_addr": "5c:59:48:7d:b9:e6",
  "tx_bytes": "34176",
  "wmm_wme": "yes",
  "preamble": "short",
  "tx_packets": "88",
  "signal_avg": "-44 [-48, -47] dBm"
}
GET /api/v1/chutes/(chute)/networks/(network)/hostapd_status

Get low-level status information from the access point.

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi/hostapd_status

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "olbc_ht": "0",
  "cac_time_left_seconds": "N/A",
  "num_sta_no_short_slot_time": "0",
  "olbc": "1",
  "num_sta_non_erp": "0",
  "ht_op_mode": "0x4",
  "state": "ENABLED",
  "num_sta_ht40_intolerant": "0",
  "channel": "11",
  "bssid[0]": "02:00:08:24:03:dd",
  "ieee80211n": "1",
  "cac_time_seconds": "0",
  "num_sta[0]": "1",
  "ieee80211ac": "0",
  "phy": "phy0",
  "num_sta_ht_no_gf": "1",
  "freq": "2462",
  "num_sta_ht_20_mhz": "1",
  "num_sta_no_short_preamble": "0",
  "secondary_channel": "0",
  "ssid[0]": "Free WiFi",
  "num_sta_no_ht": "0",
  "bss[0]": "vwlan7e1b"
}
GET /api/v1/chutes/(chute)/networks/(network)/stations

Get detailed information about connected wireless stations.

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi/stations

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "rx_packets": "230",
    "tdls_peer": "no",
    "authenticated": "yes",
    "rx_bytes": "12511",
    "tx_bitrate": "1.0 MBit/s",
    "tx_retries": "0",
    "signal": "-45 [-49, -48] dBm",
    "authorized": "yes",
    "rx_bitrate": "65.0 MBit/s MCS 7",
    "mfp": "no",
    "tx_failed": "0",
    "inactive_time": "4688 ms",
    "mac_addr": "5c:59:48:7d:b9:e6",
    "tx_bytes": "34176",
    "wmm_wme": "yes",
    "preamble": "short",
    "tx_packets": "88",
    "signal_avg": "-44 [-48, -47] dBm"
  }
]
GET /api/v1/chutes/(chute)/networks/(network)/leases

Get current list of DHCP leases for chute network.

Returns a list of DHCP lease records with the following fields:

expires
lease expiration time (seconds since Unix epoch)
mac_addr
device MAC address
ip_addr
device IP address
hostname
name that the device reported
client_id
optional identifier supplied by device

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi/leases

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "client_id": "01:5c:59:48:7d:b9:e6",
    "expires": "1511816276",
    "ip_addr": "192.168.128.64",
    "mac_addr": "5c:59:48:7d:b9:e6",
    "hostname": "paradrops-iPod"
  }
]
GET /api/v1/chutes/(chute)/networks/(network)/ssid

Get currently configured SSID for the chute network.

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi/ssid

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ssid": "Free WiFi",
  "bssid": "02:00:08:24:03:dd"
}
PUT /api/v1/chutes/(chute)/networks/(network)/ssid

Change the configured SSID for the chute network.

The change will not persist after a reboot. If a persistent change is desired, you should update the chute configuration instead.

Example request:

PUT /api/v1/chutes/captive-portal/networks/wifi/ssid
Content-Type: application/json

{
  "ssid": "Best Free WiFi"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "message": "OK"
}
GET /api/v1/chutes/(chute)/networks/(network)

Get information about a network configured for the chute.

Example request:

GET /api/v1/chutes/captive-portal/networks/wifi

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "interface": "wlan0",
  "type": "wifi",
  "name": "wifi"
}
GET /api/v1/chutes/(chute)/networks

Get list of networks configured for the chute.

Example request:

GET /api/v1/chutes/captive-portal/networks

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "interface": "wlan0",
    "type": "wifi",
    "name": "wifi"
  }
]
GET /api/v1/chutes/(chute)/config

Get current chute configuration.

Example request:

GET /api/v1/chutes/captive-portal/config

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "net": {
    "wifi": {
      "dhcp": {
        "lease": "1h",
        "limit": 250,
        "start": 3
      },
      "intfName": "wlan0",
      "options": {
        "isolate": True
      },
      "ssid": "Free WiFi",
      "type": "wifi"
    }
  }
}
PUT /api/v1/chutes/(chute)/config

Update the chute configuration and restart to apply changes.

Example request:

PUT /api/v1/chutes/captive-portal/config
Content-Type: application/json

{
  "net": {
    "wifi": {
      "dhcp": {
        "lease": "1h",
        "limit": 250,
        "start": 3
      },
      "intfName": "wlan0",
      "options": {
        "isolate": True
      },
      "ssid": "Better Free WiFi",
      "type": "wifi"
    }
  }
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "change_id": 1
}
GET /api/v1/chutes/(chute)/cache

Get chute cache contents.

The chute cache is a key-value store used during chute installation. It can be useful for debugging the Paradrop platform.

GET /api/v1/chutes/(chute)

Get information about an installed chute.

Example request:

GET /api/v1/chutes/hello-world

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "environment": {},
  "name": "hello-world",
  "allocation": {
    "cpu_shares": 1024,
    "prioritize_traffic": false
  },
  "state": "running",
  "version": "x1511808778",
  "resources": null
}