Hi all,

The following are the request-response structures for the IoT dashboard
API. Please mention any suggestion or changes to the following


1. Retrieve connectivity status.

>
> *Request: *POST /connectivityStatus

*{}*

*response:* [
>
{

"context": "deviceInfo",

"data": [

{

"group": "active",

"label": "active",

"count": activeNo

},

{

"group": "all",

"label": "all",

"count": activeNo + inactiveNo

},

{

"group": "inactive",

"label": "inactive",

"count": inactiveNo

}

]

}

]

2. Retrieve vulnerabilities


> *Request: *POST /securityConcerns
> *{*
> *}**response:* [
>
{

"context": "securityConcerns",

"data": [

{

"group": "no-passcode",

"label": "No Passcode",

"countChange": randint(100, 500),

"count": randint(100, 500)

},

{

"group": "no-encryption",

"label": "Non encrypted",

"countChange": randint(100, 500),

"count": randint(100, 500)

},

{

"group": "unmonitored",

"label": "Unmonitored",

"countChange": randint(100, 500),

"count": randint(100, 500)

}

]

}

]


3. Retrieve non compliant features


> *Request: *POST /nonCompliantDevices
> *{*

fromIndex: 10,

count: 5

*}*

*response:*[

 {

"context": "nonCompliantDevices",

"data":[

{

"group": "non-compliant-1",

"label": "Non Compliant-1",

"count": randint(100, 500)

},

{

"group": "non-compliant-2",

"label": "non-compliant-2",

"count": randint(100, 500)

},

{

"group": "non-compliant-3",

"label": "non-compliant-3",

"count": randint(100, 500)

},

{

"group": "non-compliant-4",

"label": "non-compliant-4",

"count": randint(100, 500)

},

{

"group": "non-compliant-5",

"label": "non-compliant-5",

"count": randint(100, 500)

}

]

}

]


4. Retrieve grouping: This has two types of requests request 1 without
mentioning any filters and request 2 with a filter


> *Request1: *POST /nonCompliantDevices
> *[]*

*response1:*[
>     {
>         "context": "platforms",
>         "data": [
>             {
>                 "group": "ios",
>                 "label": "iOS",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "android",
>                 "label": "Android",
>                 "count": randint(100, 500)
>             }
>         ]
>     },
>     {
>         "context": "ownerships",
>         "data": [
>             {
>                 "group": "cope",
>                 "label": "COPE",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "byod",
>                 "label": "BYOD",
>                 "count": randint(100, 500)
>             }
>         ]
>     },
>     {
>         "context": "userGroups",
>         "data": [
>             {
>                 "group": "sales",
>                 "label": "Sales",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "marketing",
>                 "label": "Marketing",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "engineering",
>                 "label": "Engineering",
>                 "count": randint(100, 500)
>             }
>         ]
>     }

]



> *Request2: *POST /nonCompliantDevices
> {
> "filters": [
>            {
>             "filteringContext": "platform",
> "filteringGroups" : ["Android"]
>            }

        ]

}
>
*response2:*[
>     {
>         "context": "platforms",
>         "data": [
>             {
>                 "group": "ios",
>                 "label": "iOS",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "android",
>                 "label": "Android",
>                 "count": randint(100, 500)
>             }
>         ]
>     },
>     {
>         "context": "ownerships",
>         "data": [
>             {
>                 "group": "cope",
>                 "label": "COPE",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "byod",
>                 "label": "BYOD",
>                 "count": randint(100, 500)
>             }
>         ]
>     },
>     {
>         "context": "userGroups",
>         "data": [
>             {
>                 "group": "sales",
>                 "label": "Sales",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "marketing",
>                 "label": "Marketing",
>                 "count": randint(100, 500)
>             },
>             {
>                 "group": "engineering",
>                 "label": "Engineering",
>                 "count": randint(100, 500)
>             }
>         ]
>     }

]

5. Retrieve Device table:
*Request:*

> POST /devices
> {
> "filters": [
>         {
>             "filter": "platform",
> "selections" : ["Android", "iOS"]
>         },
>         {
>             "filteringContext": "NonCompliantDevices",
> "filteringGroups" : ["non-compliant-1"]
>         }
>     ],
> }



*response:* [



{

"context": "devices",

"data": [

{

"id": "001",

"label": "Nexus P",

"status": "Blocked",

"platform": "Android",

"model": "HNP001",

"actions": "Action"

},

{

"id": "002",

"label": "Galaxy Note 5",

"status": "Unmonitored",

"platform": "Android",

"model": "SGN002",

"actions": "Action"

},

{

"id": "003",

"label": "iPhone 6",

"status": "Compliant",

"platform": "iOS",

"model": "AIP003",

"actions": "Action"

}

]

}

]


Best Regards,


---------- Forwarded message ----------
From: Grainier Perera <grain...@wso2.com>
Date: Tue, Mar 29, 2016 at 11:59 AM
Subject: Re: API Requirements for IoT Snapshot Dashboard
To: WSO2 Developers' List <dev@wso2.org>, Sriskandarajah Suhothayan <
s...@wso2.com>, Dilan Udara Ariyaratne <dil...@wso2.com>, Prabath
Abeysekera <praba...@wso2.com>, Sumedha Rubasinghe <sume...@wso2.com>


Hi all,
As per offline discussion, following are the finalized request-response
structures for IoT snapshot dashboard API;

1. Retrieve security concerns for the given filters.

>
> *Request: *POST /securityConcerns
> *[*
>     {
>         "*filteringContext*":"connectivityStatus",
>         "*filteringGroups*":*[*"active"*]*
>     },
>     {
>         "filteringContext":"alerts",
>         "filteringGroups":["high"]
>     }
> *]*
>
> *Response:**[*
>     {
>         "*context*": "securityConcerns",
>         "*data*": *[*
>             {
>                 "*group*": "non-compliant",
>                 "*label*": "Non Compliant",
>                 "*count*": 5
>             },
>             {
>                 "group": "no-passcode",
>                 "label": "No Passcode",
>                 "count": 18
>             },
>             {
>                 "group": "no-encryption",
>                 "label": "Non encrypted",
>                 "count": 23
>             },
>             {
>                 "group": "unmonitored",
>                 "label": "Unmonitored",
>                 "count": 12
>             }
>         *]*
>     }
> *]*


2. Retrieve all devices.

>
> *Request:*POST /devices
> *[]*
>
> *Response:**[*
>     {
>         "*context*": "devices",
>         "*data*": *[*
>             {
>                 "*id*": "001",
>                 "*label*": "Nexus P",
>                 "*status*": "Blocked",
>                 "*platform*": "Android",
>                 "*model*": "HNP001",
>                 "*actions*": URL,
>             },
>             {
>                 "id": "002",
>                 "label": "iPad Mini",
>                 "status": "Inactive",
>                 "platform": "iOS",
>                 "model": "IPM005",
>                 "actions": URL,
>             }
>         *]*
>     }
> *]*


3. Retrieve devices count for the given filters.

>
> *Request:*POST /devicesCount
> *[*
>     {
>         "*filteringContext*":"connectivityStatus",
>         "*filteringGroups*":*[*"active"*]*
>     },
>     {
>         "filteringContext":"alerts",
>         "filteringGroups":["high"]
>     }
> *]*
>
> *Response:**[*
>     {
>         "*context*": "deviceCount",
>         "*data*": *[*
>             {
>                 "*group*": "totalCount",
>                 "*label*": "Total Count",
>                 "*count*": 210
>             },
>             {
>                 "group": "filteredCount",
>                 "label": "Filtered Count",
>                 "count": 57
>             }
>        * ]*
>     }
> *]*


Regards,

On Fri, Mar 11, 2016 at 2:02 PM, Grainier Perera <grain...@wso2.com> wrote:

> Hi all,
>
> I'm in the process of implementing the first phase of IoT Snapshot
> Dashboard. So far I have managed to create generic bar (both vertical &
> horizontal), stack charts (with inter gadget communication) and a LeafletJS
> based OSM map gadget to be used with the IoT Snapshot Dashboard.
>
> However, there ain't any API to get required data to populate gadgets. [1]
> describes the API requirements for the IoT Snapshot Dashboard. Furthermore,
> as per offline discussion had with DilanA, we decided to use following
> request/response structure and implement the required APIs.
>
> WDYT?
>
> i.e. : all security concerns for the given filters.
> *Request:*
>
>> POST /iot-analytics/securityConcerns
>> {
>> "filters": [
>>         {
>>             "filter": "platform",
>> "selections" : ["Android", "iOS"]
>>         },
>>         {
>>             "filter": "ownership",
>> "selections" : ["BYOD"]
>>         }
>>     ],
>> }
>
>
> *Response:*
>
>> {
>> "status": "success",
>> "message": null,
>>   "data": {
>>     [
>>        {
>>                "filter_id":"non-compliant",
>>                "name":"Non Compliant Devices",
>>                "count":12
>>        },
>>        {
>>                "filter_id":"unmonitored",
>>                "name":"Unmonitored Devices",
>>                "count":15
>>        }
>> ]
>>   },
>> }
>
>
>
> [1]
> https://docs.google.com/a/wso2.com/spreadsheets/d/1EjGCgMvo8Hgi8HQC9AjHxKVdfYYYMwwQ9Rxugk7lwIE/edit?usp=sharing
>
> Regards,
> --
> Grainier Perera
> Software Engineer
> Mobile : +94716122384
> WSO2 Inc. | http://wso2.com
> lean.enterprise.middleware
>



-- 
Grainier Perera
Software Engineer
Mobile : +94716122384
WSO2 Inc. | http://wso2.com
lean.enterprise.middleware




-- 
*Ramindu De Silva*
Software Engineer
WSO2 Inc.: http://wso2.com
lean.enterprise.middleware

email: ramin...@wso2.com <sanj...@wso2.com>
mob: +94 772339350
mob: +94 782731766
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to