innologix 0.0.38 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/innologix/device.rb +17 -13
- data/lib/innologix/sla_group.rb +1 -1
- data/lib/innologix/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6080f596212711704051279683ff05caad540139
|
4
|
+
data.tar.gz: da4655326aca61aa3870d05624215d6fd676073a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11445213cbbcc39f66c3b75a09ea363e967572813b02a22f2a066492bed4046807caaf2cb5b67db9b43d63d53cd80c3093e8c93520a0a9320635bc3a023f0b84
|
7
|
+
data.tar.gz: fba863ae757849b6c065857f274ea628b4fedc4cf81abca89e93246a1e3d4cd605a197705a34bcfecafeaae9d8bff555fc065d988ff69fa5a34ae80dd1df99b9
|
data/lib/innologix/device.rb
CHANGED
@@ -8,6 +8,7 @@ module Innologix
|
|
8
8
|
attr_accessor :fwd_proto
|
9
9
|
attr_accessor :status
|
10
10
|
attr_accessor :device_type_id
|
11
|
+
attr_accessor :sla_group_id
|
11
12
|
attr_accessor :m2m_id
|
12
13
|
attr_accessor :logs
|
13
14
|
attr_accessor :timestamp
|
@@ -31,10 +32,10 @@ module Innologix
|
|
31
32
|
def list(offset = 0, limit = 10, params = {})
|
32
33
|
path = '/devices'
|
33
34
|
method = 'get'
|
34
|
-
options = {query_params: {offset: offset, limit: limit}.merge(params)}
|
35
|
+
options = { query_params: { offset: offset, limit: limit }.merge(params) }
|
35
36
|
result = client.call_api(path, method, options)
|
36
37
|
if result[:error].nil?
|
37
|
-
list =[]
|
38
|
+
list = []
|
38
39
|
result[:devices].each do |device|
|
39
40
|
list.push(from_hash(device))
|
40
41
|
end
|
@@ -55,9 +56,9 @@ module Innologix
|
|
55
56
|
def list_devices(offset = 0, limit = 10, params = {})
|
56
57
|
path = '/devices/list'
|
57
58
|
method = 'get'
|
58
|
-
options = {query_params: {offset: offset, limit: limit}.merge(params)}
|
59
|
+
options = { query_params: { offset: offset, limit: limit }.merge(params) }
|
59
60
|
result = client.call_api(path, method, options)
|
60
|
-
list =[]
|
61
|
+
list = []
|
61
62
|
if result[:error].nil?
|
62
63
|
result[:devices].each do |device|
|
63
64
|
list.push(from_hash(device))
|
@@ -89,7 +90,7 @@ module Innologix
|
|
89
90
|
def statistic_minutes(from_time, to_time, arrange, supervisor_id = 0)
|
90
91
|
path = '/devices/statistic_minutes'
|
91
92
|
method = 'get'
|
92
|
-
options = {query_params: {from_time: from_time, to_time: to_time, arrange: arrange, supervisor_id: supervisor_id}}
|
93
|
+
options = { query_params: { from_time: from_time, to_time: to_time, arrange: arrange, supervisor_id: supervisor_id } }
|
93
94
|
result = client.call_api(path, method, options)
|
94
95
|
if result[:error] == 0
|
95
96
|
list = []
|
@@ -119,9 +120,10 @@ module Innologix
|
|
119
120
|
def create
|
120
121
|
path = '/devices'
|
121
122
|
method = 'post'
|
122
|
-
form_params = {name: name, address: address, device_type_id: device_type_id,
|
123
|
-
|
124
|
-
|
123
|
+
form_params = { name: name, address: address, device_type_id: device_type_id,
|
124
|
+
sla_group_id: sla_group_id, fwd_proto: fwd_proto, m2m_id: m2m_id,
|
125
|
+
mac_address: mac_address, interval: interval }
|
126
|
+
options = { form_params: { device: form_params } }
|
125
127
|
result = client.call_api(path, method, options)
|
126
128
|
if result[:error].nil?
|
127
129
|
from_hash(result)
|
@@ -134,7 +136,7 @@ module Innologix
|
|
134
136
|
path = '/devices/' + id.to_s + '/enable'
|
135
137
|
method = 'patch'
|
136
138
|
form_params = {}
|
137
|
-
options = {form_params: {device: form_params}}
|
139
|
+
options = { form_params: { device: form_params } }
|
138
140
|
result = client.call_api(path, method, options)
|
139
141
|
if result[:error].nil?
|
140
142
|
from_hash(result)
|
@@ -147,7 +149,7 @@ module Innologix
|
|
147
149
|
path = '/devices/' + id.to_s + '/disable'
|
148
150
|
method = 'patch'
|
149
151
|
form_params = {}
|
150
|
-
options = {form_params: {device: form_params}}
|
152
|
+
options = { form_params: { device: form_params } }
|
151
153
|
result = client.call_api(path, method, options)
|
152
154
|
if result[:error].nil?
|
153
155
|
from_hash(result)
|
@@ -159,9 +161,10 @@ module Innologix
|
|
159
161
|
def update
|
160
162
|
path = '/devices/' + id.to_s
|
161
163
|
method = 'put'
|
162
|
-
form_params = {name: name, address: address, device_type_id: device_type_id,
|
163
|
-
|
164
|
-
|
164
|
+
form_params = { name: name, address: address, device_type_id: device_type_id,
|
165
|
+
sla_group_id: sla_group_id, fwd_proto: fwd_proto, m2m_id: m2m_id,
|
166
|
+
mac_address: mac_address, interval: interval }
|
167
|
+
options = { form_params: { device: form_params } }
|
165
168
|
result = client.call_api(path, method, options)
|
166
169
|
if result[:error].nil?
|
167
170
|
from_hash(result)
|
@@ -191,6 +194,7 @@ module Innologix
|
|
191
194
|
device.fwd_proto = attributes[:fwd_proto]
|
192
195
|
device.status = attributes[:status]
|
193
196
|
device.device_type_id = attributes[:device_type_id]
|
197
|
+
device.sla_group_id = attributes[:sla_group_id]
|
194
198
|
device.m2m_id = attributes[:m2m_id]
|
195
199
|
device.logs = attributes[:logs].nil? ? nil : attributes[:logs]
|
196
200
|
device.timestamp = attributes[:timestamp].nil? ? nil : attributes[:timestamp]
|
data/lib/innologix/sla_group.rb
CHANGED
data/lib/innologix/version.rb
CHANGED