fog 1.34.0 → 1.35.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -24
- data/CHANGELOG.md +84 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +4 -20
- data/fog.gemspec +7 -5
- data/lib/fog.rb +1 -0
- data/lib/fog/bin.rb +1 -0
- data/lib/fog/digitalocean/compute_v2.rb +108 -0
- data/lib/fog/digitalocean/models/compute_v2/flavor.rb +17 -0
- data/lib/fog/digitalocean/models/compute_v2/flavors.rb +21 -0
- data/lib/fog/digitalocean/models/compute_v2/image.rb +25 -0
- data/lib/fog/digitalocean/models/compute_v2/images.rb +36 -0
- data/lib/fog/digitalocean/models/compute_v2/region.rb +13 -0
- data/lib/fog/digitalocean/models/compute_v2/regions.rb +21 -0
- data/lib/fog/digitalocean/models/compute_v2/server.rb +166 -0
- data/lib/fog/digitalocean/models/compute_v2/servers.rb +39 -0
- data/lib/fog/digitalocean/models/compute_v2/ssh_key.rb +30 -0
- data/lib/fog/digitalocean/models/compute_v2/ssh_keys.rb +35 -0
- data/lib/fog/digitalocean/requests/compute_v2/change_kernel.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/convert_to_snapshot.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/create_server.rb +93 -0
- data/lib/fog/digitalocean/requests/compute_v2/create_ssh_key.rb +47 -0
- data/lib/fog/digitalocean/requests/compute_v2/delete_server.rb +28 -0
- data/lib/fog/digitalocean/requests/compute_v2/delete_ssh_key.rb +28 -0
- data/lib/fog/digitalocean/requests/compute_v2/disable_backups.rb +45 -0
- data/lib/fog/digitalocean/requests/compute_v2/enable_ipv6.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/enable_private_networking.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/get_droplet_action.rb +36 -0
- data/lib/fog/digitalocean/requests/compute_v2/get_image_details.rb +43 -0
- data/lib/fog/digitalocean/requests/compute_v2/get_server_details.rb +84 -0
- data/lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb +34 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_droplet_actions.rb +38 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_flavors.rb +131 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_images.rb +50 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_regions.rb +94 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_servers.rb +28 -0
- data/lib/fog/digitalocean/requests/compute_v2/list_ssh_keys.rb +26 -0
- data/lib/fog/digitalocean/requests/compute_v2/password_reset.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/power_cycle.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/power_off.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/power_on.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/reboot_server.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/rebuild.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/rename.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/resize.rb +48 -0
- data/lib/fog/digitalocean/requests/compute_v2/restore.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/shutdown.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/snapshot.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/transfer_image.rb +44 -0
- data/lib/fog/digitalocean/requests/compute_v2/update_ssh_key.rb +46 -0
- data/lib/fog/digitalocean/requests/compute_v2/upgrade.rb +44 -0
- data/lib/fog/digitalocean/service.rb +51 -0
- data/lib/fog/linode/models/compute/kernels.rb +1 -1
- data/lib/fog/opennebula/models/compute/flavor.rb +13 -13
- data/lib/fog/opennebula/requests/compute/template_pool.rb +14 -11
- data/lib/fog/openstack.rb +2 -0
- data/lib/fog/openstack/core.rb +30 -3
- data/lib/fog/openstack/identity.rb +8 -7
- data/lib/fog/openstack/identity_v3.rb +1 -0
- data/lib/fog/openstack/image.rb +35 -130
- data/lib/fog/openstack/image_v1.rb +142 -0
- data/lib/fog/openstack/image_v2.rb +137 -0
- data/lib/fog/openstack/models/image_v1/image.rb +78 -0
- data/lib/fog/openstack/models/image_v1/images.rb +70 -0
- data/lib/fog/openstack/models/image_v2/image.rb +149 -0
- data/lib/fog/openstack/models/image_v2/images.rb +67 -0
- data/lib/fog/openstack/models/orchestration/stack.rb +5 -0
- data/lib/fog/openstack/models/volume/volume_type.rb +25 -0
- data/lib/fog/openstack/orchestration.rb +1 -0
- data/lib/fog/openstack/requests/compute/server_actions.rb +14 -3
- data/lib/fog/openstack/requests/{image → image_v1}/add_member_to_image.rb +2 -0
- data/lib/fog/openstack/requests/image_v1/create_image.rb +78 -0
- data/lib/fog/openstack/requests/image_v1/delete_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v1/get_image.rb +47 -0
- data/lib/fog/openstack/requests/image_v1/get_image_by_id.rb +34 -0
- data/lib/fog/openstack/requests/image_v1/get_image_members.rb +31 -0
- data/lib/fog/openstack/requests/image_v1/get_shared_images.rb +31 -0
- data/lib/fog/openstack/requests/image_v1/list_public_images.rb +35 -0
- data/lib/fog/openstack/requests/image_v1/list_public_images_detailed.rb +37 -0
- data/lib/fog/openstack/requests/image_v1/remove_member_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v1/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/image_v1/update_image.rb +66 -0
- data/lib/fog/openstack/requests/image_v1/update_image_members.rb +39 -0
- data/lib/fog/openstack/requests/image_v2/add_member_to_image.rb +26 -0
- data/lib/fog/openstack/requests/image_v2/add_tag_to_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/create_image.rb +54 -0
- data/lib/fog/openstack/requests/image_v2/deactivate_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/delete_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/download_image.rb +29 -0
- data/lib/fog/openstack/requests/image_v2/get_image.rb +47 -0
- data/lib/fog/openstack/requests/image_v2/get_image_by_id.rb +34 -0
- data/lib/fog/openstack/requests/image_v2/get_image_members.rb +31 -0
- data/lib/fog/openstack/requests/image_v2/get_member_details.rb +33 -0
- data/lib/fog/openstack/requests/image_v2/get_shared_images.rb +31 -0
- data/lib/fog/openstack/requests/image_v2/list_images.rb +35 -0
- data/lib/fog/openstack/requests/image_v2/reactivate_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/remove_member_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/remove_tag_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/image_v2/update_image.rb +49 -0
- data/lib/fog/openstack/requests/image_v2/update_image_member.rb +34 -0
- data/lib/fog/openstack/requests/image_v2/upload_image.rb +30 -0
- data/lib/fog/openstack/requests/orchestration/patch_stack.rb +37 -0
- data/lib/fog/openstack/requests/volume/create_volume_type.rb +41 -0
- data/lib/fog/openstack/requests/{image/delete_image.rb → volume/delete_volume_type.rb} +6 -6
- data/lib/fog/openstack/requests/volume/get_quota_usage.rb +44 -0
- data/lib/fog/openstack/requests/volume/get_volume_type_details.rb +1 -1
- data/lib/fog/openstack/requests/volume/update_volume_type.rb +41 -0
- data/lib/fog/openstack/volume.rb +5 -0
- data/lib/fog/rackspace/models/compute_v2/server.rb +11 -1
- data/lib/fog/rackspace/models/compute_v2/servers.rb +2 -2
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +7 -2
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +13 -10
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/models/compute/server.rb +1 -1
- data/lib/tasks/changelog_task.rb +1 -0
- data/spec/fog/openstack/identity_v3/authv3_a.yml +45 -52
- data/spec/fog/openstack/identity_v3/authv3_b.yml +45 -52
- data/spec/fog/openstack/identity_v3/authv3_c.yml +95 -101
- data/spec/fog/openstack/identity_v3/authv3_project.yml +68 -75
- data/spec/fog/openstack/identity_v3/authv3_token.yml +212 -174
- data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +278 -266
- data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +190 -202
- data/spec/fog/openstack/identity_v3/common_setup.yml +67 -445
- data/spec/fog/openstack/identity_v3/idv3_credential.yml +56 -26
- data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +292 -152
- data/spec/fog/openstack/identity_v3/idv3_domain.yml +99 -49
- data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +239 -119
- data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +414 -205
- data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +259 -136
- data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +474 -472
- data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +679 -626
- data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +536 -269
- data/spec/fog/openstack/identity_v3/idv3_policy.yml +76 -36
- data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +197 -97
- data/spec/fog/openstack/identity_v3/idv3_project.yml +135 -85
- data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +237 -127
- data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +625 -295
- data/spec/fog/openstack/identity_v3/idv3_project_hier_crud_list.yml +716 -355
- data/spec/fog/openstack/identity_v3/idv3_role.yml +134 -88
- data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +312 -118
- data/spec/fog/openstack/identity_v3/idv3_service.yml +179 -133
- data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +306 -212
- data/spec/fog/openstack/identity_v3/idv3_token.yml +213 -177
- data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +345 -188
- data/spec/fog/openstack/identity_v3/idv3_users.yml +182 -116
- data/spec/fog/openstack/identity_v3_spec.rb +103 -85
- data/spec/fog/openstack/{identity_v3/idv3_other_region.yml → image_v1/common_setup.yml} +50 -93
- data/spec/fog/openstack/image_v1/list_images.yml +54 -0
- data/spec/fog/openstack/image_v1_spec.rb +24 -0
- data/spec/fog/openstack/image_v2/common_setup.yml +144 -0
- data/spec/fog/openstack/image_v2/image_schema.json +190 -0
- data/spec/fog/openstack/image_v2/image_v2_activation.yml +3988 -0
- data/spec/fog/openstack/image_v2/image_v2_create_id.yml +291 -0
- data/spec/fog/openstack/image_v2/image_v2_crud.yml +437 -0
- data/spec/fog/openstack/image_v2/image_v2_member_crudl.yml +451 -0
- data/spec/fog/openstack/image_v2/image_v2_tags.yml +532 -0
- data/spec/fog/openstack/image_v2/image_v2_upload_download.yml +3966 -0
- data/spec/fog/openstack/image_v2/minimal.ova +0 -0
- data/spec/fog/openstack/image_v2_spec.rb +285 -0
- data/spec/fog/openstack/image_v2_upload_spec.rb +74 -0
- data/spec/fog/openstack/shared_context.rb +14 -10
- data/tests/compute/helper.rb +0 -3
- data/tests/digitalocean/requests/compute_v2/list_flavors_tests.rb +25 -0
- data/tests/digitalocean/requests/compute_v2/list_images_tests.rb +25 -0
- data/tests/digitalocean/requests/compute_v2/list_regions_tests.rb +21 -0
- data/tests/digitalocean/requests/compute_v2/server_tests.rb +77 -0
- data/tests/helpers/mock_helper.rb +1 -0
- data/tests/opennebula/models/compute/flavor_tests.rb +1 -1
- data/tests/openstack/requests/orchestration/stack_tests.rb +5 -1
- data/tests/openstack/requests/volume/volume_type_tests.rb +32 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +7 -7
- metadata +160 -236
- data/gemfiles/Gemfile-ruby-1.8.7 +0 -17
- data/lib/fog/bin/xenserver.rb +0 -29
- data/lib/fog/openstack/models/image/image.rb +0 -76
- data/lib/fog/openstack/models/image/images.rb +0 -67
- data/lib/fog/openstack/requests/image/create_image.rb +0 -76
- data/lib/fog/openstack/requests/image/get_image.rb +0 -45
- data/lib/fog/openstack/requests/image/get_image_by_id.rb +0 -32
- data/lib/fog/openstack/requests/image/get_image_members.rb +0 -29
- data/lib/fog/openstack/requests/image/get_shared_images.rb +0 -29
- data/lib/fog/openstack/requests/image/list_public_images.rb +0 -33
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +0 -35
- data/lib/fog/openstack/requests/image/remove_member_from_image.rb +0 -23
- data/lib/fog/openstack/requests/image/set_tenant.rb +0 -19
- data/lib/fog/openstack/requests/image/update_image.rb +0 -64
- data/lib/fog/openstack/requests/image/update_image_members.rb +0 -37
- data/lib/fog/xenserver.rb +0 -1
- data/lib/fog/xenserver/CHANGELOG.md +0 -77
- data/lib/fog/xenserver/compute.rb +0 -186
- data/lib/fog/xenserver/core.rb +0 -94
- data/lib/fog/xenserver/examples/README.md +0 -11
- data/lib/fog/xenserver/examples/chage_default_storage_repository.md +0 -99
- data/lib/fog/xenserver/examples/creating_servers.md +0 -168
- data/lib/fog/xenserver/examples/getting_started.md +0 -163
- data/lib/fog/xenserver/examples/networks-and-vlans.rb +0 -44
- data/lib/fog/xenserver/examples/storage_repositories.md +0 -94
- data/lib/fog/xenserver/models/compute/blob.rb +0 -22
- data/lib/fog/xenserver/models/compute/blobs.rb +0 -25
- data/lib/fog/xenserver/models/compute/bond.rb +0 -23
- data/lib/fog/xenserver/models/compute/bonds.rb +0 -25
- data/lib/fog/xenserver/models/compute/console.rb +0 -29
- data/lib/fog/xenserver/models/compute/consoles.rb +0 -25
- data/lib/fog/xenserver/models/compute/crash_dump.rb +0 -19
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +0 -25
- data/lib/fog/xenserver/models/compute/dr_task.rb +0 -17
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +0 -25
- data/lib/fog/xenserver/models/compute/gpu_group.rb +0 -22
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +0 -25
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +0 -26
- data/lib/fog/xenserver/models/compute/host.rb +0 -156
- data/lib/fog/xenserver/models/compute/host_cpu.rb +0 -34
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +0 -20
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +0 -25
- data/lib/fog/xenserver/models/compute/host_metrics.rb +0 -26
- data/lib/fog/xenserver/models/compute/host_patch.rb +0 -25
- data/lib/fog/xenserver/models/compute/host_patchs.rb +0 -25
- data/lib/fog/xenserver/models/compute/hosts.rb +0 -25
- data/lib/fog/xenserver/models/compute/network.rb +0 -93
- data/lib/fog/xenserver/models/compute/networks.rb +0 -29
- data/lib/fog/xenserver/models/compute/pbd.rb +0 -37
- data/lib/fog/xenserver/models/compute/pbds.rb +0 -29
- data/lib/fog/xenserver/models/compute/pci.rb +0 -22
- data/lib/fog/xenserver/models/compute/pcis.rb +0 -25
- data/lib/fog/xenserver/models/compute/pgpu.rb +0 -20
- data/lib/fog/xenserver/models/compute/pgpus.rb +0 -25
- data/lib/fog/xenserver/models/compute/pif.rb +0 -54
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +0 -28
- data/lib/fog/xenserver/models/compute/pifs.rb +0 -29
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +0 -25
- data/lib/fog/xenserver/models/compute/pool.rb +0 -75
- data/lib/fog/xenserver/models/compute/pool_patch.rb +0 -24
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +0 -25
- data/lib/fog/xenserver/models/compute/pools.rb +0 -29
- data/lib/fog/xenserver/models/compute/role.rb +0 -19
- data/lib/fog/xenserver/models/compute/roles.rb +0 -25
- data/lib/fog/xenserver/models/compute/server.rb +0 -251
- data/lib/fog/xenserver/models/compute/server_appliance.rb +0 -21
- data/lib/fog/xenserver/models/compute/server_appliances.rb +0 -25
- data/lib/fog/xenserver/models/compute/servers.rb +0 -64
- data/lib/fog/xenserver/models/compute/storage_manager.rb +0 -28
- data/lib/fog/xenserver/models/compute/storage_managers.rb +0 -25
- data/lib/fog/xenserver/models/compute/storage_repositories.rb +0 -27
- data/lib/fog/xenserver/models/compute/storage_repository.rb +0 -90
- data/lib/fog/xenserver/models/compute/tunnel.rb +0 -20
- data/lib/fog/xenserver/models/compute/tunnels.rb +0 -25
- data/lib/fog/xenserver/models/compute/vbd.rb +0 -88
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +0 -25
- data/lib/fog/xenserver/models/compute/vbds.rb +0 -29
- data/lib/fog/xenserver/models/compute/vdi.rb +0 -102
- data/lib/fog/xenserver/models/compute/vdis.rb +0 -25
- data/lib/fog/xenserver/models/compute/vif.rb +0 -56
- data/lib/fog/xenserver/models/compute/vifs.rb +0 -25
- data/lib/fog/xenserver/models/compute/vlan.rb +0 -78
- data/lib/fog/xenserver/models/compute/vlans.rb +0 -35
- data/lib/fog/xenserver/models/compute/vmpp.rb +0 -35
- data/lib/fog/xenserver/models/compute/vmpps.rb +0 -25
- data/lib/fog/xenserver/models/compute/vtpm.rb +0 -18
- data/lib/fog/xenserver/models/compute/vtpms.rb +0 -25
- data/lib/fog/xenserver/parser.rb +0 -34
- data/lib/fog/xenserver/parsers/get_hosts.rb +0 -16
- data/lib/fog/xenserver/parsers/get_networks.rb +0 -16
- data/lib/fog/xenserver/parsers/get_pools.rb +0 -16
- data/lib/fog/xenserver/parsers/get_records.rb +0 -16
- data/lib/fog/xenserver/parsers/get_storage_repositories.rb +0 -16
- data/lib/fog/xenserver/parsers/get_vbds.rb +0 -16
- data/lib/fog/xenserver/parsers/get_vifs.rb +0 -16
- data/lib/fog/xenserver/parsers/get_vms.rb +0 -16
- data/lib/fog/xenserver/requests/compute/clone_server.rb +0 -30
- data/lib/fog/xenserver/requests/compute/create_network.rb +0 -46
- data/lib/fog/xenserver/requests/compute/create_server.rb +0 -144
- data/lib/fog/xenserver/requests/compute/create_sr.rb +0 -88
- data/lib/fog/xenserver/requests/compute/create_vbd.rb +0 -43
- data/lib/fog/xenserver/requests/compute/create_vdi.rb +0 -57
- data/lib/fog/xenserver/requests/compute/create_vif.rb +0 -62
- data/lib/fog/xenserver/requests/compute/create_vlan.rb +0 -43
- data/lib/fog/xenserver/requests/compute/destroy_network.rb +0 -31
- data/lib/fog/xenserver/requests/compute/destroy_record.rb +0 -11
- data/lib/fog/xenserver/requests/compute/destroy_server.rb +0 -20
- data/lib/fog/xenserver/requests/compute/destroy_sr.rb +0 -28
- data/lib/fog/xenserver/requests/compute/destroy_vdi.rb +0 -20
- data/lib/fog/xenserver/requests/compute/destroy_vif.rb +0 -20
- data/lib/fog/xenserver/requests/compute/destroy_vlan.rb +0 -30
- data/lib/fog/xenserver/requests/compute/disable_host.rb +0 -23
- data/lib/fog/xenserver/requests/compute/eject_vbd.rb +0 -17
- data/lib/fog/xenserver/requests/compute/enable_host.rb +0 -22
- data/lib/fog/xenserver/requests/compute/get_record.rb +0 -31
- data/lib/fog/xenserver/requests/compute/get_records.rb +0 -24
- data/lib/fog/xenserver/requests/compute/insert_vbd.rb +0 -17
- data/lib/fog/xenserver/requests/compute/provision_server.rb +0 -17
- data/lib/fog/xenserver/requests/compute/reboot_host.rb +0 -17
- data/lib/fog/xenserver/requests/compute/reboot_server.rb +0 -17
- data/lib/fog/xenserver/requests/compute/scan_sr.rb +0 -17
- data/lib/fog/xenserver/requests/compute/set_affinity.rb +0 -19
- data/lib/fog/xenserver/requests/compute/set_attribute.rb +0 -19
- data/lib/fog/xenserver/requests/compute/shutdown_host.rb +0 -17
- data/lib/fog/xenserver/requests/compute/shutdown_server.rb +0 -17
- data/lib/fog/xenserver/requests/compute/snapshot_revert.rb +0 -24
- data/lib/fog/xenserver/requests/compute/snapshot_server.rb +0 -17
- data/lib/fog/xenserver/requests/compute/start_server.rb +0 -17
- data/lib/fog/xenserver/requests/compute/start_vm.rb +0 -19
- data/lib/fog/xenserver/requests/compute/unplug_pbd.rb +0 -20
- data/lib/fog/xenserver/requests/compute/unplug_vbd.rb +0 -25
- data/lib/fog/xenserver/utilities.rb +0 -8
- data/tests/xenserver/README +0 -21
- data/tests/xenserver/compute_tests.rb +0 -51
- data/tests/xenserver/helper.rb +0 -36
- data/tests/xenserver/models/compute/console_test.rb +0 -35
- data/tests/xenserver/models/compute/consoles_test.rb +0 -19
- data/tests/xenserver/models/compute/host_cpu_tests.rb +0 -58
- data/tests/xenserver/models/compute/host_metrics_tests.rb +0 -48
- data/tests/xenserver/models/compute/host_tests.rb +0 -98
- data/tests/xenserver/models/compute/hosts_tests.rb +0 -22
- data/tests/xenserver/models/compute/network_tests.rb +0 -79
- data/tests/xenserver/models/compute/networks_tests.rb +0 -22
- data/tests/xenserver/models/compute/pbd_tests.rb +0 -76
- data/tests/xenserver/models/compute/pbds_tests.rb +0 -22
- data/tests/xenserver/models/compute/pif_tests.rb +0 -58
- data/tests/xenserver/models/compute/pifs_tests.rb +0 -22
- data/tests/xenserver/models/compute/pool_tests.rb +0 -56
- data/tests/xenserver/models/compute/pools_tests.rb +0 -30
- data/tests/xenserver/models/compute/server_tests.rb +0 -184
- data/tests/xenserver/models/compute/servers_tests.rb +0 -89
- data/tests/xenserver/models/compute/storage_repositories_tests.rb +0 -30
- data/tests/xenserver/models/compute/storage_repository_tests.rb +0 -114
- data/tests/xenserver/models/compute/vbd_tests.rb +0 -115
- data/tests/xenserver/models/compute/vbds_tests.rb +0 -22
- data/tests/xenserver/models/compute/vif_tests.rb +0 -53
- data/tests/xenserver/models/compute/vifs_tests.rb +0 -22
- data/tests/xenserver/models/compute/vlan_tests.rb +0 -76
- data/tests/xenserver/models/compute/vlans_tests.rb +0 -36
- data/tests/xenserver/requests/compute/clone_server_tests.rb +0 -32
- data/tests/xenserver/requests/compute/create_network_tests.rb +0 -20
- data/tests/xenserver/requests/compute/create_server_tests.rb +0 -129
- data/tests/xenserver/requests/compute/create_sr_tests.rb +0 -54
- data/tests/xenserver/requests/compute/create_vdi_tests.rb +0 -80
- data/tests/xenserver/requests/compute/create_vif_tests.rb +0 -88
- data/tests/xenserver/requests/compute/create_vlan_tests.rb +0 -36
- data/tests/xenserver/requests/compute/destroy_network_tests.rb +0 -13
- data/tests/xenserver/requests/compute/destroy_sr_tests.rb +0 -46
- data/tests/xenserver/requests/compute/destroy_vdi_tests.rb +0 -25
- data/tests/xenserver/requests/compute/destroy_vlan_tests.rb +0 -36
- data/tests/xenserver/requests/compute/disable_host_tests.rb +0 -16
- data/tests/xenserver/requests/compute/enable_host_tests.rb +0 -16
- data/tests/xenserver/requests/compute/get_record_tests.rb +0 -15
- data/tests/xenserver/requests/compute/set_attribute_tests.rb +0 -66
- data/tests/xenserver/requests/compute/unplug_pbd_tests.rb +0 -48
- data/tests/xenserver/xenserver_tests.rb +0 -33
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/pgpu'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class Pgpus < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::Pgpu
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'PGPU'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( pgpu_ref )
|
16
|
-
if pgpu_ref && pgpu = service.get_record( pgpu_ref, 'PGPU' )
|
17
|
-
new(pgpu)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class PIF < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PIF
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :uuid
|
13
|
-
attribute :__bond_master_of, :aliases => :bond_master_of
|
14
|
-
attribute :__bond_slave_of, :aliases => :bond_slave_of
|
15
|
-
attribute :disallow_unplug
|
16
|
-
attribute :physical
|
17
|
-
attribute :mac, :aliases => :MAC
|
18
|
-
attribute :currently_attached
|
19
|
-
attribute :device
|
20
|
-
attribute :device_name
|
21
|
-
attribute :metrics
|
22
|
-
attribute :dns, :aliases => :DNS
|
23
|
-
attribute :gateway
|
24
|
-
attribute :ip, :aliases => :IP
|
25
|
-
attribute :ip_configuration_mode
|
26
|
-
attribute :ipv6, :aliases => :IPv6
|
27
|
-
attribute :ipv6_configuration_mode
|
28
|
-
attribute :ipv6_gateway
|
29
|
-
attribute :mtu, :aliases => :MTU
|
30
|
-
attribute :__network, :aliases => :network
|
31
|
-
attribute :netmask
|
32
|
-
attribute :status_code
|
33
|
-
attribute :status_detail
|
34
|
-
attribute :management
|
35
|
-
attribute :primary_address_type
|
36
|
-
attribute :__tunnel_access_pif_of, :aliases => :tunnel_access_PIF_of
|
37
|
-
attribute :__tunnel_transport_pif_of, :aliases => :tunnel_transport_PIF_of
|
38
|
-
attribute :vlan, :aliases => :VLAN
|
39
|
-
attribute :vlan_master_of, :aliases => :VLAN_master_of
|
40
|
-
attribute :vlan_slave_of, :aliases => :VLAN_slave_of
|
41
|
-
attribute :other_config
|
42
|
-
attribute :__host, :aliases => :host
|
43
|
-
|
44
|
-
def network
|
45
|
-
service.networks.get __network
|
46
|
-
end
|
47
|
-
|
48
|
-
def host
|
49
|
-
service.hosts.get __host
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class PifMetrics < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PIF_metrics
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :carrier
|
13
|
-
attribute :device_id
|
14
|
-
attribute :device_name
|
15
|
-
attribute :duplex
|
16
|
-
attribute :io_read_kbs
|
17
|
-
attribute :io_write_kbs
|
18
|
-
attribute :last_updated
|
19
|
-
attribute :other_config
|
20
|
-
attribute :pci_bus_path
|
21
|
-
attribute :speed
|
22
|
-
attribute :uuid
|
23
|
-
attribute :vendor_id
|
24
|
-
attribute :vendor_name
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/pif'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class Pifs < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::PIF
|
9
|
-
|
10
|
-
def initialize(attributes)
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
def all(options = {})
|
15
|
-
data = service.get_records 'PIF'
|
16
|
-
load(data)
|
17
|
-
end
|
18
|
-
|
19
|
-
def get( ref )
|
20
|
-
if ref && obj = service.get_record( ref, 'PIF' )
|
21
|
-
new(obj)
|
22
|
-
end
|
23
|
-
rescue Fog::XenServer::NotFound
|
24
|
-
nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/pif_metrics'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class PifsMetrics < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::PifMetrics
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'PIF_metrics'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( pif_metrics_ref )
|
16
|
-
if pif_metrics_ref && pif_metrics = service.get_record( pif_metrics_ref, 'PIF_metrics' )
|
17
|
-
new(pif_metrics)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class Pool < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=pool
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :uuid
|
13
|
-
attribute :blobs
|
14
|
-
attribute :__crash_dump_sr, :aliases => :crash_dump_SR
|
15
|
-
attribute :name, :aliases => :name_label
|
16
|
-
attribute :description, :aliases => :name_description
|
17
|
-
attribute :__default_sr, :aliases => :default_SR
|
18
|
-
attribute :gui_config
|
19
|
-
attribute :ha_allow_overcommit
|
20
|
-
attribute :ha_configuration
|
21
|
-
attribute :__master, :aliases => :master
|
22
|
-
attribute :tags
|
23
|
-
attribute :restrictions
|
24
|
-
attribute :ha_enabled
|
25
|
-
attribute :ha_host_failures_to_tolerate
|
26
|
-
attribute :ha_overcommitted
|
27
|
-
attribute :ha_plan_exists_for
|
28
|
-
attribute :ha_statefiles
|
29
|
-
attribute :__metadata_vdis, :aliases => :metadata_VDIs
|
30
|
-
attribute :other_config
|
31
|
-
attribute :redo_log_enabled
|
32
|
-
attribute :redo_log_vdi
|
33
|
-
attribute :vswitch_controller
|
34
|
-
attribute :__suspend_image_sr, :aliases => :suspend_image_SR
|
35
|
-
attribute :wlb_enabled
|
36
|
-
attribute :wlb_url
|
37
|
-
attribute :wlb_username
|
38
|
-
attribute :wlb_verify_cert
|
39
|
-
|
40
|
-
def default_sr
|
41
|
-
service.storage_repositories.get __default_sr
|
42
|
-
end
|
43
|
-
|
44
|
-
def default_sr=(sr)
|
45
|
-
service.set_attribute( 'pool', reference, 'default_SR', sr.reference )
|
46
|
-
end
|
47
|
-
alias_method :default_storage_repository=, :default_sr=
|
48
|
-
|
49
|
-
def default_storage_repository
|
50
|
-
default_sr
|
51
|
-
end
|
52
|
-
|
53
|
-
def suspend_image_sr=(sr)
|
54
|
-
service.set_attribute( 'pool', reference, 'suspend_image_SR', sr.reference )
|
55
|
-
end
|
56
|
-
|
57
|
-
def suspend_image_sr
|
58
|
-
service.storage_repositories.get __suspend_image_sr
|
59
|
-
end
|
60
|
-
|
61
|
-
def master
|
62
|
-
service.hosts.get __master
|
63
|
-
end
|
64
|
-
|
65
|
-
def set_attribute(name, *val)
|
66
|
-
data = service.set_attribute( 'pool', reference, name, *val )
|
67
|
-
# Do not reload automatically for performance reasons
|
68
|
-
# We can set multiple attributes at the same time and
|
69
|
-
# then reload manually
|
70
|
-
#reload
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class PoolPatch < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=pool_patch
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :after_apply_guidance
|
13
|
-
attribute :__host_patches, :aliases => :host_patches
|
14
|
-
attribute :description, :aliases => :name_description
|
15
|
-
attribute :name, :aliases => :name_label
|
16
|
-
attribute :other_config
|
17
|
-
attribute :pool_applied
|
18
|
-
attribute :size
|
19
|
-
attribute :uuid
|
20
|
-
attribute :version
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/pool_patch'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class PoolPatchs < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::PoolPatch
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'pool_patch'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( pool_patch_ref )
|
16
|
-
if pool_patch_ref && pool_patch = service.get_record( pool_patch_ref, 'pool_patch' )
|
17
|
-
new(pool_patch)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/pool'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class Pools < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::Pool
|
9
|
-
|
10
|
-
def initialize(attributes)
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
def all(options = {})
|
15
|
-
data = service.get_records 'pool'
|
16
|
-
load(data)
|
17
|
-
end
|
18
|
-
|
19
|
-
def get( pool_ref )
|
20
|
-
if pool_ref && pool = service.get_record( pool_ref, 'pool' )
|
21
|
-
new(pool)
|
22
|
-
else
|
23
|
-
nil
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class Role < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=role
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :description, :aliases => :name_description
|
13
|
-
attribute :name, :aliases => :name_label
|
14
|
-
attribute :__subroles, :aliases => :subroles
|
15
|
-
attribute :uuid
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/role'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class Roles < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::Role
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'role'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( role_ref )
|
16
|
-
if role_ref && role = service.get_record( role_ref, 'role' )
|
17
|
-
new(role)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,251 +0,0 @@
|
|
1
|
-
require 'fog/compute/models/server'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class Server < Fog::Compute::Server
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :uuid
|
13
|
-
attribute :name, :aliases => :name_label
|
14
|
-
attribute :description, :aliases => :name_description
|
15
|
-
attribute :__affinity, :aliases => :affinity
|
16
|
-
attribute :actions_after_crash
|
17
|
-
attribute :actions_after_reboot
|
18
|
-
attribute :actions_after_shutdown
|
19
|
-
attribute :allowed_operations
|
20
|
-
attribute :__consoles, :aliases => :consoles
|
21
|
-
attribute :__attached_pcis, :aliases => :attached_PCIs
|
22
|
-
attribute :bios_strings
|
23
|
-
attribute :blobs
|
24
|
-
attribute :blocked_operations
|
25
|
-
attribute :__children, :aliases => :children
|
26
|
-
attribute :__crash_dumps, :aliases => :crash_dumps
|
27
|
-
attribute :current_operations
|
28
|
-
attribute :domarch
|
29
|
-
attribute :domid
|
30
|
-
attribute :generation_id
|
31
|
-
attribute :tags
|
32
|
-
attribute :__guest_metrics, :aliases => :guest_metrics
|
33
|
-
attribute :ha_always_run
|
34
|
-
attribute :ha_restart_priority
|
35
|
-
attribute :is_a_snapshot
|
36
|
-
attribute :is_a_template
|
37
|
-
attribute :is_control_domain
|
38
|
-
attribute :is_snapshot_from_vmpp
|
39
|
-
attribute :last_boot_cpu_flags, :aliases => :last_boot_CPU_flags
|
40
|
-
attribute :last_booted_record
|
41
|
-
attribute :memory_dynamic_max
|
42
|
-
attribute :memory_dynamic_min
|
43
|
-
attribute :memory_overhead
|
44
|
-
attribute :memory_static_max
|
45
|
-
attribute :memory_static_min
|
46
|
-
attribute :memory_target
|
47
|
-
attribute :__metrics, :aliases => :metrics
|
48
|
-
attribute :order
|
49
|
-
attribute :other_config
|
50
|
-
attribute :__parent, :aliases => :parent
|
51
|
-
attribute :platform
|
52
|
-
attribute :power_state
|
53
|
-
attribute :protection_policy
|
54
|
-
attribute :pv_args, :aliases => :PV_args
|
55
|
-
attribute :pv_bootloader, :aliases => :PV_bootloader
|
56
|
-
attribute :pv_bootloader_args, :aliases => :PV_bootloader_args
|
57
|
-
attribute :pv_kernel, :aliases => :PV_kernel
|
58
|
-
attribute :pv_ramdisk, :aliases => :PV_ramdisk
|
59
|
-
attribute :pv_legacy_args, :aliases => :PV_legacy_args
|
60
|
-
attribute :recommendations
|
61
|
-
attribute :__resident_on, :aliases => :resident_on
|
62
|
-
attribute :shutdown_delay
|
63
|
-
attribute :snapshot_info
|
64
|
-
attribute :snapshot_metadata
|
65
|
-
attribute :__snapshot_of, :aliases => :snapshot_of
|
66
|
-
attribute :snapshot_time
|
67
|
-
attribute :start_delay
|
68
|
-
attribute :__suspend_sr, :aliases => :suspend_sr
|
69
|
-
attribute :__suspend_vdi, :aliases => :suspend_VDI
|
70
|
-
attribute :transportable_snapshot_id
|
71
|
-
attribute :user_version
|
72
|
-
attribute :version
|
73
|
-
attribute :__vgpus, :aliases => :VGPUs
|
74
|
-
attribute :__vtpms, :aliases => :VTPMs
|
75
|
-
attribute :xenstore_data
|
76
|
-
# Virtual Block Devices
|
77
|
-
attribute :__vbds, :aliases => :VBDs
|
78
|
-
# Virtual CPUs
|
79
|
-
attribute :vcpus_at_startup, :aliases => :VCPUs_at_startup
|
80
|
-
attribute :vcpus_max, :aliases => :VCPUs_max
|
81
|
-
attribute :vcpus_params, :aliases => :VCPUs_params
|
82
|
-
# Virtual Interfaces (NIC)
|
83
|
-
attribute :__vifs, :aliases => :VIFs
|
84
|
-
attribute :template_name
|
85
|
-
attribute :hvm_boot_policy, :aliases => :HVM_boot_policy
|
86
|
-
attribute :hvm_boot_params, :aliases => :HVM_boot_params
|
87
|
-
attribute :hvm_shadow_multiplier, :aliases => :HVM_shadow_multiplier
|
88
|
-
attribute :pci_bus, :aliases => :PCI_bus
|
89
|
-
attribute :snapshots
|
90
|
-
|
91
|
-
def vbds
|
92
|
-
__vbds.map {|vbd| service.vbds.get vbd }
|
93
|
-
end
|
94
|
-
|
95
|
-
def affinity
|
96
|
-
service.hosts.get __affinity
|
97
|
-
end
|
98
|
-
|
99
|
-
def consoles
|
100
|
-
__consoles.map {|console| service.consoles.get console }
|
101
|
-
end
|
102
|
-
|
103
|
-
def destroy
|
104
|
-
# Make sure it's halted
|
105
|
-
stop('hard')
|
106
|
-
vbds.each do |vbd|
|
107
|
-
if vbd.type == "Disk"
|
108
|
-
vbd.unplug \
|
109
|
-
if vbd.allowed_operations.include?("unplug")
|
110
|
-
vbd.vdi.destroy \
|
111
|
-
if vbd.vdi.allowed_operations.include?("destroy")
|
112
|
-
end
|
113
|
-
end
|
114
|
-
service.destroy_server( reference )
|
115
|
-
true
|
116
|
-
end
|
117
|
-
|
118
|
-
def set_attribute(name, *val)
|
119
|
-
data = service.set_attribute( 'VM', reference, name, *val )
|
120
|
-
# Do not reload automatically for performance reasons
|
121
|
-
# We can set multiple attributes at the same time and
|
122
|
-
# then reload manually
|
123
|
-
#reload
|
124
|
-
end
|
125
|
-
|
126
|
-
def refresh
|
127
|
-
Fog::Logger.deprecation(
|
128
|
-
'This method is deprecated. Use #reload instead.'
|
129
|
-
)
|
130
|
-
data = service.get_record( reference, 'VM' )
|
131
|
-
merge_attributes( data )
|
132
|
-
true
|
133
|
-
end
|
134
|
-
|
135
|
-
def vifs
|
136
|
-
__vifs.map { |vif| service.vifs.get vif }
|
137
|
-
end
|
138
|
-
|
139
|
-
# associations
|
140
|
-
def networks
|
141
|
-
vifs.map { |v| v.network }
|
142
|
-
end
|
143
|
-
|
144
|
-
def resident_on
|
145
|
-
service.hosts.get __resident_on
|
146
|
-
end
|
147
|
-
|
148
|
-
#
|
149
|
-
# This is not always present in XenServer VMs
|
150
|
-
# Guest needs XenTools installed to report this AFAIK
|
151
|
-
def guest_metrics
|
152
|
-
return nil unless __guest_metrics
|
153
|
-
rec = service.get_record( __guest_metrics, 'VM_guest_metrics' )
|
154
|
-
Fog::Compute::XenServer::GuestMetrics.new(rec)
|
155
|
-
end
|
156
|
-
|
157
|
-
def tools_installed?
|
158
|
-
!guest_metrics.nil?
|
159
|
-
end
|
160
|
-
|
161
|
-
def home_hypervisor
|
162
|
-
service.hosts.first
|
163
|
-
end
|
164
|
-
|
165
|
-
def mac_address
|
166
|
-
networks.first.MAC
|
167
|
-
end
|
168
|
-
|
169
|
-
def running?
|
170
|
-
reload
|
171
|
-
power_state == "Running"
|
172
|
-
end
|
173
|
-
|
174
|
-
def halted?
|
175
|
-
reload
|
176
|
-
power_state == "Halted"
|
177
|
-
end
|
178
|
-
|
179
|
-
# operations
|
180
|
-
def start
|
181
|
-
return false if running?
|
182
|
-
service.start_server( reference )
|
183
|
-
true
|
184
|
-
end
|
185
|
-
|
186
|
-
def save(params = {})
|
187
|
-
requires :name
|
188
|
-
nets = attributes[:networks] || []
|
189
|
-
if params[:auto_start].nil?
|
190
|
-
auto_start = true
|
191
|
-
else
|
192
|
-
auto_start = params[:auto_start]
|
193
|
-
end
|
194
|
-
if template_name
|
195
|
-
attr = service.get_record(
|
196
|
-
service.create_server( name, template_name, nets, :auto_start => auto_start),
|
197
|
-
'VM'
|
198
|
-
)
|
199
|
-
else
|
200
|
-
attr = service.get_record(
|
201
|
-
service.create_server_raw(attributes),
|
202
|
-
'VM'
|
203
|
-
)
|
204
|
-
end
|
205
|
-
merge_attributes attr
|
206
|
-
true
|
207
|
-
end
|
208
|
-
|
209
|
-
def reboot(stype = 'clean')
|
210
|
-
service.reboot_server(reference, stype)
|
211
|
-
true
|
212
|
-
end
|
213
|
-
|
214
|
-
def hard_reboot
|
215
|
-
reboot 'hard'
|
216
|
-
end
|
217
|
-
|
218
|
-
def clean_reboot
|
219
|
-
reboot 'clean'
|
220
|
-
end
|
221
|
-
|
222
|
-
def stop(stype = 'clean')
|
223
|
-
return false if !running?
|
224
|
-
service.shutdown_server( reference, stype )
|
225
|
-
wait_for { power_state == 'Halted' }
|
226
|
-
true
|
227
|
-
end
|
228
|
-
|
229
|
-
def hard_shutdown
|
230
|
-
stop 'hard'
|
231
|
-
end
|
232
|
-
|
233
|
-
def clean_shutdown
|
234
|
-
stop 'clean'
|
235
|
-
end
|
236
|
-
|
237
|
-
def provision
|
238
|
-
service.provision_server reference
|
239
|
-
end
|
240
|
-
|
241
|
-
def snapshot(name)
|
242
|
-
service.snapshot_server(reference, name)
|
243
|
-
end
|
244
|
-
|
245
|
-
def revert(snapshot_ref)
|
246
|
-
service.snapshot_revert(snapshot_ref)
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
end
|
251
|
-
end
|