Class: Docker::Remote::Client
- Inherits:
-
Object
- Object
- Docker::Remote::Client
- Defined in:
- lib/docker/remote/client.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#registry_url ⇒ Object
readonly
Returns the value of attribute registry_url.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #catalog ⇒ Object
-
#initialize(registry_url, repo, username = nil, password = nil) ⇒ Client
constructor
A new instance of Client.
- #manifest_for(reference) ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(registry_url, repo, username = nil, password = nil) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 |
# File 'lib/docker/remote/client.rb', line 13 def initialize(registry_url, repo, username = nil, password = nil) @registry_url = registry_url @repo = repo @username = username @password = password end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
11 12 13 |
# File 'lib/docker/remote/client.rb', line 11 def password @password end |
#registry_url ⇒ Object (readonly)
Returns the value of attribute registry_url.
11 12 13 |
# File 'lib/docker/remote/client.rb', line 11 def registry_url @registry_url end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
11 12 13 |
# File 'lib/docker/remote/client.rb', line 11 def repo @repo end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/docker/remote/client.rb', line 11 def username @username end |
Instance Method Details
#catalog ⇒ Object
34 35 36 37 38 39 |
# File 'lib/docker/remote/client.rb', line 34 def catalog request = make_get("/v2/_catalog") response = registry_http.request(request) potentially_raise_error!(response) JSON.parse(response.body) end |
#manifest_for(reference) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/docker/remote/client.rb', line 27 def manifest_for(reference) request = make_get("/v2/#{repo}/manifests/#{reference}") response = registry_http.request(request) potentially_raise_error!(response) JSON.parse(response.body) end |
#tags ⇒ Object
20 21 22 23 24 25 |
# File 'lib/docker/remote/client.rb', line 20 def request = make_get("/v2/#{repo}/tags/list") response = registry_http.request(request) potentially_raise_error!(response) JSON.parse(response.body)['tags'] end |