class EY::CloudClient

Constants

VERSION

Attributes

connection[R]

Public Class Methods

new(options={}) click to toggle source

Initialize a new EY::CloudClient.

Creates and stores a new Connection for communicating with EY Cloud.

See EY::CloudClient::Connection for options.

# File lib/engineyard-cloud-client.rb, line 29
def initialize(options={})
  @connection = Connection.new(options)
end

Public Instance Methods

==(other) click to toggle source
# File lib/engineyard-cloud-client.rb, line 33
def ==(other)
  other.is_a?(self.class) && other.connection == connection
end
app_environments() click to toggle source

TODO: unhaxor This should load an api endpoint that deals directly in app_deployments

# File lib/engineyard-cloud-client.rb, line 59
def app_environments
  @app_environments ||= apps.map { |app| app.app_environments }.flatten
end
apps() click to toggle source
# File lib/engineyard-cloud-client.rb, line 53
def apps
  @apps ||= EY::CloudClient::App.all(self)
end
current_user() click to toggle source
# File lib/engineyard-cloud-client.rb, line 63
def current_user
  EY::CloudClient::User.from_hash(self, get('/current_user')['user'])
end
env_by_name(environment_name, account_name=nil)

For ease of use:

Alias for: environment_by_name
environment_by_name(environment_name, account_name=nil) click to toggle source

Accepts an environment name and optional account name and returns the best matching environment for the given constraints.

This is a shortcut for Environment.resolve Raises if nothing is found or if more than one env is found.

# File lib/engineyard-cloud-client.rb, line 72
def environment_by_name(environment_name, account_name=nil)
  EY::CloudClient::Environment.by_name(self, environment_name, account_name)
end
Also aliased as: env_by_name
environments() click to toggle source
# File lib/engineyard-cloud-client.rb, line 49
def environments
  @environments ||= EY::CloudClient::Environment.all(self)
end
registry() click to toggle source
# File lib/engineyard-cloud-client.rb, line 37
def registry
  @registry ||= ModelRegistry.new
end
resolve_app_environments(constraints) click to toggle source
# File lib/engineyard-cloud-client.rb, line 45
def resolve_app_environments(constraints)
  EY::CloudClient::AppEnvironment.resolve(self, constraints)
end
resolve_environments(constraints) click to toggle source
# File lib/engineyard-cloud-client.rb, line 41
def resolve_environments(constraints)
  EY::CloudClient::Environment.resolve(self, constraints)
end