bosh_cli 1.2785.0 → 1.2786.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ require 'multi_json'
2
+
1
3
  module Bosh::Cli::Client
2
4
  class ErrandsClient
3
5
  class ErrandResult
@@ -25,9 +27,10 @@ module Bosh::Cli::Client
25
27
  @director = director
26
28
  end
27
29
 
28
- def run_errand(deployment_name, errand_name)
30
+ def run_errand(deployment_name, errand_name, keep_alive)
29
31
  url = "/deployments/#{deployment_name}/errands/#{errand_name}/runs"
30
- options = { content_type: 'application/json', payload: '{}' }
32
+ payload = MultiJson.encode({'keep-alive' => (keep_alive || FALSE)})
33
+ options = { content_type: 'application/json', payload: payload }
31
34
 
32
35
  status, task_id = @director.request_and_track(:post, url, options)
33
36
 
@@ -24,6 +24,7 @@ module Bosh::Cli::Command
24
24
  desc 'Run specified errand'
25
25
  option '--download-logs', 'download logs'
26
26
  option '--logs-dir destination_directory', String, 'logs download directory'
27
+ option '--keep-alive', 'prevent deletion/creation of vm after running errand'
27
28
  def run_errand(errand_name=nil)
28
29
  auth_required
29
30
  deployment_required
@@ -40,7 +41,7 @@ module Bosh::Cli::Command
40
41
  deployment_name = prepare_deployment_manifest['name']
41
42
 
42
43
  errands_client = Bosh::Cli::Client::ErrandsClient.new(director)
43
- status, task_id, errand_result = errands_client.run_errand(deployment_name, errand_name)
44
+ status, task_id, errand_result = errands_client.run_errand(deployment_name, errand_name, options[:keep_alive] || FALSE)
44
45
 
45
46
  unless errand_result
46
47
  task_report(status, task_id, nil, "Errand `#{errand_name}' did not complete")
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Cli
3
- VERSION = '1.2785.0'
3
+ VERSION = '1.2786.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2785.0
4
+ version: 1.2786.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-08 00:00:00.000000000 Z
12
+ date: 2014-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bosh_common
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2785.0
21
+ version: 1.2786.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2785.0
29
+ version: 1.2786.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bosh-template
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 1.2785.0
37
+ version: 1.2786.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 1.2785.0
45
+ version: 1.2786.0
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: json_pure
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ dependencies:
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: 1.2785.0
133
+ version: 1.2786.0
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  requirements:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: 1.2785.0
141
+ version: 1.2786.0
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: net-ssh
144
144
  requirement: !ruby/object:Gem::Requirement
@@ -221,7 +221,7 @@ dependencies:
221
221
  version: 0.5.4
222
222
  description: ! 'BOSH CLI
223
223
 
224
- 30caeb'
224
+ 48a194'
225
225
  email: support@cloudfoundry.com
226
226
  executables:
227
227
  - bosh
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  version: '0'
345
345
  segments:
346
346
  - 0
347
- hash: -2784303786598487727
347
+ hash: -1064382594146933703
348
348
  requirements: []
349
349
  rubyforge_project:
350
350
  rubygems_version: 1.8.23