Class: DockerCloud::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_cloud.rb

Defined Under Namespace

Classes: ApiType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, api_key) ⇒ Client

Returns a new instance of Client.



53
54
55
56
# File 'lib/docker_cloud.rb', line 53

def initialize(username, api_key)
  @username = username
  @api_key = api_key
end

Instance Attribute Details

#usernameObject (readonly)

Returns the value of attribute username.



43
44
45
# File 'lib/docker_cloud.rb', line 43

def username
  @username
end

Instance Method Details

#availability_zonesObject



74
75
76
# File 'lib/docker_cloud.rb', line 74

def availability_zones
  @availability_zones ||= DockerCloud::AvailabilityZoneAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#containersObject



107
108
109
# File 'lib/docker_cloud.rb', line 107

def containers
  @containers ||= DockerCloud::ContainerAPI.new(headers, ApiType::APPLICATION, self)
end

#eventsObject



111
112
113
# File 'lib/docker_cloud.rb', line 111

def events
  @events ||= DockerCloud::EventsAPI.new(headers, ApiType::AUDIT, self)
end

#external_repositoriesObject



94
95
96
97
# File 'lib/docker_cloud.rb', line 94

def external_repositories
  @repositories ||=
    DockerCloud::ExternalRepositoryAPI.new(headers, ApiType::REPOSITORY, self)
end

#headersObject



58
59
60
61
62
63
64
# File 'lib/docker_cloud.rb', line 58

def headers
  {
    'Authorization' => authorization,
    'Accept' => 'application/json',
    'Content-Type' => 'application/json'
  }
end

#node_clustersObject



82
83
84
# File 'lib/docker_cloud.rb', line 82

def node_clusters
  @node_clusters ||= DockerCloud::NodeClusterAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#node_typesObject



78
79
80
# File 'lib/docker_cloud.rb', line 78

def node_types
  @node_types ||= DockerCloud::NodeTypeAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#nodesObject



86
87
88
# File 'lib/docker_cloud.rb', line 86

def nodes
  @nodes ||= DockerCloud::NodeAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#providersObject



66
67
68
# File 'lib/docker_cloud.rb', line 66

def providers
  @providers ||= DockerCloud::ProviderAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#regionsObject



70
71
72
# File 'lib/docker_cloud.rb', line 70

def regions
  @regions ||= DockerCloud::RegionAPI.new(headers, ApiType::INFRASTRUCTURE, self)
end

#registriesObject



90
91
92
# File 'lib/docker_cloud.rb', line 90

def registries
  @registries ||= DockerCloud::RegistryAPI.new(headers, ApiType::REPOSITORY, self)
end

#servicesObject



103
104
105
# File 'lib/docker_cloud.rb', line 103

def services
  @services ||= DockerCloud::ServiceAPI.new(headers, ApiType::APPLICATION, self)
end

#stacksObject



99
100
101
# File 'lib/docker_cloud.rb', line 99

def stacks
  @stacks ||= DockerCloud::StackAPI.new(headers, ApiType::APPLICATION, self)
end