bits_service_client 2.0.0.pre.1 → 2.0.1.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bits_service_client/resource_pool.rb +16 -9
- data/lib/bits_service_client/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0df9c486bd6f1057d9c710d8f0d9e058fac0f3b
|
|
4
|
+
data.tar.gz: 897fe68dcd77b63c26e43f8f793b567c40f8484b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70c6a2dd2d73f591bbbd73876efdae68ea933e2da1e77fc3da7ca1ee7c36a15b82749d9efa7ac850465c355b345164bf228ab4686053c8a0cd898d3f73f7527c
|
|
7
|
+
data.tar.gz: e802d5af22bc59697bf7399d254c9b3c28b6e6e21d4bab32ec56506b9d3d6fec5c0341513073a0ed3d9bae24ef310acfcbc12ae8f9833f52a0891b061b15feac
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module BitsService
|
|
3
4
|
class ResourcePool
|
|
4
5
|
def initialize(endpoint:, request_timeout_in_seconds:, vcap_request_id: '', ca_cert_path: nil)
|
|
@@ -16,13 +17,19 @@ module BitsService
|
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def bundles(resources_json, entries_path)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if entries_path.to_s == ''
|
|
21
|
+
post('/app_stash/bundles', resources_json, @vcap_request_id).tap do |response|
|
|
22
|
+
validate_response_code!(200, response)
|
|
23
|
+
end
|
|
24
|
+
else
|
|
25
|
+
validate_file! entries_path
|
|
26
|
+
body = {
|
|
27
|
+
resources: UploadIO.new(StringIO.new(resources_json), 'application/json', 'resources.json'),
|
|
28
|
+
application: UploadIO.new(entries_path, 'application/octet-stream', 'entries.zip')
|
|
29
|
+
}
|
|
30
|
+
multipart_post('/app_stash/bundles', body, @vcap_request_id).tap do |response|
|
|
31
|
+
validate_response_code!(200, response)
|
|
32
|
+
end
|
|
26
33
|
end
|
|
27
34
|
end
|
|
28
35
|
|
|
@@ -67,7 +74,7 @@ module BitsService
|
|
|
67
74
|
path: request.path,
|
|
68
75
|
address: http_client.address,
|
|
69
76
|
port: http_client.port,
|
|
70
|
-
vcap_request_id: vcap_request_id
|
|
77
|
+
vcap_request_id: vcap_request_id
|
|
71
78
|
})
|
|
72
79
|
|
|
73
80
|
request.add_field('X-VCAP-REQUEST-ID', vcap_request_id)
|
|
@@ -75,7 +82,7 @@ module BitsService
|
|
|
75
82
|
http_client.request(request).tap do |response|
|
|
76
83
|
@logger.info('Response', {
|
|
77
84
|
code: response.code,
|
|
78
|
-
vcap_request_id: vcap_request_id
|
|
85
|
+
vcap_request_id: vcap_request_id
|
|
79
86
|
})
|
|
80
87
|
end
|
|
81
88
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bits_service_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1.pre.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rizwan Reza
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2018-05-
|
|
14
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: activesupport
|