Class: CfRubyClient::AppInstance
- Defined in:
- lib/cf_ruby_client/app_instance.rb
Instance Attribute Summary collapse
-
#app_guid ⇒ Object
readonly
Returns the value of attribute app_guid.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(guid, index) ⇒ AppInstance
constructor
A new instance of AppInstance.
- #restart ⇒ Object
- #status ⇒ 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, index) ⇒ AppInstance
Returns a new instance of AppInstance.
6 7 8 9 |
# File 'lib/cf_ruby_client/app_instance.rb', line 6 def initialize(guid, index) @app_guid = guid @index = index end |
Instance Attribute Details
#app_guid ⇒ Object (readonly)
Returns the value of attribute app_guid.
4 5 6 |
# File 'lib/cf_ruby_client/app_instance.rb', line 4 def app_guid @app_guid end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
4 5 6 |
# File 'lib/cf_ruby_client/app_instance.rb', line 4 def index @index end |
Instance Method Details
#restart ⇒ Object
11 12 13 14 |
# File 'lib/cf_ruby_client/app_instance.rb', line 11 def restart url_path = "/v2/apps/#{app_guid}/instances/#{index}" delete_entity(url_path) end |
#status ⇒ Object
16 17 18 19 |
# File 'lib/cf_ruby_client/app_instance.rb', line 16 def status url_path = "/v2/apps/#{app_guid}/instances" JSON::parse(fetch_entities(url_path))[index.to_s] end |