Class: OpenStack::Keystone::Public::Tenant
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- Common
- Base
- OpenStack::Keystone::Public::Tenant
- Defined in:
- lib/open_stack/keystone/public/tenant.rb
Overview
An OpenStack Tenant (“public view”)
Attributes
-
name
- The name of the tenant -
description
- A description of the tenant -
enabled
- True if the tenant is enabled
Class Method Summary collapse
-
.find_all_by_name(name) ⇒ Object
The first tenant with a given name (accessible by the current authenticated user…).
-
.find_by_name(name) ⇒ Object
List of tenants with a given name (accessible by the current authenticated user…).
-
.find_every(options) ⇒ Object
:nodoc:.
Methods inherited from Base
Methods inherited from Common
collection_path, custom_method_collection_url, element_path
Methods inherited from Base
Methods inherited from ActiveResource::Base
Class Method Details
.find_all_by_name(name) ⇒ Object
The first tenant with a given name (accessible by the current authenticated user…)
Attributes
-
name
- A string
69 70 71 |
# File 'lib/open_stack/keystone/public/tenant.rb', line 69 def self.find_all_by_name(name) all.reject! { |tenant| tenant.name != name } end |
.find_by_name(name) ⇒ Object
List of tenants with a given name (accessible by the current authenticated user…)
Attributes
-
name
- A string
61 62 63 |
# File 'lib/open_stack/keystone/public/tenant.rb', line 61 def self.find_by_name(name) all.detect { |tenant| tenant.name == name } end |
.find_every(options) ⇒ Object
:nodoc:
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/open_stack/keystone/public/tenant.rb', line 36 def self.find_every() # :nodoc: class_name = self.name.split('::').last.downcase begin case from = [:from] when Symbol instantiate_collection(get(from, [:params])) when String path = "#{from}#{query_string([:params])}" instantiate_collection(format.decode(connection.get(path, headers).body)[class_name.pluralize] || []) else , = ([:params]) path = collection_path(, ) instantiate_collection((format.decode(connection.get(path, headers).body)[class_name.pluralize] || []), ) end rescue ActiveResource::ResourceNotFound # Swallowing ResourceNotFound exceptions and return nil - as per # ActiveRecord. nil end end |