salt-api 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: fe9a4ef81da864ac063adcf8395bcd525bf668ae
4
- data.tar.gz: 2fd665f9c80083d03cce40a6956b2cccc031bc0d
3
+ metadata.gz: 5d8892e47d7abc4f6fe3cc2f678d529b0b7fc9e7
4
+ data.tar.gz: a76bd159fc18d9926ed41e6a56ea727cac8e46ba
5
5
  SHA512:
6
- metadata.gz: 37670e0c4712b16f7ee1fc04fb8d8500d6d762e10e591a6562e08ea2c91837f4861a3026ae6e1c8e20661d65243f8efab5ba8e88a7248f6bf8cbb0df9fa05e3e
7
- data.tar.gz: 382de37d0717b03f5374a7546d9e4da7967038aa0fd8bf806f8fc732d31008c9d70ec2f2e86a90eb530b7892d388125a76d640756df7a08722e92cf5743d8a17
6
+ metadata.gz: b2418887df3567df3aca147c505ca3ed89d51f318b82df7bf1bcf4d5e7836bc2f3c45422fd3e777a11b604574075f5a8018dd2ca355979a0268925d844f8ff45
7
+ data.tar.gz: 626056c9e74cd60e984e73f87504ca208b931e142be9e2fd9cc77114de142012db868c256790dcb7ce8c566026e46d9ac5c700110050d6f2057b7d76626e225a
@@ -4,6 +4,7 @@ require "salt/api/client"
4
4
  require "salt/api/minions"
5
5
  require "salt/api/events"
6
6
  require "salt/api/run"
7
+ require "salt/api/jobs"
7
8
 
8
9
  module Salt
9
10
  module Api
@@ -12,5 +13,6 @@ module Salt
12
13
  extend Minions
13
14
  extend Events
14
15
  extend Run
16
+ extend Jobs
15
17
  end
16
18
  end
@@ -0,0 +1,15 @@
1
+ module Salt
2
+ module Api
3
+ module Jobs
4
+ def jobs(jid = nil)
5
+ req = Net::HTTP::Get.new(jid.nil? ? "/jobs" : "/jobs/#{jid}")
6
+ req['X-Auth-Token'] = token
7
+ req['Accept'] = "application/x-yaml"
8
+ resp = client.request(req)
9
+ raise "Get request to /jobs failed (#{resp})" unless resp.kind_of? Net::HTTPSuccess
10
+ parsed_resp = YAML.load(resp.body)["return"]
11
+ return parsed_resp
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Salt
2
2
  module Api
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salt-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua B. Bussdieker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-12 00:00:00.000000000 Z
11
+ date: 2016-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,6 +86,7 @@ files:
86
86
  - lib/salt/api/client.rb
87
87
  - lib/salt/api/configure.rb
88
88
  - lib/salt/api/events.rb
89
+ - lib/salt/api/jobs.rb
89
90
  - lib/salt/api/minions.rb
90
91
  - lib/salt/api/run.rb
91
92
  - lib/salt/api/version.rb
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  version: '0'
111
112
  requirements: []
112
113
  rubyforge_project:
113
- rubygems_version: 2.4.5.1
114
+ rubygems_version: 2.5.1
114
115
  signing_key:
115
116
  specification_version: 4
116
117
  summary: Simple gem for communicating with a salt server.