bosh_cli 1.2754.0 → 1.2765.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: cc7f9861eca72a12c8eb131107b0483040a87c9c
4
- data.tar.gz: 9a5460703219b885cf9067183ca7d23ec0dd27a2
3
+ metadata.gz: d626a4e2a9ad9f7034527d7f8273c4f3f98c719e
4
+ data.tar.gz: 22d3ce83edbc686e86eb24d600a41fd50328f1a2
5
5
  SHA512:
6
- metadata.gz: 6c563411a781a2ed642b132547639148c2719b0b8c36bd3c28d8d748b3ebf8e40ea75b2797fdade189d95d68c71a83a71ae89feac3fe6bb10ad8bc6276cf95aa
7
- data.tar.gz: 0039bd37b311f0b35b1222ba3e738bbecfb83e26964fdd725722deb5023d3d85757dce1d65da08a6f2739912d9dc8b8b84d1b4463f8ffeeb20717bb0191b5862
6
+ metadata.gz: 39d04edc6573e7ae7e4c8357f57b1eb098abf8d2002fb38fe1577ea2274f7a7601753dd60e36ceeae93ffbabc46c4c0cf31cfb121296c5c86e77f6f4e8f4fa39
7
+ data.tar.gz: 78a334ced86c9a15133d19c0726fa4bb2f303012421088dff4c0343fce5318fbab5491341644418868495074caca92ae268ca2be480a443459d47d13c64506ba
@@ -162,13 +162,7 @@ module Bosh
162
162
  options = options.dup
163
163
  options[:content_type] = 'application/x-compressed'
164
164
 
165
- upload_and_track(:post, '/releases', filename, options)
166
- end
167
-
168
- def rebase_release(filename, options = {})
169
- options = options.dup
170
- options[:content_type] = 'application/x-compressed'
171
- upload_and_track(:post, '/releases?rebase=true', filename, options)
165
+ upload_and_track(:post, releases_path(options), filename, options)
172
166
  end
173
167
 
174
168
  def upload_remote_release(release_location, options = {})
@@ -177,16 +171,7 @@ module Bosh
177
171
  options[:payload] = JSON.generate(payload)
178
172
  options[:content_type] = 'application/json'
179
173
 
180
- request_and_track(:post, '/releases', options)
181
- end
182
-
183
- def rebase_remote_release(release_location, options = {})
184
- options = options.dup
185
- payload = { 'location' => release_location }
186
- options[:payload] = JSON.generate(payload)
187
- options[:content_type] = 'application/json'
188
-
189
- request_and_track(:post, '/releases?rebase=true', options)
174
+ request_and_track(:post, releases_path(options), options)
190
175
  end
191
176
 
192
177
  def delete_stemcell(name, version, options = {})
@@ -599,6 +584,13 @@ module Bosh
599
584
  @director_name ||= get_status['name']
600
585
  end
601
586
 
587
+ def releases_path(options = {})
588
+ path = '/releases'
589
+ params = [:rebase, :skip_if_exists].select { |p| options[p] }.map { |p| "#{p}=true" }
590
+ path << "?#{params.join('&')}" unless params.empty?
591
+ path
592
+ end
593
+
602
594
  def request(method, uri, content_type = nil, payload = nil, headers = {}, options = {})
603
595
  headers = headers.dup
604
596
  headers['Content-Type'] = content_type if content_type
@@ -131,26 +131,31 @@ module Bosh::Cli::Command
131
131
 
132
132
  if rebase
133
133
  say("Uploading release (#{'will be rebased'.make_yellow})")
134
- status, task_id = director.rebase_release(tarball_path)
135
- task_report(status, task_id, 'Release rebased')
134
+ report = 'Release rebased'
136
135
  else
137
136
  say("\nUploading release\n")
138
- status, task_id = director.upload_release(tarball_path)
139
- task_report(status, task_id, 'Release uploaded')
137
+ report = 'Release uploaded'
140
138
  end
139
+ status, task_id = director.upload_release(tarball_path, rebase: rebase)
140
+ task_report(status, task_id, report)
141
141
  end
142
142
 
143
143
  def upload_remote_release(release_location, upload_options = {})
144
144
  nl
145
145
  if upload_options[:rebase]
146
146
  say("Using remote release `#{release_location}' (#{'will be rebased'.make_yellow})")
147
- status, task_id = director.rebase_remote_release(release_location)
148
- task_report(status, task_id, 'Release rebased')
147
+ report = 'Release rebased'
149
148
  else
150
149
  say("Using remote release `#{release_location}'")
151
- status, task_id = director.upload_remote_release(release_location)
152
- task_report(status, task_id, 'Release uploaded')
150
+ report = 'Release uploaded'
153
151
  end
152
+
153
+ status, task_id = director.upload_remote_release(
154
+ release_location,
155
+ rebase: upload_options[:rebase],
156
+ skip_if_exists: upload_options[:skip_if_exists],
157
+ )
158
+ task_report(status, task_id, report)
154
159
  end
155
160
 
156
161
  # if we aren't already in a release directory, try going up two levels
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Cli
3
- VERSION = '1.2754.0'
3
+ VERSION = '1.2765.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2754.0
4
+ version: 1.2765.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bosh_common
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2754.0
19
+ version: 1.2765.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2754.0
26
+ version: 1.2765.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bosh-template
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2754.0
33
+ version: 1.2765.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2754.0
40
+ version: 1.2765.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json_pure
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2754.0
117
+ version: 1.2765.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.2754.0
124
+ version: 1.2765.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: net-ssh
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +194,7 @@ dependencies:
194
194
  version: 0.5.4
195
195
  description: |-
196
196
  BOSH CLI
197
- 9fe2b2
197
+ ae0a5a
198
198
  email: support@cloudfoundry.com
199
199
  executables:
200
200
  - bosh