module Docker::Distribution::Api

Constants

API_VERSION
VERSION

Attributes

logger[RW]
creds[RW]
logger[RW]

Public Class Methods

connection() click to toggle source
# File lib/docker/distribution/api.rb, line 40
def connection
  @connection ||= Connection.new(url, options)
end
options() click to toggle source
# File lib/docker/distribution/api.rb, line 31
def options
  @options ||= {}
end
options=(new_options) click to toggle source
# File lib/docker/distribution/api.rb, line 35
def options=(new_options)
  @options = @options.merge(new_options || {})
  reset_connection!
end
reset_connection!() click to toggle source
# File lib/docker/distribution/api.rb, line 44
def reset_connection!
  @connection = nil
end
tags(repository, connection = self.connection) click to toggle source
# File lib/docker/distribution/api.rb, line 17
def tags(repository, connection = self.connection)
  response = connection.get("/#{repository}/tags/list")
  Util.parse_json(response.body)['tags']
end
url() click to toggle source
# File lib/docker/distribution/api.rb, line 22
def url
  @url ||= 'localhost:5000'
end
url=(new_url) click to toggle source
# File lib/docker/distribution/api.rb, line 26
def url=(new_url)
  @url = new_url
  reset_connection!
end
version(connection = self.connection) click to toggle source
# File lib/docker/distribution/api.rb, line 12
def version(connection = self.connection)
  response = connection.get('/')
  response.headers['Docker-Distribution-Api-Version']
end

Private Instance Methods

connection() click to toggle source
# File lib/docker/distribution/api.rb, line 40
def connection
  @connection ||= Connection.new(url, options)
end
options() click to toggle source
# File lib/docker/distribution/api.rb, line 31
def options
  @options ||= {}
end
options=(new_options) click to toggle source
# File lib/docker/distribution/api.rb, line 35
def options=(new_options)
  @options = @options.merge(new_options || {})
  reset_connection!
end
reset_connection!() click to toggle source
# File lib/docker/distribution/api.rb, line 44
def reset_connection!
  @connection = nil
end
tags(repository, connection = self.connection) click to toggle source
# File lib/docker/distribution/api.rb, line 17
def tags(repository, connection = self.connection)
  response = connection.get("/#{repository}/tags/list")
  Util.parse_json(response.body)['tags']
end
url() click to toggle source
# File lib/docker/distribution/api.rb, line 22
def url
  @url ||= 'localhost:5000'
end
url=(new_url) click to toggle source
# File lib/docker/distribution/api.rb, line 26
def url=(new_url)
  @url = new_url
  reset_connection!
end
version(connection = self.connection) click to toggle source
# File lib/docker/distribution/api.rb, line 12
def version(connection = self.connection)
  response = connection.get('/')
  response.headers['Docker-Distribution-Api-Version']
end