Class: Fog::Compute::Ecloud::Environment
Instance Attribute Summary
#loaded
Attributes inherited from Model
#collection, #connection
Instance Method Summary
collapse
#load_unless_loaded!, #reload
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#backup_internet_services ⇒ Object
26
27
28
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 26
def backup_internet_services
@backup_internet_services ||= Fog::Compute::Ecloud::BackupInternetServices.new(:connection, :href => "/cloudapi/ecloud/backupInternetServices/environments/#{id}")
end
|
#catalog ⇒ Object
75
76
77
78
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 75
def catalog
org_href = other_links[:Link].detect { |l| l[:type] == "application/vnd.tmrk.cloud.organization" }[:href]
@catalog ||= Fog::Compute::Ecloud::Catalog.new(:connection => connection, :href => "/cloudapi/ecloud/admin/catalog/organizations/#{org_href.scan(/\d+/)[0]}")
end
|
#compute_pools ⇒ Object
63
64
65
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 63
def compute_pools
@compute_pools ||= Fog::Compute::Ecloud::ComputePools.new(:connection => connection, :href => "/cloudapi/ecloud/computePools/environments/#{id}")
end
|
#create_firewall_acl(options = {}) ⇒ Object
90
91
92
93
94
95
96
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 90
def create_firewall_acl(options = {})
options[:uri] = "/cloudapi/ecloud/firewallAcls/environments/#{id}/action/createFirewallAcl"
options[:permission] ||= "deny"
options[:protocol] ||= "any"
data = connection.firewall_acls_create(options).body
acl = Fog::Compute::Ecloud::FirewallAcls.new(:connection => connection, :href => data[:href])[0]
end
|
#create_trusted_network_group(options = {}) ⇒ Object
84
85
86
87
88
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 84
def create_trusted_network_group(options = {})
options[:uri] = "/cloudapi/ecloud/trustedNetworkGroups/environments/#{id}/action/createTrustedNetworkGroup"
data = connection.trusted_network_groups_create(options).body
tng = Fog::Compute::Ecloud::TrustedNetworkGroups.new(:connection => connection, :href => data[:href])[0]
end
|
#firewall_acls ⇒ Object
59
60
61
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 59
def firewall_acls
@firewall_acls ||= Fog::Compute::Ecloud::FirewallAcls.new(:connection => connection, :href => "/cloudapi/ecloud/firewallAcls/environments/#{id}")
end
|
#id ⇒ Object
98
99
100
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 98
def id
href.scan(/\d+/)[0]
end
|
#internet_services ⇒ Object
18
19
20
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 18
def internet_services
@internet_services ||= Fog::Compute::Ecloud::InternetServices.new(:connection => connection, :href => "/cloudapi/ecloud/networkSummary/environments/#{id}")
end
|
#layout ⇒ Object
47
48
49
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 47
def layout
@layout ||= Fog::Compute::Ecloud::Layouts.new(:connection => connection, :href => "/cloudapi/ecloud/layout/environments/#{id}").first
end
|
#networks ⇒ Object
30
31
32
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 30
def networks
@networks ||= Fog::Compute::Ecloud::Networks.new(:connection => connection, :href => "/cloudapi/ecloud/networks/environments/#{id}")
end
|
#node_services ⇒ Object
22
23
24
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 22
def node_services
@node_services ||= Fog::Compute::Ecloud::Nodes.new(:connection => connection, :href => "/cloudapi/ecloud/networkSummary/environments/#{id}")
end
|
#physical_devices ⇒ Object
67
68
69
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 67
def physical_devices
@physical_devices ||= Fog::Compute::Ecloud::PhysicalDevices.new(:connection => connection, :href => "/cloudapi/ecloud/physicalDevices/environments/#{id}")
end
|
#public_ips ⇒ Object
14
15
16
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 14
def public_ips
@public_ips ||= Fog::Compute::Ecloud::PublicIps.new(:connection => connection, :href => "/cloudapi/ecloud/publicIps/environments/#{id}")
end
|
#rnats ⇒ Object
80
81
82
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 80
def rnats
@rnats ||= Fog::Compute::Ecloud::Rnats.new(:connection => connection, :href => "/cloudapi/ecloud/rnats/environments/#{id}")
end
|
#rows ⇒ Object
51
52
53
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 51
def rows
layout.rows
end
|
#servers ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 34
def servers
@servers = nil
pools = compute_pools
pools.each do |c|
if pools.index(c) == 0
@servers = c.servers
else
c.servers.each { |s| @servers << s }
end
end
@servers
end
|
#tasks ⇒ Object
55
56
57
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 55
def tasks
@tasks ||= Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => "/cloudapi/ecloud/tasks/environments/#{id}")
end
|
#trusted_network_groups ⇒ Object
71
72
73
|
# File 'lib/rackspace-fog/ecloud/models/compute/environment.rb', line 71
def trusted_network_groups
@trusted_network_groups ||= Fog::Compute::Ecloud::TrustedNetworkGroups.new(:connection => connection, :href => "/cloudapi/ecloud/trustedNetworkGroups/environments/#{id}")
end
|