class Docker::Registry::Api::DockerRegistryApi

Attributes

base_url[RW]
certificate[RW]

Public Class Methods

new(base_url, certificate) click to toggle source
# File lib/docker/registry/api.rb, line 17
def initialize(base_url, certificate)
  @base_url = base_url
  @certificate = certificate
end

Public Instance Methods

execute_rest_request(method, endpoint) click to toggle source
# File lib/docker/registry/api.rb, line 22
def execute_rest_request(method, endpoint)
  JSON.parse(RestClient::Request.execute(method: method, url: "#{@base_url}/#{endpoint}", ssl_ca_file: @certificate, headers: AUTHORIZATION_HEADERS), symbolize_names: true)
end
get(endpoint) click to toggle source
# File lib/docker/registry/api.rb, line 26
def get(endpoint)
  execute_rest_request(:get, endpoint)
end
get_tag_list(repository) click to toggle source
# File lib/docker/registry/api.rb, line 30
def get_tag_list(repository)
  get("#{repository}/tags/list")
end
list_repositories() click to toggle source
# File lib/docker/registry/api.rb, line 34
def list_repositories
  get("_catalog")
end