innologix 0.0.34 → 0.0.35

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: 14307ae771fa6a03cfd5072d7f56dfe3478d991a
4
- data.tar.gz: 53ffefa04b4a9aa51fb51d92851f0feece68328e
3
+ metadata.gz: e50f242e6b7b3434f6343b7ab955698e60d0831e
4
+ data.tar.gz: 4a5a1344cc1f52750985450592f2eb49aba70cbd
5
5
  SHA512:
6
- metadata.gz: 62f040b7dd6ef0dd2484dc6273444a6e30b31065698adeab0609683b6dcb09050af3d4a3108288f80a22da84e019e58140f72b39b91215655b9b00a1acec62e2
7
- data.tar.gz: a9449ab04362e36cfaea3dcfcebc9a39775dca44847358e5e7bd726ab87d3503a3c617a8f3de56384afb48b4b11e870b23c9d42b91180a168dfb4c6e3fe3a720
6
+ metadata.gz: fd283db44bcc8585269fba7c1342a67bf27993f3fdbf2ed15478cfc0980a00b6db44e122c9e4a41c354e3798d1cb38919928f73329bef683d93509dcd3533cc6
7
+ data.tar.gz: 23fec0e0f54e459ea77ed9768b9f90d185bf3d5af15b569e7b072f1462a1e70b70e44350663559806efd1cd6f5a0b294ac39131658cc1ceab17130266f534ea9
@@ -0,0 +1,97 @@
1
+ module Innologix
2
+ class SlaGroup
3
+ attr_accessor :id
4
+ attr_accessor :name
5
+ attr_accessor :time_frames
6
+ attr_accessor :created_at
7
+ attr_accessor :updated_at
8
+
9
+ attr_accessor :client
10
+ attr_accessor :error
11
+
12
+ def initialize(h = {})
13
+ h.each { |k, v| public_send("#{k}=", v) }
14
+ @client = Client.default
15
+ end
16
+
17
+ def list(offset = 0, limit = 10)
18
+ path = '/sla_groups'
19
+ method = 'get'
20
+ options = {query_params: {offset: offset, limit: limit}}
21
+ result = client.call_api(path, method, options)
22
+ if result[:error].nil?
23
+ list =[]
24
+ result[:sla_groups].each do |sla_group|
25
+ list.push(from_hash(sla_group))
26
+ end
27
+ meta = OpenStruct.new
28
+ meta.offset = result[:meta][:offset]
29
+ meta.limit = result[:meta][:limit]
30
+ meta.total = result[:meta][:total]
31
+
32
+ result = OpenStruct.new
33
+ result.sla_groups = list
34
+ result.meta = meta
35
+ result
36
+ else
37
+ RequestError.new(result)
38
+ end
39
+ end
40
+
41
+ def get(id)
42
+ path = '/sla_groups/' + id.to_s
43
+ method = 'get'
44
+ result = client.call_api(path, method)
45
+ if result[:error].nil?
46
+ from_hash(result)
47
+ else
48
+ RequestError.new(result)
49
+ end
50
+ end
51
+
52
+ def create
53
+ path = '/sla_groups'
54
+ method = 'post'
55
+ options = {form_params: {sla_group: {name: name, time_frames: time_frames}}}
56
+ result = client.call_api(path, method, options)
57
+ if result[:error].nil?
58
+ from_hash(result)
59
+ else
60
+ RequestError.new(result)
61
+ end
62
+ end
63
+
64
+ def update
65
+ path = '/sla_groups/' + id.to_s
66
+ method = 'put'
67
+ options = {form_params: {sla_group: {name: name, time_frames: time_frames}}}
68
+ result = client.call_api(path, method, options)
69
+ if result[:error].nil?
70
+ from_hash(result)
71
+ else
72
+ RequestError.new(result)
73
+ end
74
+ end
75
+
76
+ def delete
77
+ path = '/sla_groups/' + id.to_s
78
+ method = 'delete'
79
+ result = client.call_api(path, method)
80
+ if result[:error].nil?
81
+ from_hash(result)
82
+ else
83
+ RequestError.new(result)
84
+ end
85
+ end
86
+
87
+ def from_hash(attributes)
88
+ sla_group = Innologix::DeviceType.new
89
+ sla_group.id = attributes[:id]
90
+ sla_group.name = attributes[:name]
91
+ sla_group.time_frames = attributes[:time_frames]
92
+ sla_group.created_at = attributes[:created_at]
93
+ sla_group.updated_at = attributes[:updated_at]
94
+ sla_group
95
+ end
96
+ end
97
+ end
@@ -1,3 +1,3 @@
1
1
  module Innologix
2
- VERSION = "0.0.34"
2
+ VERSION = "0.0.35"
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.34
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - SkyLab Innogram
@@ -55,6 +55,7 @@ files:
55
55
  - lib/innologix/logger.rb
56
56
  - lib/innologix/m2m.rb
57
57
  - lib/innologix/request_error.rb
58
+ - lib/innologix/sla_group.rb
58
59
  - lib/innologix/storage.rb
59
60
  - lib/innologix/supervisor.rb
60
61
  - lib/innologix/user.rb
@@ -79,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
80
  version: '0'
80
81
  requirements: []
81
82
  rubyforge_project:
82
- rubygems_version: 2.6.7
83
+ rubygems_version: 2.6.13
83
84
  signing_key:
84
85
  specification_version: 4
85
86
  summary: Innologix SDK for Ruby