fog 0.0.77 → 0.0.78
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/fog.gemspec +59 -48
- data/lib/fog.rb +2 -1
- data/lib/fog/aws/models/ec2/snapshot.rb +3 -1
- data/lib/fog/aws/models/ec2/volume.rb +4 -2
- data/lib/fog/aws/s3.rb +1 -1
- data/lib/fog/deprecation.rb +14 -0
- data/lib/fog/terremark.rb +7 -220
- data/lib/fog/terremark/bin.rb +24 -14
- data/lib/fog/terremark/ecloud.rb +51 -0
- data/lib/fog/terremark/models/shared/address.rb +29 -0
- data/lib/fog/terremark/models/shared/addresses.rb +49 -0
- data/lib/fog/terremark/models/shared/network.rb +30 -0
- data/lib/fog/terremark/models/shared/networks.rb +52 -0
- data/lib/fog/terremark/models/shared/server.rb +57 -0
- data/lib/fog/terremark/models/shared/servers.rb +55 -0
- data/lib/fog/terremark/models/shared/task.rb +43 -0
- data/lib/fog/terremark/models/shared/tasks.rb +58 -0
- data/lib/fog/terremark/parser.rb +18 -0
- data/lib/fog/terremark/parsers/shared/get_catalog.rb +46 -0
- data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +46 -0
- data/lib/fog/terremark/parsers/shared/get_internet_services.rb +60 -0
- data/lib/fog/terremark/parsers/{get_node_services.rb → shared/get_node_services.rb} +10 -11
- data/lib/fog/terremark/parsers/shared/get_organization.rb +47 -0
- data/lib/fog/terremark/parsers/shared/get_organizations.rb +27 -0
- data/lib/fog/terremark/parsers/shared/get_public_ips.rb +30 -0
- data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +52 -0
- data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +46 -0
- data/lib/fog/terremark/parsers/shared/get_vdc.rb +108 -0
- data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +41 -0
- data/lib/fog/terremark/parsers/shared/internet_service.rb +65 -0
- data/lib/fog/terremark/parsers/shared/network.rb +51 -0
- data/lib/fog/terremark/parsers/shared/node_service.rb +32 -0
- data/lib/fog/terremark/parsers/shared/public_ip.rb +26 -0
- data/lib/fog/terremark/parsers/shared/task.rb +40 -0
- data/lib/fog/terremark/parsers/shared/vapp.rb +47 -0
- data/lib/fog/terremark/requests/shared/add_internet_service.rb +63 -0
- data/lib/fog/terremark/requests/shared/add_node_service.rb +63 -0
- data/lib/fog/terremark/requests/shared/create_internet_service.rb +63 -0
- data/lib/fog/terremark/requests/shared/delete_internet_service.rb +42 -0
- data/lib/fog/terremark/requests/shared/delete_node_service.rb +42 -0
- data/lib/fog/terremark/requests/shared/delete_public_ip.rb +30 -0
- data/lib/fog/terremark/requests/shared/delete_vapp.rb +42 -0
- data/lib/fog/terremark/requests/shared/deploy_vapp.rb +43 -0
- data/lib/fog/terremark/requests/shared/get_catalog.rb +40 -0
- data/lib/fog/terremark/requests/shared/get_catalog_item.rb +43 -0
- data/lib/fog/terremark/requests/shared/get_internet_services.rb +43 -0
- data/lib/fog/terremark/requests/shared/get_network.rb +37 -0
- data/lib/fog/terremark/requests/shared/get_node_services.rb +38 -0
- data/lib/fog/terremark/requests/shared/get_organization.rb +42 -0
- data/lib/fog/terremark/requests/shared/get_organizations.rb +39 -0
- data/lib/fog/terremark/requests/shared/get_public_ip.rb +41 -0
- data/lib/fog/terremark/requests/shared/get_public_ips.rb +41 -0
- data/lib/fog/terremark/requests/shared/get_task.rb +47 -0
- data/lib/fog/terremark/requests/shared/get_tasks_list.rb +40 -0
- data/lib/fog/terremark/requests/shared/get_vapp.rb +50 -0
- data/lib/fog/terremark/requests/shared/get_vapp_template.rb +43 -0
- data/lib/fog/terremark/requests/shared/get_vdc.rb +43 -0
- data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +79 -0
- data/lib/fog/terremark/requests/shared/power_off.rb +43 -0
- data/lib/fog/terremark/requests/shared/power_on.rb +43 -0
- data/lib/fog/terremark/requests/shared/reset.rb +43 -0
- data/lib/fog/terremark/requests/shared/shutdown.rb +43 -0
- data/lib/fog/terremark/shared.rb +139 -0
- data/lib/fog/terremark/vcloud.rb +98 -0
- metadata +60 -49
- data/lib/fog/terremark/models/server.rb +0 -56
- data/lib/fog/terremark/models/servers.rb +0 -53
- data/lib/fog/terremark/models/task.rb +0 -41
- data/lib/fog/terremark/models/tasks.rb +0 -56
- data/lib/fog/terremark/parsers/get_catalog.rb +0 -44
- data/lib/fog/terremark/parsers/get_catalog_item.rb +0 -44
- data/lib/fog/terremark/parsers/get_internet_services.rb +0 -58
- data/lib/fog/terremark/parsers/get_organization.rb +0 -45
- data/lib/fog/terremark/parsers/get_organizations.rb +0 -26
- data/lib/fog/terremark/parsers/get_public_ips.rb +0 -28
- data/lib/fog/terremark/parsers/get_tasks_list.rb +0 -50
- data/lib/fog/terremark/parsers/get_vapp_template.rb +0 -44
- data/lib/fog/terremark/parsers/get_vdc.rb +0 -106
- data/lib/fog/terremark/parsers/instantiate_vapp_template.rb +0 -39
- data/lib/fog/terremark/parsers/internet_service.rb +0 -63
- data/lib/fog/terremark/parsers/node_service.rb +0 -30
- data/lib/fog/terremark/parsers/public_ip.rb +0 -24
- data/lib/fog/terremark/parsers/task.rb +0 -38
- data/lib/fog/terremark/parsers/vapp.rb +0 -45
- data/lib/fog/terremark/requests/add_internet_service.rb +0 -61
- data/lib/fog/terremark/requests/add_node_service.rb +0 -61
- data/lib/fog/terremark/requests/create_internet_service.rb +0 -61
- data/lib/fog/terremark/requests/delete_internet_service.rb +0 -40
- data/lib/fog/terremark/requests/delete_node_service.rb +0 -40
- data/lib/fog/terremark/requests/delete_public_ip.rb +0 -28
- data/lib/fog/terremark/requests/delete_vapp.rb +0 -40
- data/lib/fog/terremark/requests/deploy_vapp.rb +0 -41
- data/lib/fog/terremark/requests/get_catalog.rb +0 -38
- data/lib/fog/terremark/requests/get_catalog_item.rb +0 -41
- data/lib/fog/terremark/requests/get_internet_services.rb +0 -41
- data/lib/fog/terremark/requests/get_node_services.rb +0 -36
- data/lib/fog/terremark/requests/get_organization.rb +0 -40
- data/lib/fog/terremark/requests/get_organizations.rb +0 -37
- data/lib/fog/terremark/requests/get_public_ip.rb +0 -35
- data/lib/fog/terremark/requests/get_public_ips.rb +0 -35
- data/lib/fog/terremark/requests/get_task.rb +0 -45
- data/lib/fog/terremark/requests/get_tasks_list.rb +0 -38
- data/lib/fog/terremark/requests/get_vapp.rb +0 -48
- data/lib/fog/terremark/requests/get_vapp_template.rb +0 -41
- data/lib/fog/terremark/requests/get_vdc.rb +0 -41
- data/lib/fog/terremark/requests/instantiate_vapp_template.rb +0 -77
- data/lib/fog/terremark/requests/power_off.rb +0 -41
- data/lib/fog/terremark/requests/power_on.rb +0 -41
- data/lib/fog/terremark/requests/reset.rb +0 -41
- data/lib/fog/terremark/requests/shutdown.rb +0 -41
@@ -0,0 +1,39 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get list of organizations
|
7
|
+
#
|
8
|
+
# ==== Returns
|
9
|
+
# * response<~Excon::Response>:
|
10
|
+
# * body<~Array>:
|
11
|
+
# * 'description'<~String> - Description of organization
|
12
|
+
# * 'links'<~Array> - An array of links to entities in the organization
|
13
|
+
# * 'name'<~String> - Name of organization
|
14
|
+
def get_organizations
|
15
|
+
request({
|
16
|
+
:expects => 200,
|
17
|
+
:headers => {
|
18
|
+
'Authorization' => "Basic #{Base64.encode64("#{@terremark_username}:#{@terremark_password}").chomp!}",
|
19
|
+
# Terremark said they're going to remove passing in the Content-Type to login in a future release
|
20
|
+
'Content-Type' => "application/vnd.vmware.vcloud.orgList+xml"
|
21
|
+
},
|
22
|
+
:method => 'POST',
|
23
|
+
:parser => Fog::Parsers::Terremark::Shared::GetOrganizations.new,
|
24
|
+
:path => 'login'
|
25
|
+
})
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
module Mock
|
31
|
+
|
32
|
+
def get_organizations
|
33
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get details for a public ip
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * public_ip_id<~Integer> - Id of public ip to look up
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
# * 'PublicIpAddresses'<~Array>
|
15
|
+
# * 'href'<~String> - linke to item
|
16
|
+
# * 'name'<~String> - name of item
|
17
|
+
def get_public_ip(public_ip_id)
|
18
|
+
opts = {
|
19
|
+
:expects => 200,
|
20
|
+
:method => 'GET',
|
21
|
+
:parser => Fog::Parsers::Terremark::Shared::PublicIp.new,
|
22
|
+
:path => "publicIps/#{public_ip_id}"
|
23
|
+
}
|
24
|
+
if self.class == Fog::Terremark::Ecloud::Real
|
25
|
+
opts[:path] = "extensions/publicIp/#{public_ip_id}"
|
26
|
+
end
|
27
|
+
request(opts)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
module Mock
|
33
|
+
|
34
|
+
def get_public_ip(public_ip_id)
|
35
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get list of public ips
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * vdc_id<~Integer> - Id of vdc to find public ips for
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
# * 'PublicIpAddresses'<~Array>
|
15
|
+
# * 'href'<~String> - link to item
|
16
|
+
# * 'name'<~String> - name of item
|
17
|
+
def get_public_ips(vdc_id)
|
18
|
+
opts = {
|
19
|
+
:expects => 200,
|
20
|
+
:method => 'GET',
|
21
|
+
:parser => Fog::Parsers::Terremark::Shared::GetPublicIps.new,
|
22
|
+
:path => "vdc/#{vdc_id}/publicIps"
|
23
|
+
}
|
24
|
+
if self.class == Fog::Terremark::Ecloud::Real
|
25
|
+
opts[:path] = "extensions/vdc/#{vdc_id}/publicIps"
|
26
|
+
end
|
27
|
+
request(opts)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
module Mock
|
33
|
+
|
34
|
+
def get_public_ips(vdc_id)
|
35
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get details of a task
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * task_id<~Integer> - Id of task to lookup
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
# * 'endTime'<~String> - endTime of task
|
15
|
+
# * 'href'<~String> - link to task
|
16
|
+
# * 'startTime'<~String> - startTime of task
|
17
|
+
# * 'status'<~String> - status of task
|
18
|
+
# * 'type'<~String> - type of task
|
19
|
+
# * 'Owner'<~String> -
|
20
|
+
# * 'href'<~String> - href of owner
|
21
|
+
# * 'name'<~String> - name of owner
|
22
|
+
# * 'type'<~String> - type of owner
|
23
|
+
# * 'Result'<~String> -
|
24
|
+
# * 'href'<~String> - href of result
|
25
|
+
# * 'name'<~String> - name of result
|
26
|
+
# * 'type'<~String> - type of result
|
27
|
+
def get_task(task_id)
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => 'GET',
|
31
|
+
:parser => Fog::Parsers::Terremark::Shared::Task.new,
|
32
|
+
:path => "task/#{task_id}"
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
module Mock
|
39
|
+
|
40
|
+
def get_task(task_id)
|
41
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get list of tasks
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * tasks_list_id<~Integer> - Id of tasks lists to view
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
# * 'CatalogItems'<~Array>
|
15
|
+
# * 'href'<~String> - linke to item
|
16
|
+
# * 'name'<~String> - name of item
|
17
|
+
# * 'type'<~String> - type of item
|
18
|
+
# * 'description'<~String> - Description of catalog
|
19
|
+
# * 'name'<~String> - Name of catalog
|
20
|
+
def get_tasks_list(tasks_list_id)
|
21
|
+
request(
|
22
|
+
:expects => 200,
|
23
|
+
:method => 'GET',
|
24
|
+
:parser => Fog::Parsers::Terremark::Shared::GetTasksList.new,
|
25
|
+
:path => "tasksList/#{tasks_list_id}"
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
module Mock
|
32
|
+
|
33
|
+
def get_tasks_list(tasks_list_id)
|
34
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get details of a vapp
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * vapp_id<~Integer> - Id of vapp to lookup
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
|
15
|
+
# FIXME
|
16
|
+
|
17
|
+
# * 'endTime'<~String> - endTime of task
|
18
|
+
# * 'href'<~String> - link to task
|
19
|
+
# * 'startTime'<~String> - startTime of task
|
20
|
+
# * 'status'<~String> - status of task
|
21
|
+
# * 'type'<~String> - type of task
|
22
|
+
# * 'Owner'<~String> -
|
23
|
+
# * 'href'<~String> - href of owner
|
24
|
+
# * 'name'<~String> - name of owner
|
25
|
+
# * 'type'<~String> - type of owner
|
26
|
+
# * 'Result'<~String> -
|
27
|
+
# * 'href'<~String> - href of result
|
28
|
+
# * 'name'<~String> - name of result
|
29
|
+
# * 'type'<~String> - type of result
|
30
|
+
def get_vapp(vapp_id)
|
31
|
+
request(
|
32
|
+
:expects => 200,
|
33
|
+
:method => 'GET',
|
34
|
+
:parser => Fog::Parsers::Terremark::Shared::Vapp.new,
|
35
|
+
:path => "vapp/#{vapp_id}"
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
module Mock
|
42
|
+
|
43
|
+
def get_vapp(vapp_id)
|
44
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get details of a vapp template
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * vapp_template_id<~Integer> - Id of vapp template to lookup
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
|
15
|
+
# FIXME
|
16
|
+
|
17
|
+
# * 'CatalogItems'<~Array>
|
18
|
+
# * 'href'<~String> - linke to item
|
19
|
+
# * 'name'<~String> - name of item
|
20
|
+
# * 'type'<~String> - type of item
|
21
|
+
# * 'description'<~String> - Description of catalog
|
22
|
+
# * 'name'<~String> - Name of catalog
|
23
|
+
def get_vapp_template(vapp_template_id)
|
24
|
+
request(
|
25
|
+
:expects => 200,
|
26
|
+
:method => 'GET',
|
27
|
+
:parser => Fog::Parsers::Terremark::Shared::GetVappTemplate.new,
|
28
|
+
:path => "vAppTemplate/#{vapp_template_id}"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
module Mock
|
35
|
+
|
36
|
+
def get_vapp_template(vapp_template_id)
|
37
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Get details of a vdc
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * vdc_id<~Integer> - Id of vdc to lookup
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
|
15
|
+
# FIXME
|
16
|
+
|
17
|
+
# * 'CatalogItems'<~Array>
|
18
|
+
# * 'href'<~String> - linke to item
|
19
|
+
# * 'name'<~String> - name of item
|
20
|
+
# * 'type'<~String> - type of item
|
21
|
+
# * 'description'<~String> - Description of catalog
|
22
|
+
# * 'name'<~String> - Name of catalog
|
23
|
+
def get_vdc(vdc_id)
|
24
|
+
request(
|
25
|
+
:expects => 200,
|
26
|
+
:method => 'GET',
|
27
|
+
:parser => Fog::Parsers::Terremark::Shared::GetVdc.new,
|
28
|
+
:path => "vdc/#{vdc_id}"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
module Mock
|
35
|
+
|
36
|
+
def get_vdc(vdc_id)
|
37
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Instatiate a vapp template
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * name<~String>: Name of the resulting vapp .. must start with letter, up to 15 chars alphanumeric.
|
10
|
+
# * options<~Hash>:
|
11
|
+
# * cpus<~Integer>: Number of cpus in [1, 2, 4, 8], defaults to 1
|
12
|
+
# * memory<~Integer>: Amount of memory either 512 or a multiple of 1024, defaults to 512
|
13
|
+
# * vapp_template<~String>: id of the vapp template to be instantiated
|
14
|
+
# ==== Returns
|
15
|
+
# * response<~Excon::Response>:
|
16
|
+
# * body<~Hash>:
|
17
|
+
# * 'Links;<~Array> (e.g. up to vdc)
|
18
|
+
# * 'href'<~String> Link to the resulting vapp
|
19
|
+
# * 'name'<~String> - name of item
|
20
|
+
# * 'type'<~String> - type of item
|
21
|
+
# * 'status'<~String> - 0(pending) --> 2(off) -->4(on)
|
22
|
+
def instantiate_vapp_template(name, vapp_template, options = {})
|
23
|
+
unless name.length < 15
|
24
|
+
raise ArgumentError.new('Name must be fewer than 15 characters')
|
25
|
+
end
|
26
|
+
options['cpus'] ||= 1
|
27
|
+
options['memory'] ||= 512
|
28
|
+
options['network_id'] ||= default_network_id
|
29
|
+
options['vdc_id'] ||= default_vdc_id
|
30
|
+
|
31
|
+
data = <<-DATA
|
32
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
33
|
+
<InstantiateVAppTemplateParams name="#{name}" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v0.8 http://services.vcloudexpress.terremark.com/api/v0.8/ns/vcloud.xsd">
|
34
|
+
<VAppTemplate href="#{@scheme}://#{@host}/#{@path}/vAppTemplate/#{vapp_template}" />
|
35
|
+
<InstantiationParams xmlns:vmw="http://www.vmware.com/schema/ovf">
|
36
|
+
<ProductSection xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:q1="http://www.vmware.com/vcloud/v0.8"/>
|
37
|
+
<VirtualHardwareSection xmlns:q1="http://www.vmware.com/vcloud/v0.8">
|
38
|
+
<Item xmlns="http://schemas.dmtf.org/ovf/envelope/1">
|
39
|
+
<InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</InstanceID>
|
40
|
+
<ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</ResourceType>
|
41
|
+
<VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">#{options['cpus']}</VirtualQuantity>
|
42
|
+
</Item>
|
43
|
+
<Item xmlns="http://schemas.dmtf.org/ovf/envelope/1">
|
44
|
+
<InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</InstanceID>
|
45
|
+
<ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4</ResourceType>
|
46
|
+
<VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">#{options['memory']}</VirtualQuantity>
|
47
|
+
</Item>
|
48
|
+
</VirtualHardwareSection>
|
49
|
+
<NetworkConfigSection>
|
50
|
+
<NetworkConfig>
|
51
|
+
<NetworkAssociation href="#{@scheme}://#{@host}/#{@path}/network/#{options['network_id']}"/>
|
52
|
+
</NetworkConfig>
|
53
|
+
</NetworkConfigSection>
|
54
|
+
</InstantiationParams>
|
55
|
+
</InstantiateVAppTemplateParams>
|
56
|
+
DATA
|
57
|
+
|
58
|
+
request(
|
59
|
+
:body => data,
|
60
|
+
:expects => 200,
|
61
|
+
:headers => { 'Content-Type' => 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml' },
|
62
|
+
:method => 'POST',
|
63
|
+
:parser => Fog::Parsers::Terremark::Shared::InstantiateVappTemplate.new,
|
64
|
+
:path => "vdc/#{options['vdc_id']}/action/instantiatevAppTemplate"
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
module Mock
|
71
|
+
|
72
|
+
def instatiate_vapp_template(vapp_template_id)
|
73
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fog
|
2
|
+
module Terremark
|
3
|
+
module Shared
|
4
|
+
module Real
|
5
|
+
|
6
|
+
# Power off a vapp
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * vapp_id<~Integer> - Id of vapp to power off
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
# * 'endTime'<~String> - endTime of task
|
15
|
+
# * 'href'<~String> - link to task
|
16
|
+
# * 'startTime'<~String> - startTime of task
|
17
|
+
# * 'status'<~String> - status of task
|
18
|
+
# * 'type'<~String> - type of task
|
19
|
+
# * 'Owner'<~String> -
|
20
|
+
# * 'href'<~String> - href of owner
|
21
|
+
# * 'name'<~String> - name of owner
|
22
|
+
# * 'type'<~String> - type of owner
|
23
|
+
def power_off(vapp_id)
|
24
|
+
request(
|
25
|
+
:expects => 202,
|
26
|
+
:method => 'POST',
|
27
|
+
:parser => Fog::Parsers::Terremark::Shared::Task.new,
|
28
|
+
:path => "vApp/#{vapp_id}/power/action/powerOff"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
module Mock
|
35
|
+
|
36
|
+
def power_off(vapp_id)
|
37
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|