docker_cloud 0.2.3 → 0.3.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: 43f3e0d89980cf841ac5530874567e609b297991
4
- data.tar.gz: 6aceee3473fff66a359eb4bdb5ad18ffe0786592
3
+ metadata.gz: fd176ad0969c0fd6e6833d541388d5c15a05b7ed
4
+ data.tar.gz: 914de054c26d067e68c343c8717a5975ef261435
5
5
  SHA512:
6
- metadata.gz: f011d94c203c2c60e91939b87f3bec1d0ef41c953f914f707a9b898ca7e1489e03efdd68886a546b9751c422760be418df77f436f3d04bd0ee663ffa09f221d8
7
- data.tar.gz: ea7e367527cd85dd3eddee9c0379ffe277aac89990d6821b0d29e38950e16f0b93bea94766b414ecfed27aa2571b574f8f3a02076377b206300e6ad6dd54fc57
6
+ metadata.gz: 9a7dd81f0eaf11fc4209d654299e279a0b3caee5ec4f22c35be9366b4ed90c3a61a6ace5374623598172a8b3be5853ae88925cb587f26f9f18f26d5c3c852e0c
7
+ data.tar.gz: 3ac19a14b6ba6db1046d7bfe036f611ce57c02e319c6c8b05795279938cb51467e2b780887bb2c4db644e573b1cce282c03ccaa02b5675da4794848b152e5d2c
@@ -30,6 +30,7 @@ require 'docker_cloud/api/node_api'
30
30
  require 'docker_cloud/api/external_repository_api'
31
31
  require 'docker_cloud/api/service_api'
32
32
  require 'docker_cloud/api/container_api'
33
+ require 'docker_cloud/api/container_stream_api'
33
34
  require 'docker_cloud/api/stack_api'
34
35
  require 'docker_cloud/api/registry_api'
35
36
  require 'docker_cloud/api/events_api'
@@ -46,6 +47,7 @@ module DockerCloud
46
47
  REPOSITORY = 'repo'.freeze
47
48
  APPLICATION = 'app'.freeze
48
49
  AUDIT = 'audit'.freeze
50
+ CONTAINER = 'container'.freeze
49
51
  end
50
52
 
51
53
  def initialize(username, api_key)
@@ -107,7 +109,7 @@ module DockerCloud
107
109
  end
108
110
 
109
111
  def events
110
- @containers ||= DockerCloud::EventsAPI.new(headers, ApiType::AUDIT, self)
112
+ @events ||= DockerCloud::EventsAPI.new(headers, ApiType::AUDIT, self)
111
113
  end
112
114
 
113
115
  private
@@ -0,0 +1,19 @@
1
+ module DockerCloud
2
+ class ContainerStreamAPI < DockerCloud::StreamAPI
3
+ def initialize(uuid, command, headers, client)
4
+ @uuid = uuid
5
+ @command = command
6
+ super(headers, DockerCloud::Client::ApiType::CONTAINER, client)
7
+ end
8
+
9
+ private
10
+
11
+ def websocket_path
12
+ @websocket_path ||= "/container/#{@uuid}/exec?command=#{@command}"
13
+ end
14
+
15
+ def root_path
16
+ 'app'
17
+ end
18
+ end
19
+ end
@@ -10,6 +10,10 @@ module DockerCloud
10
10
  @websocket_path ||= '/events'.freeze
11
11
  end
12
12
 
13
+ def root_path
14
+ 'audit'
15
+ end
16
+
13
17
  def _on_message(event)
14
18
  @listeners[:message].call(convert_to_dockercloud_event(event)) if @listeners[:message]
15
19
  end
@@ -4,7 +4,7 @@ module DockerCloud
4
4
 
5
5
  def websocket
6
6
  @websocket ||= begin
7
- url = URI.escape(STREAM_API_PATH + '/' + @type + '/' + API_VERSION + websocket_path)
7
+ url = URI.escape(STREAM_API_PATH + '/' + root_path + '/' + API_VERSION + websocket_path)
8
8
  Faye::WebSocket::Client.new(url, nil, ping: 240, headers: headers)
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module DockerCloud
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jillian Tullo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-05-05 00:00:00.000000000 Z
13
+ date: 2016-06-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -161,6 +161,7 @@ files:
161
161
  - lib/docker_cloud/api/api.rb
162
162
  - lib/docker_cloud/api/availability_zone_api.rb
163
163
  - lib/docker_cloud/api/container_api.rb
164
+ - lib/docker_cloud/api/container_stream_api.rb
164
165
  - lib/docker_cloud/api/events_api.rb
165
166
  - lib/docker_cloud/api/external_repository_api.rb
166
167
  - lib/docker_cloud/api/node_api.rb
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  version: '0'
209
210
  requirements: []
210
211
  rubyforge_project:
211
- rubygems_version: 2.6.3
212
+ rubygems_version: 2.5.1
212
213
  signing_key:
213
214
  specification_version: 4
214
215
  summary: Ruby wrapper for the Docker Cloud HTTP REST API