fog-vcloud-director 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +11 -0
- data/.gitignore +17 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +240 -0
- data/.ruby-gemset +1 -0
- data/.travis.yml +15 -0
- data/Gemfile +4 -0
- data/LICENSE.md +20 -0
- data/README.md +962 -0
- data/Rakefile +19 -0
- data/fog-vcloud-director.gemspec +31 -0
- data/lib/fog/vcloud_director.rb +1 -0
- data/lib/fog/vcloud_director/compute.rb +916 -0
- data/lib/fog/vcloud_director/core.rb +69 -0
- data/lib/fog/vcloud_director/generators/compute/compose_common.rb +122 -0
- data/lib/fog/vcloud_director/generators/compute/compose_vapp.rb +25 -0
- data/lib/fog/vcloud_director/generators/compute/create_snapshot.rb +25 -0
- data/lib/fog/vcloud_director/generators/compute/customization.rb +105 -0
- data/lib/fog/vcloud_director/generators/compute/disks.rb +186 -0
- data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +243 -0
- data/lib/fog/vcloud_director/generators/compute/instantiate_vapp_template_params.rb +30 -0
- data/lib/fog/vcloud_director/generators/compute/metadata.rb +104 -0
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +88 -0
- data/lib/fog/vcloud_director/generators/compute/recompose_vapp.rb +34 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +28 -0
- data/lib/fog/vcloud_director/generators/compute/vm.rb +32 -0
- data/lib/fog/vcloud_director/generators/compute/vm_network.rb +119 -0
- data/lib/fog/vcloud_director/models/compute/catalog.rb +22 -0
- data/lib/fog/vcloud_director/models/compute/catalog_item.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/catalog_items.rb +33 -0
- data/lib/fog/vcloud_director/models/compute/catalogs.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/custom_field.rb +18 -0
- data/lib/fog/vcloud_director/models/compute/custom_fields.rb +67 -0
- data/lib/fog/vcloud_director/models/compute/disk.rb +53 -0
- data/lib/fog/vcloud_director/models/compute/disks.rb +44 -0
- data/lib/fog/vcloud_director/models/compute/media.rb +26 -0
- data/lib/fog/vcloud_director/models/compute/medias.rb +75 -0
- data/lib/fog/vcloud_director/models/compute/network.rb +25 -0
- data/lib/fog/vcloud_director/models/compute/networks.rb +62 -0
- data/lib/fog/vcloud_director/models/compute/organization.rb +37 -0
- data/lib/fog/vcloud_director/models/compute/organizations.rb +28 -0
- data/lib/fog/vcloud_director/models/compute/tag.rb +31 -0
- data/lib/fog/vcloud_director/models/compute/tags.rb +41 -0
- data/lib/fog/vcloud_director/models/compute/task.rb +55 -0
- data/lib/fog/vcloud_director/models/compute/tasks.rb +36 -0
- data/lib/fog/vcloud_director/models/compute/template_vm.rb +52 -0
- data/lib/fog/vcloud_director/models/compute/template_vms.rb +41 -0
- data/lib/fog/vcloud_director/models/compute/vapp.rb +144 -0
- data/lib/fog/vcloud_director/models/compute/vapp_template.rb +26 -0
- data/lib/fog/vcloud_director/models/compute/vapp_templates.rb +40 -0
- data/lib/fog/vcloud_director/models/compute/vapps.rb +40 -0
- data/lib/fog/vcloud_director/models/compute/vdc.rb +45 -0
- data/lib/fog/vcloud_director/models/compute/vdcs.rb +37 -0
- data/lib/fog/vcloud_director/models/compute/vm.rb +197 -0
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +40 -0
- data/lib/fog/vcloud_director/models/compute/vm_customizations.rb +29 -0
- data/lib/fog/vcloud_director/models/compute/vm_network.rb +27 -0
- data/lib/fog/vcloud_director/models/compute/vm_networks.rb +19 -0
- data/lib/fog/vcloud_director/models/compute/vms.rb +46 -0
- data/lib/fog/vcloud_director/parsers/compute/disks.rb +53 -0
- data/lib/fog/vcloud_director/parsers/compute/metadata.rb +61 -0
- data/lib/fog/vcloud_director/parsers/compute/network.rb +104 -0
- data/lib/fog/vcloud_director/parsers/compute/vm.rb +86 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +55 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_network.rb +107 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_parser_helper.rb +62 -0
- data/lib/fog/vcloud_director/parsers/compute/vms.rb +68 -0
- data/lib/fog/vcloud_director/parsers/compute/vms_by_metadata.rb +37 -0
- data/lib/fog/vcloud_director/query.rb +59 -0
- data/lib/fog/vcloud_director/requests/compute/delete_catalog_item.rb +22 -0
- data/lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/delete_disk.rb +60 -0
- data/lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/delete_logout.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/delete_media.rb +122 -0
- data/lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/delete_network.rb +62 -0
- data/lib/fog/vcloud_director/requests/compute/delete_shadow_vm.rb +30 -0
- data/lib/fog/vcloud_director/requests/compute/delete_vapp.rb +59 -0
- data/lib/fog/vcloud_director/requests/compute/delete_vapp_metadata_item_metadata.rb +30 -0
- data/lib/fog/vcloud_director/requests/compute/delete_vapp_template.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog.rb +63 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_item.rb +48 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb +94 -0
- data/lib/fog/vcloud_director/requests/compute/get_control_access_params_catalog.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_cpu_rasd_item.rb +65 -0
- data/lib/fog/vcloud_director/requests/compute/get_current_session.rb +83 -0
- data/lib/fog/vcloud_director/requests/compute/get_disk.rb +123 -0
- data/lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_disk_owner.rb +70 -0
- data/lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb +94 -0
- data/lib/fog/vcloud_director/requests/compute/get_disks_rasd_items_list.rb +90 -0
- data/lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb +109 -0
- data/lib/fog/vcloud_director/requests/compute/get_entity.rb +38 -0
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +736 -0
- data/lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb +95 -0
- data/lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp.rb +69 -0
- data/lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_href.rb +21 -0
- data/lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp.rb +59 -0
- data/lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_media.rb +111 -0
- data/lib/fog/vcloud_director/requests/compute/get_media_drives_rasd_items_list.rb +92 -0
- data/lib/fog/vcloud_director/requests/compute/get_media_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_media_owner.rb +70 -0
- data/lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb +94 -0
- data/lib/fog/vcloud_director/requests/compute/get_memory_rasd_item.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_metadata.rb +41 -0
- data/lib/fog/vcloud_director/requests/compute/get_network.rb +67 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_cards_items_list.rb +70 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_complete.rb +78 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp.rb +61 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp.rb +68 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb +59 -0
- data/lib/fog/vcloud_director/requests/compute/get_org_settings.rb +38 -0
- data/lib/fog/vcloud_director/requests/compute/get_org_vdc_gateways.rb +83 -0
- data/lib/fog/vcloud_director/requests/compute/get_organization.rb +100 -0
- data/lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_organization_metadata_item_metadata.rb +28 -0
- data/lib/fog/vcloud_director/requests/compute/get_organizations.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb +95 -0
- data/lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_request.rb +19 -0
- data/lib/fog/vcloud_director/requests/compute/get_runtime_info_section_type.rb +57 -0
- data/lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_shadow_vm.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/get_snapshot_section.rb +55 -0
- data/lib/fog/vcloud_director/requests/compute/get_startup_section.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_supported_systems_info.rb +239 -0
- data/lib/fog/vcloud_director/requests/compute/get_supported_versions.rb +1159 -0
- data/lib/fog/vcloud_director/requests/compute/get_task.rb +168 -0
- data/lib/fog/vcloud_director/requests/compute/get_task_list.rb +130 -0
- data/lib/fog/vcloud_director/requests/compute/get_template_vm.rb +74 -0
- data/lib/fog/vcloud_director/requests/compute/get_template_vms.rb +41 -0
- data/lib/fog/vcloud_director/requests/compute/get_thumbnail.rb +28 -0
- data/lib/fog/vcloud_director/requests/compute/get_users_from_query.rb +95 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +176 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +84 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_ovf_descriptor.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_owner.rb +58 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template_ovf_descriptor.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb +95 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb +94 -0
- data/lib/fog/vcloud_director/requests/compute/get_vcloud.rb +76 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc.rb +174 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb +28 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc_storage_class.rb +83 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb +94 -0
- data/lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb +29 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm.rb +74 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_capabilities.rb +61 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_customization.rb +31 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_disks.rb +51 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_network.rb +56 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_pending_question.rb +34 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms.rb +41 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms_in_lease_from_query.rb +150 -0
- data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +173 -0
- data/lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_answer_vm_pending_question.rb +36 -0
- data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +51 -0
- data/lib/fog/vcloud_director/requests/compute/post_cancel_task.rb +43 -0
- data/lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb +70 -0
- data/lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb +28 -0
- data/lib/fog/vcloud_director/requests/compute/post_clone_media.rb +102 -0
- data/lib/fog/vcloud_director/requests/compute/post_clone_vapp.rb +62 -0
- data/lib/fog/vcloud_director/requests/compute/post_clone_vapp_template.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb +45 -0
- data/lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb +73 -0
- data/lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_create_catalog_item.rb +56 -0
- data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +171 -0
- data/lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb +21 -0
- data/lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb +51 -0
- data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb +30 -0
- data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/post_enter_maintenance_mode.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/post_exit_maintenance_mode.rb +22 -0
- data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_instantiate_vapp_template.rb +196 -0
- data/lib/fog/vcloud_director/requests/compute/post_login_session.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/post_power_off_vapp.rb +36 -0
- data/lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb +71 -0
- data/lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb +33 -0
- data/lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb +21 -0
- data/lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb +118 -0
- data/lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb +33 -0
- data/lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb +27 -0
- data/lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb +33 -0
- data/lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb +33 -0
- data/lib/fog/vcloud_director/requests/compute/post_undeploy_vapp.rb +66 -0
- data/lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/post_update_vapp_metadata.rb +86 -0
- data/lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb +52 -0
- data/lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb +28 -0
- data/lib/fog/vcloud_director/requests/compute/post_upload_disk.rb +133 -0
- data/lib/fog/vcloud_director/requests/compute/post_upload_media.rb +120 -0
- data/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb +46 -0
- data/lib/fog/vcloud_director/requests/compute/put_catalog_item_metadata_item_metadata.rb +50 -0
- data/lib/fog/vcloud_director/requests/compute/put_cpu.rb +88 -0
- data/lib/fog/vcloud_director/requests/compute/put_disk_metadata_item_metadata.rb +46 -0
- data/lib/fog/vcloud_director/requests/compute/put_disks.rb +39 -0
- data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +141 -0
- data/lib/fog/vcloud_director/requests/compute/put_media_metadata_item_metadata.rb +50 -0
- data/lib/fog/vcloud_director/requests/compute/put_memory.rb +89 -0
- data/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/put_network.rb +162 -0
- data/lib/fog/vcloud_director/requests/compute/put_network_connection_system_section_vapp.rb +152 -0
- data/lib/fog/vcloud_director/requests/compute/put_product_sections.rb +46 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_metadata_item_metadata.rb +85 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +36 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_template_metadata_item_metadata.rb +50 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm.rb +72 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_capabilities.rb +44 -0
- data/lib/fog/vcloud_director/version.rb +5 -0
- data/spec/spec_helper.rb +15 -0
- data/spec/vcloud_director/generators/compute/instantiate_vapp_template_params_spec.rb +68 -0
- data/spec/vcloud_director/requests/compute/instantiate_vapp_template_spec.rb +78 -0
- data/spec/vcloud_director/spec_helper.rb +11 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/console.rake +12 -0
- data/tasks/lint.rake +3 -0
- data/tasks/test.rake +13 -0
- data/tests/helper.rb +32 -0
- data/tests/helpers/collection_helper.rb +97 -0
- data/tests/helpers/compute/flavors_helper.rb +32 -0
- data/tests/helpers/compute/server_helper.rb +25 -0
- data/tests/helpers/compute/servers_helper.rb +10 -0
- data/tests/helpers/formats_helper.rb +98 -0
- data/tests/helpers/formats_helper_tests.rb +110 -0
- data/tests/helpers/mock_helper.rb +95 -0
- data/tests/helpers/model_helper.rb +31 -0
- data/tests/helpers/responds_to_helper.rb +11 -0
- data/tests/helpers/schema_validator_tests.rb +107 -0
- data/tests/helpers/succeeds_helper.rb +9 -0
- data/tests/lorem.txt +1 -0
- data/tests/vcloud_director/ensure_list_tests.rb +84 -0
- data/tests/vcloud_director/fixtures/test.iso +1 -0
- data/tests/vcloud_director/fixtures/vapp.xml +532 -0
- data/tests/vcloud_director/fixtures/vm.xml +213 -0
- data/tests/vcloud_director/generators/compute/compose_vapp_tests.rb +108 -0
- data/tests/vcloud_director/models/compute/catalog_items_tests.rb +42 -0
- data/tests/vcloud_director/models/compute/catalogs_tests.rb +40 -0
- data/tests/vcloud_director/models/compute/helper.rb +60 -0
- data/tests/vcloud_director/models/compute/media_tests.rb +58 -0
- data/tests/vcloud_director/models/compute/network_tests.rb +108 -0
- data/tests/vcloud_director/models/compute/organizations_tests.rb +18 -0
- data/tests/vcloud_director/models/compute/tasks_tests.rb +56 -0
- data/tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb +93 -0
- data/tests/vcloud_director/models/compute/vapp_template_tests.rb +29 -0
- data/tests/vcloud_director/models/compute/vapp_tests.rb +61 -0
- data/tests/vcloud_director/models/compute/vdcs_tests.rb +54 -0
- data/tests/vcloud_director/models/compute/vms_tests.rb +101 -0
- data/tests/vcloud_director/requests/compute/admin_tests.rb +16 -0
- data/tests/vcloud_director/requests/compute/catalog_tests.rb +42 -0
- data/tests/vcloud_director/requests/compute/disk_tests.rb +178 -0
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +217 -0
- data/tests/vcloud_director/requests/compute/groups_tests.rb +18 -0
- data/tests/vcloud_director/requests/compute/helper.rb +32 -0
- data/tests/vcloud_director/requests/compute/media_tests.rb +195 -0
- data/tests/vcloud_director/requests/compute/network_tests.rb +186 -0
- data/tests/vcloud_director/requests/compute/organization_tests.rb +37 -0
- data/tests/vcloud_director/requests/compute/ovf_descriptor_tests.rb +36 -0
- data/tests/vcloud_director/requests/compute/query_tests.rb +99 -0
- data/tests/vcloud_director/requests/compute/schema_helper.rb +663 -0
- data/tests/vcloud_director/requests/compute/session_tests.rb +14 -0
- data/tests/vcloud_director/requests/compute/supported_systems_tests.rb +11 -0
- data/tests/vcloud_director/requests/compute/task_tests.rb +35 -0
- data/tests/vcloud_director/requests/compute/users_tests.rb +18 -0
- data/tests/vcloud_director/requests/compute/vapp_tests.rb +123 -0
- data/tests/vcloud_director/requests/compute/vdc_storage_profile_tests.rb +27 -0
- data/tests/vcloud_director/requests/compute/vdc_tests.rb +36 -0
- data/tests/vcloud_director/requests/compute/versions_tests.rb +13 -0
- data/tests/vcloud_director/requests/compute/vm_tests.rb +185 -0
- data/tests/watchr.rb +22 -0
- metadata +461 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class VcloudDirector
|
4
|
+
class Real
|
5
|
+
# Set the value for the specified metadata key to the value provided,
|
6
|
+
# overwriting any existing value.
|
7
|
+
#
|
8
|
+
# @param [String] id Object identifier of the media object.
|
9
|
+
# @param [String] key Key of the metadata item.
|
10
|
+
# @param [Boolean,DateTime,Fixnum,String] value Value of the metadata
|
11
|
+
# item.
|
12
|
+
# @return [Excon::Response]
|
13
|
+
# * body<~Hash>:
|
14
|
+
#
|
15
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/PUT-MediaMetadataItem-metadata.html
|
16
|
+
# @since vCloud API version 1.5
|
17
|
+
def put_media_metadata_item_metadata(id, key, value)
|
18
|
+
body = Nokogiri::XML::Builder.new do
|
19
|
+
attrs = {
|
20
|
+
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
|
21
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
|
22
|
+
}
|
23
|
+
MetadataValue(attrs) {
|
24
|
+
if api_version.to_f < 5.1
|
25
|
+
Value value
|
26
|
+
else
|
27
|
+
type = case value
|
28
|
+
when TrueClass, FalseClass then 'MetadataBooleanValue';
|
29
|
+
when DateTime then 'MetadataDateTimeValue';
|
30
|
+
when Fixnum then 'MetadataNumberValue';
|
31
|
+
else 'MetadataStringValue'
|
32
|
+
end
|
33
|
+
TypedValue('xsi:type' => type) { Value value }
|
34
|
+
end
|
35
|
+
}
|
36
|
+
end.to_xml
|
37
|
+
|
38
|
+
request(
|
39
|
+
:body => body,
|
40
|
+
:expects => 202,
|
41
|
+
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'},
|
42
|
+
:method => 'PUT',
|
43
|
+
:parser => Fog::ToHashDocument.new,
|
44
|
+
:path => "media/#{id}/metadata/#{URI.escape(key)}"
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class VcloudDirector
|
4
|
+
class Real
|
5
|
+
extend Fog::Deprecation
|
6
|
+
deprecate :put_vm_memory, :put_memory
|
7
|
+
|
8
|
+
# Update the RASD item that specifies memory properties of a VM.
|
9
|
+
#
|
10
|
+
# This operation is asynchronous and returns a task that you can
|
11
|
+
# monitor to track the progress of the request.
|
12
|
+
#
|
13
|
+
# @param [String] id Object identifier of the VM.
|
14
|
+
# @param [Integer] memory Memory size in Megabytes.
|
15
|
+
# @return [Excon::Response]
|
16
|
+
# * body<~Hash>:
|
17
|
+
#
|
18
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/PUT-Memory.html
|
19
|
+
# @since vCloud API version 0.9
|
20
|
+
def put_memory(id, memory)
|
21
|
+
data = <<EOF
|
22
|
+
<Item
|
23
|
+
xmlns="http://www.vmware.com/vcloud/v1.5"
|
24
|
+
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
|
25
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
26
|
+
xmlns:ns12="http://www.vmware.com/vcloud/v1.5"
|
27
|
+
ns12:href="#{end_point}vApp/#{id}/virtualHardwareSection/memory"
|
28
|
+
ns12:type="application/vnd.vmware.vcloud.rasdItem+xml"
|
29
|
+
xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 #{end_point}v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd">
|
30
|
+
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
|
31
|
+
<rasd:Description>Memory Size</rasd:Description>
|
32
|
+
<rasd:ElementName>#{memory} MB of memory</rasd:ElementName>
|
33
|
+
<rasd:InstanceID>5</rasd:InstanceID>
|
34
|
+
<rasd:Reservation>0</rasd:Reservation>
|
35
|
+
<rasd:ResourceType>4</rasd:ResourceType>
|
36
|
+
<rasd:VirtualQuantity>#{memory}</rasd:VirtualQuantity>
|
37
|
+
<rasd:Weight>0</rasd:Weight>
|
38
|
+
<Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="#{end_point}vApp/#{id}/virtualHardwareSection/memory"/>
|
39
|
+
</Item>
|
40
|
+
EOF
|
41
|
+
|
42
|
+
request(
|
43
|
+
:body => data,
|
44
|
+
:expects => 202,
|
45
|
+
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItem+xml'},
|
46
|
+
:method => 'PUT',
|
47
|
+
:parser => Fog::ToHashDocument.new,
|
48
|
+
:path => "vApp/#{id}/virtualHardwareSection/memory"
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class Mock
|
54
|
+
|
55
|
+
def put_memory(id, memory)
|
56
|
+
unless vm = data[:vms][id]
|
57
|
+
raise Fog::Compute::VcloudDirector::Forbidden.new(
|
58
|
+
'This operation is denied.'
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
owner = {
|
63
|
+
:href => make_href("vApp/#{id}"),
|
64
|
+
:type => 'application/vnd.vmware.vcloud.vm+xml'
|
65
|
+
}
|
66
|
+
task_id = enqueue_task(
|
67
|
+
"Updating Virtual Machine #{data[:vms][id][:name]}(#{id})", 'vappUpdateVm', owner,
|
68
|
+
:on_success => lambda do
|
69
|
+
data[:vms][id][:memory_in_mb] = memory
|
70
|
+
end
|
71
|
+
)
|
72
|
+
body = {
|
73
|
+
:xmlns => xmlns,
|
74
|
+
:xmlns_xsi => xmlns_xsi,
|
75
|
+
:xsi_schemaLocation => xsi_schema_location,
|
76
|
+
}.merge(task_body(task_id))
|
77
|
+
|
78
|
+
Excon::Response.new(
|
79
|
+
:status => 202,
|
80
|
+
:headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
|
81
|
+
:body => body
|
82
|
+
)
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class VcloudDirector
|
4
|
+
class Real
|
5
|
+
# deprecated Use {#put_vapp_metadata_item_metadata} instead.
|
6
|
+
def put_metadata_value(vm_id, metadata_key, metadata_value)
|
7
|
+
Fog::Logger.deprecation("#{self} => ##{put_metadata_value} is deprecated, use ##{put_vapp_metadata_item_metadata} instead [light_black](#{caller.first})[/]")
|
8
|
+
|
9
|
+
body="
|
10
|
+
<MetadataValue xmlns=\"http://www.vmware.com/vcloud/v1.5\">
|
11
|
+
<Value>#{metadata_value}</Value>
|
12
|
+
</MetadataValue>"
|
13
|
+
|
14
|
+
request(
|
15
|
+
:body => body,
|
16
|
+
:expects => 202,
|
17
|
+
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'},
|
18
|
+
:method => 'PUT',
|
19
|
+
:parser => Fog::ToHashDocument.new,
|
20
|
+
:path => "vApp/#{vm_id}/metadata/#{URI.escape(metadata_key)}"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class VcloudDirector
|
4
|
+
class Real
|
5
|
+
require 'fog/vcloud_director/generators/compute/org_vdc_network'
|
6
|
+
|
7
|
+
# Update an Org vDC network.
|
8
|
+
#
|
9
|
+
# This operation is asynchronous and returns a task that you can
|
10
|
+
# monitor to track the progress of the request.
|
11
|
+
#
|
12
|
+
# Produce media type(s):
|
13
|
+
# application/vnd.vmware.vcloud.orgVdcNetwork+xml
|
14
|
+
# Output type:
|
15
|
+
# TaskType
|
16
|
+
#
|
17
|
+
# @param [String] id Object identifier of the network
|
18
|
+
# @param [String] name The name of the entity.
|
19
|
+
# @param [Hash] options
|
20
|
+
# @option options [String] :Description Optional description.
|
21
|
+
# @option options [Hash] :Configuration Network configuration.
|
22
|
+
# @option options [Hash] :EdgeGateway EdgeGateway that connects this
|
23
|
+
# Org vDC network. Applicable only for routed networks.
|
24
|
+
# @option options [Hash] :ServiceConfig Specifies the service
|
25
|
+
# configuration for an isolated Org vDC networks.
|
26
|
+
# @option options [Boolean] :IsShared True if this network is shared
|
27
|
+
# to multiple Org vDCs.
|
28
|
+
# * :Configuration<~Hash>: NetworkConfigurationType
|
29
|
+
# * :IpScopes<~Hash>:
|
30
|
+
# * :IpScope<~Hash>:
|
31
|
+
# * :IsInherited<~Boolean>: ?
|
32
|
+
# * :Gateway<~String>: IP address of gw
|
33
|
+
# * :Netmask<~String>: Subnet mask of network
|
34
|
+
# * :Dns1<~String>: Primary DNS server.
|
35
|
+
# * :Dns2<~String>: Secondary DNS server.
|
36
|
+
# * :DnsSuffix<~String>: DNS suffix.
|
37
|
+
# * :IsEnabled<~String>: Indicates if subnet is enabled or not.
|
38
|
+
# Default value is True.
|
39
|
+
# * :IpRanges<~Array>: IP ranges used for static pool allocation
|
40
|
+
# in the network. Array of Hashes of:
|
41
|
+
# * :StartAddress - start IP in range
|
42
|
+
# * :EndAddress - end IP in range
|
43
|
+
# * :EdgeGateway<~Hash>: EdgeGateway that connects this Org vDC
|
44
|
+
# network. Applicable only for routed networks.
|
45
|
+
# * :ServiceConfig<~Hash>: Specifies the service configuration for an
|
46
|
+
# isolated network
|
47
|
+
#
|
48
|
+
# @return [Excon::Response]
|
49
|
+
# * body<~Hash>:
|
50
|
+
#
|
51
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/POST-CreateOrgVdcNetwork.html
|
52
|
+
# @since vCloud API version 5.1
|
53
|
+
def put_network(id, name, options={})
|
54
|
+
body = Fog::Generators::Compute::VcloudDirector::OrgVdcNetwork.new(options.merge(:name => name)).generate_xml
|
55
|
+
|
56
|
+
request(
|
57
|
+
:body => body,
|
58
|
+
:expects => 202,
|
59
|
+
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.orgVdcNetwork+xml'},
|
60
|
+
:method => 'PUT',
|
61
|
+
:parser => Fog::ToHashDocument.new,
|
62
|
+
:path => "admin/network/#{id}"
|
63
|
+
)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class Mock
|
68
|
+
def put_network(id, name, options={})
|
69
|
+
original_network = data[:networks][id]
|
70
|
+
unless original_network
|
71
|
+
raise Fog::Compute::VcloudDirector::Forbidden.new(
|
72
|
+
"No access to entity \"(com.vmware.vcloud.entity.orgVdcNetwork:#{id})\"."
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
type = 'network'
|
77
|
+
|
78
|
+
# Description
|
79
|
+
# Configuration
|
80
|
+
# IpScopes
|
81
|
+
# IpScope
|
82
|
+
# IsInherited
|
83
|
+
# Gateway
|
84
|
+
# Netmask
|
85
|
+
# Dns1
|
86
|
+
# Dns2
|
87
|
+
# DnsSuffix
|
88
|
+
# IsEnabled
|
89
|
+
# IpRanges
|
90
|
+
# IpRange
|
91
|
+
# StartAddress
|
92
|
+
# EndAddress
|
93
|
+
# FenceMode
|
94
|
+
# EdgeGateway
|
95
|
+
# IsShared
|
96
|
+
#
|
97
|
+
vdc_id = original_network[:vdc],
|
98
|
+
|
99
|
+
network_body = {
|
100
|
+
:name => name,
|
101
|
+
:vdc => vdc_id,
|
102
|
+
}
|
103
|
+
|
104
|
+
[:Description, :IsShared].each do |key|
|
105
|
+
network_body[key] = options[key] if options.key?(key)
|
106
|
+
end
|
107
|
+
|
108
|
+
if options.key?(:EdgeGateway)
|
109
|
+
network_body[:EdgeGateway] =
|
110
|
+
options[:EdgeGateway][:href].split('/').last
|
111
|
+
end
|
112
|
+
|
113
|
+
if configuration = options[:Configuration]
|
114
|
+
if ip_scopes = configuration[:IpScopes]
|
115
|
+
if ip_scope = ip_scopes[:IpScope]
|
116
|
+
[:IsInherited, :Gateway, :Netmask,
|
117
|
+
:Dns1, :Dns2, :DnsSuffix, :IsEnabled].each do |key|
|
118
|
+
network_body[key] = ip_scope[key] if ip_scope.key?(key)
|
119
|
+
end
|
120
|
+
if ip_ranges = ip_scope[:IpRanges]
|
121
|
+
network_body[:IpRanges] = []
|
122
|
+
ip_ranges.each do |ipr|
|
123
|
+
network_body[:IpRanges] << {
|
124
|
+
:StartAddress => ipr[:IpRange][:StartAddress],
|
125
|
+
:EndAddress => ipr[:IpRange][:EndAddress]
|
126
|
+
}
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
network_body[:FenceMode] = configuration[:FenceMode] if ip_scope.key?(:FenceMode)
|
132
|
+
end
|
133
|
+
|
134
|
+
owner = {
|
135
|
+
:href => make_href("#{type}/#{id}"),
|
136
|
+
:type => "application/vnd.vmware.vcloud.#{type}+xml"
|
137
|
+
}
|
138
|
+
task_id = enqueue_task(
|
139
|
+
"Updating #{type} #{name} (#{id})", 'networkUpdateNetwork', owner,
|
140
|
+
:on_success => lambda do
|
141
|
+
data[:networks][id] = network_body
|
142
|
+
end
|
143
|
+
)
|
144
|
+
task = task_body(task_id)
|
145
|
+
task.delete(:Owner) #known-bug: admin-api does not return owner.
|
146
|
+
body = {
|
147
|
+
:xmlns => xmlns,
|
148
|
+
:xmlns_xsi => xmlns_xsi,
|
149
|
+
:xsi_schemaLocation => xsi_schema_location,
|
150
|
+
}.merge(task)
|
151
|
+
|
152
|
+
Excon::Response.new(
|
153
|
+
:status => 202,
|
154
|
+
:headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
|
155
|
+
:body => body
|
156
|
+
)
|
157
|
+
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class VcloudDirector
|
4
|
+
class Real
|
5
|
+
extend Fog::Deprecation
|
6
|
+
deprecate :put_vm_network, :put_network_connection_system_section_vapp
|
7
|
+
|
8
|
+
# Update the network connection section of a VM.
|
9
|
+
#
|
10
|
+
# This operation is asynchronous and returns a task that you can
|
11
|
+
# monitor to track the progress of the request.
|
12
|
+
#
|
13
|
+
# @param [String] id Object identifier of the VM.
|
14
|
+
# @param [Hash] options Container for the network connections of this
|
15
|
+
# virtual machine.
|
16
|
+
# @option options [Integer] :PrimaryNetworkConnectionIndex (0)
|
17
|
+
# Virtual slot number associated with the NIC that should be
|
18
|
+
# considered this virtual machine's primary network connection.
|
19
|
+
# Defaults to slot 0.
|
20
|
+
# @option options [Array<Hash>] :NetworkConnection
|
21
|
+
# * :needsCustomization<~Boolean> - True if this NIC needs
|
22
|
+
# customization.
|
23
|
+
# * :network<~String> - Name of the network to which this NIC is
|
24
|
+
# connected.
|
25
|
+
# * :NetworkConnectionIndex<~Integer> - Virtual slot number
|
26
|
+
# associated with this NIC. First slot number is 0.
|
27
|
+
# * :IpAddress<~String> - IP address assigned to this NIC.
|
28
|
+
# * :IsConnected<~Boolean> - If the virtual machine is undeployed,
|
29
|
+
# this value specifies whether the NIC should be connected upon
|
30
|
+
# deployment. If the virtual machine is deployed, this value
|
31
|
+
# reports the current status of this NIC's connection, and can be
|
32
|
+
# updated to change that connection status.
|
33
|
+
# * :MACAddress<~String> - MAC address associated with the NIC.
|
34
|
+
# * :IpAddressAllocationMode<~String> - IP address allocation mode
|
35
|
+
# for this connection. One of:
|
36
|
+
# - POOL (A static IP address is allocated automatically from a
|
37
|
+
# pool of addresses.)
|
38
|
+
# - DHCP (The IP address is obtained from a DHCP service.)
|
39
|
+
# - MANUAL (The IP address is assigned manually in the :IpAddress
|
40
|
+
# element.)
|
41
|
+
# - NONE (No IP addressing mode specified.)
|
42
|
+
# @return [Excon::Response]
|
43
|
+
# * body<~Hash>:
|
44
|
+
# * :Tasks<~Hash>:
|
45
|
+
# * :Task<~Hash>:
|
46
|
+
#
|
47
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/PUT-NetworkConnectionSystemSection-vApp.html
|
48
|
+
# @since vCloud API version 0.9
|
49
|
+
def put_network_connection_system_section_vapp(id, options={})
|
50
|
+
options = options.dup
|
51
|
+
|
52
|
+
# Mutate options to new format.
|
53
|
+
deprecated = {
|
54
|
+
:needs_customization => :needsCustomization,
|
55
|
+
:network => :network,
|
56
|
+
:network_connection_index => :NetworkConnectionIndex,
|
57
|
+
:ip_address => :IpAddress,
|
58
|
+
:is_connected => :IsConnected,
|
59
|
+
:mac_address => :MACAddress,
|
60
|
+
:ip_address_allocation_mode => :IpAddressAllocationMode
|
61
|
+
}
|
62
|
+
option = options.delete(:primary_network_connection_index)
|
63
|
+
options[:PrimaryNetworkConnectionIndex] ||= option unless option.nil?
|
64
|
+
unless options.key?(:NetworkConnection)
|
65
|
+
deprecated.each do |from, to|
|
66
|
+
if options.key?(from)
|
67
|
+
options[:NetworkConnection] ||= [{}]
|
68
|
+
options[:NetworkConnection].first[to] = options.delete(from)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
options[:NetworkConnection] = [options[:NetworkConnection]] if options[:NetworkConnection].is_a?(Hash)
|
74
|
+
|
75
|
+
body = Nokogiri::XML::Builder.new do
|
76
|
+
attrs = {
|
77
|
+
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
|
78
|
+
'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1'
|
79
|
+
}
|
80
|
+
NetworkConnectionSection(attrs) {
|
81
|
+
self[:ovf].Info 'Specifies the available VM network connections'
|
82
|
+
if options.key?(:PrimaryNetworkConnectionIndex)
|
83
|
+
PrimaryNetworkConnectionIndex options[:PrimaryNetworkConnectionIndex]
|
84
|
+
end
|
85
|
+
if network_connection = options[:NetworkConnection]
|
86
|
+
network_connection.each do |nic|
|
87
|
+
attrs = {
|
88
|
+
:network => nic[:network]
|
89
|
+
}
|
90
|
+
if nic.key?(:needsCustomization)
|
91
|
+
attrs[:needsCustomization] = nic[:needsCustomization]
|
92
|
+
end
|
93
|
+
NetworkConnection(attrs) {
|
94
|
+
NetworkConnectionIndex nic[:NetworkConnectionIndex]
|
95
|
+
if nic.key?(:IpAddress)
|
96
|
+
IpAddress nic[:IpAddress]
|
97
|
+
end
|
98
|
+
IsConnected nic[:IsConnected]
|
99
|
+
if nic.key?(:MACAddress)
|
100
|
+
MACAddress nic[:MACAddress]
|
101
|
+
end
|
102
|
+
IpAddressAllocationMode nic[:IpAddressAllocationMode]
|
103
|
+
}
|
104
|
+
end
|
105
|
+
end
|
106
|
+
}
|
107
|
+
end.to_xml
|
108
|
+
|
109
|
+
request(
|
110
|
+
:body => body,
|
111
|
+
:expects => 202,
|
112
|
+
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.networkConnectionSection+xml'},
|
113
|
+
:method => 'PUT',
|
114
|
+
:parser => Fog::ToHashDocument.new,
|
115
|
+
:path => "vApp/#{id}/networkConnectionSection/"
|
116
|
+
)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
class Mock
|
120
|
+
def put_network_connection_system_section_vapp(id, options={})
|
121
|
+
unless vm = data[:vms][id]
|
122
|
+
raise Fog::Compute::VcloudDirector::Forbidden.new(
|
123
|
+
'This operation is denied.'
|
124
|
+
)
|
125
|
+
end
|
126
|
+
|
127
|
+
owner = {
|
128
|
+
:href => make_href("vApp/#{id}"),
|
129
|
+
:type => 'application/vnd.vmware.vcloud.vApp+xml'
|
130
|
+
}
|
131
|
+
task_id = enqueue_task(
|
132
|
+
"Updating Virtual Machine #{data[:vms][id][:name]}(#{id})", 'vappUpdateVm', owner,
|
133
|
+
:on_success => lambda do
|
134
|
+
data[:vms][id][:nics].first[:network_name] = options[:network]
|
135
|
+
end
|
136
|
+
)
|
137
|
+
body = {
|
138
|
+
:xmlns => xmlns,
|
139
|
+
:xmlns_xsi => xmlns_xsi,
|
140
|
+
:xsi_schemaLocation => xsi_schema_location,
|
141
|
+
}.merge(task_body(task_id))
|
142
|
+
|
143
|
+
Excon::Response.new(
|
144
|
+
:status => 202,
|
145
|
+
:headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
|
146
|
+
:body => body
|
147
|
+
)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|