docker-api 1.22.1 → 1.22.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3741e7b8ad90ccdb8b121bd3fba475590f912883
4
- data.tar.gz: c4757dec47c50c5707ed4a6b233fc76812cd1e6a
3
+ metadata.gz: 00a29c0d7edf86aa4cd2151577d4c5f3b002785b
4
+ data.tar.gz: a9115de52579200e4d19fc8e1d9a93c146b4858c
5
5
  SHA512:
6
- metadata.gz: b1bcf172852abe75d9b6567d2d645b8da514dd99311dd6e6e228942218ea269cf1577b661a6a7651295ab5ceee40acbe4ab00ea96a95b039fbd11604fd196ea7
7
- data.tar.gz: 95f62fcf3fed065b8be232fad7513db5e4b64c1dba805db219428539973cd0b185e4f43c082b76ae39349c33d026489f145d1462e605389cc2eee96ed9a3f601
6
+ metadata.gz: 6da587c476e55b3701fc866be5a7b00994e5d1b1a3e29180e1c2410a33adccd47ec7a989a2c0495dc0e555cf41305e0b5b6871e22aacbc2ed3dc74212215ffec
7
+ data.tar.gz: 40cd1ee57aced873ac4ff3e6c7e1356eef2802d368d3822c2aed2aa511a5b8647b3d6446415ab524dd21485986be66e15383916a20d423ec341ebce10e1c4406
@@ -1,3 +1,4 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 1.9.2
@@ -43,6 +43,7 @@ class Docker::Container
43
43
  # Establish values
44
44
  tty = opts.delete(:tty) || false
45
45
  detach = opts.delete(:detach) || false
46
+ user = opts.delete(:user)
46
47
  stdin = opts.delete(:stdin)
47
48
  stdout = opts.delete(:stdout) || !detach
48
49
  stderr = opts.delete(:stderr) || !detach
@@ -50,6 +51,7 @@ class Docker::Container
50
51
  # Create Exec Instance
51
52
  instance = Docker::Exec.create(
52
53
  'Container' => self.id,
54
+ 'User' => user,
53
55
  'AttachStdin' => !!stdin,
54
56
  'AttachStdout' => stdout,
55
57
  'AttachStderr' => stderr,
@@ -147,8 +149,9 @@ class Docker::Container
147
149
 
148
150
  def streaming_logs(opts = {}, &block)
149
151
  stack_size = opts.delete('stack_size') || -1
152
+ tty = opts.delete('tty') || opts.delete(:tty) || false
150
153
  msgs = Docker::MessagesStack.new(stack_size)
151
- excon_params = {response_block: Docker::Util.attach_for_multiplex(block, msgs)}
154
+ excon_params = {response_block: Docker::Util.attach_for(block, msgs, tty)}
152
155
 
153
156
  connection.get(path_for(:logs), opts, excon_params)
154
157
  msgs.messages.join
@@ -43,6 +43,15 @@ class Docker::Messages
43
43
  @stdout_messages += messages.stdout_messages
44
44
  @stderr_messages += messages.stderr_messages
45
45
  @all_messages += messages.all_messages
46
+ messages.clear
47
+
48
+ @all_messages
49
+ end
50
+
51
+ def clear
52
+ stdout_messages.clear
53
+ stderr_messages.clear
54
+ all_messages.clear
46
55
  end
47
56
 
48
57
  # Method to break apart application/vnd.docker.raw-stream headers
@@ -20,9 +20,12 @@ module Docker::Util
20
20
  end
21
21
 
22
22
  def attach_for_tty(block, msg_stack)
23
- return lambda do |c,r,t|
24
- msg_stack.stdout_messages << c
25
- msg_stack.all_messages << c
23
+ messages = Docker::Messages.new
24
+ lambda do |c,r,t|
25
+ messages.stdout_messages << c
26
+ messages.all_messages << c
27
+ msg_stack.append(messages)
28
+
26
29
  block.call c if block
27
30
  end
28
31
  end
@@ -31,7 +34,6 @@ module Docker::Util
31
34
  messages = Docker::Messages.new
32
35
  lambda do |c,r,t|
33
36
  messages = messages.decipher_messages(c)
34
- msg_stack.append(messages)
35
37
 
36
38
  unless block.nil?
37
39
  messages.stdout_messages.each do |msg|
@@ -41,6 +43,8 @@ module Docker::Util
41
43
  block.call(:stderr, msg)
42
44
  end
43
45
  end
46
+
47
+ msg_stack.append(messages)
44
48
  end
45
49
  end
46
50
 
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.22.1'
3
+ VERSION = '1.22.2'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.16'
@@ -37,23 +37,48 @@ describe Docker::Container do
37
37
  end
38
38
 
39
39
  describe '#streaming_logs' do
40
- subject {
41
- described_class.create('Cmd' => "echo hello", 'Image' => 'debian:wheezy')
42
- }
40
+ let(:options) { {} }
41
+ subject do
42
+ described_class.create(
43
+ {'Cmd' => ['/bin/bash', '-lc', 'echo hello'], 'Image' => 'debian:wheezy'}.merge(options)
44
+ )
45
+ end
46
+
47
+ before(:each) { subject.tap(&:start).wait }
43
48
  after(:each) { subject.remove }
44
49
 
45
- context "when not selecting any stream" do
46
- let(:non_destination) { subject.logs }
50
+ context 'when not selecting any stream' do
51
+ let(:non_destination) { subject.streaming_logs }
47
52
  it 'raises a client error', :vcr do
48
53
  expect { non_destination }.to raise_error(Docker::Error::ClientError)
49
54
  end
50
55
  end
51
56
 
52
- context "when selecting stdout" do
53
- let(:stdout) { subject.logs(stdout: 1) }
57
+ context 'when selecting stdout' do
58
+ let(:stdout) { subject.streaming_logs(stdout: 1) }
54
59
  it 'returns blank logs', :vcr do
55
60
  expect(stdout).to be_a String
56
- expect(stdout).to eq ""
61
+ expect(stdout).to eq "hello\n"
62
+ end
63
+ end
64
+
65
+ context 'when using a tty' do
66
+ let(:options) { { 'Tty' => true } }
67
+
68
+ let(:output) { subject.streaming_logs(stdout: 1, tty: 1) }
69
+ it 'returns `hello`', :vcr do
70
+ expect(output).to be_a(String)
71
+ expect(output).to eq("hello\n")
72
+ end
73
+ end
74
+
75
+ context 'when passing a block' do
76
+ let(:lines) { [] }
77
+ let(:output) { subject.streaming_logs(stdout: 1, follow: 1) { |s,c| lines << c } }
78
+ it 'returns `hello`', :vcr do
79
+ expect(output).to be_a(String)
80
+ expect(output).to eq("hello\n")
81
+ expect(lines).to eq(["hello\n"])
57
82
  end
58
83
  end
59
84
  end
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: <DOCKER_HOST>/v1.16/containers/create
5
+ uri: "<DOCKER_HOST>/v1.16/containers/create"
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Cmd":"echo hello","Image":"debian:wheezy"}'
8
+ string: '{"Cmd":["/bin/bash","-lc","echo hello"],"Image":"debian:wheezy"}'
9
9
  headers:
10
10
  User-Agent:
11
- - Swipely/Docker-API 1.18.0
11
+ - Swipely/Docker-API 1.22.0
12
12
  Content-Type:
13
13
  - application/json
14
14
  response:
@@ -19,25 +19,75 @@ http_interactions:
19
19
  Content-Type:
20
20
  - application/json
21
21
  Date:
22
- - Thu, 12 Feb 2015 00:53:24 GMT
22
+ - Mon, 27 Jul 2015 14:27:16 GMT
23
23
  Content-Length:
24
24
  - '90'
25
+ body:
26
+ encoding: UTF-8
27
+ string: |
28
+ {"Id":"645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0","Warnings":null}
29
+ http_version:
30
+ recorded_at: Mon, 27 Jul 2015 14:27:16 GMT
31
+ - request:
32
+ method: post
33
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/start"
34
+ body:
35
+ encoding: UTF-8
36
+ string: "{}"
37
+ headers:
38
+ User-Agent:
39
+ - Swipely/Docker-API 1.22.0
40
+ Content-Type:
41
+ - application/json
42
+ response:
43
+ status:
44
+ code: 204
45
+ message:
46
+ headers:
47
+ Date:
48
+ - Mon, 27 Jul 2015 14:27:17 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
54
+ - request:
55
+ method: post
56
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/wait"
25
57
  body:
26
58
  encoding: US-ASCII
27
- string: ! '{"Id":"03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75","Warnings":null}
28
-
29
- '
59
+ string: ''
60
+ headers:
61
+ User-Agent:
62
+ - Swipely/Docker-API 1.22.0
63
+ Content-Type:
64
+ - text/plain
65
+ response:
66
+ status:
67
+ code: 200
68
+ message:
69
+ headers:
70
+ Content-Type:
71
+ - application/json
72
+ Date:
73
+ - Mon, 27 Jul 2015 14:27:17 GMT
74
+ Content-Length:
75
+ - '17'
76
+ body:
77
+ encoding: UTF-8
78
+ string: |
79
+ {"StatusCode":0}
30
80
  http_version:
31
- recorded_at: Thu, 12 Feb 2015 00:53:24 GMT
81
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
32
82
  - request:
33
83
  method: get
34
- uri: <DOCKER_HOST>/v1.16/containers/03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75/logs
84
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/logs"
35
85
  body:
36
86
  encoding: US-ASCII
37
87
  string: ''
38
88
  headers:
39
89
  User-Agent:
40
- - Swipely/Docker-API 1.18.0
90
+ - Swipely/Docker-API 1.22.0
41
91
  Content-Type:
42
92
  - text/plain
43
93
  response:
@@ -48,25 +98,24 @@ http_interactions:
48
98
  Content-Type:
49
99
  - text/plain; charset=utf-8
50
100
  Date:
51
- - Thu, 12 Feb 2015 00:53:24 GMT
101
+ - Mon, 27 Jul 2015 14:27:17 GMT
52
102
  Content-Length:
53
103
  - '52'
54
104
  body:
55
- encoding: US-ASCII
56
- string: ! 'Bad parameters: you must choose at least one stream
57
-
58
- '
105
+ encoding: UTF-8
106
+ string: |
107
+ Bad parameters: you must choose at least one stream
59
108
  http_version:
60
- recorded_at: Thu, 12 Feb 2015 00:53:24 GMT
109
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
61
110
  - request:
62
111
  method: get
63
- uri: <DOCKER_HOST>/v1.16/containers/03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75/logs
112
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/logs"
64
113
  body:
65
114
  encoding: US-ASCII
66
115
  string: ''
67
116
  headers:
68
117
  User-Agent:
69
- - Swipely/Docker-API 1.18.0
118
+ - Swipely/Docker-API 1.22.0
70
119
  Content-Type:
71
120
  - text/plain
72
121
  response:
@@ -77,25 +126,24 @@ http_interactions:
77
126
  Content-Type:
78
127
  - text/plain; charset=utf-8
79
128
  Date:
80
- - Thu, 12 Feb 2015 00:53:24 GMT
129
+ - Mon, 27 Jul 2015 14:27:17 GMT
81
130
  Content-Length:
82
131
  - '52'
83
132
  body:
84
- encoding: US-ASCII
85
- string: ! 'Bad parameters: you must choose at least one stream
86
-
87
- '
133
+ encoding: UTF-8
134
+ string: |
135
+ Bad parameters: you must choose at least one stream
88
136
  http_version:
89
- recorded_at: Thu, 12 Feb 2015 00:53:24 GMT
137
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
90
138
  - request:
91
139
  method: get
92
- uri: <DOCKER_HOST>/v1.16/containers/03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75/logs
140
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/logs"
93
141
  body:
94
142
  encoding: US-ASCII
95
143
  string: ''
96
144
  headers:
97
145
  User-Agent:
98
- - Swipely/Docker-API 1.18.0
146
+ - Swipely/Docker-API 1.22.0
99
147
  Content-Type:
100
148
  - text/plain
101
149
  response:
@@ -106,25 +154,24 @@ http_interactions:
106
154
  Content-Type:
107
155
  - text/plain; charset=utf-8
108
156
  Date:
109
- - Thu, 12 Feb 2015 00:53:24 GMT
157
+ - Mon, 27 Jul 2015 14:27:17 GMT
110
158
  Content-Length:
111
159
  - '52'
112
160
  body:
113
- encoding: US-ASCII
114
- string: ! 'Bad parameters: you must choose at least one stream
115
-
116
- '
161
+ encoding: UTF-8
162
+ string: |
163
+ Bad parameters: you must choose at least one stream
117
164
  http_version:
118
- recorded_at: Thu, 12 Feb 2015 00:53:24 GMT
165
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
119
166
  - request:
120
167
  method: get
121
- uri: <DOCKER_HOST>/v1.16/containers/03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75/logs
168
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0/logs"
122
169
  body:
123
170
  encoding: US-ASCII
124
171
  string: ''
125
172
  headers:
126
173
  User-Agent:
127
- - Swipely/Docker-API 1.18.0
174
+ - Swipely/Docker-API 1.22.0
128
175
  Content-Type:
129
176
  - text/plain
130
177
  response:
@@ -135,25 +182,24 @@ http_interactions:
135
182
  Content-Type:
136
183
  - text/plain; charset=utf-8
137
184
  Date:
138
- - Thu, 12 Feb 2015 00:53:24 GMT
185
+ - Mon, 27 Jul 2015 14:27:17 GMT
139
186
  Content-Length:
140
187
  - '52'
141
188
  body:
142
- encoding: US-ASCII
143
- string: ! 'Bad parameters: you must choose at least one stream
144
-
145
- '
189
+ encoding: UTF-8
190
+ string: |
191
+ Bad parameters: you must choose at least one stream
146
192
  http_version:
147
- recorded_at: Thu, 12 Feb 2015 00:53:24 GMT
193
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
148
194
  - request:
149
195
  method: delete
150
- uri: <DOCKER_HOST>/v1.16/containers/03de1b78ad9454aeb26ec0e48637c58e756be7813aea3e3fa60a1cea3965ce75
196
+ uri: "<DOCKER_HOST>/v1.16/containers/645f643f61ac9b0bde5014c63ee2730b0acd89f689ad28305f4ca29cd9a6c8a0"
151
197
  body:
152
198
  encoding: US-ASCII
153
199
  string: ''
154
200
  headers:
155
201
  User-Agent:
156
- - Swipely/Docker-API 1.18.0
202
+ - Swipely/Docker-API 1.22.0
157
203
  Content-Type:
158
204
  - text/plain
159
205
  response:
@@ -162,10 +208,10 @@ http_interactions:
162
208
  message:
163
209
  headers:
164
210
  Date:
165
- - Thu, 12 Feb 2015 00:53:25 GMT
211
+ - Mon, 27 Jul 2015 14:27:17 GMT
166
212
  body:
167
- encoding: US-ASCII
213
+ encoding: UTF-8
168
214
  string: ''
169
215
  http_version:
170
- recorded_at: Thu, 12 Feb 2015 00:53:25 GMT
216
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
171
217
  recorded_with: VCR 2.9.2
@@ -0,0 +1,131 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: "<DOCKER_HOST>/v1.16/containers/create"
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Cmd":["/bin/bash","-lc","echo hello"],"Image":"debian:wheezy"}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.22.0
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ Content-Type:
20
+ - application/json
21
+ Date:
22
+ - Mon, 27 Jul 2015 14:29:59 GMT
23
+ Content-Length:
24
+ - '90'
25
+ body:
26
+ encoding: UTF-8
27
+ string: |
28
+ {"Id":"4e9a8ca928592a0c6ee1f123c575b6b0a8e7447861c76f40df020abf1c0852d7","Warnings":null}
29
+ http_version:
30
+ recorded_at: Mon, 27 Jul 2015 14:29:59 GMT
31
+ - request:
32
+ method: post
33
+ uri: "<DOCKER_HOST>/v1.16/containers/4e9a8ca928592a0c6ee1f123c575b6b0a8e7447861c76f40df020abf1c0852d7/start"
34
+ body:
35
+ encoding: UTF-8
36
+ string: "{}"
37
+ headers:
38
+ User-Agent:
39
+ - Swipely/Docker-API 1.22.0
40
+ Content-Type:
41
+ - application/json
42
+ response:
43
+ status:
44
+ code: 204
45
+ message:
46
+ headers:
47
+ Date:
48
+ - Mon, 27 Jul 2015 14:29:59 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 27 Jul 2015 14:29:59 GMT
54
+ - request:
55
+ method: post
56
+ uri: "<DOCKER_HOST>/v1.16/containers/4e9a8ca928592a0c6ee1f123c575b6b0a8e7447861c76f40df020abf1c0852d7/wait"
57
+ body:
58
+ encoding: US-ASCII
59
+ string: ''
60
+ headers:
61
+ User-Agent:
62
+ - Swipely/Docker-API 1.22.0
63
+ Content-Type:
64
+ - text/plain
65
+ response:
66
+ status:
67
+ code: 200
68
+ message:
69
+ headers:
70
+ Content-Type:
71
+ - application/json
72
+ Date:
73
+ - Mon, 27 Jul 2015 14:29:59 GMT
74
+ Content-Length:
75
+ - '17'
76
+ body:
77
+ encoding: UTF-8
78
+ string: |
79
+ {"StatusCode":0}
80
+ http_version:
81
+ recorded_at: Mon, 27 Jul 2015 14:29:59 GMT
82
+ - request:
83
+ method: get
84
+ uri: "<DOCKER_HOST>/v1.16/containers/4e9a8ca928592a0c6ee1f123c575b6b0a8e7447861c76f40df020abf1c0852d7/logs?follow=1&stdout=1"
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ''
88
+ headers:
89
+ User-Agent:
90
+ - Swipely/Docker-API 1.22.0
91
+ Content-Type:
92
+ - text/plain
93
+ response:
94
+ status:
95
+ code: 200
96
+ message:
97
+ headers:
98
+ Date:
99
+ - Mon, 27 Jul 2015 14:29:59 GMT
100
+ Content-Type:
101
+ - application/octet-stream
102
+ body:
103
+ encoding: UTF-8
104
+ string: !binary |-
105
+ AQAAAAAAAAZoZWxsbwo=
106
+ http_version:
107
+ recorded_at: Mon, 27 Jul 2015 14:29:59 GMT
108
+ - request:
109
+ method: delete
110
+ uri: "<DOCKER_HOST>/v1.16/containers/4e9a8ca928592a0c6ee1f123c575b6b0a8e7447861c76f40df020abf1c0852d7"
111
+ body:
112
+ encoding: US-ASCII
113
+ string: ''
114
+ headers:
115
+ User-Agent:
116
+ - Swipely/Docker-API 1.22.0
117
+ Content-Type:
118
+ - text/plain
119
+ response:
120
+ status:
121
+ code: 204
122
+ message:
123
+ headers:
124
+ Date:
125
+ - Mon, 27 Jul 2015 14:29:59 GMT
126
+ body:
127
+ encoding: UTF-8
128
+ string: ''
129
+ http_version:
130
+ recorded_at: Mon, 27 Jul 2015 14:29:59 GMT
131
+ recorded_with: VCR 2.9.2
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: <DOCKER_HOST>/v1.16/containers/create
5
+ uri: "<DOCKER_HOST>/v1.16/containers/create"
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Cmd":"echo hello","Image":"debian:wheezy"}'
8
+ string: '{"Cmd":["/bin/bash","-lc","echo hello"],"Image":"debian:wheezy"}'
9
9
  headers:
10
10
  User-Agent:
11
- - Swipely/Docker-API 1.18.0
11
+ - Swipely/Docker-API 1.22.0
12
12
  Content-Type:
13
13
  - application/json
14
14
  response:
@@ -19,25 +19,47 @@ http_interactions:
19
19
  Content-Type:
20
20
  - application/json
21
21
  Date:
22
- - Thu, 12 Feb 2015 00:53:25 GMT
22
+ - Mon, 27 Jul 2015 14:27:17 GMT
23
23
  Content-Length:
24
24
  - '90'
25
25
  body:
26
- encoding: US-ASCII
27
- string: ! '{"Id":"598c1c2c0ad657aed31bcae3a7071ef356f5ab4010cce7cf8ee5f87798acaef8","Warnings":null}
28
-
29
- '
26
+ encoding: UTF-8
27
+ string: |
28
+ {"Id":"d795fdb4a056d1f56c109ea42ae0adb3b01d49101b712515ea83a115a6aeeccf","Warnings":null}
30
29
  http_version:
31
- recorded_at: Thu, 12 Feb 2015 00:53:25 GMT
30
+ recorded_at: Mon, 27 Jul 2015 14:27:17 GMT
32
31
  - request:
33
- method: get
34
- uri: <DOCKER_HOST>/v1.16/containers/598c1c2c0ad657aed31bcae3a7071ef356f5ab4010cce7cf8ee5f87798acaef8/logs?stdout=1
32
+ method: post
33
+ uri: "<DOCKER_HOST>/v1.16/containers/d795fdb4a056d1f56c109ea42ae0adb3b01d49101b712515ea83a115a6aeeccf/start"
34
+ body:
35
+ encoding: UTF-8
36
+ string: "{}"
37
+ headers:
38
+ User-Agent:
39
+ - Swipely/Docker-API 1.22.0
40
+ Content-Type:
41
+ - application/json
42
+ response:
43
+ status:
44
+ code: 204
45
+ message:
46
+ headers:
47
+ Date:
48
+ - Mon, 27 Jul 2015 14:27:17 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
54
+ - request:
55
+ method: post
56
+ uri: "<DOCKER_HOST>/v1.16/containers/d795fdb4a056d1f56c109ea42ae0adb3b01d49101b712515ea83a115a6aeeccf/wait"
35
57
  body:
36
58
  encoding: US-ASCII
37
59
  string: ''
38
60
  headers:
39
61
  User-Agent:
40
- - Swipely/Docker-API 1.18.0
62
+ - Swipely/Docker-API 1.22.0
41
63
  Content-Type:
42
64
  - text/plain
43
65
  response:
@@ -45,26 +67,53 @@ http_interactions:
45
67
  code: 200
46
68
  message:
47
69
  headers:
70
+ Content-Type:
71
+ - application/json
48
72
  Date:
49
- - Thu, 12 Feb 2015 00:53:25 GMT
73
+ - Mon, 27 Jul 2015 14:27:18 GMT
50
74
  Content-Length:
51
- - '0'
52
- Content-Type:
53
- - text/plain; charset=utf-8
75
+ - '17'
76
+ body:
77
+ encoding: UTF-8
78
+ string: |
79
+ {"StatusCode":0}
80
+ http_version:
81
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
82
+ - request:
83
+ method: get
84
+ uri: "<DOCKER_HOST>/v1.16/containers/d795fdb4a056d1f56c109ea42ae0adb3b01d49101b712515ea83a115a6aeeccf/logs?stdout=1"
54
85
  body:
55
86
  encoding: US-ASCII
56
87
  string: ''
88
+ headers:
89
+ User-Agent:
90
+ - Swipely/Docker-API 1.22.0
91
+ Content-Type:
92
+ - text/plain
93
+ response:
94
+ status:
95
+ code: 200
96
+ message:
97
+ headers:
98
+ Date:
99
+ - Mon, 27 Jul 2015 14:27:18 GMT
100
+ Content-Type:
101
+ - application/octet-stream
102
+ body:
103
+ encoding: UTF-8
104
+ string: !binary |-
105
+ AQAAAAAAAAZoZWxsbwo=
57
106
  http_version:
58
- recorded_at: Thu, 12 Feb 2015 00:53:25 GMT
107
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
59
108
  - request:
60
109
  method: delete
61
- uri: <DOCKER_HOST>/v1.16/containers/598c1c2c0ad657aed31bcae3a7071ef356f5ab4010cce7cf8ee5f87798acaef8
110
+ uri: "<DOCKER_HOST>/v1.16/containers/d795fdb4a056d1f56c109ea42ae0adb3b01d49101b712515ea83a115a6aeeccf"
62
111
  body:
63
112
  encoding: US-ASCII
64
113
  string: ''
65
114
  headers:
66
115
  User-Agent:
67
- - Swipely/Docker-API 1.18.0
116
+ - Swipely/Docker-API 1.22.0
68
117
  Content-Type:
69
118
  - text/plain
70
119
  response:
@@ -73,10 +122,10 @@ http_interactions:
73
122
  message:
74
123
  headers:
75
124
  Date:
76
- - Thu, 12 Feb 2015 00:53:26 GMT
125
+ - Mon, 27 Jul 2015 14:27:18 GMT
77
126
  body:
78
- encoding: US-ASCII
127
+ encoding: UTF-8
79
128
  string: ''
80
129
  http_version:
81
- recorded_at: Thu, 12 Feb 2015 00:53:26 GMT
130
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
82
131
  recorded_with: VCR 2.9.2
@@ -0,0 +1,131 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: "<DOCKER_HOST>/v1.16/containers/create"
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Cmd":["/bin/bash","-lc","echo hello"],"Image":"debian:wheezy","Tty":true}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.22.0
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ Content-Type:
20
+ - application/json
21
+ Date:
22
+ - Mon, 27 Jul 2015 14:27:18 GMT
23
+ Content-Length:
24
+ - '90'
25
+ body:
26
+ encoding: UTF-8
27
+ string: |
28
+ {"Id":"45c15db165f05f898604925e81ca58566e1179be1068fde0acd30b7784a19467","Warnings":null}
29
+ http_version:
30
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
31
+ - request:
32
+ method: post
33
+ uri: "<DOCKER_HOST>/v1.16/containers/45c15db165f05f898604925e81ca58566e1179be1068fde0acd30b7784a19467/start"
34
+ body:
35
+ encoding: UTF-8
36
+ string: "{}"
37
+ headers:
38
+ User-Agent:
39
+ - Swipely/Docker-API 1.22.0
40
+ Content-Type:
41
+ - application/json
42
+ response:
43
+ status:
44
+ code: 204
45
+ message:
46
+ headers:
47
+ Date:
48
+ - Mon, 27 Jul 2015 14:27:18 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 27 Jul 2015 14:27:18 GMT
54
+ - request:
55
+ method: post
56
+ uri: "<DOCKER_HOST>/v1.16/containers/45c15db165f05f898604925e81ca58566e1179be1068fde0acd30b7784a19467/wait"
57
+ body:
58
+ encoding: US-ASCII
59
+ string: ''
60
+ headers:
61
+ User-Agent:
62
+ - Swipely/Docker-API 1.22.0
63
+ Content-Type:
64
+ - text/plain
65
+ response:
66
+ status:
67
+ code: 200
68
+ message:
69
+ headers:
70
+ Content-Type:
71
+ - application/json
72
+ Date:
73
+ - Mon, 27 Jul 2015 14:27:19 GMT
74
+ Content-Length:
75
+ - '17'
76
+ body:
77
+ encoding: UTF-8
78
+ string: |
79
+ {"StatusCode":0}
80
+ http_version:
81
+ recorded_at: Mon, 27 Jul 2015 14:27:19 GMT
82
+ - request:
83
+ method: get
84
+ uri: "<DOCKER_HOST>/v1.16/containers/45c15db165f05f898604925e81ca58566e1179be1068fde0acd30b7784a19467/logs?stdout=1"
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ''
88
+ headers:
89
+ User-Agent:
90
+ - Swipely/Docker-API 1.22.0
91
+ Content-Type:
92
+ - text/plain
93
+ response:
94
+ status:
95
+ code: 200
96
+ message:
97
+ headers:
98
+ Date:
99
+ - Mon, 27 Jul 2015 14:27:19 GMT
100
+ Content-Type:
101
+ - text/plain; charset=utf-8
102
+ body:
103
+ encoding: UTF-8
104
+ string: |
105
+ hello
106
+ http_version:
107
+ recorded_at: Mon, 27 Jul 2015 14:27:19 GMT
108
+ - request:
109
+ method: delete
110
+ uri: "<DOCKER_HOST>/v1.16/containers/45c15db165f05f898604925e81ca58566e1179be1068fde0acd30b7784a19467"
111
+ body:
112
+ encoding: US-ASCII
113
+ string: ''
114
+ headers:
115
+ User-Agent:
116
+ - Swipely/Docker-API 1.22.0
117
+ Content-Type:
118
+ - text/plain
119
+ response:
120
+ status:
121
+ code: 204
122
+ message:
123
+ headers:
124
+ Date:
125
+ - Mon, 27 Jul 2015 14:27:19 GMT
126
+ body:
127
+ encoding: UTF-8
128
+ string: ''
129
+ http_version:
130
+ recorded_at: Mon, 27 Jul 2015 14:27:19 GMT
131
+ recorded_with: VCR 2.9.2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.1
4
+ version: 1.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-27 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -246,7 +246,9 @@ files:
246
246
  - spec/vcr/Docker_Container/_start/starts_the_container.yml
247
247
  - spec/vcr/Docker_Container/_stop/stops_the_container.yml
248
248
  - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/raises_a_client_error.yml
249
+ - spec/vcr/Docker_Container/_streaming_logs/when_passing_a_block/returns_hello_.yml
249
250
  - spec/vcr/Docker_Container/_streaming_logs/when_selecting_stdout/returns_blank_logs.yml
251
+ - spec/vcr/Docker_Container/_streaming_logs/when_using_a_tty/returns_hello_.yml
250
252
  - spec/vcr/Docker_Container/_top/returns_the_top_commands_as_an_Array.yml
251
253
  - spec/vcr/Docker_Container/_unpause/unpauses_the_container.yml
252
254
  - spec/vcr/Docker_Container/_wait/waits_for_the_command_to_finish.yml
@@ -373,7 +375,9 @@ test_files:
373
375
  - spec/vcr/Docker_Container/_start/starts_the_container.yml
374
376
  - spec/vcr/Docker_Container/_stop/stops_the_container.yml
375
377
  - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/raises_a_client_error.yml
378
+ - spec/vcr/Docker_Container/_streaming_logs/when_passing_a_block/returns_hello_.yml
376
379
  - spec/vcr/Docker_Container/_streaming_logs/when_selecting_stdout/returns_blank_logs.yml
380
+ - spec/vcr/Docker_Container/_streaming_logs/when_using_a_tty/returns_hello_.yml
377
381
  - spec/vcr/Docker_Container/_top/returns_the_top_commands_as_an_Array.yml
378
382
  - spec/vcr/Docker_Container/_unpause/unpauses_the_container.yml
379
383
  - spec/vcr/Docker_Container/_wait/waits_for_the_command_to_finish.yml