Class: EY::CloudClient
- Inherits:
-
Object
show all
- Extended by:
- Forwardable
- Defined in:
- lib/engineyard-cloud-client.rb,
lib/engineyard-cloud-client.rb,
lib/engineyard-cloud-client/errors.rb,
lib/engineyard-cloud-client/models.rb,
lib/engineyard-cloud-client/version.rb,
lib/engineyard-cloud-client/connection.rb,
lib/engineyard-cloud-client/models/app.rb,
lib/engineyard-cloud-client/models/log.rb,
lib/engineyard-cloud-client/models/user.rb,
lib/engineyard-cloud-client/model_registry.rb,
lib/engineyard-cloud-client/models/account.rb,
lib/engineyard-cloud-client/models/keypair.rb,
lib/engineyard-cloud-client/models/recipes.rb,
lib/engineyard-cloud-client/models/instance.rb,
lib/engineyard-cloud-client/resolver_result.rb,
lib/engineyard-cloud-client/models/api_struct.rb,
lib/engineyard-cloud-client/models/deployment.rb,
lib/engineyard-cloud-client/models/environment.rb,
lib/engineyard-cloud-client/models/app_environment.rb
Defined Under Namespace
Modules: Test
Classes: Account, ApiStruct, App, AppEnvironment, AttributeRequiredError, BadBridgeStatusError, BadEndpointError, Connection, Deployment, Environment, Error, Instance, InvalidCredentials, Keypair, Log, ModelRegistry, NoBridgeError, Recipes, RequestFailed, ResolverResult, ResourceNotFound, User
Constant Summary
collapse
- VERSION =
'1.0.4'
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ CloudClient
Initialize a new EY::CloudClient.
Creates and stores a new Connection for communicating with EY Cloud.
See EY::CloudClient::Connection for options.
30
31
32
|
# File 'lib/engineyard-cloud-client.rb', line 30
def initialize(options={})
@connection = Connection.new(options)
end
|
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
23
24
25
|
# File 'lib/engineyard-cloud-client.rb', line 23
def connection
@connection
end
|
Instance Method Details
#==(other) ⇒ Object
34
35
36
|
# File 'lib/engineyard-cloud-client.rb', line 34
def ==(other)
other.is_a?(self.class) && other.connection == connection
end
|
#app_environments ⇒ Object
TODO: unhaxor This should load an api endpoint that deals directly in app_deployments
60
61
62
|
# File 'lib/engineyard-cloud-client.rb', line 60
def app_environments
@app_environments ||= apps.map { |app| app.app_environments }.flatten
end
|
#apps ⇒ Object
54
55
56
|
# File 'lib/engineyard-cloud-client.rb', line 54
def apps
@apps ||= EY::CloudClient::App.all(self)
end
|
#current_user ⇒ Object
64
65
66
|
# File 'lib/engineyard-cloud-client.rb', line 64
def current_user
EY::CloudClient::User.from_hash(self, get('/current_user')['user'])
end
|
#environments ⇒ Object
50
51
52
|
# File 'lib/engineyard-cloud-client.rb', line 50
def environments
@environments ||= EY::CloudClient::Environment.all(self)
end
|
#registry ⇒ Object
38
39
40
|
# File 'lib/engineyard-cloud-client.rb', line 38
def registry
@registry ||= ModelRegistry.new
end
|
#resolve_app_environments(constraints) ⇒ Object
#resolve_environments(constraints) ⇒ Object
42
43
44
|
# File 'lib/engineyard-cloud-client.rb', line 42
def resolve_environments(constraints)
EY::CloudClient::Environment.resolve(self, constraints)
end
|