Class: Tagfish::DockerRegistryVbothClient
- Inherits:
-
Object
- Object
- Tagfish::DockerRegistryVbothClient
- Defined in:
- lib/tagfish/docker_registry_vboth_client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_call ⇒ Object
Returns the value of attribute api_call.
-
#docker_uri ⇒ Object
Returns the value of attribute docker_uri.
-
#http_auth ⇒ Object
Returns the value of attribute http_auth.
Instance Method Summary collapse
- #base_uri ⇒ Object
-
#initialize(docker_uri) ⇒ DockerRegistryVbothClient
constructor
A new instance of DockerRegistryVbothClient.
Constructor Details
#initialize(docker_uri) ⇒ DockerRegistryVbothClient
Returns a new instance of DockerRegistryVbothClient.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tagfish/docker_registry_vboth_client.rb', line 14 def initialize(docker_uri) @api_call = APICall.new @docker_uri = docker_uri code = api_call.get(ping_uri).response_code if code == 401 api_call.auth(docker_uri.registry) code = api_call.get(ping_uri).response_code end if code == 401 raise DockerRegistryClient::AuthenticationError, "Please `docker login <REGISTRY>` and try again" elsif code != 200 raise DockerRegistryClient::APIVersionError, "Not recognized" end end |
Instance Attribute Details
#api_call ⇒ Object
Returns the value of attribute api_call.
12 13 14 |
# File 'lib/tagfish/docker_registry_vboth_client.rb', line 12 def api_call @api_call end |
#docker_uri ⇒ Object
Returns the value of attribute docker_uri.
10 11 12 |
# File 'lib/tagfish/docker_registry_vboth_client.rb', line 10 def docker_uri @docker_uri end |
#http_auth ⇒ Object
Returns the value of attribute http_auth.
11 12 13 |
# File 'lib/tagfish/docker_registry_vboth_client.rb', line 11 def http_auth @http_auth end |
Instance Method Details
#base_uri ⇒ Object
29 30 31 |
# File 'lib/tagfish/docker_registry_vboth_client.rb', line 29 def base_uri "#{docker_uri.protocol}#{docker_uri.registry}" end |