icinga_api 0.0.2 → 0.0.3

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: 84c8bb0c765f60c62c33e0e2cedc9f9449912b7b
4
- data.tar.gz: 596f3cc6a51a549e9991e3b6ea85c286110e1afa
3
+ metadata.gz: db65239b18017d516c94d9557964cd7d05deb9fc
4
+ data.tar.gz: 83566207d187452e28f7b0fa2a675a71cbd31b70
5
5
  SHA512:
6
- metadata.gz: 7e49d4662d655f75385c06b36348d57fed7356f11bea6eae611afd19ed4d556f0523efdd3ad7bc66edc70ab9f5ee657cd9e7bf1d2dd916c863b0deb98b8bebb2
7
- data.tar.gz: fd5b161c887b7e0f83c6ff6cb1db3b59d690599db5c7330315f91fbf691d464f42f75248aca65e015509ca3410326a856faa8e1ecad0e6634c057e82717d3988
6
+ metadata.gz: c52d9d352a987f591fadc951ddc638608b7d9a4b1888f3b3903c485781b1415b547f1ad193da305673353578f497be4deab472d7a24c0b29d738fc8397973473
7
+ data.tar.gz: 0f66f89e8c1254abb2e3d8ea0ae645d6531c6121af820ff0889c6fad8db485bb901eafc0f217a2df7ac0fcbc01ee015a992781f65d006a375d0a21bea58eaca1
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  require 'json'
3
2
  require 'uri'
4
3
  require 'net/http'
@@ -15,7 +14,6 @@ class IcingaApi
15
14
 
16
15
  def initialize(options = {})
17
16
  @data = options
18
- @data[:url] += '/web/api/json'
19
17
  end
20
18
 
21
19
 
@@ -31,7 +31,8 @@ class IcingaApi
31
31
  end
32
32
 
33
33
  # post data
34
- uri = URI(@connection.data[:url])
34
+ url = @connection.data[:url]
35
+ uri = URI("#{url}/web/api/authkey=#{data[:authkey]}/json")
35
36
  res = Net::HTTP.post_form(uri, data)
36
37
  raise "error on API query" unless res.code.to_i == 200
37
38
  JSON.parse(res.body, { symbolize_names: true })
@@ -1,3 +1,3 @@
1
1
  class IcingaApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icinga_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lothar Handl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-29 00:00:00.000000000 Z
11
+ date: 2014-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ipaddress