class DockerCloud::Client

Attributes

api_key[R]
username[R]

Public Class Methods

new(username, api_key) click to toggle source
# File lib/docker_cloud.rb, line 53
def initialize(username, api_key)
  @username = username
  @api_key = api_key
end

Public Instance Methods

availability_zones() click to toggle source
# File lib/docker_cloud.rb, line 74
def availability_zones
  @availability_zones ||= DockerCloud::AvailabilityZoneAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
containers() click to toggle source
# File lib/docker_cloud.rb, line 107
def containers
  @containers ||= DockerCloud::ContainerAPI.new(headers, ApiType::APPLICATION, self)
end
events() click to toggle source
# File lib/docker_cloud.rb, line 111
def events
  @events ||= DockerCloud::EventsAPI.new(headers, ApiType::AUDIT, self)
end
external_repositories() click to toggle source
# File lib/docker_cloud.rb, line 94
def external_repositories
  @repositories ||=
    DockerCloud::ExternalRepositoryAPI.new(headers, ApiType::REPOSITORY, self)
end
headers() click to toggle source
# File lib/docker_cloud.rb, line 58
def headers
  {
    'Authorization' => authorization,
    'Accept' => 'application/json',
    'Content-Type' => 'application/json'
  }
end
node_clusters() click to toggle source
# File lib/docker_cloud.rb, line 82
def node_clusters
  @node_clusters ||= DockerCloud::NodeClusterAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
node_types() click to toggle source
# File lib/docker_cloud.rb, line 78
def node_types
  @node_types ||= DockerCloud::NodeTypeAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
nodes() click to toggle source
# File lib/docker_cloud.rb, line 86
def nodes
  @nodes ||= DockerCloud::NodeAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
providers() click to toggle source
# File lib/docker_cloud.rb, line 66
def providers
  @providers ||= DockerCloud::ProviderAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
regions() click to toggle source
# File lib/docker_cloud.rb, line 70
def regions
  @regions ||= DockerCloud::RegionAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end
registries() click to toggle source
# File lib/docker_cloud.rb, line 90
def registries
  @registries ||= DockerCloud::RegistryAPI.new(headers, ApiType::REPOSITORY, self)
end
services() click to toggle source
# File lib/docker_cloud.rb, line 103
def services
  @services ||= DockerCloud::ServiceAPI.new(headers, ApiType::APPLICATION, self)
end
stacks() click to toggle source
# File lib/docker_cloud.rb, line 99
def stacks
  @stacks ||= DockerCloud::StackAPI.new(headers, ApiType::APPLICATION, self)
end

Private Instance Methods

authorization() click to toggle source
# File lib/docker_cloud.rb, line 119
def authorization
  @auth ||= ENV['DOCKERCLOUD_AUTH'] || "Basic #{Base64.strict_encode64(@username + ':' + api_key)}"
end