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

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#adminObject



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

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

#disable_support_access(options = {}) ⇒ Object



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

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



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

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



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

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



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

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



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

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



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

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

#idObject



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

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

#locationsObject



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

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

#support_tickets(type = :open) ⇒ Object



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

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



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

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

#usersObject



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

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