rundeck 1.1.0 → 1.2.0

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: 9860977f63b19317c1a68c5b0dfddf1c5fbd1cac
4
- data.tar.gz: 44d38347f8a34e3d15fd8d91e5e13985eb70de50
3
+ metadata.gz: 8407e1d3de738371c732a02a0b3492210072897f
4
+ data.tar.gz: a1d4c717c9e12808fa26d5e920467cb8544eec20
5
5
  SHA512:
6
- metadata.gz: fc809b1ea5089772cbbe977e2e1d1c6bd94ee11ae0ba91fe1374928230a5bc3d7799051d3b40c00d19778ddb28e8c959a0bd7baf054440d0add400b9800cc931
7
- data.tar.gz: d645976bfed689e9edd76cd9cc2dbeb0ea63ce378b3581b25cbb86982a9c62e552eb9e1cf7e4d2d65cc8161b8277f55a345458274243feb181d2b334ef592a4d
6
+ metadata.gz: ec7942071a7fe3e2d649ec3fec6833a88156bdfb321070b2e9e08e6735b4963377e68252400f1cc82be4f3b5109a67e974342cf3a5a634c6ecd19762c6401a7d
7
+ data.tar.gz: c897177a1d8651c7776fcac531e6c660a1484d2075d01a17bd63e65c5bb66568a95f0ccf2906a3418aff784c95dcc5c7e2a8cc57a17a14d8153a38c1c4979747
@@ -18,3 +18,6 @@ Metrics/LineLength:
18
18
 
19
19
  Metrics/AbcSize:
20
20
  Enabled: false
21
+
22
+ Metrics/ModuleLength:
23
+ Enabled: false
@@ -1,3 +1,6 @@
1
+ 1.2.0 (July 6, 2015)
2
+ - Add `system_info` endpoint. Thanks to @shyam
3
+
1
4
  1.1.0 (February 9, 2015)
2
5
  - Change to multi_xml for XML parsing. Enables use of multiple parsers instead
3
6
  of forcing libxml.
data/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  [Official Website](http://dblessing.github.io/rundeck-ruby) with examples,
4
4
  documentation, and links to the RDoc technical documentation.
5
5
 
6
- **Note: Although the git repository is called 'rundeck-ruby', the gem is called 'rundeck' on Rubygems.org. There is another gem called 'rundeck-ruby' on Rubygems.org and it is not affiliated with this project.**
6
+ **Note: Although the git repository is called 'rundeck-ruby', the gem is called
7
+ 'rundeck' on Rubygems.org. There is another gem called 'rundeck-ruby' on Rubygems.org and
8
+ it is not affiliated with this project.**
7
9
 
8
10
  [![Gem Version](https://badge.fury.io/rb/rundeck.svg)](http://badge.fury.io/rb/rundeck)
9
11
  [![Build Status](https://travis-ci.org/dblessing/rundeck-ruby.svg?branch=master)](https://travis-ci.org/dblessing/rundeck-ruby)
@@ -55,6 +55,7 @@ module Rundeck
55
55
  include Job
56
56
  include Key
57
57
  include Project
58
+ include SystemInfo
58
59
  include Token
59
60
 
60
61
  # Turn a hash into an object for easy accessibility.
@@ -68,7 +68,7 @@ module Rundeck
68
68
  end
69
69
  options[:headers] = {} if options[:headers].nil?
70
70
  options[:headers].merge!(
71
- 'Content-Type' => 'application/x-www-form-urlencoded')
71
+ 'Content-Type' => 'application/x-www-form-urlencoded')
72
72
  options[:body] = "xmlBatch=#{content}"
73
73
  options[:query] = {} if options[:query].nil?
74
74
  options[:query]['format'] = format
@@ -38,10 +38,10 @@ module Rundeck
38
38
  options[:headers] = {} if options[:headers].nil?
39
39
  options[:headers] = if format == 'json'
40
40
  options[:headers].merge!(
41
- 'Content-Type' => 'application/json')
41
+ 'Content-Type' => 'application/json')
42
42
  elsif format == 'xml'
43
43
  options[:headers].merge!(
44
- 'Content-Type' => 'application/xml')
44
+ 'Content-Type' => 'application/xml')
45
45
  else
46
46
  fail Error::InvalidAttributes,
47
47
  'format must be json or xml'
@@ -0,0 +1,20 @@
1
+ module Rundeck
2
+ class Client
3
+ # Defines methods related to projects.
4
+ module SystemInfo
5
+ # Get the complete system info
6
+ #
7
+ # @see http://rundeck.org/docs/api/index.html#system-info
8
+ # Rundeck API documentation for 'GET /api/12/system/info' endpoint
9
+ #
10
+ # @example
11
+ # Rundeck.system_info
12
+ #
13
+ # @return [Rundeck::ObjectifiedHash]
14
+ # @!macro exceptions
15
+ def system_info
16
+ objectify get('/system/info')['system']
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Rundeck
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://192.168.50.2:4440/api/12/system/info
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Rundeck-Auth-Token:
11
+ - cmJQYoy9EAsSd0905yNjKDNGs0ESIwEd
12
+ Accept:
13
+ - application/xml
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Wed, 01 Apr 2015 21:09:38 GMT
21
+ Content-Type:
22
+ - text/xml;charset=UTF-8
23
+ X-Rundeck-Api-Xml-Response-Wrapper:
24
+ - 'false'
25
+ Pragma:
26
+ - no-cache
27
+ X-Rundeck-Api-Version:
28
+ - '12'
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Server:
32
+ - nginx/1.6.2
33
+ body:
34
+ encoding: UTF-8
35
+ string: |-
36
+ <system>
37
+ <timestamp epoch='1427925619090' unit='ms'>
38
+ <datetime>2015-04-01T22:00:19Z</datetime>
39
+ </timestamp>
40
+ <rundeck>
41
+ <version>2.4.2</version>
42
+ <build>2.4.2-1</build>
43
+ <node>rundeck-test</node>
44
+ <base>/var/lib/rundeck</base>
45
+ <apiversion>12</apiversion>
46
+ <serverUUID />
47
+ </rundeck>
48
+ <os>
49
+ <arch>amd64</arch>
50
+ <name>Linux</name>
51
+ <version>2.6.32-431.17.1.el6.x86_64</version>
52
+ </os>
53
+ <jvm>
54
+ <name>Java HotSpot(TM) 64-Bit Server VM</name>
55
+ <vendor>Oracle Corporation</vendor>
56
+ <version>1.7.0_76</version>
57
+ <implementationVersion>24.76-b04</implementationVersion>
58
+ </jvm>
59
+ <stats>
60
+ <uptime duration='130964380' unit='ms'>
61
+ <since epoch='1427794654710' unit='ms'>
62
+ <datetime>2015-03-31T09:37:34Z</datetime>
63
+ </since>
64
+ </uptime>
65
+ <cpu>
66
+ <loadAverage unit='percent'>0.0</loadAverage>
67
+ <processors>2</processors>
68
+ </cpu>
69
+ <memory unit='byte'>
70
+ <max>954728448</max>
71
+ <free>187146352</free>
72
+ <total>498073600</total>
73
+ </memory>
74
+ <scheduler>
75
+ <running>0</running>
76
+ </scheduler>
77
+ <threads>
78
+ <active>26</active>
79
+ </threads>
80
+ </stats>
81
+ <metrics href='http://192.168.50.2:4440/metrics/metrics?pretty=true' contentType='text/json' />
82
+ <threadDump href='http://192.168.50.2:4440/metrics/threads' contentType='text/plain' />
83
+ </system>
84
+ http_version:
85
+ recorded_at: Thu, 01 Apr 2015 21:09:38 GMT
86
+ recorded_with: VCR 2.9.3
@@ -31,7 +31,7 @@ describe Rundeck::Client do
31
31
 
32
32
  it 'expects a post to have been made' do
33
33
  expect(
34
- a_post('/job/2/executions?argString=-repository%20ci%20-release%20SNAPSHOT%20-packages%20app-SNAPSHOT')
34
+ a_post('/job/2/executions?argString=-repository%20ci%20-release%20SNAPSHOT%20-packages%20app-SNAPSHOT')
35
35
  ).to have_been_made
36
36
  end
37
37
  end
@@ -171,7 +171,7 @@ describe Rundeck::Client do
171
171
 
172
172
  it 'expects a get to have been made' do
173
173
  expect(
174
- a_get('/jobs/export?project=anvils&format=yaml')
174
+ a_get('/jobs/export?project=anvils&format=yaml')
175
175
  ).to have_been_made
176
176
  end
177
177
  end
@@ -186,7 +186,7 @@ describe Rundeck::Client do
186
186
 
187
187
  it 'expects a get to have been made' do
188
188
  expect(
189
- a_get('/jobs/export?project=anvils&format=xml')
189
+ a_get('/jobs/export?project=anvils&format=xml')
190
190
  ).to have_been_made
191
191
  end
192
192
  end
@@ -173,7 +173,7 @@ describe Rundeck::Client do
173
173
 
174
174
  it 'expects a post to have been made' do
175
175
  expect(
176
- a_post('/storage/keys/path/to/public_key2')
176
+ a_post('/storage/keys/path/to/public_key2')
177
177
  ).to have_been_made
178
178
  end
179
179
  end
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe Rundeck::Client do
4
+ describe '.system_info', vcr: { cassette_name: 'system_info' } do
5
+ before do
6
+ @system_info = Rundeck.system_info
7
+ end
8
+ subject { @system_info }
9
+
10
+ it 'expects a get to have been made' do
11
+ expect(a_get('/system/info')).to have_been_made
12
+ end
13
+
14
+ it { is_expected.to be_a Rundeck::ObjectifiedHash }
15
+
16
+ describe '.rundeck' do
17
+ subject { @system_info.rundeck }
18
+
19
+ its(:base) { is_expected.to eq('/var/lib/rundeck') }
20
+ end
21
+
22
+ describe '.os' do
23
+ subject { @system_info.os }
24
+
25
+ its(:arch) { is_expected.to eq('amd64') }
26
+ its(:name) { is_expected.to eq('Linux') }
27
+ end
28
+
29
+ describe '.stats' do
30
+ subject { @system_info.stats }
31
+
32
+ its('cpu.processors') { is_expected.to eq('2') }
33
+ end
34
+ end
35
+ end
@@ -95,7 +95,7 @@ describe Rundeck::Client do
95
95
 
96
96
  it 'expects a delete to have been made' do
97
97
  expect(
98
- a_delete('/token/cmJQYoy9EAsSd0905yNjKDNGs0ESIwEd')
98
+ a_delete('/token/cmJQYoy9EAsSd0905yNjKDNGs0ESIwEd')
99
99
  ).to have_been_made
100
100
  end
101
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundeck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew A. Blessing
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -217,6 +217,7 @@ files:
217
217
  - lib/rundeck/client/job.rb
218
218
  - lib/rundeck/client/key.rb
219
219
  - lib/rundeck/client/project.rb
220
+ - lib/rundeck/client/system_info.rb
220
221
  - lib/rundeck/client/token.rb
221
222
  - lib/rundeck/configuration.rb
222
223
  - lib/rundeck/error.rb
@@ -277,6 +278,7 @@ files:
277
278
  - spec/cassettes/12/running_jobs_multiple.yml
278
279
  - spec/cassettes/12/running_jobs_none.yml
279
280
  - spec/cassettes/12/running_jobs_single.yml
281
+ - spec/cassettes/12/system_info.yml
280
282
  - spec/cassettes/12/token.yml
281
283
  - spec/cassettes/12/token_invalid.yml
282
284
  - spec/cassettes/12/tokens_multiple.yml
@@ -288,6 +290,7 @@ files:
288
290
  - spec/rundeck/client/job_spec.rb
289
291
  - spec/rundeck/client/key_spec.rb
290
292
  - spec/rundeck/client/project_spec.rb
293
+ - spec/rundeck/client/system_info_spec.rb
291
294
  - spec/rundeck/client/token_spec.rb
292
295
  - spec/rundeck/client_spec.rb
293
296
  - spec/rundeck/objectified_hash_spec.rb
@@ -374,6 +377,7 @@ test_files:
374
377
  - spec/cassettes/12/running_jobs_multiple.yml
375
378
  - spec/cassettes/12/running_jobs_none.yml
376
379
  - spec/cassettes/12/running_jobs_single.yml
380
+ - spec/cassettes/12/system_info.yml
377
381
  - spec/cassettes/12/token.yml
378
382
  - spec/cassettes/12/token_invalid.yml
379
383
  - spec/cassettes/12/tokens_multiple.yml
@@ -385,6 +389,7 @@ test_files:
385
389
  - spec/rundeck/client/job_spec.rb
386
390
  - spec/rundeck/client/key_spec.rb
387
391
  - spec/rundeck/client/project_spec.rb
392
+ - spec/rundeck/client/system_info_spec.rb
388
393
  - spec/rundeck/client/token_spec.rb
389
394
  - spec/rundeck/client_spec.rb
390
395
  - spec/rundeck/objectified_hash_spec.rb