Class: CfRubyClient::App
Constant Summary collapse
- STARTED_STATE =
"STARTED"
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(guid) ⇒ App
constructor
A new instance of App.
- #instances ⇒ Object
Methods inherited from Base
#api_endpoint, #authorization_string, #cloud_foundry_config, #delete_entity, #fetch_entities, #logger, #patch_entity, #post_entity, #put_entity, #resource, #uaa_endpoint
Constructor Details
#initialize(guid) ⇒ App
Returns a new instance of App.
12 13 14 |
# File 'lib/cf_ruby_client/app.rb', line 12 def initialize(guid) @guid = guid end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
10 11 12 |
# File 'lib/cf_ruby_client/app.rb', line 10 def guid @guid end |
Class Method Details
.all ⇒ Object
5 6 7 8 |
# File 'lib/cf_ruby_client/app.rb', line 5 def self.all url_path = "/v2/apps" JSON::parse(CfRubyClient::Base.new.fetch_entities(url_path)) end |
Instance Method Details
#instances ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cf_ruby_client/app.rb', line 16 def instances return [] unless started? url_path = "/v2/apps/#{guid}/instances" JSON::parse(fetch_entities(url_path)).keys.map do |index| AppInstance.new(guid, index) end end |