zabbix-api-simple 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ee04fbcddf2af8a4e328d2dc3abe8981de5b78d6f63b9e313d2cfcb65c518b9
4
- data.tar.gz: eadcb24c4cc7811826cc71a2556fb5fc3e386243a035d9f5d60b420aacbb6c18
3
+ metadata.gz: fc07e3c44b9f77ae8ca40da089d206bdcdb176e03fac49184cafbe41f2bc613a
4
+ data.tar.gz: b05b2fa3bd4d1622c5dd5d079c022555bacd6264ca20a51cb843a628856a4a25
5
5
  SHA512:
6
- metadata.gz: 78049b7b55d4a4bdf9815a07e40ef8f8dc25af30fe1e10b79f5c57657f15d5b05f369d6a3eb58cce2b9be71394f1f4ec3346bbaafe4a67bff01f28c425e1accb
7
- data.tar.gz: 89aa2bd1dc6a83e8634d064c2e32a9f980556fefe5e2301342f38b19757540be42a40489dd9ad699b9ba59d4d059ee3b8241e0927b949e149420f2c37b1d7d87
6
+ metadata.gz: d7e0fb56182ff8ff578c2ee37689a013ef56a105b1ddfe8729321f43e29a55be9f57eb7b586f79d0f508826d78a7c0256fd20a61b0cb907a4b65488c1f5514c8
7
+ data.tar.gz: 226e82097a386288806dbe3a7f7b03dc53bc22f26cfa435f72b9f833381f2017f41d124be21a77a6f35a6dc0baab0bc294230355dbb821f90ad032dbbaedc8c2
@@ -1,5 +1,6 @@
1
1
  module Zabbix
2
2
  module Api
3
+ UsernameChangeVersion = "6.4.0"
3
4
 
4
5
  require 'faraday'
5
6
  require 'faraday/net_http'
@@ -139,7 +140,12 @@ module Zabbix
139
140
  # both :user and :pass are required. This method calls user.logic
140
141
  # abd stores the returned auth token for future calls to the api
141
142
  def login(user: nil,pass: nil)
142
- res =post(method: 'user.login', params: {user: user, password:pass}, auth:nil)
143
+ version = call('apiinfo.version',{}).result
144
+ if version < UsernameChangeVersion
145
+ res =post(method: 'user.login', params: {user: user, password:pass}, auth:nil)
146
+ else
147
+ res =post(method: 'user.login', params: {username: user, password:pass}, auth:nil)
148
+ end
143
149
  @token = res.body['result']
144
150
  OpenStruct.new(res.body)
145
151
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Zabbix
4
4
  module Api
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix-api-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Parker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-20 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.4.1
161
+ rubygems_version: 3.4.10
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Zabbix API wrapper