bosh_vcloud_cpi 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +69 -0
- data/lib/cloud/vcloud/cache.rb +20 -0
- data/lib/cloud/vcloud/cloud.rb +253 -535
- data/lib/cloud/vcloud/errors.rb +9 -0
- data/lib/cloud/vcloud/file_uploader.rb +39 -0
- data/lib/cloud/vcloud/steps/add_catalog_item.rb +28 -0
- data/lib/cloud/vcloud/steps/add_networks.rb +40 -0
- data/lib/cloud/vcloud/steps/attach_detach_disk.rb +15 -0
- data/lib/cloud/vcloud/steps/create_disk.rb +29 -0
- data/lib/cloud/vcloud/steps/create_media.rb +41 -0
- data/lib/cloud/vcloud/steps/create_template.rb +27 -0
- data/lib/cloud/vcloud/steps/create_update_agent_env.rb +66 -0
- data/lib/cloud/vcloud/steps/delete.rb +12 -0
- data/lib/cloud/vcloud/steps/delete_catalog_media.rb +23 -0
- data/lib/cloud/vcloud/steps/delete_unused_networks.rb +20 -0
- data/lib/cloud/vcloud/steps/discard_suspended_state.rb +15 -0
- data/lib/cloud/vcloud/steps/eject_catalog_media.rb +29 -0
- data/lib/cloud/vcloud/steps/insert_catalog_media.rb +26 -0
- data/lib/cloud/vcloud/steps/instantiate.rb +59 -0
- data/lib/cloud/vcloud/steps/load_agent_env.rb +14 -0
- data/lib/cloud/vcloud/steps/poweroff.rb +21 -0
- data/lib/cloud/vcloud/steps/poweron.rb +17 -0
- data/lib/cloud/vcloud/steps/reboot.rb +13 -0
- data/lib/cloud/vcloud/steps/recompose.rb +19 -0
- data/lib/cloud/vcloud/steps/reconfigure_vm.rb +35 -0
- data/lib/cloud/vcloud/steps/save_agent_env.rb +43 -0
- data/lib/cloud/vcloud/steps/stemcell_info.rb +20 -0
- data/lib/cloud/vcloud/steps/undeploy.rb +19 -0
- data/lib/cloud/vcloud/steps/upload_media_files.rb +18 -0
- data/lib/cloud/vcloud/steps/upload_template_files.rb +29 -0
- data/lib/cloud/vcloud/steps.rb +100 -0
- data/lib/cloud/vcloud/vcd_client.rb +284 -0
- data/lib/cloud/vcloud/version.rb +1 -1
- data/lib/cloud/vcloud/xml/constants.rb +428 -0
- data/lib/cloud/vcloud/xml/wrapper.rb +292 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.rb +20 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/admin_org.rb +15 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/catalog.rb +20 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/catalog_item.rb +27 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/disk.rb +42 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/disk_attach_or_detach_params.rb +12 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb +47 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/entity.rb +11 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/file.rb +11 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb +56 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/instantiate_vapp_template_params.rb +71 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/ip_scope.rb +55 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/item.rb +32 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/link_wrapper.rb +39 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/media.rb +57 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/media_insert_or_eject_params.rb +17 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/metadata_value.rb +15 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/network.rb +15 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/network_config.rb +27 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/network_config_section.rb +25 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/network_connection.rb +71 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/network_connection_section.rb +67 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/nic_item_wrapper.rb +89 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/org.rb +21 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/org_network.rb +19 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/org_vdc_network.rb +11 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/recompose_vapp_wrapper.rb +51 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/session.rb +24 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/supported_versions.rb +19 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/task.rb +32 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/upload_vapp_template_params.rb +11 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vapp.rb +77 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vapp_template.rb +17 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vcloud.rb +15 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vdc.rb +59 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vdc_storage_profile.rb +15 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/virtual_hardware_section.rb +68 -0
- data/lib/cloud/vcloud/xml/wrapper_classes/vm.rb +212 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminAllocatedExtIpRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminCatalog.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminCatalogItemRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminCatalogRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminGroupRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminMediaRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminOrg.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminOrgNetworkRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminShadowVmRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminTaskRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminUserRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVAppNetworkRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVAppRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVAppReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVAppReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVAppTemplateRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVdc.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVdcRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVdcReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVdcReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AdminVmRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AllEULAsAccepted.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/AllocatedExtIpRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/BlockingTaskRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/BlockingTaskReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/BlockingTaskReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CaptureVAppParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Catalog.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogItem.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogItemRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogItemReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogItemReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CatalogReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CellRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CloneMediaParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CloneVAppParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CloneVAppTemplateParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ComposeVAppParams.xml +17 -0
- data/lib/cloud/vcloud/xml/xml_templates/ControlAccessParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/CustomizationSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DatastoreProviderVdcRelationRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DatastoreRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DatastoreReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DatastoreReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DeployVAppParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DhcpService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/DiskAttachOrDetachParams.xml +5 -0
- data/lib/cloud/vcloud/xml/xml_templates/DiskCreateParams.xml +9 -0
- data/lib/cloud/vcloud/xml/xml_templates/DvSwitchRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Entity.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Error.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/EventRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ExternalNetwork.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/File.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/FirewallService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/GeneralOrgSettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Group.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/GroupRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/GroupReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/GroupReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/GuestCustomizationSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/HostRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/HostReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/HostReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/InstantiateOvfParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/InstantiateVAppTemplateParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpScope.xml +12 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpsecVpnLocalPeer.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpsecVpnPeer.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpsecVpnRemotePeer.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpsecVpnService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/IpsecVpnThirdPartyPeer.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Item.xml +3 -0
- data/lib/cloud/vcloud/xml/xml_templates/ItemVcd.xml +5 -0
- data/lib/cloud/vcloud/xml/xml_templates/LeaseSettingsSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Link.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Media.xml +5 -0
- data/lib/cloud/vcloud/xml/xml_templates/MediaInsertOrEjectParams.xml +4 -0
- data/lib/cloud/vcloud/xml/xml_templates/MediaRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/MediaReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/MediaReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Metadata.xml +5 -0
- data/lib/cloud/vcloud/xml/xml_templates/MetadataEntry.xml +7 -0
- data/lib/cloud/vcloud/xml/xml_templates/MetadataValue.xml +8 -0
- data/lib/cloud/vcloud/xml/xml_templates/NatService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Network.xml +4 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkAssignment.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkConfig.xml +21 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkConfigSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkConnection.xml +11 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkConnectionSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkPoolRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkPoolReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkPoolReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/NetworkService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Org.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgEmailSettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgList.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgNetwork.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgNetworkRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgNetworkReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgNetworkReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgPasswordPolicySettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgSettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVAppTemplateLeaseSettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVdcNetwork.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVdcRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVdcReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVdcReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/OrgVdcResourcePoolRelationRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Owner.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/PortgroupRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ProductSectionList.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ProviderVdc.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ProviderVdcResourcePoolRelationRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/PublishCatalogParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/QueryList.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/QueryResultRecords.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RasdItemsList.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RecomposeVAppParams.xml +17 -0
- data/lib/cloud/vcloud/xml/xml_templates/Record.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Reference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/References.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RelocateParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ResourceEntity.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ResourcePoolRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Right.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RightRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RightReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RightReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Role.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RoleRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RoleReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RoleReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/RuntimeInfoSection.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ScreenTicket.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Session.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/ShadowVMReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/StaticRoutingService.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/StrandedUserRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Task.xml +0 -0
- data/lib/cloud/vcloud/xml/xml_templates/TaskRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/TaskReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/TaskReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/TasksList.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/UndeployVAppParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/UploadVAppTemplateParams.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/User.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/UserRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/UserReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/UserReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VApp.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppLeaseSettings.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppNetwork.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppNetworkRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppNetworkReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppNetworkReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppOrgNetworkRelationRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppOrgNetworkRelationReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppOrgNetworkRelationReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppTemplate.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppTemplateRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppTemplateReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VAppTemplateReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VCloud.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMWProviderVdcRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMWProviderVdcReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VMWProviderVdcReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Vdc.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VdcReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VdcStorageProfile.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VirtualCenterRecord.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VirtualCenterReference.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VirtualCenterReferences.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/Vm.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VmPendingQuestion.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/VmQuestionAnswer.xml +1 -0
- data/lib/cloud/vcloud/xml/xml_templates/generate_dictionary.rb +8 -0
- data/lib/cloud/vcloud.rb +3 -7
- metadata +384 -88
- data/README +0 -26
- data/Rakefile +0 -50
- data/lib/cloud/vcloud/const.rb +0 -27
- data/lib/cloud/vcloud/util.rb +0 -23
- data/spec/assets/test-deployment-manifest.yml +0 -183
- data/spec/assets/test-director-config.yml +0 -73
- data/spec/assets/valid_stemcell.tgz +0 -0
- data/spec/spec_helper.rb +0 -135
- data/spec/unit/cloud_spec.rb +0 -506
@@ -0,0 +1,32 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Item < Wrapper
|
5
|
+
def add_rasd(name)
|
6
|
+
raise "Cannot add duplicate RASD element #{name}." if get_rasd(name)
|
7
|
+
add_child(name, "rasd", RASD)
|
8
|
+
end
|
9
|
+
|
10
|
+
def edit_link
|
11
|
+
get_nodes("Link", {"rel" => "edit"}, true).first
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_rasd(name)
|
15
|
+
get_nodes(name, nil, true, RASD).first
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_rasd_content(name)
|
19
|
+
node = get_rasd(name)
|
20
|
+
return node.content if node
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
|
24
|
+
def set_rasd(name, value)
|
25
|
+
node = get_rasd(name)
|
26
|
+
raise "The RASD element #{name} does not exist." unless node
|
27
|
+
node.content = value
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Link < Wrapper
|
5
|
+
def name
|
6
|
+
@root["name"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def name=(name)
|
10
|
+
@root["name"] = name
|
11
|
+
end
|
12
|
+
|
13
|
+
def rel
|
14
|
+
@root["rel"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def rel=(rel)
|
18
|
+
@root["rel"] = rel
|
19
|
+
end
|
20
|
+
|
21
|
+
def type
|
22
|
+
@root["type"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def type=(type)
|
26
|
+
@root["type"] = type
|
27
|
+
end
|
28
|
+
|
29
|
+
def href
|
30
|
+
@root["href"]
|
31
|
+
end
|
32
|
+
|
33
|
+
def href=(href)
|
34
|
+
@root["href"] = href
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Media < Wrapper
|
5
|
+
def name
|
6
|
+
@root["name"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def name=(name)
|
10
|
+
@root["name"] = name.to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
def size
|
14
|
+
@root["size"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def size=(size)
|
18
|
+
@root["size"] = size.to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
def image_type
|
22
|
+
@root["imageType"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def image_type=(image_type)
|
26
|
+
@root["imageType"] = image_type.to_s
|
27
|
+
end
|
28
|
+
|
29
|
+
def storage_profile=(storage_profile)
|
30
|
+
add_child(storage_profile) unless storage_profile.nil?
|
31
|
+
end
|
32
|
+
|
33
|
+
def files
|
34
|
+
get_nodes("File")
|
35
|
+
end
|
36
|
+
|
37
|
+
# Files that haven"t finished transferring
|
38
|
+
def incomplete_files
|
39
|
+
files.find_all { |f| f["size"].to_i < 0 ||
|
40
|
+
(f["size"].to_i > f["bytesTransferred"].to_i) }
|
41
|
+
end
|
42
|
+
|
43
|
+
def delete_link
|
44
|
+
get_nodes("Link", {"rel" => "remove"}, true).first
|
45
|
+
end
|
46
|
+
|
47
|
+
def running_tasks
|
48
|
+
get_nodes("Task", {"status" => "running"})
|
49
|
+
end
|
50
|
+
|
51
|
+
def tasks
|
52
|
+
get_nodes("Task")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class NetworkConfig < Wrapper
|
5
|
+
def ip_scope
|
6
|
+
get_nodes("IpScope").first
|
7
|
+
end
|
8
|
+
|
9
|
+
def network_name
|
10
|
+
@root["networkName"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def parent_network
|
14
|
+
get_nodes("ParentNetwork").first
|
15
|
+
end
|
16
|
+
|
17
|
+
def fence_mode
|
18
|
+
get_nodes("FenceMode").first.content
|
19
|
+
end
|
20
|
+
|
21
|
+
def fence_mode=(value)
|
22
|
+
get_nodes("FenceMode").first.content = value
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class NetworkConfigSection < Wrapper
|
5
|
+
def network_configs
|
6
|
+
get_nodes("NetworkConfig")
|
7
|
+
end
|
8
|
+
|
9
|
+
def add_network_config(config)
|
10
|
+
unless config.is_a? NetworkConfig
|
11
|
+
raise CloudError, "Only NetworkConfig can be added to #{self.class}"
|
12
|
+
end
|
13
|
+
add_child(config)
|
14
|
+
end
|
15
|
+
|
16
|
+
def delete_network_config(net_name)
|
17
|
+
net_config = network_configs.find {|n| n.network_name == net_name }
|
18
|
+
raise ObjectNotFoundError,
|
19
|
+
"Cannot delete network #{net_name}: not found" unless net_config
|
20
|
+
net_config.node.remove
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class NetworkConnection < Wrapper
|
5
|
+
def network
|
6
|
+
@root["network"]
|
7
|
+
end
|
8
|
+
|
9
|
+
# Value should be the name of the vApp network to connect to
|
10
|
+
def network=(value)
|
11
|
+
@root["network"] = value
|
12
|
+
end
|
13
|
+
|
14
|
+
def network_connection_index
|
15
|
+
get_nodes("NetworkConnectionIndex").first.content
|
16
|
+
end
|
17
|
+
|
18
|
+
def network_connection_index=(value)
|
19
|
+
unless get_nodes("NetworkConnectionIndex").first
|
20
|
+
index_node = create_child("NetworkConnectionIndex")
|
21
|
+
add_child(index_node)
|
22
|
+
end
|
23
|
+
get_nodes("NetworkConnectionIndex").first.content = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def ip_address
|
27
|
+
get_nodes("IpAddress").first.content
|
28
|
+
end
|
29
|
+
|
30
|
+
def ip_address=(value)
|
31
|
+
# When addressing mode is other than MANUAL this node does not exist.
|
32
|
+
unless get_nodes("IpAddress").first
|
33
|
+
# must be after network connection index
|
34
|
+
index_node = get_nodes("NetworkConnectionIndex").first
|
35
|
+
ip_node = create_child("IpAddress")
|
36
|
+
index_node.node.after(ip_node)
|
37
|
+
end
|
38
|
+
get_nodes("IpAddress").first.content = value
|
39
|
+
end
|
40
|
+
|
41
|
+
def is_connected
|
42
|
+
get_nodes("IsConnected").first.content
|
43
|
+
end
|
44
|
+
|
45
|
+
def is_connected=(value)
|
46
|
+
get_nodes("IsConnected").first.content = value
|
47
|
+
end
|
48
|
+
|
49
|
+
def mac_address
|
50
|
+
get_nodes("MACAddress").first.content
|
51
|
+
end
|
52
|
+
|
53
|
+
def mac_address=(value)
|
54
|
+
get_nodes("MACAddress").first.content = value
|
55
|
+
end
|
56
|
+
|
57
|
+
def ip_address_allocation_mode
|
58
|
+
get_nodes("IpAddressAllocationMode").first.content
|
59
|
+
end
|
60
|
+
|
61
|
+
def ip_address_allocation_mode=(value)
|
62
|
+
if !IP_ADDRESSING_MODE.values.include?(value)
|
63
|
+
raise ArgumentError, "Invalid IP addressing mode. Valid modes " +
|
64
|
+
"are: #{IP_ADDRESSING_MODE.values.join(" ")}"
|
65
|
+
end
|
66
|
+
get_nodes("IpAddressAllocationMode").first.content = value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class NetworkConnectionSection < Wrapper
|
5
|
+
def add_item(item)
|
6
|
+
link_node = get_nodes("Link").first
|
7
|
+
link_node.node.before(item.node)
|
8
|
+
end
|
9
|
+
|
10
|
+
def edit_link
|
11
|
+
get_nodes("Link", {"rel" => "edit"}, true).first
|
12
|
+
end
|
13
|
+
|
14
|
+
def network_connections
|
15
|
+
get_nodes("NetworkConnection")
|
16
|
+
end
|
17
|
+
|
18
|
+
def network_connection(index)
|
19
|
+
net = network_connections.find {
|
20
|
+
|n| n.network_connection_index == index.to_s }
|
21
|
+
unless net
|
22
|
+
raise ObjectNotFoundError, "Network connection #{index} does not exist."
|
23
|
+
end
|
24
|
+
net
|
25
|
+
end
|
26
|
+
|
27
|
+
# This will be nil if there are no network connections
|
28
|
+
def primary_network_connection_index
|
29
|
+
node = get_nodes("PrimaryNetworkConnectionIndex").first
|
30
|
+
if node.nil?
|
31
|
+
nil
|
32
|
+
else
|
33
|
+
node.content
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def primary_network_connection_index=(index)
|
38
|
+
get_nodes("PrimaryNetworkConnectionIndex").first.content = index
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_network_connection(index)
|
42
|
+
connection = network_connection(index)
|
43
|
+
if connection
|
44
|
+
connection.node.remove
|
45
|
+
reconcile_primary_network()
|
46
|
+
else
|
47
|
+
raise ObjectNotFoundError,
|
48
|
+
"Cannot remove network connection #{index}: does not exist."
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def reconcile_primary_network()
|
55
|
+
new_primary = network_connections.first
|
56
|
+
if new_primary
|
57
|
+
self.primary_network_connection_index =
|
58
|
+
new_primary.network_connection_index
|
59
|
+
else
|
60
|
+
primary = get_nodes("PrimaryNetworkConnectionIndex").first
|
61
|
+
primary.node.remove if primary
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class NicItemWrapper < Item
|
5
|
+
def initialize(item)
|
6
|
+
super(item.node, item.namespace, item.namespace_definitions)
|
7
|
+
|
8
|
+
# Ensure the underlying XML has all the necessary RASD elements.
|
9
|
+
# This is useful for NIC creation.
|
10
|
+
# Should have no effect when receiving XML from VCD.
|
11
|
+
[:ADDRESS_ON_PARENT, :CONNECTION, :INSTANCE_ID].each { |t|
|
12
|
+
rt = RASD_TYPES[t]
|
13
|
+
add_rasd(rt) unless get_rasd(rt) }
|
14
|
+
|
15
|
+
rt = RASD_TYPES[:RESOURCE_SUB_TYPE]
|
16
|
+
unless get_rasd(rt)
|
17
|
+
add_rasd(rt)
|
18
|
+
set_rasd(rt, RESOURCE_SUB_TYPE[:VMXNET3])
|
19
|
+
end
|
20
|
+
|
21
|
+
rt = RASD_TYPES[:RESOURCE_TYPE]
|
22
|
+
unless get_rasd(rt)
|
23
|
+
add_rasd(rt)
|
24
|
+
set_rasd(rt, HARDWARE_TYPE[:NIC])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def is_primary
|
29
|
+
connection["primaryNetworkConnection"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def is_primary=(value)
|
33
|
+
primary_attr = create_qualified_name("primaryNetworkConnection",
|
34
|
+
VCLOUD_NAMESPACE)
|
35
|
+
connection[primary_attr] = value.to_s
|
36
|
+
end
|
37
|
+
|
38
|
+
def nic_index
|
39
|
+
get_rasd_content(RASD_TYPES[:ADDRESS_ON_PARENT])
|
40
|
+
end
|
41
|
+
|
42
|
+
def nic_index=(value)
|
43
|
+
set_rasd(RASD_TYPES[:ADDRESS_ON_PARENT], value)
|
44
|
+
end
|
45
|
+
|
46
|
+
def ip_addressing_mode
|
47
|
+
attr = create_qualified_name("ipAddressingMode", VCLOUD_NAMESPACE)
|
48
|
+
connection[attr]
|
49
|
+
end
|
50
|
+
|
51
|
+
def set_ip_addressing_mode(mode, ip = nil)
|
52
|
+
unless IP_ADDRESSING_MODE.values.include?(mode)
|
53
|
+
raise ArgumentError, "Invalid choice for IP addressing mode."
|
54
|
+
end
|
55
|
+
|
56
|
+
if ip && !ip_addressing_mode == IP_ADDRESSING_MODE[:MANUAL]
|
57
|
+
raise ArgumentError,
|
58
|
+
"Cannot set IP address unless IP addressing mode is MANUAL"
|
59
|
+
end
|
60
|
+
|
61
|
+
mode_attr = create_qualified_name("ipAddressingMode",
|
62
|
+
VCLOUD_NAMESPACE)
|
63
|
+
connection[mode_attr] = mode
|
64
|
+
|
65
|
+
ip_attr = create_qualified_name("ipAddress", VCLOUD_NAMESPACE)
|
66
|
+
connection[ip_attr] = !ip.nil? ? ip : ""
|
67
|
+
end
|
68
|
+
|
69
|
+
def mac_address
|
70
|
+
get_rasd_content(RASD_TYPES[:ADDRESS])
|
71
|
+
end
|
72
|
+
|
73
|
+
def network
|
74
|
+
connection.content
|
75
|
+
end
|
76
|
+
|
77
|
+
def network=(value)
|
78
|
+
connection.content = value
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def connection
|
84
|
+
get_rasd(RASD_TYPES[:CONNECTION])
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Org < Wrapper
|
5
|
+
|
6
|
+
def vdc_link(name)
|
7
|
+
get_nodes("Link",
|
8
|
+
{ "type" => MEDIA_TYPE[:VDC],
|
9
|
+
"name" => name},
|
10
|
+
true).first
|
11
|
+
end
|
12
|
+
|
13
|
+
def catalog_link(name)
|
14
|
+
get_nodes("Link",
|
15
|
+
{ "type" => MEDIA_TYPE[:CATALOG],
|
16
|
+
"name" => name},
|
17
|
+
true).first
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class OrgNetwork < Wrapper
|
5
|
+
def ip_scope
|
6
|
+
get_nodes("IpScope").first
|
7
|
+
end
|
8
|
+
|
9
|
+
def fence_mode
|
10
|
+
get_nodes("FenceMode").first.content
|
11
|
+
end
|
12
|
+
|
13
|
+
def fence_mode=(value)
|
14
|
+
get_nodes("FenceMode").first.content = value
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class RecomposeVAppParams < Wrapper
|
5
|
+
def name
|
6
|
+
@root["name"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def name=(name)
|
10
|
+
@root["name"] = name
|
11
|
+
end
|
12
|
+
|
13
|
+
def description
|
14
|
+
get_nodes("Description").first
|
15
|
+
end
|
16
|
+
|
17
|
+
def description=(desc)
|
18
|
+
description.content = desc
|
19
|
+
end
|
20
|
+
|
21
|
+
def all_eulas_accepted=(value)
|
22
|
+
eulas_node = get_nodes("AllEULAsAccepted").first
|
23
|
+
eulas_node.content = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def add_source_item(entity_to_add_href)
|
27
|
+
return unless entity_to_add_href
|
28
|
+
|
29
|
+
prefix = namespace.prefix
|
30
|
+
prefix += ':' if prefix
|
31
|
+
|
32
|
+
node_sourced_item = create_child("#{prefix}SourcedItem")
|
33
|
+
node_sourced_item["sourceDelete"] = "true"
|
34
|
+
|
35
|
+
node_source = add_child("#{prefix}Source", nil, nil, node_sourced_item)
|
36
|
+
node_source["href"] = entity_to_add_href
|
37
|
+
|
38
|
+
get_nodes("AllEULAsAccepted").first.node.before(node_sourced_item)
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_delete_item(entity_to_delete_href)
|
42
|
+
return unless entity_to_delete_href
|
43
|
+
|
44
|
+
node_delete_item = create_child("DeleteItem")
|
45
|
+
node_delete_item["href"] = entity_to_delete_href
|
46
|
+
|
47
|
+
get_nodes("AllEULAsAccepted").first.node.after(node_delete_item)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Session < Wrapper
|
5
|
+
def admin_root
|
6
|
+
get_nodes("Link", {"type" =>
|
7
|
+
VCloudSdk::Xml::ADMIN_MEDIA_TYPE[:VCLOUD]}).first
|
8
|
+
end
|
9
|
+
|
10
|
+
def org_link(name)
|
11
|
+
get_nodes("Link",
|
12
|
+
{"type" => VCloudSdk::Xml::MEDIA_TYPE[:ORGANIZATION],
|
13
|
+
"name" => name
|
14
|
+
}).first
|
15
|
+
end
|
16
|
+
|
17
|
+
def entity_resolver
|
18
|
+
get_nodes("Link", {"type" =>
|
19
|
+
VCloudSdk::Xml::MEDIA_TYPE[:ENTITY]}).first
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class SupportedVersions < Wrapper
|
5
|
+
def login_url
|
6
|
+
ns = namespace.href # Typically it's 'http://www.vmware.com/vcloud/versions'
|
7
|
+
get_nodes('VersionInfo', nil, false, ns).each do |node|
|
8
|
+
if node.get_nodes('Version', nil, false, ns).first.content \
|
9
|
+
== VCloudClient::VCLOUD_VERSION_NUMBER
|
10
|
+
return node.get_nodes('LoginUrl', nil, false, ns).first
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module VCloudSdk
|
2
|
+
module Xml
|
3
|
+
|
4
|
+
class Task < Wrapper
|
5
|
+
def cancel_link
|
6
|
+
get_nodes("Link", {"rel" => "task:cancel"}).first
|
7
|
+
end
|
8
|
+
|
9
|
+
def status
|
10
|
+
self["status"]
|
11
|
+
end
|
12
|
+
|
13
|
+
# Friendly description of the task
|
14
|
+
def operation
|
15
|
+
self["operation"]
|
16
|
+
end
|
17
|
+
|
18
|
+
# Short form name of the operation
|
19
|
+
def operation_name
|
20
|
+
self["operationName"]
|
21
|
+
end
|
22
|
+
|
23
|
+
# Not all tasks will have progress
|
24
|
+
def progress
|
25
|
+
task_progress = get_nodes("Progress").first
|
26
|
+
return task_progress.content unless task_progress.nil?
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|