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,243 @@
|
|
1
|
+
module Fog
|
2
|
+
module Generators
|
3
|
+
module Compute
|
4
|
+
module VcloudDirector
|
5
|
+
class EdgeGatewayServiceConfiguration
|
6
|
+
def initialize(configuration={})
|
7
|
+
@configuration = configuration
|
8
|
+
end
|
9
|
+
|
10
|
+
def generate_xml
|
11
|
+
Nokogiri::XML::Builder.new do |xml|
|
12
|
+
xml.EdgeGatewayServiceConfiguration('xmlns' => "http://www.vmware.com/vcloud/v1.5"){
|
13
|
+
build_firewall_service(xml)
|
14
|
+
build_nat_service(xml)
|
15
|
+
build_load_balancer_service(xml)
|
16
|
+
build_vpn(xml)
|
17
|
+
build_dhcp(xml)
|
18
|
+
build_static_routing_service(xml)
|
19
|
+
}
|
20
|
+
end.to_xml
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def build_dhcp(xml)
|
26
|
+
dhcp_config = @configuration[:GatewayDhcpService]
|
27
|
+
return unless dhcp_config
|
28
|
+
|
29
|
+
xml.GatewayDhcpService {
|
30
|
+
xml.IsEnabled dhcp_config[:IsEnabled] if dhcp_config.key?(:IsEnabled)
|
31
|
+
dhcp_config[:pools].each do |pool|
|
32
|
+
xml.Pool {
|
33
|
+
xml.IsEnabled pool[:IsEnabled]
|
34
|
+
xml.Network pool[:Network]
|
35
|
+
xml.DefaultLeaseTime pool[:DefaultLeaseTime]
|
36
|
+
xml.MaxLeaseTime pool[:MaxLeaseTime]
|
37
|
+
xml.LowIpAddress pool[:LowIpAddress]
|
38
|
+
xml.HighIpAddress pool[:HighIpAddress]
|
39
|
+
}
|
40
|
+
end
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def build_vpn(xml)
|
45
|
+
vpn_config = @configuration[:GatewayIpsecVpnService]
|
46
|
+
return unless vpn_config
|
47
|
+
|
48
|
+
xml.GatewayIpsecVpnService {
|
49
|
+
xml.IsEnabled vpn_config[:IsEnabled] if vpn_config.key?(:IsEnabled)
|
50
|
+
vpn_config[:Tunnel].each do |tunnel_config|
|
51
|
+
xml.Tunnel {
|
52
|
+
xml.Name tunnel_config[:Name]
|
53
|
+
xml.Description tunnel_config[:Description]
|
54
|
+
xml.IpsecVpnLocalPeer {
|
55
|
+
xml.Id tunnel_config[:IpsecVpnLocalPeerId]
|
56
|
+
xml.Name tunnel_config[:IpsecVpnLocalPeerName]
|
57
|
+
}
|
58
|
+
xml.PeerIpAddress tunnel_config[:PeerIpAddress]
|
59
|
+
xml.PeerId tunnel_config[:PeerId]
|
60
|
+
xml.LocalIpAddress tunnel_config[:LocalIpAddress]
|
61
|
+
xml.LocalId tunnel_config[:LocalId]
|
62
|
+
tunnel_config[:LocalSubnet].each do |subnet|
|
63
|
+
xml.LocalSubnet {
|
64
|
+
xml.Name subnet[:Name]
|
65
|
+
xml.Gateway subnet[:Gateway]
|
66
|
+
xml.Netmask subnet[:Netmask]
|
67
|
+
}
|
68
|
+
end
|
69
|
+
tunnel_config[:PeerSubnet].each do |subnet|
|
70
|
+
xml.PeerSubnet {
|
71
|
+
xml.Name subnet[:Name]
|
72
|
+
xml.Gateway subnet[:Gateway]
|
73
|
+
xml.Netmask subnet[:Netmask]
|
74
|
+
}
|
75
|
+
end
|
76
|
+
xml.SharedSecret tunnel_config[:SharedSecret]
|
77
|
+
xml.SharedSecretEncrypted tunnel_config[:SharedSecretEncrypted] if tunnel_config.key?(:SharedSecretEncrypted)
|
78
|
+
xml.EncryptionProtocol tunnel_config[:EncryptionProtocol]
|
79
|
+
xml.Mtu tunnel_config[:Mtu]
|
80
|
+
xml.IsEnabled tunnel_config[:IsEnabled]
|
81
|
+
}
|
82
|
+
end
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
def build_load_balancer_service(xml)
|
87
|
+
lb_config = @configuration[:LoadBalancerService]
|
88
|
+
return unless lb_config
|
89
|
+
|
90
|
+
xml.LoadBalancerService {
|
91
|
+
xml.IsEnabled lb_config[:IsEnabled] if lb_config.key?(:IsEnabled)
|
92
|
+
lb_config[:Pool].each do |pool|
|
93
|
+
xml.Pool {
|
94
|
+
xml.Name pool[:Name]
|
95
|
+
xml.Description pool[:Description] if pool.key?(:Description)
|
96
|
+
pool[:ServicePort].each do |service_port|
|
97
|
+
xml.ServicePort {
|
98
|
+
xml.IsEnabled service_port[:IsEnabled]
|
99
|
+
xml.Protocol service_port[:Protocol]
|
100
|
+
xml.Algorithm service_port[:Algorithm]
|
101
|
+
xml.Port service_port[:Port]
|
102
|
+
xml.HealthCheckPort service_port[:HealthCheckPort]
|
103
|
+
xml.HealthCheck {
|
104
|
+
xml.Mode service_port[:HealthCheck][:Mode]
|
105
|
+
xml.Uri service_port[:HealthCheck][:Uri]
|
106
|
+
xml.HealthThreshold service_port[:HealthCheck][:HealthThreshold]
|
107
|
+
xml.UnhealthThreshold service_port[:HealthCheck][:UnhealthThreshold]
|
108
|
+
xml.Interval service_port[:HealthCheck][:Interval]
|
109
|
+
xml.Timeout service_port[:HealthCheck][:Timeout]
|
110
|
+
}
|
111
|
+
}
|
112
|
+
end
|
113
|
+
pool[:Member].each do |member|
|
114
|
+
xml.Member {
|
115
|
+
xml.IpAddress member[:IpAddress]
|
116
|
+
xml.Weight member[:Weight]
|
117
|
+
member[:ServicePort].each do |member_service_port|
|
118
|
+
xml.ServicePort {
|
119
|
+
xml.Protocol member_service_port[:Protocol]
|
120
|
+
xml.Port member_service_port[:Port]
|
121
|
+
xml.HealthCheckPort member_service_port[:HealthCheckPort]
|
122
|
+
}
|
123
|
+
end
|
124
|
+
}
|
125
|
+
end
|
126
|
+
|
127
|
+
}
|
128
|
+
end
|
129
|
+
lb_config[:VirtualServer].each do |virtual_server|
|
130
|
+
xml.VirtualServer {
|
131
|
+
xml.IsEnabled virtual_server[:IsEnabled]
|
132
|
+
xml.Name virtual_server[:Name]
|
133
|
+
xml.Description virtual_server[:Description]
|
134
|
+
xml.Interface(:href => virtual_server[:Interface][:href], :name => virtual_server[:Interface][:name])
|
135
|
+
xml.IpAddress virtual_server[:IpAddress]
|
136
|
+
virtual_server[:ServiceProfile].each do |service_profile|
|
137
|
+
xml.ServiceProfile {
|
138
|
+
xml.IsEnabled service_profile[:IsEnabled]
|
139
|
+
xml.Protocol service_profile[:Protocol]
|
140
|
+
xml.Port service_profile[:Port]
|
141
|
+
xml.Persistence {
|
142
|
+
xml.Method service_profile[:Persistence][:Method]
|
143
|
+
if service_profile[:Persistence][:Method] == 'COOKIE'
|
144
|
+
xml.CookieName service_profile[:Persistence][:CookieName]
|
145
|
+
xml.CookieMode service_profile[:Persistence][:CookieMode]
|
146
|
+
end
|
147
|
+
}
|
148
|
+
}
|
149
|
+
end
|
150
|
+
xml.Logging virtual_server[:Logging]
|
151
|
+
xml.Pool virtual_server[:Pool]
|
152
|
+
}
|
153
|
+
end
|
154
|
+
}
|
155
|
+
end
|
156
|
+
|
157
|
+
def build_nat_service(xml)
|
158
|
+
nat_config = @configuration[:NatService]
|
159
|
+
return unless nat_config
|
160
|
+
|
161
|
+
xml.NatService {
|
162
|
+
xml.IsEnabled nat_config[:IsEnabled]
|
163
|
+
|
164
|
+
nat_config[:NatRule].each do |rule|
|
165
|
+
xml.NatRule {
|
166
|
+
xml.RuleType rule[:RuleType]
|
167
|
+
xml.IsEnabled rule[:IsEnabled]
|
168
|
+
xml.Id rule[:Id]
|
169
|
+
gateway_nat_rule = rule[:GatewayNatRule]
|
170
|
+
xml.GatewayNatRule {
|
171
|
+
xml.Interface(:name => gateway_nat_rule[:Interface][:name], :href => gateway_nat_rule[:Interface][:href])
|
172
|
+
xml.OriginalIp gateway_nat_rule[:OriginalIp]
|
173
|
+
xml.OriginalPort gateway_nat_rule[:OriginalPort] if gateway_nat_rule.key?(:OriginalPort)
|
174
|
+
xml.TranslatedIp gateway_nat_rule[:TranslatedIp]
|
175
|
+
xml.TranslatedPort gateway_nat_rule[:TranslatedPort] if gateway_nat_rule.key?(:TranslatedPort)
|
176
|
+
xml.Protocol gateway_nat_rule[:Protocol] if rule[:RuleType] == "DNAT"
|
177
|
+
}
|
178
|
+
}
|
179
|
+
end
|
180
|
+
}
|
181
|
+
end
|
182
|
+
|
183
|
+
def build_static_routing_service(xml)
|
184
|
+
routing_config = @configuration[:StaticRoutingService]
|
185
|
+
return unless routing_config
|
186
|
+
|
187
|
+
xml.StaticRoutingService {
|
188
|
+
xml.IsEnabled routing_config[:IsEnabled]
|
189
|
+
routing_config[:StaticRoute].each do |rule|
|
190
|
+
xml.StaticRoute{
|
191
|
+
xml.Name rule[:Name]
|
192
|
+
xml.Network rule[:Network]
|
193
|
+
xml.NextHopIp rule[:NextHopIp]
|
194
|
+
xml.GatewayInterface(
|
195
|
+
:type => rule[:GatewayInterface][:type],
|
196
|
+
:name => rule[:GatewayInterface][:name],
|
197
|
+
:href => rule[:GatewayInterface][:href]
|
198
|
+
)
|
199
|
+
}
|
200
|
+
end
|
201
|
+
}
|
202
|
+
end
|
203
|
+
|
204
|
+
def build_firewall_service(xml)
|
205
|
+
firewall_config = @configuration[:FirewallService]
|
206
|
+
return unless firewall_config
|
207
|
+
|
208
|
+
xml.FirewallService {
|
209
|
+
xml.IsEnabled firewall_config[:IsEnabled]
|
210
|
+
xml.DefaultAction firewall_config[:DefaultAction] if firewall_config.key?(:DefaultAction)
|
211
|
+
xml.LogDefaultAction firewall_config[:LogDefaultAction] if firewall_config.key?(:LogDefaultAction)
|
212
|
+
firewall_config[:FirewallRule].each do |rule|
|
213
|
+
xml.FirewallRule {
|
214
|
+
xml.Id rule[:Id]
|
215
|
+
xml.IsEnabled rule[:IsEnabled] if rule.key?(:IsEnabled)
|
216
|
+
xml.MatchOnTranslate rule[:MatchOnTranslate] if rule.key?(:MatchOnTranslate)
|
217
|
+
xml.Description rule[:Description] if rule.key?(:Description)
|
218
|
+
xml.Policy rule[:Policy] if rule.key?(:Policy)
|
219
|
+
|
220
|
+
xml.Protocols {
|
221
|
+
rule[:Protocols].each do |key, value|
|
222
|
+
xml.send(key.to_s.capitalize, value)
|
223
|
+
end
|
224
|
+
}
|
225
|
+
xml.IcmpSubType rule[:IcmpSubType] if rule.key?(:IcmpSubType)
|
226
|
+
xml.Port rule[:Port] if rule.key?(:Port)
|
227
|
+
xml.DestinationPortRange rule[:DestinationPortRange]
|
228
|
+
xml.DestinationIp rule[:DestinationIp]
|
229
|
+
xml.SourcePort rule[:SourcePort] if rule.key?(:SourcePort)
|
230
|
+
xml.SourcePortRange rule[:SourcePortRange]
|
231
|
+
xml.SourceIp rule[:SourceIp]
|
232
|
+
xml.Direction rule[:Direction] if rule.key?(:Direction) #Firewall rule direction is allowed only in backward compatibility mode.
|
233
|
+
xml.EnableLogging rule[:EnableLogging] if rule.key?(:EnableLogging)
|
234
|
+
}
|
235
|
+
|
236
|
+
end
|
237
|
+
}
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fog/vcloud_director/generators/compute/compose_common'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Generators
|
5
|
+
module Compute
|
6
|
+
module VcloudDirector
|
7
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VAppType.html
|
8
|
+
class InstantiateVappTemplateParams
|
9
|
+
attr_reader :options
|
10
|
+
|
11
|
+
include ComposeCommon
|
12
|
+
|
13
|
+
def generate_xml
|
14
|
+
Nokogiri::XML::Builder.new do |xml|
|
15
|
+
|
16
|
+
|
17
|
+
xml.InstantiateVAppTemplateParams((vapp_attrs)) {
|
18
|
+
build_vapp_instantiation_params(xml)
|
19
|
+
build_source_template(xml)
|
20
|
+
build_source_items(xml)
|
21
|
+
}
|
22
|
+
end.to_xml
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Fog
|
2
|
+
module Generators
|
3
|
+
module Compute
|
4
|
+
module VcloudDirector
|
5
|
+
# {:metadata=>
|
6
|
+
# {"buenas si"=>"no tanto ya",
|
7
|
+
# "hola"=>"adios"},
|
8
|
+
# :type=>"application/vnd.vmware.vcloud.metadata+xml",
|
9
|
+
# :href=>
|
10
|
+
# "https://example.com/api/vApp/vm-18545e82-d919-4071-ae7e-d1300d9d8112/metadata",
|
11
|
+
# :id=>"vm-18545e82-d919-4071-ae7e-d1300d9d8112"}
|
12
|
+
#
|
13
|
+
# This is what it generates:
|
14
|
+
#
|
15
|
+
# <Metadata xmlns="http://www.vmware.com/vcloud/v1.5" type="application/vnd.vmware.vcloud.metadata+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://10.194.1.65/api/v1.5/schema/master.xsd">
|
16
|
+
# <MetadataEntry>
|
17
|
+
# <Key>buenas si</Key>
|
18
|
+
# <Value>no tanto ya</Value>
|
19
|
+
# </MetadataEntry>
|
20
|
+
# <MetadataEntry">
|
21
|
+
# <Key>hola</Key>
|
22
|
+
# <Value>adios</Value>
|
23
|
+
# </MetadataEntry>
|
24
|
+
# </Metadata>
|
25
|
+
#
|
26
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/MetadataType.html
|
27
|
+
class MetadataBase
|
28
|
+
attr_reader :attrs
|
29
|
+
|
30
|
+
def initialize(attrs={})
|
31
|
+
@attrs = attrs
|
32
|
+
end
|
33
|
+
|
34
|
+
def generate_xml
|
35
|
+
output = ""
|
36
|
+
output << header
|
37
|
+
attrs[:metadata].each_pair do |k,v|
|
38
|
+
output << metadata_entry(k,v)
|
39
|
+
end
|
40
|
+
output << tail
|
41
|
+
output
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_item(k,v)
|
45
|
+
@attrs[:metadata].merge!(Hash[k,v])
|
46
|
+
end
|
47
|
+
|
48
|
+
# 1.5
|
49
|
+
def header
|
50
|
+
<<-END
|
51
|
+
<Metadata
|
52
|
+
xmlns="http://www.vmware.com/vcloud/v1.5"
|
53
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
54
|
+
type="application/vnd.vmware.vcloud.metadata+xml">
|
55
|
+
END
|
56
|
+
end
|
57
|
+
|
58
|
+
def metadata_entry
|
59
|
+
raise "This is an abstract class. Use the appropriate subclass"
|
60
|
+
end
|
61
|
+
|
62
|
+
# 5.1
|
63
|
+
#def header
|
64
|
+
# '<Metadata xmlns="http://www.vmware.com/vcloud/v1.5"
|
65
|
+
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
66
|
+
# type="application/vnd.vmware.vcloud.metadata+xml"
|
67
|
+
# href="https://devlab.mdsol.com/api/vApp/vm-345c3619-edcd-4a8c-a8b9-c69ace3f89d1/metadata"
|
68
|
+
# xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://10.194.1.65/api/v1.5/schema/master.xsd">'
|
69
|
+
#end
|
70
|
+
|
71
|
+
def tail
|
72
|
+
<<-END
|
73
|
+
</Metadata>
|
74
|
+
END
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class MetadataV51 < MetadataBase
|
79
|
+
def metadata_entry(key, value)
|
80
|
+
<<-END
|
81
|
+
<MetadataEntry type="application/vnd.vmware.vcloud.metadata.value+xml">
|
82
|
+
<Key>#{key}</Key>
|
83
|
+
<TypedValue xsi:type="MetadataStringValue">
|
84
|
+
<Value>#{value}</Value>
|
85
|
+
</TypedValue>
|
86
|
+
</MetadataEntry>
|
87
|
+
END
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
class MetadataV15 < MetadataBase
|
92
|
+
def metadata_entry(key, value)
|
93
|
+
<<-END
|
94
|
+
<MetadataEntry>
|
95
|
+
<Key>#{key}</Key>
|
96
|
+
<Value>#{value}</Value>
|
97
|
+
</MetadataEntry>
|
98
|
+
END
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Fog
|
2
|
+
module Generators
|
3
|
+
module Compute
|
4
|
+
module VcloudDirector
|
5
|
+
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/OrgVdcNetworkType.html
|
6
|
+
class OrgVdcNetwork
|
7
|
+
attr_reader :options
|
8
|
+
|
9
|
+
def initialize(options={})
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
|
13
|
+
def generate_xml
|
14
|
+
body = Nokogiri::XML::Builder.new do
|
15
|
+
attrs = {
|
16
|
+
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
|
17
|
+
:name => options[:name]
|
18
|
+
}
|
19
|
+
OrgVdcNetwork(attrs) {
|
20
|
+
Description options[:Description] if options.key?(:Description)
|
21
|
+
if configuration = options[:Configuration]
|
22
|
+
Configuration {
|
23
|
+
if ip_scopes = configuration[:IpScopes]
|
24
|
+
IpScopes {
|
25
|
+
if ip_scope = ip_scopes[:IpScope]
|
26
|
+
IpScope {
|
27
|
+
IsInherited ip_scope[:IsInherited] if ip_scope.key?(:IsInherited)
|
28
|
+
Gateway ip_scope[:Gateway] if ip_scope.key?(:Gateway)
|
29
|
+
Netmask ip_scope[:Netmask] if ip_scope.key?(:Netmask)
|
30
|
+
Dns1 ip_scope[:Dns1] if ip_scope.key?(:Dns1)
|
31
|
+
Dns2 ip_scope[:Dns2] if ip_scope.key?(:Dns2)
|
32
|
+
DnsSuffix ip_scope[:DnsSuffix] if ip_scope.key?(:DnsSuffix)
|
33
|
+
IsEnabled ip_scope[:IsEnabled] if ip_scope.key?(:IsEnabled)
|
34
|
+
if ip_ranges = ip_scope[:IpRanges]
|
35
|
+
IpRanges {
|
36
|
+
ip_ranges.each do |h|
|
37
|
+
if h.key?(:IpRange)
|
38
|
+
IpRange {
|
39
|
+
StartAddress h[:IpRange][:StartAddress]
|
40
|
+
EndAddress h[:IpRange][:EndAddress]
|
41
|
+
}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
}
|
45
|
+
end
|
46
|
+
}
|
47
|
+
end
|
48
|
+
}
|
49
|
+
end
|
50
|
+
FenceMode configuration[:FenceMode]
|
51
|
+
if router_info = configuration[:RouterInfo]
|
52
|
+
RouterInfoType {
|
53
|
+
ExternalIp router_info[:ExternalIp]
|
54
|
+
}
|
55
|
+
end
|
56
|
+
}
|
57
|
+
end # Configuration
|
58
|
+
|
59
|
+
if edgegw = options[:EdgeGateway] and configuration[:FenceMode] != 'isolated'
|
60
|
+
EdgeGateway(edgegw)
|
61
|
+
elsif options[:Configuration] && options[:Configuration][:FenceMode] == 'isolated'
|
62
|
+
# isolated networks can specify ServiceConfig
|
63
|
+
if sc = options[:ServiceConfig]
|
64
|
+
ServiceConfig {
|
65
|
+
if dhcp = sc[:GatewayDhcpService]
|
66
|
+
IsEnabled dhcp[:IsEnabled] if dhcp[:IsEnabled]
|
67
|
+
if pool = dhcp[:Pool]
|
68
|
+
IsEnabled pool[:IsEnabled]
|
69
|
+
DefaultLeaseTime pool[:DefaultLeaseTime]
|
70
|
+
MaxLeaseTime pool[:MaxLeaseTime]
|
71
|
+
LowIpAddress pool[:LowIpAddress]
|
72
|
+
HighIpAddress pool[:HighIpAddress]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
IsShared options[:IsShared] if options.key?(:IsShared)
|
80
|
+
|
81
|
+
}
|
82
|
+
end.to_xml
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|