Class: Fog::Compute::Ecloud::Organization

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/ecloud/models/compute/organization.rb

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Instance Method Details

#adminObject



25
26
27
# File 'lib/fog/ecloud/models/compute/organization.rb', line 25

def admin
  @admin ||= self.service.admin_organizations.new(:href => "#{service.base_path}/admin/organizations/#{id}")
end

#disable_support_access(options = {}) ⇒ Object



65
66
67
68
# File 'lib/fog/ecloud/models/compute/organization.rb', line 65

def disable_support_access(options = {})
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/action/disableSupportAccess"
  service.admin_disable_support_access(options[:uri])
end

#edit_authentication_levels(options = {}) ⇒ Object



42
43
44
45
46
# File 'lib/fog/ecloud/models/compute/organization.rb', line 42

def edit_authentication_levels(options = {})
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/authenticationLevels"
  data = service.admin_edit_authentication_levels(options).body
  level = Fog::Compute::Ecloud::AdminOrganizations.new(:service => service, :href => data[:href])[0]
end

#edit_login_banner(options = {}) ⇒ Object



54
55
56
57
58
# File 'lib/fog/ecloud/models/compute/organization.rb', line 54

def (options = {})
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/loginBanner"
  data = service.(options).body
  banner = Fog::Compute::Ecloud::LoginBanners.new(:service => service, :href => data[:href])[0]
end

#edit_password_complexity_rules(options = {}) ⇒ Object



48
49
50
51
52
# File 'lib/fog/ecloud/models/compute/organization.rb', line 48

def edit_password_complexity_rules(options = {})
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/passwordComplexityRules"
  data = service.admin_edit_password_complexity_rules(options).body
  level = Fog::Compute::Ecloud::PasswordComplexityRules.new(:service => service, :href => data[:href])[0]
end

#enable_support_access(options = {}) ⇒ Object



60
61
62
63
# File 'lib/fog/ecloud/models/compute/organization.rb', line 60

def enable_support_access(options = {})
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/action/enableSupportAccess"
  service.admin_enable_support_access(options[:uri])
end

#environmentsObject Also known as: vdcs



17
18
19
# File 'lib/fog/ecloud/models/compute/organization.rb', line 17

def environments
  @environments ||= self.service.environments(:href => href)
end

#idObject



70
71
72
# File 'lib/fog/ecloud/models/compute/organization.rb', line 70

def id
  href.scan(/\d+/)[0]
end

#locationsObject



13
14
15
# File 'lib/fog/ecloud/models/compute/organization.rb', line 13

def locations
  @locations ||= Fog::Compute::Ecloud::Locations.new( :service => service, :href => href )
end

#support_tickets(type = :open) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/fog/ecloud/models/compute/organization.rb', line 33

def support_tickets(type = :open)
  case type
  when :open
    @support_tickets ||= Fog::Compute::Ecloud::SupportTickets.new(:service => service, :href => "#{service.base_path}/admin/tickets/organizations/#{id}/active")
  when :closed
    @support_tickets ||= Fog::Compute::Ecloud::SupportTickets.new(:service => service, :href => "#{service.base_path}/admin/tickets/organizations/#{id}/closed")
  end
end

#tagsObject



21
22
23
# File 'lib/fog/ecloud/models/compute/organization.rb', line 21

def tags
  @tags ||= self.service.tags(:href => "#{service.base_path}/deviceTags/organizations/#{id}")
end

#usersObject



29
30
31
# File 'lib/fog/ecloud/models/compute/organization.rb', line 29

def users
  @users ||= self.service.users(:href => "#{service.base_path}/admin/users/organizations/#{id}")
end