Class: CfRubyClient::Space
- Inherits:
-
Base
- Object
- Base
- CfRubyClient::Space
show all
- Defined in:
- lib/cf_ruby_client/space.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
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) ⇒ Space
Returns a new instance of Space.
11
12
13
|
# File 'lib/cf_ruby_client/space.rb', line 11
def initialize(guid)
@guid = guid
end
|
Instance Attribute Details
#guid ⇒ Object
Returns the value of attribute guid.
9
10
11
|
# File 'lib/cf_ruby_client/space.rb', line 9
def guid
@guid
end
|
Class Method Details
.all ⇒ Object
4
5
6
7
|
# File 'lib/cf_ruby_client/space.rb', line 4
def self.all
url_path = "/v2/spaces"
JSON::parse(CfRubyClient::Base.new.fetch_entities(url_path))
end
|
Instance Method Details
#app_guids ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/cf_ruby_client/space.rb', line 25
def app_guids
if not(apps.nil? or apps.empty?)
apps["resources"].collect {|entry| entry["metadata"]["guid"]}
else
[]
end
end
|
#apps ⇒ Object
20
21
22
23
|
# File 'lib/cf_ruby_client/space.rb', line 20
def apps
url_path = "/v2/spaces/#{guid}/apps"
JSON::parse(fetch_entities(url_path))
end
|
#org_guid ⇒ Object
15
16
17
18
|
# File 'lib/cf_ruby_client/space.rb', line 15
def org_guid
url_path = "/v2/spaces/#{guid}"
space = JSON::parse(fetch_entities(url_path))["entity"]["organization_guid"]
end
|