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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a14e81f9ce77abbfb64a43f9ab0964aad279ea28
4
- data.tar.gz: d7ff6cea529deacc89e2a9b4379d8a7b4653076a
3
+ metadata.gz: 6080f596212711704051279683ff05caad540139
4
+ data.tar.gz: da4655326aca61aa3870d05624215d6fd676073a
5
5
  SHA512:
6
- metadata.gz: 19252d12916891a40bd1445330d8e2ba22742048549e3e194c661540b53a06dab7111f0a9fbf521e1f447f9e2939afe22d965805c8e1d6f9644fc57e65334478
7
- data.tar.gz: 7a316e3626ec19900ba8b098b8d69fc0c4058afb6e5d8b5f13c249ae41c2cadbfe11d746129fc4abc86a04b616eba3059c25a54cae0914a9a32562c986e7c1ee
6
+ metadata.gz: 11445213cbbcc39f66c3b75a09ea363e967572813b02a22f2a066492bed4046807caaf2cb5b67db9b43d63d53cd80c3093e8c93520a0a9320635bc3a023f0b84
7
+ data.tar.gz: fba863ae757849b6c065857f274ea628b4fedc4cf81abca89e93246a1e3d4cd605a197705a34bcfecafeaae9d8bff555fc065d988ff69fa5a34ae80dd1df99b9
@@ -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, fwd_proto: fwd_proto, m2m_id: m2m_id,
123
- mac_address: mac_address, interval: interval}
124
- options = {form_params: {device: form_params}}
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, fwd_proto: fwd_proto, m2m_id: m2m_id,
163
- mac_address: mac_address, interval: interval}
164
- options = {form_params: {device: form_params}}
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]
@@ -85,7 +85,7 @@ module Innologix
85
85
  end
86
86
 
87
87
  def from_hash(attributes)
88
- sla_group = Innologix::DeviceType.new
88
+ sla_group = Innologix::SlaGroup.new
89
89
  sla_group.id = attributes[:id]
90
90
  sla_group.name = attributes[:name]
91
91
  sla_group.time_frames = attributes[:time_frames]
@@ -1,3 +1,3 @@
1
1
  module Innologix
2
- VERSION = "0.0.38"
2
+ VERSION = "0.0.40"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: innologix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.38
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - SkyLab Innogram