fog-maestrodev 1.18.0.20131209091424 → 1.18.0.20131218202447

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. data/.gitignore +1 -0
  2. data/CONTRIBUTING.md +22 -0
  3. data/LICENSE.md +20 -0
  4. data/README.md +29 -42
  5. data/fog.gemspec +3 -3
  6. data/lib/fog/aws/compute.rb +1 -0
  7. data/lib/fog/aws/models/compute/subnet.rb +4 -0
  8. data/lib/fog/aws/models/compute/vpc.rb +5 -0
  9. data/lib/fog/aws/models/rds/server.rb +2 -0
  10. data/lib/fog/aws/models/storage/file.rb +2 -2
  11. data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
  12. data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
  13. data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
  14. data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
  15. data/lib/fog/cloudstack.rb +1 -1
  16. data/lib/fog/core/connection.rb +1 -2
  17. data/lib/fog/core/hmac.rb +3 -3
  18. data/lib/fog/core/mock.rb +2 -2
  19. data/lib/fog/core/wait_for.rb +1 -1
  20. data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
  21. data/lib/fog/core.rb +1 -1
  22. data/lib/fog/google/compute.rb +19 -11
  23. data/lib/fog/google/examples/create.rb +12 -1
  24. data/lib/fog/google/examples/eric-fail.rb +13 -2
  25. data/lib/fog/google/examples/image_create.rb +0 -1
  26. data/lib/fog/google/examples/launch_micro_instance.rb +1 -2
  27. data/lib/fog/google/examples/metadata.rb +14 -2
  28. data/lib/fog/google/examples/network.rb +13 -2
  29. data/lib/fog/google/models/compute/disk.rb +10 -8
  30. data/lib/fog/google/models/compute/image.rb +8 -3
  31. data/lib/fog/google/models/compute/server.rb +19 -4
  32. data/lib/fog/google/models/compute/servers.rb +25 -9
  33. data/lib/fog/google/requests/compute/insert_disk.rb +6 -3
  34. data/lib/fog/google/requests/compute/insert_image.rb +1 -5
  35. data/lib/fog/google/requests/compute/insert_server.rb +8 -21
  36. data/lib/fog/openstack/compute.rb +3 -0
  37. data/lib/fog/openstack/models/compute/host.rb +1 -0
  38. data/lib/fog/openstack/models/compute/security_group.rb +18 -4
  39. data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
  40. data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
  41. data/lib/fog/openstack/network.rb +33 -3
  42. data/lib/fog/openstack/requests/compute/create_security_group.rb +3 -3
  43. data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
  44. data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
  45. data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
  46. data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
  47. data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
  48. data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
  49. data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
  50. data/lib/fog/openstack/volume.rb +3 -1
  51. data/lib/fog/rackspace/docs/auto_scale.md +9 -9
  52. data/lib/fog/rackspace/docs/getting_started.md +1 -0
  53. data/lib/fog/rackspace/docs/queues.md +312 -0
  54. data/lib/fog/vcloud_director/README.md +2 -0
  55. data/lib/fog/vcloud_director/compute.rb +78 -8
  56. data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
  57. data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
  58. data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
  59. data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
  60. data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
  61. data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
  62. data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
  63. data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
  64. data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +83 -0
  65. data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
  66. data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
  67. data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
  68. data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
  69. data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
  70. data/lib/fog/vsphere/models/compute/server.rb +1 -1
  71. data/lib/fog/xenserver/compute.rb +35 -0
  72. data/lib/fog/xenserver/models/compute/blob.rb +22 -0
  73. data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
  74. data/lib/fog/xenserver/models/compute/bond.rb +23 -0
  75. data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
  76. data/lib/fog/xenserver/models/compute/console.rb +3 -1
  77. data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
  78. data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
  79. data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
  80. data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
  81. data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
  82. data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
  83. data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
  84. data/lib/fog/xenserver/models/compute/host.rb +41 -8
  85. data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
  86. data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
  87. data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
  88. data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
  89. data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
  90. data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
  91. data/lib/fog/xenserver/models/compute/network.rb +7 -6
  92. data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
  93. data/lib/fog/xenserver/models/compute/pci.rb +22 -0
  94. data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
  95. data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
  96. data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
  97. data/lib/fog/xenserver/models/compute/pif.rb +19 -8
  98. data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
  99. data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
  100. data/lib/fog/xenserver/models/compute/pool.rb +18 -1
  101. data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
  102. data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
  103. data/lib/fog/xenserver/models/compute/role.rb +19 -0
  104. data/lib/fog/xenserver/models/compute/roles.rb +25 -0
  105. data/lib/fog/xenserver/models/compute/server.rb +59 -26
  106. data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
  107. data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
  108. data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
  109. data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
  110. data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
  111. data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
  112. data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
  113. data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
  114. data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
  115. data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
  116. data/lib/fog/xenserver/models/compute/vif.rb +11 -2
  117. data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
  118. data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
  119. data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
  120. data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
  121. data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
  122. data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
  123. data/tests/google/models/compute/servers_tests.rb +12 -1
  124. data/tests/google/requests/compute/image_tests.rb +0 -1
  125. data/tests/helpers/mock_helper.rb +1 -1
  126. data/tests/openstack/models/compute/security_group_tests.rb +54 -0
  127. data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
  128. data/tests/openstack/requests/network/network_tests.rb +8 -8
  129. data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +17 -8
  130. data/tests/vcloud_director/requests/compute/network_tests.rb +25 -1
  131. data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
  132. metadata +125 -132
  133. checksums.yaml +0 -15
@@ -0,0 +1,91 @@
1
+ module Fog
2
+ module Generators
3
+ module Compute
4
+ module VcloudDirector
5
+
6
+ # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/OrgVdcNetworkType.html
7
+ class OrgVdcNetwork
8
+ attr_reader :options
9
+
10
+ def initialize(options={})
11
+ @options = options
12
+ end
13
+
14
+ def generate_xml
15
+
16
+ body = Nokogiri::XML::Builder.new do
17
+ attrs = {
18
+ :xmlns => 'http://www.vmware.com/vcloud/v1.5',
19
+ :name => options[:name]
20
+ }
21
+ OrgVdcNetwork(attrs) {
22
+ Description options[:Description] if options.key?(:Description)
23
+ if configuration = options[:Configuration]
24
+ Configuration {
25
+ if ip_scopes = configuration[:IpScopes]
26
+ IpScopes {
27
+ if ip_scope = ip_scopes[:IpScope]
28
+ IpScope {
29
+ IsInherited ip_scope[:IsInherited] if ip_scope.key?(:IsInherited)
30
+ Gateway ip_scope[:Gateway] if ip_scope.key?(:Gateway)
31
+ Netmask ip_scope[:Netmask] if ip_scope.key?(:Netmask)
32
+ Dns1 ip_scope[:Dns1] if ip_scope.key?(:Dns1)
33
+ Dns2 ip_scope[:Dns2] if ip_scope.key?(:Dns2)
34
+ DnsSuffix ip_scope[:DnsSuffix] if ip_scope.key?(:DnsSuffix)
35
+ IsEnabled ip_scope[:IsEnabled] if ip_scope.key?(:IsEnabled)
36
+ if ip_ranges = ip_scope[:IpRanges]
37
+ IpRanges {
38
+ ip_ranges.each do |h|
39
+ if h.key?(:IpRange)
40
+ IpRange {
41
+ StartAddress h[:IpRange][:StartAddress]
42
+ EndAddress h[:IpRange][:EndAddress]
43
+ }
44
+ end
45
+ end
46
+ }
47
+ end
48
+ }
49
+ end
50
+ }
51
+ end
52
+ FenceMode configuration[:FenceMode]
53
+ if router_info = configuration[:RouterInfo]
54
+ RouterInfoType {
55
+ ExternalIp router_info[:ExternalIp]
56
+ }
57
+ end
58
+ }
59
+ end # Configuration
60
+
61
+ if edgegw = options[:EdgeGateway] and configuration[:FenceMode] != 'isolated'
62
+ EdgeGateway(edgegw)
63
+ elsif options[:Configuration] && options[:Configuration][:FenceMode] == 'isolated'
64
+ # isolated networks can specify ServiceConfig
65
+ if sc = options[:ServiceConfig]
66
+ ServiceConfig {
67
+ if dhcp = sc[:GatewayDhcpService]
68
+ IsEnabled dhcp[:IsEnabled] if dhcp[:IsEnabled]
69
+ if pool = dhcp[:Pool]
70
+ IsEnabled pool[:IsEnabled]
71
+ DefaultLeaseTime pool[:DefaultLeaseTime]
72
+ MaxLeaseTime pool[:MaxLeaseTime]
73
+ LowIpAddress pool[:LowIpAddress]
74
+ HighIpAddress pool[:HighIpAddress]
75
+ end
76
+ end
77
+ }
78
+ end
79
+ end
80
+
81
+ IsShared options[:IsShared] if options.key?(:IsShared)
82
+
83
+ }
84
+ end.to_xml
85
+ end
86
+
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,30 @@
1
+ module Fog
2
+ module Generators
3
+ module Compute
4
+ module VcloudDirector
5
+
6
+ # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VAppType.html
7
+ class Vapp
8
+ attr_reader :name, :options
9
+
10
+ def initialize(name, options={})
11
+ @name = name
12
+ @options = options
13
+ end
14
+
15
+ def generate_xml
16
+ attrs = @attrs
17
+ Nokogiri::XML::Builder.new do
18
+ VApp('xmlns' => 'http://www.vmware.com/vcloud/v1.5',
19
+ 'name' => name
20
+ ) {
21
+ Description options[:Description] if options.key?(:Description)
22
+ }
23
+ end.to_xml
24
+ end
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -14,6 +14,8 @@ module Fog
14
14
  attribute :change_sid
15
15
  attribute :join_domain_enabled
16
16
  attribute :use_org_settings
17
+ attribute :admin_password_auto
18
+ attribute :admin_password
17
19
  attribute :admin_password_enabled
18
20
  attribute :reset_password_required
19
21
  attribute :virtual_machine_id
@@ -32,6 +32,8 @@ module Fog
32
32
  @response[:join_domain_enabled] = (value == "true")
33
33
  when 'UseOrgSettings'
34
34
  @response[:use_org_settings] = (value == "true")
35
+ when 'AdminPassword'
36
+ @response[:admin_password] = value
35
37
  when 'AdminPasswordEnabled'
36
38
  @response[:admin_password_enabled] = (value == "true")
37
39
  when 'AdminPasswordAuto'
@@ -0,0 +1,64 @@
1
+ module Fog
2
+ module Compute
3
+ class VcloudDirector
4
+ class Real
5
+ # Delete an OrgVdcNetwork
6
+ #
7
+ # This operation is asynchronous and returns a task that you can
8
+ # monitor to track the progress of the request.
9
+ #
10
+ # @param [String] id Object identifier of the OrgVdcNetwork.
11
+ # @return [Excon::Response]
12
+ # * body<~Hash>:
13
+ #
14
+ # @raise [Fog::Compute::VcloudDirector::BadRequest]
15
+ #
16
+ # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/DELETE-Network.html
17
+ # @since vCloud API version 0.9
18
+ def delete_network(id)
19
+ request(
20
+ :expects => 202,
21
+ :method => 'DELETE',
22
+ :parser => Fog::ToHashDocument.new,
23
+ :path => "admin/network/#{id}"
24
+ )
25
+ end
26
+ end
27
+
28
+ class Mock
29
+ def delete_network(id)
30
+
31
+ unless data[:networks][id]
32
+ raise Fog::Compute::VcloudDirector::Forbidden.new(
33
+ "No access to entity \"(com.vmware.vcloud.entity.orgVdcNetwork:#{id})\""
34
+ )
35
+ end
36
+
37
+ owner = {
38
+ :href => make_href("network/#{id}"),
39
+ :type => 'application/vnd.vmware.vcloud.network+xml'
40
+ }
41
+ task_id = enqueue_task(
42
+ "Deleting Network(#{id})", 'DeleteNetwork', owner,
43
+ :on_success => lambda do
44
+ data[:networks].delete(id)
45
+ end
46
+ )
47
+
48
+ body = {
49
+ :xmlns => xmlns,
50
+ :xmlns_xsi => xmlns_xsi,
51
+ :xsi_schemaLocation => xsi_schema_location,
52
+ }.merge(task_body(task_id))
53
+
54
+ Excon::Response.new(
55
+ :status => 202,
56
+ :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
57
+ :body => body
58
+ )
59
+ end
60
+
61
+ end
62
+ end
63
+ end
64
+ end