Skip to content

1 Fetch Connection List API

manas11 edited this page Jun 26, 2021 · 1 revision

Fetch a list of all connections. Can also fetch active and inactive connections selectively.


Request: GET /connections

Fetches a list of all connections. Each connection's details are also returned as various parameters.

Response: 200 OK

Sample Response if there is atleast one connection present: 200 OK

[
  {
    "id": 1,
    "rule_protocol": "tcp",
    "active": false,
    "created_at": "2021-06-26T00:09:48.376071+05:30",
    "updated_at": "2021-06-26T00:10:09.119828+05:30",
    "renewal_count": 0,
    "source_ip": "8.8.8.8",
    "forwarder_port": "23986",
    "destination_ip": "10.16.17.18",
    "destination_port": "7800",
    "expiry_period": "00:10:00"
  },
  {
   ...
  },
  ...
]

Sample Response if there are no connections present: 200 OK

[]

Request: GET /connections?active=<param_value>

Note: Permissible values of <param_value> are [true, false, 0, 1].

Fetches a list of active or inactive connections. Each connection's details are also returned as various parameters.

true, 1 corersponds to active connections and false, 0 corresponds to inactive connections.

Response: 200 OK

Note: For sample responses below, <param_value> is assumed to be passes as true

Sample Response if there is atleast one active connection present: 200 OK

[
  {
    "id": 1,
    "rule_protocol": "tcp",
    "active": true,
    "created_at": "2021-06-26T00:09:48.376071+05:30",
    "updated_at": "2021-06-26T00:10:09.119828+05:30",
    "renewal_count": 0,
    "source_ip": "8.8.8.8",
    "forwarder_port": "23986",
    "destination_ip": "10.16.17.18",
    "destination_port": "7800",
    "expiry_period": "00:10:00"
  },
  {
   ...
  },
  ...
]

Sample Response if there are no active connections present: 200 OK

[]