|
16 | 16 | #print res1.content |
17 | 17 |
|
18 | 18 | # 更新设备 |
19 | | - #device_id = ********** |
| 19 | + #device_id = ****** |
20 | 20 | #title = "test_abs" |
21 | 21 | #private = 'true' |
22 | 22 | #res2 = test.device_update(device_id = device_id, title = title, private = private) |
|
33 | 33 | #print res4.content |
34 | 34 |
|
35 | 35 | # 添加数据流 |
36 | | - #device_id = ******** |
| 36 | + #device_id = ******* |
37 | 37 | #res1 = test.datastream_add(device_id = device_id, datastream_id = 'test1') |
38 | 38 | #print res1.content |
39 | 39 |
|
40 | 40 | # 更新数据流 |
41 | | - #device_id = ********* |
| 41 | + #device_id = ****** |
42 | 42 | #res2 = test.datastream_update(device_id = device_id, datastream_id = 'test1',datastream = {"tags":["test1","test2"], "unit":"Celsius"}) |
43 | 43 | #print res2.content |
44 | 44 |
|
45 | 45 | # 删除数据流 |
46 | | - #device_id = ********* |
| 46 | + #device_id = ****** |
47 | 47 | #res3 = test.datastream_del(device_id = device_id, datastream_id = 'test1') |
48 | 48 | #print res3.content |
49 | 49 |
|
50 | 50 | # 增加触发器 |
51 | | - #device_id = ******* |
| 51 | + #device_id = ****** |
52 | 52 | #trigger = {"ds_id": "test1", "url": "http://xx.bb.com", "type":">=", "threshold":100} |
53 | 53 | #res1 = test.trigger_add(trigger = trigger) |
54 | 54 | #print res1.content |
55 | 55 |
|
56 | 56 | # 更新触发器 |
57 | | - #trigger_id = ****** |
| 57 | + #trigger_id = ***** |
58 | 58 | #trigger = {"ds_id":"test1","title":"wen du jian kong", "url":"http://cc.bb.com", "type":"<", "threshold":60} |
59 | 59 | #res2 = test.trigger_update(trigger_id = trigger_id, trigger = trigger) |
60 | 60 | #print res2.content |
61 | 61 |
|
62 | 62 | # 删除触发器 |
| 63 | + #trigger_id = ***** |
| 64 | + #res3 = test.trigger_del(trigger_id = trigger_id) |
| 65 | + #print res3.content |
63 | 66 |
|
64 | 67 | # 查看触发器 |
65 | | - title = "wen du jian kong" |
66 | | - page = 1 |
67 | | - per_page = 10 |
68 | | - res4 = test.trigger_list(title = title, page = page, per_page = 10) |
69 | | - print res4.content |
| 68 | + #title = "wen du jian kong" |
| 69 | + #page = 1 |
| 70 | + #per_page = 10 |
| 71 | + #res4 = test.trigger_list(title = title, page = page, per_page = 10) |
| 72 | + #print res4.content |
70 | 73 |
|
| 74 | + ######### 数据点操作 ############ |
71 | 75 | # 添加数据 |
72 | | - #device_id = ******* |
| 76 | + #device_id = ****** |
73 | 77 | #无名参数要放在keyword前面 |
74 | 78 | #res1 = test.datapoint_add(device_id, 'temperature', 70) |
75 | 79 | #print res1.content |
|
86 | 90 | #res3 = test.datapoint_multi_get(device_id = device_id, start_time = start_time, end_time = end_time, limit = limit, datastream_ids = datastream_ids) |
87 | 91 | #print res3.content |
88 | 92 |
|
| 93 | + ############# API操作 ############## |
| 94 | + title = "sharing key" |
| 95 | + dev_id = "*******" #这里是字符串 |
| 96 | + res1 = test.api_add(dev_id = dev_id, title = title) |
| 97 | + print res1.content |
| 98 | + |
0 commit comments