zapix3 0.2.1 → 0.2.2

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: f2fffb337b51edca784d4aec806ba3f911654ba9
4
- data.tar.gz: 87e614dc3aab2af906a300deb31a336a815290d9
3
+ metadata.gz: 4e83c4140f098e4ef1f92a91bc0a8384f034c33b
4
+ data.tar.gz: d1c8ed83755afb2526214cc4d6e54126ebd5b696
5
5
  SHA512:
6
- metadata.gz: cf03f4da8144ab5cb409708fd6c1b9e5b1df8027a5336583f95e796e12293d25e0c6d538c48ed9c5f66ed042d29130a906584fb5b29f50d020868de8cdfab2c8
7
- data.tar.gz: f8550712e4806b67899f4d1d1c815a2c54654ffa7eb4aec103d3d83f97848de596dac1612703e6d5811521dfbff304e6e8c6e30e88cc9816514f87615d633ede
6
+ metadata.gz: 7fc85708f4ba6231efc574c91996cf2ae8980435d90fe613a234d0b18bdb5a83b436441b8dde22c9de5653fa3eae1ec3bd38082ec1ac02543c46746349363925
7
+ data.tar.gz: a2477b737f6dbdff67b182cbc2432cb6ac003b5fc618ea490df13d7a5e93e5685da68236678e875e1c679cef8f724abdf52b5bbff938867ce94e824ead8399ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zapix3 (0.2.1)
4
+ zapix3 (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,18 @@
1
+ require_relative 'base'
2
+
3
+ class Graphs < Base
4
+ def get_all_graph_ids_for(options)
5
+ graphs_with_names_and_ids = []
6
+ graphs = client.graph_get(options)
7
+
8
+ graphs.each do |g|
9
+ graphs_with_names_and_ids <<
10
+ {
11
+ 'name' => g['name'],
12
+ 'id' => g['graphid']
13
+ }
14
+ end
15
+
16
+ graphs_with_names_and_ids
17
+ end
18
+ end
@@ -9,6 +9,10 @@ class Hosts < Base
9
9
  end
10
10
  end
11
11
 
12
+ def get_hosts_for_hostgroup(group_id)
13
+ client.host_get({'groupids' => [group_id]})
14
+ end
15
+
12
16
  def create(options={})
13
17
  client.host_create(options) unless exists?(options["host"])
14
18
  end
@@ -0,0 +1,11 @@
1
+ require_relative 'base'
2
+
3
+ class ScreenItems < Base
4
+ def create(options)
5
+ client.screenitem_create(options)
6
+ end
7
+
8
+ def delete(*screen_items_ids)
9
+ client.screenitem_delete(screen_items_ids)
10
+ end
11
+ end
@@ -0,0 +1,28 @@
1
+ require_relative 'base'
2
+
3
+ class Screens < Base
4
+ def get_id(options)
5
+ result = client.screen_get({
6
+ 'filter' => {'name' => options['name']}
7
+ })
8
+
9
+ result.first['screenid']
10
+ end
11
+
12
+ def create(options)
13
+ client.screen_create(options) unless exists?(options)
14
+ end
15
+
16
+ def delete(*screen_ids)
17
+ client.screen_delete(screen_ids)
18
+ end
19
+
20
+ def exists?(options)
21
+ result = client.screen_get({'filter' => {'name' => options['name']}})
22
+ if (result == nil || result.empty?)
23
+ false
24
+ else
25
+ true
26
+ end
27
+ end
28
+ end
data/lib/zapix/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zapix
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/zapix.rb CHANGED
@@ -58,4 +58,16 @@ class ZabbixAPI
58
58
  @users ||= Users.new(client)
59
59
  end
60
60
 
61
+ def screens
62
+ @screens ||= Screens.new(client)
63
+ end
64
+
65
+ def screenitems
66
+ @screenitems ||= ScreenItems.new(client)
67
+ end
68
+
69
+ def graphs
70
+ @graphs ||= Graphs.new(client)
71
+ end
72
+
61
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zapix3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - stoyan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-08 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,11 +97,14 @@ files:
97
97
  - lib/zapix/proxies/actions.rb
98
98
  - lib/zapix/proxies/applications.rb
99
99
  - lib/zapix/proxies/base.rb
100
+ - lib/zapix/proxies/graphs.rb
100
101
  - lib/zapix/proxies/hostgroups.rb
101
102
  - lib/zapix/proxies/hostinterfaces.rb
102
103
  - lib/zapix/proxies/hosts.rb
103
104
  - lib/zapix/proxies/proxies.rb
104
105
  - lib/zapix/proxies/scenarios.rb
106
+ - lib/zapix/proxies/screenitems.rb
107
+ - lib/zapix/proxies/screens.rb
105
108
  - lib/zapix/proxies/templates.rb
106
109
  - lib/zapix/proxies/triggers.rb
107
110
  - lib/zapix/proxies/usergroups.rb