fog 1.41.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/stale.yml +17 -0
- data/.travis.yml +1 -8
- data/CHANGELOG.md +78 -0
- data/README.md +4 -5
- data/Rakefile +0 -3
- data/fog.gemspec +13 -13
- data/lib/fog/bin/brightbox.rb +2 -2
- data/lib/fog/bin.rb +0 -2
- data/lib/fog/cloudstack/models/compute/server.rb +2 -0
- data/lib/fog/linode/requests/compute/avail_datacenters.rb +1 -0
- data/lib/fog/opennebula/compute.rb +6 -1
- data/lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb +5 -1
- data/lib/fog/vcloud_director/compute.rb +3 -2
- data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +2 -2
- data/lib/fog/vcloud_director/generators/compute/network_config_section.rb +68 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +0 -4
- data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +11 -11
- data/lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_config_network_section_vapp.rb +26 -0
- data/lib/fog/version.rb +1 -1
- data/lib/fog.rb +0 -2
- data/lib/tasks/changelog_task.rb +4 -1
- data/lib/tasks/github_release_task.rb +1 -1
- data/spec/fog/bin/atmos_spec.rb +0 -10
- data/spec/fog/bin/aws_spec.rb +0 -18
- data/spec/fog/bin/baremetalcloud_spec.rb +0 -10
- data/spec/fog/bin/brightbox_spec.rb +2 -2
- data/spec/fog/bin_spec.rb +0 -6
- data/tests/cloudsigma/models/snapshot_tests.rb +2 -0
- data/tests/cloudsigma/models/snapshots_tests.rb +1 -0
- data/tests/cloudsigma/requests/snapshots_tests.rb +1 -0
- data/tests/cloudsigma/requests/volumes_tests.rb +1 -1
- data/tests/cloudstack/compute/models/volume_tests.rb +1 -1
- data/tests/compute/helper.rb +0 -9
- data/tests/dns/helper.rb +0 -9
- data/tests/helpers/collection_helper.rb +0 -6
- data/tests/helpers/mock_helper.rb +0 -7
- data/tests/opennebula/compute_tests.rb +5 -2
- data/tests/opennebula/models/compute/flavor_tests.rb +5 -1
- data/tests/opennebula/models/compute/flavors_tests.rb +5 -2
- data/tests/opennebula/models/compute/group_tests.rb +5 -2
- data/tests/opennebula/models/compute/groups_tests.rb +5 -2
- data/tests/opennebula/models/compute/network_tests.rb +5 -1
- data/tests/opennebula/models/compute/networks_tests.rb +5 -2
- data/tests/opennebula/requests/compute/vm_allocate_tests.rb +5 -1
- data/tests/opennebula/requests/compute/vm_suspend_resume_tests.rb +5 -2
- metadata +37 -546
- data/gemfiles/Gemfile-1.9 +0 -16
- data/gemfiles/Gemfile-edge-1.9 +0 -20
- data/lib/fog/bin/bluebox.rb +0 -36
- data/lib/fog/bin/ovirt.rb +0 -28
- data/lib/fog/bin/zerigo.rb +0 -29
- data/lib/fog/bluebox/blb.rb +0 -82
- data/lib/fog/bluebox/compute.rb +0 -98
- data/lib/fog/bluebox/core.rb +0 -12
- data/lib/fog/bluebox/dns.rb +0 -101
- data/lib/fog/bluebox/models/blb/lb_application.rb +0 -29
- data/lib/fog/bluebox/models/blb/lb_applications.rb +0 -24
- data/lib/fog/bluebox/models/blb/lb_backend.rb +0 -19
- data/lib/fog/bluebox/models/blb/lb_backends.rb +0 -27
- data/lib/fog/bluebox/models/blb/lb_service.rb +0 -32
- data/lib/fog/bluebox/models/blb/lb_services.rb +0 -27
- data/lib/fog/bluebox/models/compute/flavor.rb +0 -41
- data/lib/fog/bluebox/models/compute/flavors.rb +0 -24
- data/lib/fog/bluebox/models/compute/image.rb +0 -30
- data/lib/fog/bluebox/models/compute/images.rb +0 -24
- data/lib/fog/bluebox/models/compute/location.rb +0 -13
- data/lib/fog/bluebox/models/compute/locations.rb +0 -24
- data/lib/fog/bluebox/models/compute/server.rb +0 -121
- data/lib/fog/bluebox/models/compute/servers.rb +0 -32
- data/lib/fog/bluebox/models/dns/record.rb +0 -52
- data/lib/fog/bluebox/models/dns/records.rb +0 -32
- data/lib/fog/bluebox/models/dns/zone.rb +0 -62
- data/lib/fog/bluebox/models/dns/zones.rb +0 -24
- data/lib/fog/bluebox/parsers/dns/create_record.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/create_zone.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/get_record.rb +0 -17
- data/lib/fog/bluebox/parsers/dns/get_records.rb +0 -24
- data/lib/fog/bluebox/parsers/dns/get_zone.rb +0 -22
- data/lib/fog/bluebox/parsers/dns/get_zones.rb +0 -26
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_application.rb +0 -33
- data/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb +0 -31
- data/lib/fog/bluebox/requests/blb/get_lb_application.rb +0 -32
- data/lib/fog/bluebox/requests/blb/get_lb_applications.rb +0 -30
- data/lib/fog/bluebox/requests/blb/get_lb_backend.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_backends.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_machine.rb +0 -34
- data/lib/fog/bluebox/requests/blb/get_lb_machines.rb +0 -34
- data/lib/fog/bluebox/requests/blb/get_lb_service.rb +0 -35
- data/lib/fog/bluebox/requests/blb/get_lb_services.rb +0 -35
- data/lib/fog/bluebox/requests/blb/remove_machine_from_lb_backend.rb +0 -28
- data/lib/fog/bluebox/requests/blb/update_lb_backend_machine.rb +0 -29
- data/lib/fog/bluebox/requests/compute/create_block.rb +0 -44
- data/lib/fog/bluebox/requests/compute/create_template.rb +0 -25
- data/lib/fog/bluebox/requests/compute/destroy_block.rb +0 -24
- data/lib/fog/bluebox/requests/compute/destroy_template.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_block.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_blocks.rb +0 -26
- data/lib/fog/bluebox/requests/compute/get_location.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_locations.rb +0 -22
- data/lib/fog/bluebox/requests/compute/get_product.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_products.rb +0 -23
- data/lib/fog/bluebox/requests/compute/get_template.rb +0 -24
- data/lib/fog/bluebox/requests/compute/get_templates.rb +0 -24
- data/lib/fog/bluebox/requests/compute/reboot_block.rb +0 -25
- data/lib/fog/bluebox/requests/dns/create_record.rb +0 -44
- data/lib/fog/bluebox/requests/dns/create_zone.rb +0 -48
- data/lib/fog/bluebox/requests/dns/delete_record.rb +0 -27
- data/lib/fog/bluebox/requests/dns/delete_zone.rb +0 -27
- data/lib/fog/bluebox/requests/dns/get_record.rb +0 -36
- data/lib/fog/bluebox/requests/dns/get_records.rb +0 -37
- data/lib/fog/bluebox/requests/dns/get_zone.rb +0 -40
- data/lib/fog/bluebox/requests/dns/get_zones.rb +0 -39
- data/lib/fog/bluebox/requests/dns/update_record.rb +0 -30
- data/lib/fog/bluebox/requests/dns/update_zone.rb +0 -26
- data/lib/fog/bluebox.rb +0 -3
- data/lib/fog/ovirt/compute.rb +0 -155
- data/lib/fog/ovirt/core.rb +0 -16
- data/lib/fog/ovirt/models/compute/affinity_group.rb +0 -25
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +0 -20
- data/lib/fog/ovirt/models/compute/cluster.rb +0 -20
- data/lib/fog/ovirt/models/compute/clusters.rb +0 -20
- data/lib/fog/ovirt/models/compute/instance_type.rb +0 -39
- data/lib/fog/ovirt/models/compute/instance_types.rb +0 -20
- data/lib/fog/ovirt/models/compute/interface.rb +0 -19
- data/lib/fog/ovirt/models/compute/interfaces.rb +0 -29
- data/lib/fog/ovirt/models/compute/quota.rb +0 -16
- data/lib/fog/ovirt/models/compute/quotas.rb +0 -20
- data/lib/fog/ovirt/models/compute/server.rb +0 -175
- data/lib/fog/ovirt/models/compute/servers.rb +0 -27
- data/lib/fog/ovirt/models/compute/template.rb +0 -58
- data/lib/fog/ovirt/models/compute/templates.rb +0 -20
- data/lib/fog/ovirt/models/compute/volume.rb +0 -36
- data/lib/fog/ovirt/models/compute/volumes.rb +0 -28
- data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
- data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
- data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
- data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
- data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
- data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
- data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
- data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
- data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup.xml +0 -8
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup_vms.xml +0 -9
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroups.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/cluster.xml +0 -20
- data/lib/fog/ovirt/requests/compute/mock_files/clusters.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/data_centers.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/disks.xml +0 -58
- data/lib/fog/ovirt/requests/compute/mock_files/instance_type.xml +0 -42
- data/lib/fog/ovirt/requests/compute/mock_files/instance_types.xml +0 -197
- data/lib/fog/ovirt/requests/compute/mock_files/nics.xml +0 -10
- data/lib/fog/ovirt/requests/compute/mock_files/quotas.xml +0 -7
- data/lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml +0 -36
- data/lib/fog/ovirt/requests/compute/mock_files/template.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/templates.xml +0 -110
- data/lib/fog/ovirt/requests/compute/mock_files/vm.xml +0 -52
- data/lib/fog/ovirt/requests/compute/mock_files/vms.xml +0 -152
- data/lib/fog/ovirt/requests/compute/mock_files/volumes.xml +0 -40
- data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
- data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
- data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
- data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
- data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
- data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
- data/lib/fog/ovirt.rb +0 -1
- data/lib/fog/zerigo/core.rb +0 -10
- data/lib/fog/zerigo/dns.rb +0 -114
- data/lib/fog/zerigo/models/dns/record.rb +0 -66
- data/lib/fog/zerigo/models/dns/records.rb +0 -45
- data/lib/fog/zerigo/models/dns/zone.rb +0 -84
- data/lib/fog/zerigo/models/dns/zones.rb +0 -26
- data/lib/fog/zerigo/parsers/dns/count_hosts.rb +0 -20
- data/lib/fog/zerigo/parsers/dns/count_zones.rb +0 -20
- data/lib/fog/zerigo/parsers/dns/create_host.rb +0 -24
- data/lib/fog/zerigo/parsers/dns/create_zone.rb +0 -22
- data/lib/fog/zerigo/parsers/dns/find_hosts.rb +0 -28
- data/lib/fog/zerigo/parsers/dns/get_host.rb +0 -24
- data/lib/fog/zerigo/parsers/dns/get_zone.rb +0 -53
- data/lib/fog/zerigo/parsers/dns/get_zone_stats.rb +0 -22
- data/lib/fog/zerigo/parsers/dns/list_hosts.rb +0 -28
- data/lib/fog/zerigo/parsers/dns/list_zones.rb +0 -26
- data/lib/fog/zerigo/requests/dns/count_hosts.rb +0 -45
- data/lib/fog/zerigo/requests/dns/count_zones.rb +0 -37
- data/lib/fog/zerigo/requests/dns/create_host.rb +0 -125
- data/lib/fog/zerigo/requests/dns/create_zone.rb +0 -128
- data/lib/fog/zerigo/requests/dns/delete_host.rb +0 -41
- data/lib/fog/zerigo/requests/dns/delete_zone.rb +0 -40
- data/lib/fog/zerigo/requests/dns/find_hosts.rb +0 -74
- data/lib/fog/zerigo/requests/dns/get_host.rb +0 -54
- data/lib/fog/zerigo/requests/dns/get_zone.rb +0 -64
- data/lib/fog/zerigo/requests/dns/get_zone_stats.rb +0 -57
- data/lib/fog/zerigo/requests/dns/list_hosts.rb +0 -73
- data/lib/fog/zerigo/requests/dns/list_zones.rb +0 -62
- data/lib/fog/zerigo/requests/dns/update_host.rb +0 -68
- data/lib/fog/zerigo/requests/dns/update_zone.rb +0 -86
- data/lib/fog/zerigo.rb +0 -1
- data/spec/fog/bin/bluebox_spec.rb +0 -55
- data/spec/fog/bin/ovirt_spec.rb +0 -10
- data/spec/fog/bin/zerigo_spec.rb +0 -10
- data/spec/fog/compute_spec.rb +0 -19
- data/spec/fog/dns_spec.rb +0 -19
- data/tests/bluebox/requests/blb/helper.rb +0 -64
- data/tests/bluebox/requests/blb/lb_tests.rb +0 -75
- data/tests/bluebox/requests/compute/block_tests.rb +0 -83
- data/tests/bluebox/requests/compute/helper.rb +0 -16
- data/tests/bluebox/requests/compute/location_tests.rb +0 -32
- data/tests/bluebox/requests/compute/product_tests.rb +0 -34
- data/tests/bluebox/requests/compute/template_tests.rb +0 -37
- data/tests/bluebox/requests/dns/dns_tests.rb +0 -258
- data/tests/ovirt/compute_tests.rb +0 -25
- data/tests/ovirt/models/compute/cluster_tests.rb +0 -31
- data/tests/ovirt/models/compute/clusters_tests.rb +0 -9
- data/tests/ovirt/models/compute/interface_tests.rb +0 -27
- data/tests/ovirt/models/compute/interfaces_tests.rb +0 -9
- data/tests/ovirt/models/compute/server_tests.rb +0 -51
- data/tests/ovirt/models/compute/servers_tests.rb +0 -14
- data/tests/ovirt/models/compute/template_tests.rb +0 -28
- data/tests/ovirt/models/compute/templates_tests.rb +0 -9
- data/tests/ovirt/requests/compute/create_vm_tests.rb +0 -26
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +0 -13
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +0 -12
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +0 -13
- data/tests/ovirt/requests/compute/update_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/update_volume_tests.rb +0 -20
- data/tests/zerigo/requests/dns/dns_tests.rb +0 -440
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
class Real
|
5
|
-
def remove_from_affinity_group(id, options = {})
|
6
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
7
|
-
raise ArgumentError, "affinity group id is a required parameter for remove-from-affinity-group" unless options.key? :id
|
8
|
-
client.delete_vm_from_affinity_group(options[:id], id)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
class Mock
|
13
|
-
def remove_from_affinity_group(id, options = {})
|
14
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
15
|
-
raise ArgumentError, "affinity group id is a required parameter for remove-from-affinity-group" unless options.key? :id
|
16
|
-
true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
class Real
|
5
|
-
def storage_domains filter={}
|
6
|
-
client.storagedomains(filter)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
class Mock
|
11
|
-
def storage_domains(filters = {})
|
12
|
-
xml = read_xml 'storage_domains.xml'
|
13
|
-
Nokogiri::XML(xml).xpath('/storage_domains/storage_domain').map do |sd|
|
14
|
-
OVIRT::StorageDomain::new(self, sd)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
|
5
|
-
module Shared
|
6
|
-
def check_arguments(id, options)
|
7
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
-
raise ArgumentError, "interface id is a required parameter for update-interface" unless options.key? :id
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
class Real
|
13
|
-
extend ::Fog::Compute::Ovirt::Shared
|
14
|
-
|
15
|
-
def update_interface(id, options)
|
16
|
-
check_arguments(id, options)
|
17
|
-
|
18
|
-
interface_id = options[:id]
|
19
|
-
options.delete(:id)
|
20
|
-
|
21
|
-
client.update_interface(id, interface_id, options)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class Mock
|
26
|
-
extend ::Fog::Compute::Ovirt::Shared
|
27
|
-
|
28
|
-
def update_interface(id, options)
|
29
|
-
check_arguments(id, options)
|
30
|
-
true
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
class Real
|
5
|
-
def update_vm(attrs)
|
6
|
-
client.update_vm(attrs)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
class Mock
|
11
|
-
def update_vm(attrs)
|
12
|
-
xml = read_xml('vm.xml')
|
13
|
-
OVIRT::VM::new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
|
5
|
-
module Shared
|
6
|
-
def check_arguments(id, options)
|
7
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
-
raise ArgumentError, "disk id is a required parameter for update-volume" unless options.has_key? :id
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
class Real
|
14
|
-
extend ::Fog::Compute::Ovirt::Shared
|
15
|
-
|
16
|
-
def update_volume(id, options)
|
17
|
-
check_arguments(id, options)
|
18
|
-
|
19
|
-
disk_id = options[:id]
|
20
|
-
options.delete(:id)
|
21
|
-
|
22
|
-
client.update_volume(id, disk_id, options)
|
23
|
-
true # If we come here, expect success and return true
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
class Mock
|
29
|
-
extend ::Fog::Compute::Ovirt::Shared
|
30
|
-
|
31
|
-
def update_volume(id, options)
|
32
|
-
check_arguments(id, options)
|
33
|
-
true
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
class Real
|
5
|
-
def vm_action(options = {})
|
6
|
-
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
|
7
|
-
raise ArgumentError, "action is a required parameter" unless options.key? :action
|
8
|
-
|
9
|
-
client.vm_action options[:id], options[:action]
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class Mock
|
14
|
-
def vm_action(options = {})
|
15
|
-
raise ArgumentError, "id is a required parameter" unless options.key? :id
|
16
|
-
raise ArgumentError, "action is a required parameter" unless options.key? :action
|
17
|
-
true
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class Ovirt
|
4
|
-
class Real
|
5
|
-
def vm_start_with_cloudinit(options = {})
|
6
|
-
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
|
7
|
-
client.vm_start_with_cloudinit(options[:id], options[:user_data])
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class Mock
|
12
|
-
def vm_start_with_cloudinit(options = {})
|
13
|
-
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
|
14
|
-
true
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/lib/fog/ovirt.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'fog/ovirt/compute'
|
data/lib/fog/zerigo/core.rb
DELETED
data/lib/fog/zerigo/dns.rb
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
require 'fog/zerigo/core'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module DNS
|
5
|
-
class Zerigo < Fog::Service
|
6
|
-
requires :zerigo_email, :zerigo_token
|
7
|
-
recognizes :host, :persistent, :port, :scheme, :timeout
|
8
|
-
|
9
|
-
model_path 'fog/zerigo/models/dns'
|
10
|
-
model :record
|
11
|
-
collection :records
|
12
|
-
model :zone
|
13
|
-
collection :zones
|
14
|
-
|
15
|
-
request_path 'fog/zerigo/requests/dns'
|
16
|
-
request :count_hosts
|
17
|
-
request :count_zones
|
18
|
-
request :create_host
|
19
|
-
request :create_zone
|
20
|
-
request :delete_host
|
21
|
-
request :delete_zone
|
22
|
-
request :find_hosts
|
23
|
-
request :get_host
|
24
|
-
request :get_zone
|
25
|
-
request :get_zone_stats
|
26
|
-
request :list_zones
|
27
|
-
request :list_hosts
|
28
|
-
request :update_host
|
29
|
-
request :update_zone
|
30
|
-
|
31
|
-
class Mock
|
32
|
-
def self.data
|
33
|
-
@data ||= Hash.new do |hash, key|
|
34
|
-
hash[key] = key == :zones ? [] : {}
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.reset
|
39
|
-
@data = nil
|
40
|
-
end
|
41
|
-
|
42
|
-
def initialize(options={})
|
43
|
-
@zerigo_email = options[:zerigo_email]
|
44
|
-
@zerigo_token = options[:zerigo_token]
|
45
|
-
end
|
46
|
-
|
47
|
-
def data
|
48
|
-
self.class.data
|
49
|
-
end
|
50
|
-
|
51
|
-
def reset_data
|
52
|
-
self.class.reset
|
53
|
-
end
|
54
|
-
|
55
|
-
def find_by_zone_id(zone_id)
|
56
|
-
self.data[:zones].find { |z| z['id'] == zone_id }
|
57
|
-
end
|
58
|
-
|
59
|
-
def find_by_domain(domain)
|
60
|
-
self.data[:zones].find { |z| z['domain'] == domain }
|
61
|
-
end
|
62
|
-
|
63
|
-
def find_host(host_id)
|
64
|
-
self.data[:zones].map { |z| z['hosts'].find { |h| h['id'] == host_id } }.compact.first
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
class Real
|
69
|
-
def initialize(options={})
|
70
|
-
|
71
|
-
@zerigo_email = options[:zerigo_email]
|
72
|
-
@zerigo_token = options[:zerigo_token]
|
73
|
-
@connection_options = options[:connection_options] || {}
|
74
|
-
@host = options[:host] || "ns.zerigo.com"
|
75
|
-
@persistent = options[:persistent] || false
|
76
|
-
@port = options[:port] || 80
|
77
|
-
@scheme = options[:scheme] || 'http'
|
78
|
-
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
79
|
-
end
|
80
|
-
|
81
|
-
def reload
|
82
|
-
@connection.reset
|
83
|
-
end
|
84
|
-
|
85
|
-
def request(params)
|
86
|
-
params[:headers] ||= {}
|
87
|
-
key= "#{@zerigo_email}:#{@zerigo_token}"
|
88
|
-
params[:headers].merge!({
|
89
|
-
'Authorization' => "Basic #{Base64.encode64(key).delete("\r\n")}"
|
90
|
-
})
|
91
|
-
case params[:method]
|
92
|
-
when 'DELETE', 'GET', 'HEAD'
|
93
|
-
params[:headers]['Accept'] = 'application/xml'
|
94
|
-
when 'POST', 'PUT'
|
95
|
-
params[:headers]['Content-Type'] = 'application/xml'
|
96
|
-
end
|
97
|
-
|
98
|
-
begin
|
99
|
-
response = @connection.request(params)
|
100
|
-
rescue Excon::Errors::HTTPStatusError => error
|
101
|
-
raise case error
|
102
|
-
when Excon::Errors::NotFound
|
103
|
-
Fog::DNS::Zerigo::NotFound.slurp(error)
|
104
|
-
else
|
105
|
-
error
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
response
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module DNS
|
5
|
-
class Zerigo
|
6
|
-
class Record < Fog::Model
|
7
|
-
extend Fog::Deprecation
|
8
|
-
deprecate :ip, :value
|
9
|
-
deprecate :ip=, :value=
|
10
|
-
|
11
|
-
identity :id
|
12
|
-
|
13
|
-
attribute :created_at, :aliases => 'created-at'
|
14
|
-
attribute :value, :aliases => 'data'
|
15
|
-
attribute :domain, :aliases => 'fqdn'
|
16
|
-
attribute :name, :aliases => 'hostname'
|
17
|
-
attribute :description, :aliases => 'notes'
|
18
|
-
attribute :priority
|
19
|
-
attribute :ttl
|
20
|
-
attribute :type, :aliases => 'host-type'
|
21
|
-
attribute :updated_at, :aliases => 'updated-at'
|
22
|
-
attribute :zone_id, :aliases => 'zone-id'
|
23
|
-
|
24
|
-
def initialize(attributes={})
|
25
|
-
super
|
26
|
-
end
|
27
|
-
|
28
|
-
def destroy
|
29
|
-
requires :identity
|
30
|
-
service.delete_host(identity)
|
31
|
-
true
|
32
|
-
end
|
33
|
-
|
34
|
-
def zone
|
35
|
-
@zone
|
36
|
-
end
|
37
|
-
|
38
|
-
def save
|
39
|
-
requires :zone, :type, :value
|
40
|
-
options = {}
|
41
|
-
options[:hostname] = name if name
|
42
|
-
options[:notes] = description if description
|
43
|
-
options[:priority] = priority if priority
|
44
|
-
options[:ttl] = ttl if ttl
|
45
|
-
|
46
|
-
if persisted?
|
47
|
-
options[:host_type] = type
|
48
|
-
options[:data] = value
|
49
|
-
service.update_host(identity, options)
|
50
|
-
else
|
51
|
-
data = service.create_host(@zone.id, type, value, options)
|
52
|
-
merge_attributes(data.body)
|
53
|
-
end
|
54
|
-
|
55
|
-
true
|
56
|
-
end
|
57
|
-
|
58
|
-
private
|
59
|
-
|
60
|
-
def zone=(new_zone)
|
61
|
-
@zone = new_zone
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/zerigo/models/dns/record'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module DNS
|
6
|
-
class Zerigo
|
7
|
-
class Records < Fog::Collection
|
8
|
-
attribute :zone
|
9
|
-
|
10
|
-
model Fog::DNS::Zerigo::Record
|
11
|
-
|
12
|
-
# List all domains
|
13
|
-
# @param [Hash] options Options to pass to the underlying API call
|
14
|
-
# @option options [String] :fqdn search for the given fqdn
|
15
|
-
def all(options = {})
|
16
|
-
requires :zone
|
17
|
-
if options[:fqdn]
|
18
|
-
hosts = service.find_hosts(options[:fqdn], zone.id).body['hosts']
|
19
|
-
load(hosts)
|
20
|
-
else
|
21
|
-
parent = zone.collection.get(zone.identity)
|
22
|
-
if parent
|
23
|
-
merge_attributes(parent.records.attributes)
|
24
|
-
load(parent.records.map {|record| record.attributes})
|
25
|
-
else
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def get(record_id)
|
32
|
-
data = service.get_host(record_id).body
|
33
|
-
new(data)
|
34
|
-
rescue Fog::Service::NotFound
|
35
|
-
nil
|
36
|
-
end
|
37
|
-
|
38
|
-
def new(attributes = {})
|
39
|
-
requires :zone
|
40
|
-
super({ :zone => zone }.merge!(attributes))
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
require 'fog/zerigo/models/dns/records'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module DNS
|
6
|
-
class Zerigo
|
7
|
-
class Zone < Fog::Model
|
8
|
-
identity :id
|
9
|
-
|
10
|
-
attribute :created_at, :aliases => 'created-at'
|
11
|
-
attribute :domain
|
12
|
-
attribute :ttl, :aliases => 'default-ttl'
|
13
|
-
attribute :type, :aliases => 'ns-type'
|
14
|
-
attribute :updated_at, :aliases => 'updated-at'
|
15
|
-
|
16
|
-
# <custom-nameservers>ns1.example.com,ns2.example.com</custom-nameservers>
|
17
|
-
# <custom-ns type="boolean">true</custom-ns>
|
18
|
-
# <hostmaster>dnsadmin@example.com</hostmaster>
|
19
|
-
# <notes nil="true"/>
|
20
|
-
# <ns1 nil="true"/>
|
21
|
-
# <nx-ttl nil="true"></nx-ttl>
|
22
|
-
# <slave-nameservers nil="true"/>
|
23
|
-
# <tag-list>one two</tag-list>
|
24
|
-
# <hosts-count>1</hosts-count>
|
25
|
-
|
26
|
-
def initialize(attributes={})
|
27
|
-
self.type ||= 'pri_sec'
|
28
|
-
super
|
29
|
-
end
|
30
|
-
|
31
|
-
def destroy
|
32
|
-
requires :identity
|
33
|
-
service.delete_zone(identity)
|
34
|
-
true
|
35
|
-
end
|
36
|
-
|
37
|
-
def records
|
38
|
-
@records ||= begin
|
39
|
-
Fog::DNS::Zerigo::Records.new(
|
40
|
-
:zone => self,
|
41
|
-
:service => service
|
42
|
-
)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def nameservers
|
47
|
-
[
|
48
|
-
'a.ns.zerigo.net',
|
49
|
-
'b.ns.zerigo.net',
|
50
|
-
'c.ns.zerigo.net',
|
51
|
-
'd.ns.zerigo.net',
|
52
|
-
'e.ns.zerigo.net'
|
53
|
-
]
|
54
|
-
end
|
55
|
-
|
56
|
-
def save
|
57
|
-
self.ttl ||= 3600
|
58
|
-
requires :domain, :type, :ttl
|
59
|
-
options = {}
|
60
|
-
# * options<~Hash> - optional paramaters
|
61
|
-
# * ns1<~String> - required if ns_type == sec
|
62
|
-
# * nx_ttl<~Integer> -
|
63
|
-
# * slave_nameservers<~String> - required if ns_type == pri
|
64
|
-
# * axfr_ips<~String> - comma-separated list of IPs or IP blocks allowed to perform AXFRs
|
65
|
-
# * custom_nameservers<~String> - comma-separated list of custom nameservers
|
66
|
-
# * custom_ns<~String> - indicates if vanity (custom) nameservers are enabled for this domain
|
67
|
-
# * hostmaster<~String> - email of the DNS administrator or hostmaster
|
68
|
-
# * notes<~String> - notes about the domain
|
69
|
-
# * restrict_axfr<~String> - indicates if AXFR transfers should be restricted to IPs in axfr-ips
|
70
|
-
# * tag_list<~String> - List of all tags associated with this domain
|
71
|
-
data = unless identity
|
72
|
-
service.create_zone(domain, ttl, type, options)
|
73
|
-
else
|
74
|
-
options[:default_ttl] = ttl
|
75
|
-
options[:ns_type] = type
|
76
|
-
service.update_zone(identity, options)
|
77
|
-
end
|
78
|
-
merge_attributes(data.body)
|
79
|
-
true
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/zerigo/models/dns/zone'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module DNS
|
6
|
-
class Zerigo
|
7
|
-
class Zones < Fog::Collection
|
8
|
-
model Fog::DNS::Zerigo::Zone
|
9
|
-
|
10
|
-
def all(options = {})
|
11
|
-
data = service.list_zones(options).body['zones']
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get(zone_id_or_domain)
|
16
|
-
data = service.get_zone(zone_id_or_domain).body
|
17
|
-
zone = new(data)
|
18
|
-
zone.records.load(data['hosts'])
|
19
|
-
zone
|
20
|
-
rescue Fog::Service::NotFound
|
21
|
-
nil
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module DNS
|
4
|
-
module Zerigo
|
5
|
-
class CountHosts < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@response = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def end_element(name)
|
11
|
-
case name
|
12
|
-
when 'count'
|
13
|
-
@response[name] = value.to_i
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module DNS
|
4
|
-
module Zerigo
|
5
|
-
class CountZones < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@response = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def end_element(name)
|
11
|
-
case name
|
12
|
-
when 'count'
|
13
|
-
@response[name] = value.to_i
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module DNS
|
4
|
-
module Zerigo
|
5
|
-
class CreateHost < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@response = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def end_element(name)
|
11
|
-
case name
|
12
|
-
when 'id', 'zone-id'
|
13
|
-
@response[name] = value.to_i
|
14
|
-
when 'priority', 'ttl'
|
15
|
-
@response[name] = value.to_i if value
|
16
|
-
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
17
|
-
@response[name] = value
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module DNS
|
4
|
-
module Zerigo
|
5
|
-
class CreateZone < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@response = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def end_element(name)
|
11
|
-
case name
|
12
|
-
when 'default-ttl', 'id', 'nx-ttl', 'hosts-count'
|
13
|
-
@response[name] = value.to_i
|
14
|
-
when 'created-at', 'custom-nameservers', 'custom-ns', 'domain', 'hostmaster', 'notes', 'ns1', 'ns-type', 'slave-nameservers', 'tag-list', 'updated-at', 'hosts', 'axfr-ips', 'restrict-axfr'
|
15
|
-
@response[name] = value
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Parsers
|
3
|
-
module DNS
|
4
|
-
module Zerigo
|
5
|
-
class FindHosts < Fog::Parsers::Base
|
6
|
-
def reset
|
7
|
-
@host = {}
|
8
|
-
@response = { 'hosts' => [] }
|
9
|
-
end
|
10
|
-
|
11
|
-
def end_element(name)
|
12
|
-
case name
|
13
|
-
when 'id', 'zone-id'
|
14
|
-
@host[name] = value.to_i
|
15
|
-
when 'priority', 'ttl'
|
16
|
-
@host[name] = value.to_i if value
|
17
|
-
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
18
|
-
@host[name] = value
|
19
|
-
when 'host'
|
20
|
-
@response['hosts'] << @host
|
21
|
-
@host = {}
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|