zabbixapi 0.5.0a → 0.5.0b
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -3
- data/lib/zabbixapi/usergroups.rb +1 -1
- data/lib/zabbixapi/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -217,17 +217,18 @@ zbx.screens.get_or_create_for_host(
|
|
217
217
|
)
|
218
218
|
```
|
219
219
|
|
220
|
-
### Create UserGroup, add user and
|
220
|
+
### Create UserGroup, add user and set permission ###
|
221
221
|
```ruby
|
222
222
|
zbx.usergroups.get_or_create(:name => "Some user group")
|
223
223
|
zbx.usergroups.add_user(
|
224
224
|
:usrgrpids => [zbx.usergroups.get_id(:name => "Some user group")],
|
225
225
|
:userids => [zbx.users.get_id(:name => "Some user")]
|
226
226
|
)
|
227
|
-
#
|
227
|
+
# set write and read permissions for UserGroup on all hostgroups
|
228
228
|
zbx.usergroups.set_perm_read(
|
229
229
|
:usrgrpid => zbx.usergroups.get_or_create(:name => "Some user group"),
|
230
|
-
:hostgroupids => zbx.hostgroups.all.values
|
230
|
+
:hostgroupids => zbx.hostgroups.all.values,
|
231
|
+
:permission => 3 # 2- read (by default) and 3 - write and read
|
231
232
|
)
|
232
233
|
```
|
233
234
|
|
data/lib/zabbixapi/usergroups.rb
CHANGED
@@ -98,7 +98,7 @@ class ZabbixApi
|
|
98
98
|
result = @client.api_request(
|
99
99
|
:method => "usergroup.massAdd",
|
100
100
|
:params => {
|
101
|
-
:usrgrpids => [data[:
|
101
|
+
:usrgrpids => [data[:usrgrpid]],
|
102
102
|
:rights => data[:hostgroupids].map { |t| {:permission => permission, :id => t} }
|
103
103
|
}
|
104
104
|
)
|
data/lib/zabbixapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbixapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.0b
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -58,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
58
|
version: '0'
|
59
59
|
segments:
|
60
60
|
- 0
|
61
|
-
hash:
|
61
|
+
hash: 3354477705725061225
|
62
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|