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.



51
52
53
54
# File 'lib/docker_cloud.rb', line 51

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

Instance Attribute Details

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#availability_zonesObject



72
73
74
# File 'lib/docker_cloud.rb', line 72

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

#containersObject



105
106
107
# File 'lib/docker_cloud.rb', line 105

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

#eventsObject



109
110
111
# File 'lib/docker_cloud.rb', line 109

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

#external_repositoriesObject



92
93
94
95
# File 'lib/docker_cloud.rb', line 92

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

#headersObject



56
57
58
59
60
61
62
# File 'lib/docker_cloud.rb', line 56

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

#node_clustersObject



80
81
82
# File 'lib/docker_cloud.rb', line 80

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

#node_typesObject



76
77
78
# File 'lib/docker_cloud.rb', line 76

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

#nodesObject



84
85
86
# File 'lib/docker_cloud.rb', line 84

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

#providersObject



64
65
66
# File 'lib/docker_cloud.rb', line 64

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

#regionsObject



68
69
70
# File 'lib/docker_cloud.rb', line 68

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

#registriesObject



88
89
90
# File 'lib/docker_cloud.rb', line 88

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

#servicesObject



101
102
103
# File 'lib/docker_cloud.rb', line 101

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

#stacksObject



97
98
99
# File 'lib/docker_cloud.rb', line 97

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