Difference between revisions of "EIS RESTfulAPI ProcWSNData"

From ESS-WIKI
Jump to: navigation, search
Line 1: Line 1:
= RESTful API Rule for WSNManage = WSNManage Service: User could control Advantech's Wireless Sensor Network Modules by WSNManage service group.&lt;\br&gt; Root path of WSNManage Service URL: http://Server:port/restapi/WSNManage There are two major category: 1. Connectivity 2. SenHub == Connectivity == '''URI: WSNManage/Connectivity''' Description:Capability of Connectivity ( The capability of wireless connectivity interfaces in gateway. ex: DustLink(6lowpan), zigbee, ble...) { "IoTGW": { "WSN": { "WSN0": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":",","asm":"r"}, &nbsp; {"n":"Neighbor","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":80,"asm":"r"}, &nbsp; {"n":"Name","sv":"WSN0","asm":"r"}, &nbsp; {"n":"sw","sv":"1.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000852CF4B7B0E8", "ver":1 &nbsp; }, &nbsp; "WSN1": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":"","asm":"r"}, &nbsp; {"n":"Neighbor","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":50,"asm":"r"}, &nbsp; {"n":"Name","sv":"WSN1","asm":"r"}, &nbsp; {"n":"sw","sv":"1.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000852CF4B7B0E7", &nbsp; "ver":1 &nbsp; }, &nbsp; "bn":"WSN" &nbsp; }, &nbsp; "Bt": { &nbsp; "Bt0": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":90,"asm":"r"}, &nbsp; {"n":"Name","sv":"Bt0","asm":"r"}, &nbsp; {"n":"sw","sv":"3.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000802CF4B7B028", &nbsp; "ver":1 &nbsp; }, &nbsp; "bn":"Bt" &nbsp; }, &nbsp; "ver": 1, "bn":"IoTGW" } } = Event Trigger by WebSockt = events:[ {"event":"eConnectivity_Capability"}, // => Update Connectivity Capability ( Without data ) {"event":"eConnectivity_UpdateData"}, // => Update Connectivity's Data {"event":"eSenHub_Connected"}, // => A new SenHub connected {"event":"eSenHub_Disconnect"}, // => A SenHub is disconnected {"event":"eSenHub_Capability"}, // => Update a SenHub's Capability ( Without Data ) {"event":"eSenHub_UpdateData"}] // => Update SenHub's Data == Updtae Connectivity Capability == '''Event Type:'''&nbsp;eConnectivity_Capability { "IoTGW": { "WSN": { "WSN0": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":",","asm":"r"}, &nbsp; {"n":"Neighbor","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":80,"asm":"r"}, &nbsp; {"n":"Name","sv":"WSN0","asm":"r"}, &nbsp; {"n":"sw","sv":"1.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000852CF4B7B0E8", "ver":1 &nbsp; }, &nbsp; "WSN1": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":"","asm":"r"}, &nbsp; {"n":"Neighbor","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":50,"asm":"r"}, &nbsp; {"n":"Name","sv":"WSN1","asm":"r"}, &nbsp; {"n":"sw","sv":"1.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000852CF4B7B0E7", &nbsp; "ver":1 &nbsp; }, &nbsp; "bn":"WSN" &nbsp; }, &nbsp; "Bt": { &nbsp; "Bt0": { &nbsp; "Info": { &nbsp; "e": [{"n":"SenHubList","sv":"","asm":"r"}, &nbsp; {"n":"Health","v":90,"asm":"r"}, &nbsp; {"n":"Name","sv":"Bt0","asm":"r"}, &nbsp; {"n":"sw","sv":"3.0.0.1","asm":"r"}, &nbsp; {"n":"reset","bv":0,"asm":"rw"}], &nbsp; "bn":"Info" &nbsp; }, &nbsp; "bn":"0000802CF4B7B028", &nbsp; "ver":1 &nbsp; }, &nbsp; "bn":"Bt" &nbsp; }, &nbsp; "ver": 1, "bn":"IoTGW" } }<!--\br-->
+
= RESTful API Path Rule for WSNManage =
 +
 
 +
== Connectivity ==
 +
 
 +
'''Path: WSNManage/Connectivity'''
 +
 
 +
-> All Capability ( without data )
 +
 
 +
{
 +
  "IoTGW": {
 +
          "WSN": {  
 +
              "WSN0": {  
 +
&nbsp;                 "Info": {  
 +
&nbsp;                           "e": [{"n":"SenHubList","sv":",","asm":"r"},
 +
&nbsp;                                 {"n":"Neighbor","sv":"","asm":"r"},
 +
&nbsp;                                 {"n":"Health","v":80,"asm":"r"},
 +
&nbsp;                                 {"n":"Name","sv":"WSN0","asm":"r"},
 +
&nbsp;                                 {"n":"sw","sv":"1.0.0.1","asm":"r"},
 +
&nbsp;                                 {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                 "bn":"Info"  
 +
&nbsp;                 },  
 +
&nbsp;             "bn":"0000852CF4B7B0E8", "ver":1  
 +
&nbsp;           },  
 +
&nbsp;           "WSN1": {  
 +
&nbsp;                 "Info": {  
 +
&nbsp;                         "e": [{"n":"SenHubList","sv":"","asm":"r"},  
 +
&nbsp;                               {"n":"Neighbor","sv":"","asm":"r"},  
 +
&nbsp;                               {"n":"Health","v":50,"asm":"r"},  
 +
&nbsp;                               {"n":"Name","sv":"WSN1","asm":"r"},  
 +
&nbsp;                               {"n":"sw","sv":"1.0.0.1","asm":"r"},  
 +
&nbsp;                               {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                 "bn":"Info"  
 +
&nbsp;                 },  
 +
&nbsp;           "bn":"0000852CF4B7B0E7",  
 +
&nbsp;           "ver":1  
 +
&nbsp;           },  
 +
&nbsp;       "bn":"WSN"  
 +
&nbsp;     },  
 +
&nbsp;     "Bt": {  
 +
&nbsp;           "Bt0": {  
 +
&nbsp;                   "Info": {  
 +
&nbsp;                           "e": [{"n":"SenHubList","sv":"","asm":"r"},  
 +
&nbsp;                                 {"n":"Health","v":90,"asm":"r"},  
 +
&nbsp;                                 {"n":"Name","sv":"Bt0","asm":"r"},  
 +
&nbsp;                                 {"n":"sw","sv":"3.0.0.1","asm":"r"},  
 +
&nbsp;                                 {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                   "bn":"Info"  
 +
&nbsp;                   },  
 +
&nbsp;             "bn":"0000802CF4B7B028",  
 +
&nbsp;             "ver":1  
 +
&nbsp;             },  
 +
&nbsp;       "bn":"Bt"  
 +
&nbsp;       },  
 +
&nbsp;   "ver": 1,
 +
      "bn":"IoTGW"
 +
    }
 +
  }
 +
 
 +
= Event Trigger by WebSockt =
 +
 
 +
events:[
 +
      {"event":"eConnectivity_Capability"}, // => Update Connectivity Capability ( Without data )
 +
      {"event":"eConnectivity_UpdateData"}, // => Update Connectivity's Data
 +
      {"event":"eSenHub_Connected"},       // => A new SenHub connected
 +
      {"event":"eSenHub_Disconnect"},       // => A SenHub is disconnected
 +
      {"event":"eSenHub_Capability"},       // => Update a SenHub's Capability ( Without Data )
 +
      {"event":"eSenHub_UpdateData"}]       // => Update SenHub's Data
 +
 
 +
 
 +
 
 +
== Updtae Connectivity Capability ==
 +
 
 +
'''Event Type:'''&nbsp;eConnectivity_Capability
 +
 
 +
{
 +
  "IoTGW": {
 +
          "WSN": {  
 +
              "WSN0": {  
 +
&nbsp;                 "Info": {  
 +
&nbsp;                           "e": [{"n":"SenHubList","sv":",","asm":"r"},
 +
&nbsp;                                 {"n":"Neighbor","sv":"","asm":"r"},
 +
&nbsp;                                 {"n":"Health","v":80,"asm":"r"},
 +
&nbsp;                                 {"n":"Name","sv":"WSN0","asm":"r"},
 +
&nbsp;                                 {"n":"sw","sv":"1.0.0.1","asm":"r"},
 +
&nbsp;                                 {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                 "bn":"Info"  
 +
&nbsp;                 },  
 +
&nbsp;             "bn":"0000852CF4B7B0E8", "ver":1  
 +
&nbsp;           },  
 +
&nbsp;           "WSN1": {  
 +
&nbsp;                 "Info": {  
 +
&nbsp;                         "e": [{"n":"SenHubList","sv":"","asm":"r"},  
 +
&nbsp;                               {"n":"Neighbor","sv":"","asm":"r"},  
 +
&nbsp;                               {"n":"Health","v":50,"asm":"r"},  
 +
&nbsp;                               {"n":"Name","sv":"WSN1","asm":"r"},  
 +
&nbsp;                               {"n":"sw","sv":"1.0.0.1","asm":"r"},  
 +
&nbsp;                               {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                 "bn":"Info"  
 +
&nbsp;                 },  
 +
&nbsp;           "bn":"0000852CF4B7B0E7",  
 +
&nbsp;           "ver":1  
 +
&nbsp;           },  
 +
&nbsp;       "bn":"WSN"  
 +
&nbsp;     },  
 +
&nbsp;     "Bt": {  
 +
&nbsp;           "Bt0": {  
 +
&nbsp;                   "Info": {  
 +
&nbsp;                           "e": [{"n":"SenHubList","sv":"","asm":"r"},  
 +
&nbsp;                                 {"n":"Health","v":90,"asm":"r"},  
 +
&nbsp;                                 {"n":"Name","sv":"Bt0","asm":"r"},  
 +
&nbsp;                                 {"n":"sw","sv":"3.0.0.1","asm":"r"},  
 +
&nbsp;                                 {"n":"reset","bv":0,"asm":"rw"}],  
 +
&nbsp;                   "bn":"Info"  
 +
&nbsp;                   },  
 +
&nbsp;             "bn":"0000802CF4B7B028",  
 +
&nbsp;             "ver":1  
 +
&nbsp;             },  
 +
&nbsp;       "bn":"Bt"  
 +
&nbsp;       },  
 +
&nbsp;   "ver": 1,
 +
      "bn":"IoTGW"
 +
    }
 +
  }

Revision as of 02:25, 7 November 2016

RESTful API Path Rule for WSNManage

Connectivity

Path: WSNManage/Connectivity

-> All Capability ( without data )

{
 "IoTGW": {
          "WSN": { 
             "WSN0": { 
                  "Info": { 
                            "e": [{"n":"SenHubList","sv":",","asm":"r"},
                                  {"n":"Neighbor","sv":"","asm":"r"},
                                  {"n":"Health","v":80,"asm":"r"},
                                  {"n":"Name","sv":"WSN0","asm":"r"},
                                  {"n":"sw","sv":"1.0.0.1","asm":"r"},
                                  {"n":"reset","bv":0,"asm":"rw"}], 
                  "bn":"Info" 
                  }, 
              "bn":"0000852CF4B7B0E8", "ver":1 
            }, 
            "WSN1": { 
                  "Info": { 
                           "e": [{"n":"SenHubList","sv":"","asm":"r"}, 
                                 {"n":"Neighbor","sv":"","asm":"r"}, 
                                 {"n":"Health","v":50,"asm":"r"}, 
                                 {"n":"Name","sv":"WSN1","asm":"r"}, 
                                 {"n":"sw","sv":"1.0.0.1","asm":"r"}, 
                                 {"n":"reset","bv":0,"asm":"rw"}], 
                   "bn":"Info" 
                   }, 
            "bn":"0000852CF4B7B0E7", 
            "ver":1 
            }, 
         "bn":"WSN" 
       }, 
       "Bt": { 
             "Bt0": { 
                    "Info": { 
                             "e": [{"n":"SenHubList","sv":"","asm":"r"}, 
                                   {"n":"Health","v":90,"asm":"r"}, 
                                   {"n":"Name","sv":"Bt0","asm":"r"}, 
                                   {"n":"sw","sv":"3.0.0.1","asm":"r"}, 
                                   {"n":"reset","bv":0,"asm":"rw"}], 
                    "bn":"Info" 
                    }, 
               "bn":"0000802CF4B7B028", 
               "ver":1 
               }, 
         "bn":"Bt" 
        },   
     "ver": 1,
     "bn":"IoTGW"
    }
 }

Event Trigger by WebSockt

events:[
     {"event":"eConnectivity_Capability"}, // => Update Connectivity Capability ( Without data )
     {"event":"eConnectivity_UpdateData"}, // => Update Connectivity's Data
     {"event":"eSenHub_Connected"},        // => A new SenHub connected
     {"event":"eSenHub_Disconnect"},       // => A SenHub is disconnected
     {"event":"eSenHub_Capability"},       // => Update a SenHub's Capability ( Without Data )
     {"event":"eSenHub_UpdateData"}]       // => Update SenHub's Data


Updtae Connectivity Capability

Event Type: eConnectivity_Capability

{
 "IoTGW": {
          "WSN": { 
             "WSN0": { 
                  "Info": { 
                            "e": [{"n":"SenHubList","sv":",","asm":"r"},
                                  {"n":"Neighbor","sv":"","asm":"r"},
                                  {"n":"Health","v":80,"asm":"r"},
                                  {"n":"Name","sv":"WSN0","asm":"r"},
                                  {"n":"sw","sv":"1.0.0.1","asm":"r"},
                                  {"n":"reset","bv":0,"asm":"rw"}], 
                  "bn":"Info" 
                  }, 
              "bn":"0000852CF4B7B0E8", "ver":1 
            }, 
            "WSN1": { 
                  "Info": { 
                           "e": [{"n":"SenHubList","sv":"","asm":"r"}, 
                                 {"n":"Neighbor","sv":"","asm":"r"}, 
                                 {"n":"Health","v":50,"asm":"r"}, 
                                 {"n":"Name","sv":"WSN1","asm":"r"}, 
                                 {"n":"sw","sv":"1.0.0.1","asm":"r"}, 
                                 {"n":"reset","bv":0,"asm":"rw"}], 
                   "bn":"Info" 
                   }, 
            "bn":"0000852CF4B7B0E7", 
            "ver":1 
            }, 
         "bn":"WSN" 
       }, 
       "Bt": { 
             "Bt0": { 
                    "Info": { 
                             "e": [{"n":"SenHubList","sv":"","asm":"r"}, 
                                   {"n":"Health","v":90,"asm":"r"}, 
                                   {"n":"Name","sv":"Bt0","asm":"r"}, 
                                   {"n":"sw","sv":"3.0.0.1","asm":"r"}, 
                                   {"n":"reset","bv":0,"asm":"rw"}], 
                    "bn":"Info" 
                    }, 
               "bn":"0000802CF4B7B028", 
               "ver":1 
               }, 
         "bn":"Bt" 
        },   
     "ver": 1,
     "bn":"IoTGW"
    }
 }