Class: Fog::Compute::Ecloud::Organization
- Inherits:
-
Ecloud::Model
- Object
- Model
- Ecloud::Model
- Fog::Compute::Ecloud::Organization
- Defined in:
- lib/fog/compute/ecloud/models/organization.rb
Instance Attribute Summary
Attributes inherited from Ecloud::Model
Instance Method Summary collapse
- #admin ⇒ Object
- #disable_support_access(options = {}) ⇒ Object
- #edit_authentication_levels(options = {}) ⇒ Object
- #edit_login_banner(options = {}) ⇒ Object
- #edit_password_complexity_rules(options = {}) ⇒ Object
- #enable_support_access(options = {}) ⇒ Object
- #environments ⇒ Object (also: #vdcs)
- #id ⇒ Object
- #locations ⇒ Object
-
#reload ⇒ Object
Set instance variables for child collections/models to nil so that they will be reloaded correctly.
- #support_tickets(type = :open) ⇒ Object
- #tags ⇒ Object
- #users ⇒ Object
Methods inherited from Ecloud::Model
Instance Method Details
#admin ⇒ Object
25 26 27 |
# File 'lib/fog/compute/ecloud/models/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
78 79 80 81 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 78 def disable_support_access( = {}) [:uri] = "#{service.base_path}/admin/organizations/#{id}/action/disableSupportAccess" service.admin_disable_support_access([:uri]) end |
#edit_authentication_levels(options = {}) ⇒ Object
55 56 57 58 59 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 55 def edit_authentication_levels( = {}) [:uri] = "#{service.base_path}/admin/organizations/#{id}/authenticationLevels" data = service.admin_edit_authentication_levels().body level = Fog::Compute::Ecloud::AdminOrganizations.new(:service => service, :href => data[:href])[0] end |
#edit_login_banner(options = {}) ⇒ Object
67 68 69 70 71 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 67 def ( = {}) [:uri] = "#{service.base_path}/admin/organizations/#{id}/loginBanner" data = service.().body = Fog::Compute::Ecloud::LoginBanners.new(:service => service, :href => data[:href])[0] end |
#edit_password_complexity_rules(options = {}) ⇒ Object
61 62 63 64 65 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 61 def edit_password_complexity_rules( = {}) [:uri] = "#{service.base_path}/admin/organizations/#{id}/passwordComplexityRules" data = service.admin_edit_password_complexity_rules().body level = Fog::Compute::Ecloud::PasswordComplexityRules.new(:service => service, :href => data[:href])[0] end |
#enable_support_access(options = {}) ⇒ Object
73 74 75 76 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 73 def enable_support_access( = {}) [:uri] = "#{service.base_path}/admin/organizations/#{id}/action/enableSupportAccess" service.admin_enable_support_access([:uri]) end |
#environments ⇒ Object Also known as: vdcs
17 18 19 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 17 def environments @environments ||= self.service.environments(:href => href) end |
#id ⇒ Object
83 84 85 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 83 def id href.scan(/\d+/)[0] end |
#locations ⇒ Object
13 14 15 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 13 def locations @locations ||= Fog::Compute::Ecloud::Locations.new( :service => service, :href => href ) end |
#reload ⇒ Object
Set instance variables for child collections/models to nil so that they will be reloaded correctly
45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 45 def reload @locations = nil @environments = nil @tags = nil @admin = nil @users = nil @support_tickets = nil super end |
#support_tickets(type = :open) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/fog/compute/ecloud/models/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 |
#tags ⇒ Object
21 22 23 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 21 def @tags ||= self.service.(:href => "#{service.base_path}/deviceTags/organizations/#{id}") end |
#users ⇒ Object
29 30 31 |
# File 'lib/fog/compute/ecloud/models/organization.rb', line 29 def users @users ||= self.service.users(:href => "#{service.base_path}/admin/users/organizations/#{id}") end |