List gateways

Depending on the parameters passed through the URL, the list gateways API allows the client application to get a list of gateways that are attached to a particular group.

To get a list of all gateways irrespective of the make and model that are attached to a particular group, pass the groupName parameter through the URL.

To get a list of gateways of a particular make, model irrespective of the gateway type, pass the groupName, manu, and model parameters through the URL.

To get a list of Nokia ISA gateways that are attached to a particular group, set the, manu to Nokia, and model to ISA Gateway and pass it through the URL along with the groupName.

List gateways describes the API structure for listing all gateways that are attached to a particular group.

Table 1. List gateways
Title List gateways
URL http://<impact_url>/m2m/gateway?groupName=<>&manu=<>&model=<>
Method GET
Content-Type application/json
URL Params The following are the URL parameters:
  • groupName:[string]:(Mandatory): Specifies the name of the IMPACT IoT group for retrieving the list of gateways.

  • manu:[string]:(Optional): Specifies the name of the gateway manufacturer.

  • model:[string]:(Optional): Specifies the model of the gateway.

Data Params Msg:[String]: info/warning/error message
Success Code
Response Code: 201
Error Code
400 : Bad Request
401 : Unauthorized 
403 : Forbidden 
404 : Not Found 
Sample Call
  • only groupName is passed through the URL.

    Curl:

    curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic
          Y2RwdGVzdDpOb2tpYUAyMQ==' ' http://mfussip02.iot.nokia.com:9090/m2m/gateway?groupName=DM.AIRTEL'

    Response body:

    {
     "msg":"Success",
     "GWList":[
    
    { "serialNumber":"VIRTUAL_GATEWAY_INTELLIGENT6", "groupId":6, "groupName":"DM.AIRTEL", "make":"Cisco", "model":"Gateway", "gatewayType":"I" } 
    ,
    
    { "serialNumber":"VIRTUAL_GATEWAY_COAP6", "groupId":6, "groupName":"DM.AIRTEL", "gatewayType":"C" } 
    ,
     {
     "serialNumber":"ISA_GATEWAY_2",
     "groupId":6,
     "groupName":"DM.AIRTEL",
     "make":"Nokia",
     "model":"ISA Gateway",
     "gatewayVersion":"2.0.0",
     "gatewayType":"E",
     "gatewayJson":"[
    {\"csaGateway/0/friendlyName\":\"Test\",\"csaSystem/0/powerSource\":\"AC not connected\",\"csaSystem/0/lastReboot\":\"Fri Nov 17 02:49\",\"csaSystem/0/networkInformation\":[\"IFC-eth0,MAC-00:16:3e:cf:ac:59,IPv4-addr:10.0.8.185,IPv6-fe80::216:3eff:fecf:ac59/64\"],\"csaSystem/0/networkStats\":[\"IFC-lo,RCV BYTES-0,RCV PKTS-0,XMIT BYTES-0,XMIT PKTS-0\",\"IFC-eth0,RCV BYTES-482740,RCV PKTS-403,XMIT BYTES-15001,XMIT PKTS-211\"],\"csaSystem/0/diskUsed\":\"13145924 kB\",\"csaSystem/0/diskAvaliable\":\"2150856 kB\",\"csaSystem/0/memoryTotal\":\"4046580 kB\",\"csaSystem/0/memoryFree\":\"3759924 kB\",\"csaSystem/0/uptime\":\"817.00 secs\",\"csaSystem/0/processInformation\":[\"PID-289,PPID-1,PROC-/usr/lib/snapd/snapd,MEM-0.00,CPU-0.50\",\"PID-281,PPID-1,PROC-/usr/lib/accountsservice/ac,MEM-0.00,CPU-0.10\",\"PID-328,PPID-1,PROC-/usr/bin/redis-server,MEM-0.10,CPU-127.00\",\"PID-337,PPID-1,PROC-/usr/lib/policykit-1/polkit,MEM-0.00,CPU-0.10\",\"PID-1,PPID-0,PROC-/sbin/init,MEM-0.10,CPU-0.10\",\"PID-283,PPID-1,PROC-/usr/sbin/sshd,MEM-0.10,CPU-0.10\",\"PID-817,PPID-1,PROC-./intelligentgateway,MEM-0.00,CPU-0.10\",\"PID-368,PPID-0,PROC-/bin/bash,MEM-0.00,CPU-0.00\",\"PID-270,PPID-1,PROC-/usr/bin/dbus-daemon,MEM-0.00,CPU-0.00\",\"PID-55,PPID-1,PROC-/lib/systemd/systemd-udevd,MEM-0.00,CPU-0.00\"]} 
    ]"
     }
     ],
     "code":1000
     }
  • URL is configured to get the list of non-ISA gateways that are attached to the specified group.

    Curl:

    curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic
          Y2RwdGVzdDpOb2tpYUAyMQ==' ' http://mfussip02.iot.nokia.com:9090/m2m/gateway?groupName=DM.AIRTEL&manu=Cisco&model=Gateway'

    Response body:

    {
     "msg":"Success",
     "GWList":[
    { "serialNumber":"VIRTUAL_GATEWAY_INTELLIGENT6", "groupId":6, "groupName":"DM.AIRTEL", "make":"Cisco", "model":"Gateway", "gatewayType":"I" } 
    ],
     "code":1000
     }
  • URL is configured to get the list of Nokia ISA gateways that are attached to the specified group.

    Curl:

    curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic
          Y2RwdGVzdDpOb2tpYUAyMQ==' ' http://mfussip02.iot.nokia.com:9090/m2m/gateway?groupName=DM.AIRTEL&manu=Nokia&model=ISA Gateway'

    Response body:

    {
     "msg":"Success",
     "GWList":[
     {
     "serialNumber":"ISA_GATEWAY_2",
     "groupId":6,
     "groupName":"DM.AIRTEL",
     "make":"Nokia",
     "model":"ISA Gateway",
     "gatewayVersion":"2.0.0",
     "gatewayType":"E",
     "ipaddress":"IFC-eth0,MAC-00:16:3e:cf:ac:59,IPv4-addr:10.0.8.185,IPv6-fe80::216:3eff:fecf:ac59/64",
     "friendlyname":"\"Test\"",
     "gatewayJson":"[
    {\"csaGateway/0/friendlyName\":\"Test\",\"csaSystem/0/powerSource\":\"AC not connected\",\"csaSystem/0/lastReboot\":\"Fri Nov 17 02:49\",\"csaSystem/0/networkInformation\":[\"IFC-eth0,MAC-00:16:3e:cf:ac:59,IPv4-addr:10.0.8.185,IPv6-fe80::216:3eff:fecf:ac59/64\"],\"csaSystem/0/networkStats\":[\"IFC-lo,RCV BYTES-0,RCV PKTS-0,XMIT BYTES-0,XMIT PKTS-0\",\"IFC-eth0,RCV BYTES-482740,RCV PKTS-403,XMIT BYTES-15001,XMIT PKTS-211\"],\"csaSystem/0/diskUsed\":\"13145924 kB\",\"csaSystem/0/diskAvaliable\":\"2150856 kB\",\"csaSystem/0/memoryTotal\":\"4046580 kB\",\"csaSystem/0/memoryFree\":\"3759924 kB\",\"csaSystem/0/uptime\":\"817.00 secs\",\"csaSystem/0/processInformation\":[\"PID-289,PPID-1,PROC-/usr/lib/snapd/snapd,MEM-0.00,CPU-0.50\",\"PID-281,PPID-1,PROC-/usr/lib/accountsservice/ac,MEM-0.00,CPU-0.10\",\"PID-328,PPID-1,PROC-/usr/bin/redis-server,MEM-0.10,CPU-127.00\",\"PID-337,PPID-1,PROC-/usr/lib/policykit-1/polkit,MEM-0.00,CPU-0.10\",\"PID-1,PPID-0,PROC-/sbin/init,MEM-0.10,CPU-0.10\",\"PID-283,PPID-1,PROC-/usr/sbin/sshd,MEM-0.10,CPU-0.10\",\"PID-817,PPID-1,PROC-./intelligentgateway,MEM-0.00,CPU-0.10\",\"PID-368,PPID-0,PROC-/bin/bash,MEM-0.00,CPU-0.00\",\"PID-270,PPID-1,PROC-/usr/bin/dbus-daemon,MEM-0.00,CPU-0.00\",\"PID-55,PPID-1,PROC-/lib/systemd/systemd-udevd,MEM-0.00,CPU-0.00\"]} 
    ]"
     }
     ],
     "code":1000
     }
Notes

Depending upon the nature of the error, IMPACT IoT returns an error messages and error code. The valid error message and error codes are:

  • Gateway not found: {"msg":"No gateways in the group","GWList":[],"code":8003}
  • model is missing: {"msg":"Missing parmater 'model'","code":4003}
  • manu is missing: {"msg":"Missing parameter 'make'","code":4002}
  • Unknown group: {"msg":"Group not found","code":1013}