Class: Fog::Identity::OpenStack::V3::Projects

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/openstack/models/identity_v3/projects.rb

Instance Method Summary collapse

Instance Method Details

#all(params = {}) ⇒ Object



11
12
13
# File 'lib/fog/openstack/models/identity_v3/projects.rb', line 11

def all params={}
  load(service.list_projects(params).body['projects'])
end

#auth_projects(params = {}) ⇒ Object



15
16
17
# File 'lib/fog/openstack/models/identity_v3/projects.rb', line 15

def auth_projects params={}
  load(service.auth_projects(params).body['projects'])
end

#find_by_id(id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/fog/openstack/models/identity_v3/projects.rb', line 19

def find_by_id(id)
  cached_project = self.find { |project| project.id == id }
  return cached_project if cached_project
  project_hash = service.get_project(id).body['project']
  Fog::Identity::OpenStack::V3::Project.new(
      project_hash.merge(:service => service))
end