docker-api 1.13.7 → 1.14.0

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: 45f70da35419949c901a1b2b750ec2e454201be4
4
- data.tar.gz: 8da9bae0e32e3aae975e63c043678ed3e824b87f
3
+ metadata.gz: dab7caebda8a517a9660ae2c95ea440ee306f726
4
+ data.tar.gz: de34214e3e4529b93a3f0a2a5cc6d4a9361b12d8
5
5
  SHA512:
6
- metadata.gz: 081982c62e160210bf203751eb83076d4216a6dee0d89ebcf68a4c503a4d27f217052e7d0550083fa35f02a83a55e6b74d69b449149a33e6a7e0da1a99623640
7
- data.tar.gz: 36549b9513b512fd8c2d0ed4d00d5ebfb07977158e57ed6abc84e58165cdfacab6987137df2f85fe6e0da8be733914472060d3857947f81adec77af16955387f
6
+ metadata.gz: 67e1f79132a6d26c962e7df5dee773fe196c7e6416db0024500ec517563cb1403a831f7215e795c6d985efd76381388b8d9cbaa66f45ea9f55305b7b893b5add
7
+ data.tar.gz: fa18fd517d9cefaa26f5bc4342eba57e1dd27016400ee7de00cb65e2f06a2f933988157f867036890e8b36b65904d05e2365b06efdd0b45ee3fba229987ad6fd
@@ -99,6 +99,14 @@ class Docker::Container
99
99
  connection.get(path_for(:logs), opts)
100
100
  end
101
101
 
102
+ def streaming_logs(opts = {}, &block)
103
+ msgs = Docker::Messages.new
104
+ excon_params = { response_block: attach_for(block, msgs, false) }
105
+
106
+ connection.get(path_for(:logs), opts, excon_params)
107
+ msgs.all_messages.join("\n")
108
+ end
109
+
102
110
  def start!(opts = {})
103
111
  connection.post(path_for(:start), {}, :body => opts.to_json)
104
112
  self
@@ -242,6 +250,7 @@ class Docker::Container
242
250
  def attach_for_tty(block, msg_stack)
243
251
  return lambda do |c,r,t|
244
252
  msg_stack.stdout_messages << c
253
+ msg_stack.all_messages << c
245
254
  block.call c if block
246
255
  end
247
256
  end
@@ -1,11 +1,15 @@
1
1
  # This class represents all the messages either received by chunks from attach
2
2
  class Docker::Messages
3
3
 
4
- attr_accessor :buffer, :stdout_messages, :stderr_messages
4
+ attr_accessor :buffer, :stdout_messages, :stderr_messages, :all_messages
5
5
 
6
- def initialize(stdout_messages = [], stderr_messages = [], buffer = "")
6
+ def initialize(stdout_messages=[],
7
+ stderr_messages=[],
8
+ all_messages=[],
9
+ buffer="")
7
10
  @stdout_messages = stdout_messages
8
11
  @stderr_messages = stderr_messages
12
+ @all_messages = all_messages
9
13
  @buffer = buffer
10
14
  end
11
15
 
@@ -16,6 +20,7 @@ class Docker::Messages
16
20
  when 2
17
21
  stderr_messages << message
18
22
  end
23
+ all_messages << message
19
24
  end
20
25
 
21
26
  def get_message(raw_text)
@@ -37,6 +42,7 @@ class Docker::Messages
37
42
  def append(messages)
38
43
  @stdout_messages += messages.stdout_messages
39
44
  @stderr_messages += messages.stderr_messages
45
+ @all_messages += messages.all_messages
40
46
  end
41
47
 
42
48
  # Method to break apart application/vnd.docker.raw-stream headers
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.13.7'
3
+ VERSION = '1.14.0'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.12'
@@ -33,14 +33,32 @@ describe Docker::Container do
33
33
  end
34
34
  end
35
35
 
36
+ describe '#streaming_logs' do
37
+ subject { described_class.create('Cmd' => "echo hello", 'Image' => 'base') }
38
+
39
+ context "when not selecting any stream" do
40
+ let(:non_destination) { subject.logs }
41
+ it 'raises a client error', :vcr do
42
+ expect { non_destination }.to raise_error(Docker::Error::ClientError)
43
+ end
44
+ end
45
+
46
+ context "when selecting stdout" do
47
+ let(:stdout) { subject.logs(stdout: 1) }
48
+ it 'returns blank logs', :vcr do
49
+ expect(stdout).to be_a String
50
+ expect(stdout).to eq ""
51
+ end
52
+ end
53
+ end
54
+
36
55
  describe '#logs' do
37
56
  subject { described_class.create('Cmd' => "echo hello", 'Image' => 'base') }
38
57
 
39
58
  context "when not selecting any stream" do
40
59
  let(:non_destination) { subject.logs }
41
- it 'returns the error message', :vcr do
42
- expect(non_destination).to be_a String
43
- expect(non_destination).to match /You must choose at least one/
60
+ it 'raises a client error', :vcr do
61
+ expect { non_destination }.to raise_error(Docker::Error::ClientError)
44
62
  end
45
63
  end
46
64
 
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  describe Docker::Messages do
4
4
  shared_examples_for "two equal messages" do
5
5
  it "has the same messages as we expect" do
6
+ expect(messages.all_messages).to eq(expected.all_messages)
6
7
  expect(messages.stdout_messages).to eq(expected.stdout_messages)
7
8
  expect(messages.stderr_messages).to eq(expected.stderr_messages)
8
9
  expect(messages.buffer).to eq(expected.buffer)
@@ -23,7 +24,7 @@ describe Docker::Messages do
23
24
  "\x01\x00\x00\x00\x00\x00\x00\x01a\x02\x00\x00\x00\x00\x00\x00\x01b"
24
25
  }
25
26
  let(:expected) {
26
- Docker::Messages.new(["a"], ["b"], "")
27
+ Docker::Messages.new(["a"], ["b"], ["a","b"], "")
27
28
  }
28
29
 
29
30
  it_behaves_like "decipher_messages of raw_test"
@@ -32,7 +33,7 @@ describe Docker::Messages do
32
33
  context 'given a single header' do
33
34
  let(:raw_text) { "\x01\x00\x00\x00\x00\x00\x00\x01a" }
34
35
  let(:expected) {
35
- Docker::Messages.new(["a"], [], "")
36
+ Docker::Messages.new(["a"], [], ["a"], "")
36
37
  }
37
38
 
38
39
  it_behaves_like "decipher_messages of raw_test"
@@ -44,7 +45,7 @@ describe Docker::Messages do
44
45
  }
45
46
 
46
47
  let(:expected) {
47
- Docker::Messages.new(["a", "b"], [], "")
48
+ Docker::Messages.new(["a", "b"], [], ["a","b"], "")
48
49
  }
49
50
 
50
51
  it_behaves_like "decipher_messages of raw_test"
@@ -55,7 +56,7 @@ describe Docker::Messages do
55
56
  "\x01\x00\x00\x00\x00\x00\x01\x01" + ("a" * 257)
56
57
  }
57
58
  let(:expected) {
58
- Docker::Messages.new([("a" * 257)], [], "")
59
+ Docker::Messages.new([("a" * 257)], [], [("a" * 257)], "")
59
60
  }
60
61
 
61
62
  it_behaves_like "decipher_messages of raw_test"
@@ -65,7 +66,7 @@ describe Docker::Messages do
65
66
  describe "#append" do
66
67
  context "appending one set of messages on another" do
67
68
  let(:messages) {
68
- Docker::Messages.new([], [], "")
69
+ Docker::Messages.new([], [], [], "")
69
70
  }
70
71
 
71
72
  before do
@@ -74,20 +75,20 @@ describe Docker::Messages do
74
75
 
75
76
  context "with a buffer" do
76
77
  let(:new_messages) {
77
- Docker::Messages.new(["a"], [], "b")
78
+ Docker::Messages.new(["a"], [], ["a"], "b")
78
79
  }
79
80
  let(:expected) {
80
- Docker::Messages.new(["a"], [], "")
81
+ Docker::Messages.new(["a"], [], ["a"], "")
81
82
  }
82
83
  it_behaves_like "two equal messages"
83
84
  end
84
85
 
85
86
  context "without a buffer" do
86
87
  let(:new_messages) {
87
- Docker::Messages.new(["a"], [], "")
88
+ Docker::Messages.new(["a"], [], ["a"], "")
88
89
  }
89
90
  let(:expected) {
90
- Docker::Messages.new(["a"], [], "")
91
+ Docker::Messages.new(["a"], [], ["a"], "")
91
92
  }
92
93
  it_behaves_like "two equal messages"
93
94
  end
@@ -0,0 +1,163 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: unix:///var/run/docker.sock/v1.12/containers/create
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"Cmd":"echo hello","Image":"base"}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.13.6
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ !binary "Q29udGVudC1UeXBl":
20
+ - !binary |-
21
+ YXBwbGljYXRpb24vanNvbg==
22
+ !binary "RGF0ZQ==":
23
+ - !binary |-
24
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
25
+ !binary "Q29udGVudC1MZW5ndGg=":
26
+ - !binary |-
27
+ OTA=
28
+ body:
29
+ encoding: US-ASCII
30
+ string: ! '{"Id":"18a56c0a1826c882b5debd3b1ab2cc2037d6cb59e1a3f4d4b32301f496e379b0","Warnings":null}
31
+
32
+ '
33
+ http_version:
34
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
35
+ - request:
36
+ method: get
37
+ uri: unix:///var/run/docker.sock/v1.12/containers/18a56c0a1826c882b5debd3b1ab2cc2037d6cb59e1a3f4d4b32301f496e379b0/logs
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ headers:
42
+ User-Agent:
43
+ - Swipely/Docker-API 1.13.6
44
+ Content-Type:
45
+ - text/plain
46
+ response:
47
+ status:
48
+ code: 400
49
+ message:
50
+ headers:
51
+ !binary "Q29udGVudC1UeXBl":
52
+ - !binary |-
53
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
54
+ !binary "RGF0ZQ==":
55
+ - !binary |-
56
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
57
+ !binary "Q29udGVudC1MZW5ndGg=":
58
+ - !binary |-
59
+ NTI=
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! 'Bad parameters: you must choose at least one stream
63
+
64
+ '
65
+ http_version:
66
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
67
+ - request:
68
+ method: get
69
+ uri: unix:///var/run/docker.sock/v1.12/containers/18a56c0a1826c882b5debd3b1ab2cc2037d6cb59e1a3f4d4b32301f496e379b0/logs
70
+ body:
71
+ encoding: US-ASCII
72
+ string: ''
73
+ headers:
74
+ User-Agent:
75
+ - Swipely/Docker-API 1.13.6
76
+ Content-Type:
77
+ - text/plain
78
+ response:
79
+ status:
80
+ code: 400
81
+ message:
82
+ headers:
83
+ !binary "Q29udGVudC1UeXBl":
84
+ - !binary |-
85
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
86
+ !binary "RGF0ZQ==":
87
+ - !binary |-
88
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
89
+ !binary "Q29udGVudC1MZW5ndGg=":
90
+ - !binary |-
91
+ NTI=
92
+ body:
93
+ encoding: US-ASCII
94
+ string: ! 'Bad parameters: you must choose at least one stream
95
+
96
+ '
97
+ http_version:
98
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
99
+ - request:
100
+ method: get
101
+ uri: unix:///var/run/docker.sock/v1.12/containers/18a56c0a1826c882b5debd3b1ab2cc2037d6cb59e1a3f4d4b32301f496e379b0/logs
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ''
105
+ headers:
106
+ User-Agent:
107
+ - Swipely/Docker-API 1.13.6
108
+ Content-Type:
109
+ - text/plain
110
+ response:
111
+ status:
112
+ code: 400
113
+ message:
114
+ headers:
115
+ !binary "Q29udGVudC1UeXBl":
116
+ - !binary |-
117
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
118
+ !binary "RGF0ZQ==":
119
+ - !binary |-
120
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
121
+ !binary "Q29udGVudC1MZW5ndGg=":
122
+ - !binary |-
123
+ NTI=
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ! 'Bad parameters: you must choose at least one stream
127
+
128
+ '
129
+ http_version:
130
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
131
+ - request:
132
+ method: get
133
+ uri: unix:///var/run/docker.sock/v1.12/containers/18a56c0a1826c882b5debd3b1ab2cc2037d6cb59e1a3f4d4b32301f496e379b0/logs
134
+ body:
135
+ encoding: US-ASCII
136
+ string: ''
137
+ headers:
138
+ User-Agent:
139
+ - Swipely/Docker-API 1.13.6
140
+ Content-Type:
141
+ - text/plain
142
+ response:
143
+ status:
144
+ code: 400
145
+ message:
146
+ headers:
147
+ !binary "Q29udGVudC1UeXBl":
148
+ - !binary |-
149
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
150
+ !binary "RGF0ZQ==":
151
+ - !binary |-
152
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
153
+ !binary "Q29udGVudC1MZW5ndGg=":
154
+ - !binary |-
155
+ NTI=
156
+ body:
157
+ encoding: US-ASCII
158
+ string: ! 'Bad parameters: you must choose at least one stream
159
+
160
+ '
161
+ http_version:
162
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
163
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,163 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: unix:///var/run/docker.sock/v1.12/containers/create
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"Cmd":"echo hello","Image":"base"}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.13.6
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ !binary "Q29udGVudC1UeXBl":
20
+ - !binary |-
21
+ YXBwbGljYXRpb24vanNvbg==
22
+ !binary "RGF0ZQ==":
23
+ - !binary |-
24
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
25
+ !binary "Q29udGVudC1MZW5ndGg=":
26
+ - !binary |-
27
+ OTA=
28
+ body:
29
+ encoding: US-ASCII
30
+ string: ! '{"Id":"a3b2f62bdbfcc210f36c23bccd6332031f8351542033478e1ffc53deb67adaa8","Warnings":null}
31
+
32
+ '
33
+ http_version:
34
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
35
+ - request:
36
+ method: get
37
+ uri: unix:///var/run/docker.sock/v1.12/containers/a3b2f62bdbfcc210f36c23bccd6332031f8351542033478e1ffc53deb67adaa8/logs
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ headers:
42
+ User-Agent:
43
+ - Swipely/Docker-API 1.13.6
44
+ Content-Type:
45
+ - text/plain
46
+ response:
47
+ status:
48
+ code: 400
49
+ message:
50
+ headers:
51
+ !binary "Q29udGVudC1UeXBl":
52
+ - !binary |-
53
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
54
+ !binary "RGF0ZQ==":
55
+ - !binary |-
56
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
57
+ !binary "Q29udGVudC1MZW5ndGg=":
58
+ - !binary |-
59
+ NTI=
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! 'Bad parameters: you must choose at least one stream
63
+
64
+ '
65
+ http_version:
66
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
67
+ - request:
68
+ method: get
69
+ uri: unix:///var/run/docker.sock/v1.12/containers/a3b2f62bdbfcc210f36c23bccd6332031f8351542033478e1ffc53deb67adaa8/logs
70
+ body:
71
+ encoding: US-ASCII
72
+ string: ''
73
+ headers:
74
+ User-Agent:
75
+ - Swipely/Docker-API 1.13.6
76
+ Content-Type:
77
+ - text/plain
78
+ response:
79
+ status:
80
+ code: 400
81
+ message:
82
+ headers:
83
+ !binary "Q29udGVudC1UeXBl":
84
+ - !binary |-
85
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
86
+ !binary "RGF0ZQ==":
87
+ - !binary |-
88
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
89
+ !binary "Q29udGVudC1MZW5ndGg=":
90
+ - !binary |-
91
+ NTI=
92
+ body:
93
+ encoding: US-ASCII
94
+ string: ! 'Bad parameters: you must choose at least one stream
95
+
96
+ '
97
+ http_version:
98
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
99
+ - request:
100
+ method: get
101
+ uri: unix:///var/run/docker.sock/v1.12/containers/a3b2f62bdbfcc210f36c23bccd6332031f8351542033478e1ffc53deb67adaa8/logs
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ''
105
+ headers:
106
+ User-Agent:
107
+ - Swipely/Docker-API 1.13.6
108
+ Content-Type:
109
+ - text/plain
110
+ response:
111
+ status:
112
+ code: 400
113
+ message:
114
+ headers:
115
+ !binary "Q29udGVudC1UeXBl":
116
+ - !binary |-
117
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
118
+ !binary "RGF0ZQ==":
119
+ - !binary |-
120
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
121
+ !binary "Q29udGVudC1MZW5ndGg=":
122
+ - !binary |-
123
+ NTI=
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ! 'Bad parameters: you must choose at least one stream
127
+
128
+ '
129
+ http_version:
130
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
131
+ - request:
132
+ method: get
133
+ uri: unix:///var/run/docker.sock/v1.12/containers/a3b2f62bdbfcc210f36c23bccd6332031f8351542033478e1ffc53deb67adaa8/logs
134
+ body:
135
+ encoding: US-ASCII
136
+ string: ''
137
+ headers:
138
+ User-Agent:
139
+ - Swipely/Docker-API 1.13.6
140
+ Content-Type:
141
+ - text/plain
142
+ response:
143
+ status:
144
+ code: 400
145
+ message:
146
+ headers:
147
+ !binary "Q29udGVudC1UeXBl":
148
+ - !binary |-
149
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
150
+ !binary "RGF0ZQ==":
151
+ - !binary |-
152
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NjozMyBHTVQ=
153
+ !binary "Q29udGVudC1MZW5ndGg=":
154
+ - !binary |-
155
+ NTI=
156
+ body:
157
+ encoding: US-ASCII
158
+ string: ! 'Bad parameters: you must choose at least one stream
159
+
160
+ '
161
+ http_version:
162
+ recorded_at: Mon, 27 Oct 2014 14:46:33 GMT
163
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,163 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: unix:///var/run/docker.sock/v1.12/containers/create
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"Cmd":"echo hello","Image":"base"}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.13.6
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ !binary "Q29udGVudC1UeXBl":
20
+ - !binary |-
21
+ YXBwbGljYXRpb24vanNvbg==
22
+ !binary "RGF0ZQ==":
23
+ - !binary |-
24
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
25
+ !binary "Q29udGVudC1MZW5ndGg=":
26
+ - !binary |-
27
+ OTA=
28
+ body:
29
+ encoding: US-ASCII
30
+ string: ! '{"Id":"3fdba310d24ef8a2daeaa082cde837623c38a29bcf8c7ac47e955448a9a44070","Warnings":null}
31
+
32
+ '
33
+ http_version:
34
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
35
+ - request:
36
+ method: get
37
+ uri: unix:///var/run/docker.sock/v1.12/containers/3fdba310d24ef8a2daeaa082cde837623c38a29bcf8c7ac47e955448a9a44070/logs
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ headers:
42
+ User-Agent:
43
+ - Swipely/Docker-API 1.13.6
44
+ Content-Type:
45
+ - text/plain
46
+ response:
47
+ status:
48
+ code: 400
49
+ message:
50
+ headers:
51
+ !binary "Q29udGVudC1UeXBl":
52
+ - !binary |-
53
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
54
+ !binary "RGF0ZQ==":
55
+ - !binary |-
56
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
57
+ !binary "Q29udGVudC1MZW5ndGg=":
58
+ - !binary |-
59
+ NTI=
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! 'Bad parameters: you must choose at least one stream
63
+
64
+ '
65
+ http_version:
66
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
67
+ - request:
68
+ method: get
69
+ uri: unix:///var/run/docker.sock/v1.12/containers/3fdba310d24ef8a2daeaa082cde837623c38a29bcf8c7ac47e955448a9a44070/logs
70
+ body:
71
+ encoding: US-ASCII
72
+ string: ''
73
+ headers:
74
+ User-Agent:
75
+ - Swipely/Docker-API 1.13.6
76
+ Content-Type:
77
+ - text/plain
78
+ response:
79
+ status:
80
+ code: 400
81
+ message:
82
+ headers:
83
+ !binary "Q29udGVudC1UeXBl":
84
+ - !binary |-
85
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
86
+ !binary "RGF0ZQ==":
87
+ - !binary |-
88
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
89
+ !binary "Q29udGVudC1MZW5ndGg=":
90
+ - !binary |-
91
+ NTI=
92
+ body:
93
+ encoding: US-ASCII
94
+ string: ! 'Bad parameters: you must choose at least one stream
95
+
96
+ '
97
+ http_version:
98
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
99
+ - request:
100
+ method: get
101
+ uri: unix:///var/run/docker.sock/v1.12/containers/3fdba310d24ef8a2daeaa082cde837623c38a29bcf8c7ac47e955448a9a44070/logs
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ''
105
+ headers:
106
+ User-Agent:
107
+ - Swipely/Docker-API 1.13.6
108
+ Content-Type:
109
+ - text/plain
110
+ response:
111
+ status:
112
+ code: 400
113
+ message:
114
+ headers:
115
+ !binary "Q29udGVudC1UeXBl":
116
+ - !binary |-
117
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
118
+ !binary "RGF0ZQ==":
119
+ - !binary |-
120
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
121
+ !binary "Q29udGVudC1MZW5ndGg=":
122
+ - !binary |-
123
+ NTI=
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ! 'Bad parameters: you must choose at least one stream
127
+
128
+ '
129
+ http_version:
130
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
131
+ - request:
132
+ method: get
133
+ uri: unix:///var/run/docker.sock/v1.12/containers/3fdba310d24ef8a2daeaa082cde837623c38a29bcf8c7ac47e955448a9a44070/logs
134
+ body:
135
+ encoding: US-ASCII
136
+ string: ''
137
+ headers:
138
+ User-Agent:
139
+ - Swipely/Docker-API 1.13.6
140
+ Content-Type:
141
+ - text/plain
142
+ response:
143
+ status:
144
+ code: 400
145
+ message:
146
+ headers:
147
+ !binary "Q29udGVudC1UeXBl":
148
+ - !binary |-
149
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
150
+ !binary "RGF0ZQ==":
151
+ - !binary |-
152
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
153
+ !binary "Q29udGVudC1MZW5ndGg=":
154
+ - !binary |-
155
+ NTI=
156
+ body:
157
+ encoding: US-ASCII
158
+ string: ! 'Bad parameters: you must choose at least one stream
159
+
160
+ '
161
+ http_version:
162
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
163
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: unix:///var/run/docker.sock/v1.12/containers/create
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"Cmd":"echo hello","Image":"base"}'
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.13.6
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 201
17
+ message:
18
+ headers:
19
+ !binary "Q29udGVudC1UeXBl":
20
+ - !binary |-
21
+ YXBwbGljYXRpb24vanNvbg==
22
+ !binary "RGF0ZQ==":
23
+ - !binary |-
24
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
25
+ !binary "Q29udGVudC1MZW5ndGg=":
26
+ - !binary |-
27
+ OTA=
28
+ body:
29
+ encoding: US-ASCII
30
+ string: ! '{"Id":"8220b807160a789cb4a560ff0dda4bd03e37334b4e4a2f7cea19808c05fbc47d","Warnings":null}
31
+
32
+ '
33
+ http_version:
34
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
35
+ - request:
36
+ method: get
37
+ uri: unix:///var/run/docker.sock/v1.12/containers/8220b807160a789cb4a560ff0dda4bd03e37334b4e4a2f7cea19808c05fbc47d/logs?stdout=1
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ headers:
42
+ User-Agent:
43
+ - Swipely/Docker-API 1.13.6
44
+ Content-Type:
45
+ - text/plain
46
+ response:
47
+ status:
48
+ code: 200
49
+ message:
50
+ headers:
51
+ !binary "RGF0ZQ==":
52
+ - !binary |-
53
+ TW9uLCAyNyBPY3QgMjAxNCAxNDo0NDo0NiBHTVQ=
54
+ !binary "Q29udGVudC1MZW5ndGg=":
55
+ - !binary |-
56
+ MA==
57
+ !binary "Q29udGVudC1UeXBl":
58
+ - !binary |-
59
+ dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
63
+ http_version:
64
+ recorded_at: Mon, 27 Oct 2014 14:44:46 GMT
65
+ recorded_with: VCR 2.9.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.7
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
@@ -225,7 +225,7 @@ files:
225
225
  - spec/vcr/Docker_Container/_json/returns_the_description_as_a_Hash.yml
226
226
  - spec/vcr/Docker_Container/_kill/kills_the_container.yml
227
227
  - spec/vcr/Docker_Container/_kill/with_a_kill_signal/kills_the_container.yml
228
- - spec/vcr/Docker_Container/_logs/when_not_selecting_any_stream/returns_the_error_message.yml
228
+ - spec/vcr/Docker_Container/_logs/when_not_selecting_any_stream/raises_a_client_error.yml
229
229
  - spec/vcr/Docker_Container/_logs/when_selecting_stdout/returns_blank_logs.yml
230
230
  - spec/vcr/Docker_Container/_pause/pauses_the_container.yml
231
231
  - spec/vcr/Docker_Container/_restart/restarts_the_container.yml
@@ -233,6 +233,9 @@ files:
233
233
  - spec/vcr/Docker_Container/_run/when_the_Container_s_command_returns_a_status_code_of_0/creates_a_new_container_to_run_the_specified_command.yml
234
234
  - spec/vcr/Docker_Container/_start/starts_the_container.yml
235
235
  - spec/vcr/Docker_Container/_stop/stops_the_container.yml
236
+ - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/raises_a_client_error.yml
237
+ - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/returns_the_error_message.yml
238
+ - spec/vcr/Docker_Container/_streaming_logs/when_selecting_stdout/returns_blank_logs.yml
236
239
  - spec/vcr/Docker_Container/_top/returns_the_top_commands_as_an_Array.yml
237
240
  - spec/vcr/Docker_Container/_unpause/unpauses_the_container.yml
238
241
  - spec/vcr/Docker_Container/_wait/waits_for_the_command_to_finish.yml
@@ -327,7 +330,7 @@ test_files:
327
330
  - spec/vcr/Docker_Container/_json/returns_the_description_as_a_Hash.yml
328
331
  - spec/vcr/Docker_Container/_kill/kills_the_container.yml
329
332
  - spec/vcr/Docker_Container/_kill/with_a_kill_signal/kills_the_container.yml
330
- - spec/vcr/Docker_Container/_logs/when_not_selecting_any_stream/returns_the_error_message.yml
333
+ - spec/vcr/Docker_Container/_logs/when_not_selecting_any_stream/raises_a_client_error.yml
331
334
  - spec/vcr/Docker_Container/_logs/when_selecting_stdout/returns_blank_logs.yml
332
335
  - spec/vcr/Docker_Container/_pause/pauses_the_container.yml
333
336
  - spec/vcr/Docker_Container/_restart/restarts_the_container.yml
@@ -335,6 +338,9 @@ test_files:
335
338
  - spec/vcr/Docker_Container/_run/when_the_Container_s_command_returns_a_status_code_of_0/creates_a_new_container_to_run_the_specified_command.yml
336
339
  - spec/vcr/Docker_Container/_start/starts_the_container.yml
337
340
  - spec/vcr/Docker_Container/_stop/stops_the_container.yml
341
+ - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/raises_a_client_error.yml
342
+ - spec/vcr/Docker_Container/_streaming_logs/when_not_selecting_any_stream/returns_the_error_message.yml
343
+ - spec/vcr/Docker_Container/_streaming_logs/when_selecting_stdout/returns_blank_logs.yml
338
344
  - spec/vcr/Docker_Container/_top/returns_the_top_commands_as_an_Array.yml
339
345
  - spec/vcr/Docker_Container/_unpause/unpauses_the_container.yml
340
346
  - spec/vcr/Docker_Container/_wait/waits_for_the_command_to_finish.yml
@@ -1,65 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: unix:///var/run/docker.sock/v1.12/containers/create
6
- body:
7
- encoding: UTF-8
8
- string: '{"Cmd":"echo hello","Image":"base"}'
9
- headers:
10
- User-Agent:
11
- - Swipely/Docker-API 1.11.2
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
- - Thu, 26 Jun 2014 19:41:57 GMT
23
- Content-Length:
24
- - '90'
25
- Connection:
26
- - close
27
- body:
28
- encoding: UTF-8
29
- string: |
30
- {"Id":"6968a8299df95ffad447a6b364d0cb9cfeb1bcc28d0ef09356f35bdeca57d953","Warnings":null}
31
- http_version:
32
- recorded_at: Thu, 26 Jun 2014 19:41:57 GMT
33
- - request:
34
- method: get
35
- uri: unix:///var/run/docker.sock/v1.12/containers/6968a8299df95ffad447a6b364d0cb9cfeb1bcc28d0ef09356f35bdeca57d953/logs
36
- body:
37
- encoding: US-ASCII
38
- string: ''
39
- headers:
40
- User-Agent:
41
- - Swipely/Docker-API 1.11.2
42
- Content-Type:
43
- - text/plain
44
- response:
45
- status:
46
- code: 200
47
- message:
48
- headers:
49
- Date:
50
- - Thu, 26 Jun 2014 19:41:57 GMT
51
- Content-Type:
52
- - application/octet-stream
53
- Connection:
54
- - close
55
- Transfer-Encoding:
56
- - ''
57
- body:
58
- encoding: UTF-8
59
- string: !binary |-
60
- AgAAAAAAACRZb3UgbXVzdCBjaG9vc2UgYXQgbGVhc3Qgb25lIHN0cmVhbQoB
61
- AAAAAAAAPEVycm9yIHJ1bm5pbmcgbG9ncyBqb2I6IFlvdSBtdXN0IGNob29z
62
- ZSBhdCBsZWFzdCBvbmUgc3RyZWFtCg==
63
- http_version:
64
- recorded_at: Thu, 26 Jun 2014 19:41:57 GMT
65
- recorded_with: VCR 2.9.2