fog 0.0.77 → 0.0.78

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/Gemfile.lock +2 -2
  2. data/fog.gemspec +59 -48
  3. data/lib/fog.rb +2 -1
  4. data/lib/fog/aws/models/ec2/snapshot.rb +3 -1
  5. data/lib/fog/aws/models/ec2/volume.rb +4 -2
  6. data/lib/fog/aws/s3.rb +1 -1
  7. data/lib/fog/deprecation.rb +14 -0
  8. data/lib/fog/terremark.rb +7 -220
  9. data/lib/fog/terremark/bin.rb +24 -14
  10. data/lib/fog/terremark/ecloud.rb +51 -0
  11. data/lib/fog/terremark/models/shared/address.rb +29 -0
  12. data/lib/fog/terremark/models/shared/addresses.rb +49 -0
  13. data/lib/fog/terremark/models/shared/network.rb +30 -0
  14. data/lib/fog/terremark/models/shared/networks.rb +52 -0
  15. data/lib/fog/terremark/models/shared/server.rb +57 -0
  16. data/lib/fog/terremark/models/shared/servers.rb +55 -0
  17. data/lib/fog/terremark/models/shared/task.rb +43 -0
  18. data/lib/fog/terremark/models/shared/tasks.rb +58 -0
  19. data/lib/fog/terremark/parser.rb +18 -0
  20. data/lib/fog/terremark/parsers/shared/get_catalog.rb +46 -0
  21. data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +46 -0
  22. data/lib/fog/terremark/parsers/shared/get_internet_services.rb +60 -0
  23. data/lib/fog/terremark/parsers/{get_node_services.rb → shared/get_node_services.rb} +10 -11
  24. data/lib/fog/terremark/parsers/shared/get_organization.rb +47 -0
  25. data/lib/fog/terremark/parsers/shared/get_organizations.rb +27 -0
  26. data/lib/fog/terremark/parsers/shared/get_public_ips.rb +30 -0
  27. data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +52 -0
  28. data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +46 -0
  29. data/lib/fog/terremark/parsers/shared/get_vdc.rb +108 -0
  30. data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +41 -0
  31. data/lib/fog/terremark/parsers/shared/internet_service.rb +65 -0
  32. data/lib/fog/terremark/parsers/shared/network.rb +51 -0
  33. data/lib/fog/terremark/parsers/shared/node_service.rb +32 -0
  34. data/lib/fog/terremark/parsers/shared/public_ip.rb +26 -0
  35. data/lib/fog/terremark/parsers/shared/task.rb +40 -0
  36. data/lib/fog/terremark/parsers/shared/vapp.rb +47 -0
  37. data/lib/fog/terremark/requests/shared/add_internet_service.rb +63 -0
  38. data/lib/fog/terremark/requests/shared/add_node_service.rb +63 -0
  39. data/lib/fog/terremark/requests/shared/create_internet_service.rb +63 -0
  40. data/lib/fog/terremark/requests/shared/delete_internet_service.rb +42 -0
  41. data/lib/fog/terremark/requests/shared/delete_node_service.rb +42 -0
  42. data/lib/fog/terremark/requests/shared/delete_public_ip.rb +30 -0
  43. data/lib/fog/terremark/requests/shared/delete_vapp.rb +42 -0
  44. data/lib/fog/terremark/requests/shared/deploy_vapp.rb +43 -0
  45. data/lib/fog/terremark/requests/shared/get_catalog.rb +40 -0
  46. data/lib/fog/terremark/requests/shared/get_catalog_item.rb +43 -0
  47. data/lib/fog/terremark/requests/shared/get_internet_services.rb +43 -0
  48. data/lib/fog/terremark/requests/shared/get_network.rb +37 -0
  49. data/lib/fog/terremark/requests/shared/get_node_services.rb +38 -0
  50. data/lib/fog/terremark/requests/shared/get_organization.rb +42 -0
  51. data/lib/fog/terremark/requests/shared/get_organizations.rb +39 -0
  52. data/lib/fog/terremark/requests/shared/get_public_ip.rb +41 -0
  53. data/lib/fog/terremark/requests/shared/get_public_ips.rb +41 -0
  54. data/lib/fog/terremark/requests/shared/get_task.rb +47 -0
  55. data/lib/fog/terremark/requests/shared/get_tasks_list.rb +40 -0
  56. data/lib/fog/terremark/requests/shared/get_vapp.rb +50 -0
  57. data/lib/fog/terremark/requests/shared/get_vapp_template.rb +43 -0
  58. data/lib/fog/terremark/requests/shared/get_vdc.rb +43 -0
  59. data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +79 -0
  60. data/lib/fog/terremark/requests/shared/power_off.rb +43 -0
  61. data/lib/fog/terremark/requests/shared/power_on.rb +43 -0
  62. data/lib/fog/terremark/requests/shared/reset.rb +43 -0
  63. data/lib/fog/terremark/requests/shared/shutdown.rb +43 -0
  64. data/lib/fog/terremark/shared.rb +139 -0
  65. data/lib/fog/terremark/vcloud.rb +98 -0
  66. metadata +60 -49
  67. data/lib/fog/terremark/models/server.rb +0 -56
  68. data/lib/fog/terremark/models/servers.rb +0 -53
  69. data/lib/fog/terremark/models/task.rb +0 -41
  70. data/lib/fog/terremark/models/tasks.rb +0 -56
  71. data/lib/fog/terremark/parsers/get_catalog.rb +0 -44
  72. data/lib/fog/terremark/parsers/get_catalog_item.rb +0 -44
  73. data/lib/fog/terremark/parsers/get_internet_services.rb +0 -58
  74. data/lib/fog/terremark/parsers/get_organization.rb +0 -45
  75. data/lib/fog/terremark/parsers/get_organizations.rb +0 -26
  76. data/lib/fog/terremark/parsers/get_public_ips.rb +0 -28
  77. data/lib/fog/terremark/parsers/get_tasks_list.rb +0 -50
  78. data/lib/fog/terremark/parsers/get_vapp_template.rb +0 -44
  79. data/lib/fog/terremark/parsers/get_vdc.rb +0 -106
  80. data/lib/fog/terremark/parsers/instantiate_vapp_template.rb +0 -39
  81. data/lib/fog/terremark/parsers/internet_service.rb +0 -63
  82. data/lib/fog/terremark/parsers/node_service.rb +0 -30
  83. data/lib/fog/terremark/parsers/public_ip.rb +0 -24
  84. data/lib/fog/terremark/parsers/task.rb +0 -38
  85. data/lib/fog/terremark/parsers/vapp.rb +0 -45
  86. data/lib/fog/terremark/requests/add_internet_service.rb +0 -61
  87. data/lib/fog/terremark/requests/add_node_service.rb +0 -61
  88. data/lib/fog/terremark/requests/create_internet_service.rb +0 -61
  89. data/lib/fog/terremark/requests/delete_internet_service.rb +0 -40
  90. data/lib/fog/terremark/requests/delete_node_service.rb +0 -40
  91. data/lib/fog/terremark/requests/delete_public_ip.rb +0 -28
  92. data/lib/fog/terremark/requests/delete_vapp.rb +0 -40
  93. data/lib/fog/terremark/requests/deploy_vapp.rb +0 -41
  94. data/lib/fog/terremark/requests/get_catalog.rb +0 -38
  95. data/lib/fog/terremark/requests/get_catalog_item.rb +0 -41
  96. data/lib/fog/terremark/requests/get_internet_services.rb +0 -41
  97. data/lib/fog/terremark/requests/get_node_services.rb +0 -36
  98. data/lib/fog/terremark/requests/get_organization.rb +0 -40
  99. data/lib/fog/terremark/requests/get_organizations.rb +0 -37
  100. data/lib/fog/terremark/requests/get_public_ip.rb +0 -35
  101. data/lib/fog/terremark/requests/get_public_ips.rb +0 -35
  102. data/lib/fog/terremark/requests/get_task.rb +0 -45
  103. data/lib/fog/terremark/requests/get_tasks_list.rb +0 -38
  104. data/lib/fog/terremark/requests/get_vapp.rb +0 -48
  105. data/lib/fog/terremark/requests/get_vapp_template.rb +0 -41
  106. data/lib/fog/terremark/requests/get_vdc.rb +0 -41
  107. data/lib/fog/terremark/requests/instantiate_vapp_template.rb +0 -77
  108. data/lib/fog/terremark/requests/power_off.rb +0 -41
  109. data/lib/fog/terremark/requests/power_on.rb +0 -41
  110. data/lib/fog/terremark/requests/reset.rb +0 -41
  111. data/lib/fog/terremark/requests/shutdown.rb +0 -41
@@ -1,50 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class GetTasksList < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = { 'Tasks' => [] }
9
- @task = {}
10
- end
11
-
12
- def start_element(name, attributes)
13
- @value = ''
14
- case name
15
- when 'Owner', 'Result'
16
- data = {}
17
- until attributes.empty?
18
- data[attributes.shift] = attributes.shift
19
- end
20
- @task[name] = data
21
- when 'Task'
22
- until attributes.empty?
23
- @task[attributes.shift] = attributes.shift
24
- end
25
- when 'TasksList'
26
- tasks_list = {}
27
- until attributes.empty?
28
- if attributes.first.is_a?(Array)
29
- attribute = attributes.shift
30
- tasks_list[attribute.first] = attribute.last
31
- else
32
- tasks_list[attributes.shift] = attributes.shift
33
- end
34
- end
35
- @response['href'] = tasks_list['href']
36
- end
37
- end
38
-
39
- def end_element(name)
40
- if name == 'Task'
41
- @response['Tasks'] << @task
42
- @task = {}
43
- end
44
- end
45
-
46
- end
47
-
48
- end
49
- end
50
- end
@@ -1,44 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class GetVappTemplate < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = { 'Links' => [] }
9
- end
10
-
11
- def start_element(name, attributes)
12
- @value = ''
13
- case name
14
- when 'Link'
15
- link = {}
16
- until attributes.empty?
17
- link[attributes.shift] = attributes.shift
18
- end
19
- @response['Links'] << link
20
- when 'VAppTemplate'
21
- vapp_template = {}
22
- until attributes.empty?
23
- if attributes.first.is_a?(Array)
24
- attribute = attributes.shift
25
- vapp_template[attribute.first] = attribute.last
26
- else
27
- vapp_template[attributes.shift] = attributes.shift
28
- end
29
- end
30
- @response['name'] = vapp_template['name']
31
- end
32
- end
33
-
34
- def end_element(name)
35
- if name == 'Description'
36
- @response['Description'] = @value
37
- end
38
- end
39
-
40
- end
41
-
42
- end
43
- end
44
- end
@@ -1,106 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class GetVdc < Fog::Parsers::Base
6
-
7
- def reset
8
- @in_storage_capacity = false
9
- @in_cpu = false
10
- @in_memory = false
11
- @in_instantiated_vms_quota = false
12
- @in_deployed_vms_quota = false
13
- @response = {
14
- 'links' => [],
15
- 'AvailableNetworks' => [],
16
- 'ComputeCapacity' => {
17
- 'Cpu' => {},
18
- 'DeployedVmsQuota' => {},
19
- 'InstantiatedVmsQuota' => {},
20
- 'Memory' => {}
21
- },
22
- 'StorageCapacity' => {},
23
- 'ResourceEntities' => []
24
- }
25
- end
26
-
27
- def start_element(name, attributes)
28
- @value = ''
29
- case name
30
- when 'Cpu'
31
- @in_cpu = true
32
- when 'DeployedVmsQuota'
33
- @in_deployed_vms_quota = true
34
- when 'InstantiatedVmsQuota'
35
- @in_instantiated_vms_quota = true
36
- when 'Link'
37
- link = {}
38
- until attributes.empty?
39
- link[attributes.shift] = attributes.shift
40
- end
41
- @response['links'] << link
42
- when 'Memory'
43
- @in_memory = true
44
- when 'Network'
45
- network = {}
46
- until attributes.empty?
47
- network[attributes.shift] = attributes.shift
48
- end
49
- @response['AvailableNetworks'] << network
50
- when 'ResourceEntity'
51
- resource_entity = {}
52
- until attributes.empty?
53
- resource_entity[attributes.shift] = attributes.shift
54
- end
55
- @response['ResourceEntities'] << resource_entity
56
- when 'StorageCapacity'
57
- @in_storage_capacity = true
58
- when 'Vdc'
59
- vdc = {}
60
- until attributes.empty?
61
- if attributes.first.is_a?(Array)
62
- attribute = attributes.shift
63
- vdc[attribute.first] = attribute.last
64
- else
65
- vdc[attributes.shift] = attributes.shift
66
- end
67
- end
68
- @response['href'] = vdc['href']
69
- @response['name'] = vdc['name']
70
- end
71
- end
72
-
73
- def end_element(name)
74
- case name
75
- when 'Allocated', 'Limit', 'Units', 'Used'
76
- if @in_cpu
77
- @response['ComputeCapacity']['Cpu'][name] = @value
78
- elsif @in_deployed_vms_quota
79
- @response['ComputeCapacity']['DeployedVmsQuota'][name] = @value
80
- elsif @in_instantiated_vms_quota
81
- @response['ComputeCapacity']['InstantiatedVmsQuota'][name] = @value
82
- elsif @in_memory
83
- @response['ComputeCapacity']['Memory'][name] = @value
84
- elsif @in_storage_capacity
85
- @response['StorageCapacity'][name] = @value
86
- end
87
- when 'Cpu'
88
- @in_cpu = false
89
- when 'DeployedVmsQuota'
90
- @in_deployed_vms_quota = false
91
- when 'InstantiatedVmsQuota'
92
- @in_instantiated_vms_quota = false
93
- when 'Memory'
94
- @in_memory = false
95
- when 'StorageCapacity'
96
- @in_storage_capacity = false
97
- when 'Type'
98
- @response[name] = @value
99
- end
100
- end
101
-
102
- end
103
-
104
- end
105
- end
106
- end
@@ -1,39 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class InstantiateVappTemplate < Fog::Parsers::Base
6
-
7
- def reset
8
- @property_key
9
- @response = { 'Links' => [] }
10
- end
11
-
12
- def start_element(name, attributes)
13
- @value = ''
14
- case name
15
- when 'Link'
16
- link = {}
17
- until attributes.empty?
18
- link[attributes.shift] = attributes.shift
19
- end
20
- @response['Links'] << link
21
- when 'VApp'
22
- vapp_template = {}
23
- until attributes.empty?
24
- if attributes.first.is_a?(Array)
25
- attribute = attributes.shift
26
- vapp_template[attribute.first] = attribute.last
27
- else
28
- vapp_template[attributes.shift] = attributes.shift
29
- end
30
- end
31
- @response.merge!(vapp_template.reject {|key, value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
32
- end
33
- end
34
-
35
- end
36
-
37
- end
38
- end
39
- end
@@ -1,63 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class InternetService < Fog::Parsers::Base
6
-
7
- def reset
8
- @in_public_ip_address = false
9
- @response = { 'PublicIpAddress' => {} }
10
- end
11
-
12
- def start_element(name, attributes)
13
- @value = ''
14
- case name
15
- when 'Href'
16
- data = {}
17
- until attributes.empty?
18
- data[attributes.shift] = attributes.shift
19
- end
20
- if @in_public_ip_address
21
- @response['PublicIpAddress'][name] = data
22
- else
23
- @response[name] = data
24
- end
25
- when 'PublicIpAddress'
26
- @in_public_ip_address = true
27
- end
28
- end
29
-
30
- def end_element(name)
31
- case name
32
- when 'Description', 'Protocol'
33
- @response[name] = @value
34
- when 'Enabled'
35
- if @value == 'false'
36
- @response[name] = false
37
- else
38
- @response[name] = true
39
- end
40
- when 'Id'
41
- if @in_public_ip_address
42
- @response['PublicIpAddress'][name] = @value.to_i
43
- else
44
- @response[name] = @value.to_i
45
- end
46
- when 'Name'
47
- if @in_public_ip_address
48
- @response['PublicIpAddress'][name] = @value
49
- else
50
- @response[name] = @value
51
- end
52
- when 'Port', 'Timeout'
53
- @response[name] = @value.to_i
54
- when 'PublicIpAddress'
55
- @in_public_ip_address = false
56
- end
57
- end
58
-
59
- end
60
-
61
- end
62
- end
63
- end
@@ -1,30 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class NodeService < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = {}
9
- end
10
-
11
- def end_element(name)
12
- case name
13
- when 'Description', 'Href', 'IpAddress', 'Name', 'Protocol'
14
- @response[name] = @value
15
- when 'Enabled'
16
- if @value == 'false'
17
- @response[name] = false
18
- else
19
- @response[name] = true
20
- end
21
- when 'Id', 'Port'
22
- @response[name] = @value.to_i
23
- end
24
- end
25
-
26
- end
27
-
28
- end
29
- end
30
- end
@@ -1,24 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class PublicIp < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = {}
9
- end
10
-
11
- def end_element(name)
12
- case name
13
- when 'Href', 'Name'
14
- @response[name] = @value
15
- when 'Id'
16
- @response[name] = @value.to_i
17
- end
18
- end
19
-
20
- end
21
-
22
- end
23
- end
24
- end
@@ -1,38 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class Task < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = {}
9
- end
10
-
11
- def start_element(name, attributes)
12
- @value = ''
13
- case name
14
- when 'Owner', 'Result'
15
- data = {}
16
- until attributes.empty?
17
- data[attributes.shift] = attributes.shift
18
- end
19
- @response[name] = data
20
- when 'Task'
21
- task = {}
22
- until attributes.empty?
23
- if attributes.first.is_a?(Array)
24
- attribute = attributes.shift
25
- task[attribute.first] = attribute.last
26
- else
27
- task[attributes.shift] = attributes.shift
28
- end
29
- end
30
- @response.merge!(task.reject {|key,value| !['endTime', 'href', 'startTime', 'status', 'type'].include?(key)})
31
- end
32
- end
33
-
34
- end
35
-
36
- end
37
- end
38
- end
@@ -1,45 +0,0 @@
1
- module Fog
2
- module Parsers
3
- module Terremark
4
-
5
- class Vapp < Fog::Parsers::Base
6
-
7
- def reset
8
- @response = { 'Links' => [] }
9
- end
10
-
11
- def start_element(name, attributes)
12
- @value = ''
13
- case name
14
- when 'Link'
15
- link = {}
16
- until attributes.empty?
17
- link[attributes.shift] = attributes.shift
18
- end
19
- @response['Links'] << link
20
- when 'Vapp'
21
- vapp = {}
22
- until attributes.empty?
23
- if attributes.first.is_a?(Array)
24
- attribute = attributes.shift
25
- vapp[attribute.first] = attribute.last
26
- else
27
- vapp[attributes.shift] = attributes.shift
28
- end
29
- end
30
- @response.merge!(vapp.reject {|key,value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
31
- end
32
- end
33
-
34
- def end_element(name)
35
- case name
36
- when 'IpAddress'
37
- @response['IpAddress'] = @value
38
- end
39
- end
40
-
41
- end
42
-
43
- end
44
- end
45
- end