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 +4 -4
- data/lib/salt/api.rb +2 -0
- data/lib/salt/api/jobs.rb +15 -0
- data/lib/salt/api/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d8892e47d7abc4f6fe3cc2f678d529b0b7fc9e7
|
4
|
+
data.tar.gz: a76bd159fc18d9926ed41e6a56ea727cac8e46ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2418887df3567df3aca147c505ca3ed89d51f318b82df7bf1bcf4d5e7836bc2f3c45422fd3e777a11b604574075f5a8018dd2ca355979a0268925d844f8ff45
|
7
|
+
data.tar.gz: 626056c9e74cd60e984e73f87504ca208b931e142be9e2fd9cc77114de142012db868c256790dcb7ce8c566026e46d9ac5c700110050d6f2057b7d76626e225a
|
data/lib/salt/api.rb
CHANGED
@@ -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
|
data/lib/salt/api/version.rb
CHANGED
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
|
+
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-
|
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.
|
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.
|