ruby_vcloud_sdk 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (319) hide show
  1. data/README +1 -0
  2. data/Rakefile +50 -0
  3. data/lib/ruby_vcloud_sdk.rb +19 -0
  4. data/lib/ruby_vcloud_sdk/client.rb +899 -0
  5. data/lib/ruby_vcloud_sdk/config.rb +17 -0
  6. data/lib/ruby_vcloud_sdk/connection/connection.rb +163 -0
  7. data/lib/ruby_vcloud_sdk/connection/file_uploader.rb +43 -0
  8. data/lib/ruby_vcloud_sdk/errors.rb +21 -0
  9. data/lib/ruby_vcloud_sdk/ovf_directory.rb +45 -0
  10. data/lib/ruby_vcloud_sdk/util.rb +21 -0
  11. data/lib/ruby_vcloud_sdk/version.rb +3 -0
  12. data/lib/ruby_vcloud_sdk/xml/constants.rb +427 -0
  13. data/lib/ruby_vcloud_sdk/xml/wrapper.rb +242 -0
  14. data/lib/ruby_vcloud_sdk/xml/wrapper_classes.rb +3 -0
  15. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/admin_catalog.rb +20 -0
  16. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/admin_org.rb +15 -0
  17. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/catalog_item.rb +27 -0
  18. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb +40 -0
  19. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/disk_attach_or_detach_params.rb +12 -0
  20. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/disk_create_params.rb +47 -0
  21. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/entity.rb +11 -0
  22. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/file.rb +11 -0
  23. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/hard_disk_item_wrapper.rb +50 -0
  24. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/instantiate_vapp_template_params.rb +71 -0
  25. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/ip_scope.rb +55 -0
  26. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/item.rb +32 -0
  27. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/media.rb +53 -0
  28. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/media_insert_or_eject_params.rb +17 -0
  29. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/metadata_value.rb +15 -0
  30. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/network.rb +15 -0
  31. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/network_config.rb +27 -0
  32. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/network_config_section.rb +25 -0
  33. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection.rb +71 -0
  34. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/network_connection_section.rb +67 -0
  35. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/nic_item_wrapper.rb +91 -0
  36. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/org_network.rb +19 -0
  37. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/org_vdc_network.rb +11 -0
  38. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/session.rb +17 -0
  39. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/task.rb +32 -0
  40. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/upload_vapp_template_params.rb +11 -0
  41. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vapp.rb +55 -0
  42. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vapp_template.rb +19 -0
  43. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vcloud.rb +15 -0
  44. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vdc.rb +54 -0
  45. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vdc_storage_profile.rb +15 -0
  46. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/virtual_hardware_section.rb +68 -0
  47. data/lib/ruby_vcloud_sdk/xml/wrapper_classes/vm.rb +179 -0
  48. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminAllocatedExtIpRecord.xml +1 -0
  49. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminCatalog.xml +1 -0
  50. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminCatalogItemRecord.xml +1 -0
  51. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminCatalogRecord.xml +1 -0
  52. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminGroupRecord.xml +1 -0
  53. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminMediaRecord.xml +1 -0
  54. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminOrg.xml +1 -0
  55. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminOrgNetworkRecord.xml +1 -0
  56. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminShadowVmRecord.xml +1 -0
  57. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminTaskRecord.xml +1 -0
  58. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminUserRecord.xml +1 -0
  59. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVAppNetworkRecord.xml +1 -0
  60. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVAppRecord.xml +1 -0
  61. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVAppReference.xml +1 -0
  62. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVAppReferences.xml +1 -0
  63. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVAppTemplateRecord.xml +1 -0
  64. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVdc.xml +1 -0
  65. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVdcRecord.xml +1 -0
  66. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVdcReference.xml +1 -0
  67. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVdcReferences.xml +1 -0
  68. data/lib/ruby_vcloud_sdk/xml/xml_templates/AdminVmRecord.xml +1 -0
  69. data/lib/ruby_vcloud_sdk/xml/xml_templates/AllEULAsAccepted.xml +1 -0
  70. data/lib/ruby_vcloud_sdk/xml/xml_templates/AllocatedExtIpRecord.xml +1 -0
  71. data/lib/ruby_vcloud_sdk/xml/xml_templates/BlockingTaskRecord.xml +1 -0
  72. data/lib/ruby_vcloud_sdk/xml/xml_templates/BlockingTaskReference.xml +1 -0
  73. data/lib/ruby_vcloud_sdk/xml/xml_templates/BlockingTaskReferences.xml +1 -0
  74. data/lib/ruby_vcloud_sdk/xml/xml_templates/CaptureVAppParams.xml +1 -0
  75. data/lib/ruby_vcloud_sdk/xml/xml_templates/Catalog.xml +1 -0
  76. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogItem.xml +1 -0
  77. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogItemRecord.xml +1 -0
  78. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogItemReference.xml +1 -0
  79. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogItemReferences.xml +1 -0
  80. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogRecord.xml +1 -0
  81. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogReference.xml +1 -0
  82. data/lib/ruby_vcloud_sdk/xml/xml_templates/CatalogReferences.xml +1 -0
  83. data/lib/ruby_vcloud_sdk/xml/xml_templates/CellRecord.xml +1 -0
  84. data/lib/ruby_vcloud_sdk/xml/xml_templates/CloneMediaParams.xml +1 -0
  85. data/lib/ruby_vcloud_sdk/xml/xml_templates/CloneVAppParams.xml +1 -0
  86. data/lib/ruby_vcloud_sdk/xml/xml_templates/CloneVAppTemplateParams.xml +1 -0
  87. data/lib/ruby_vcloud_sdk/xml/xml_templates/ComposeVAppParams.xml +1 -0
  88. data/lib/ruby_vcloud_sdk/xml/xml_templates/ControlAccessParams.xml +1 -0
  89. data/lib/ruby_vcloud_sdk/xml/xml_templates/CustomizationSection.xml +1 -0
  90. data/lib/ruby_vcloud_sdk/xml/xml_templates/DatastoreProviderVdcRelationRecord.xml +1 -0
  91. data/lib/ruby_vcloud_sdk/xml/xml_templates/DatastoreRecord.xml +1 -0
  92. data/lib/ruby_vcloud_sdk/xml/xml_templates/DatastoreReference.xml +1 -0
  93. data/lib/ruby_vcloud_sdk/xml/xml_templates/DatastoreReferences.xml +1 -0
  94. data/lib/ruby_vcloud_sdk/xml/xml_templates/DeployVAppParams.xml +1 -0
  95. data/lib/ruby_vcloud_sdk/xml/xml_templates/DhcpService.xml +1 -0
  96. data/lib/ruby_vcloud_sdk/xml/xml_templates/DiskAttachOrDetachParams.xml +5 -0
  97. data/lib/ruby_vcloud_sdk/xml/xml_templates/DiskCreateParams.xml +9 -0
  98. data/lib/ruby_vcloud_sdk/xml/xml_templates/DvSwitchRecord.xml +1 -0
  99. data/lib/ruby_vcloud_sdk/xml/xml_templates/Entity.xml +1 -0
  100. data/lib/ruby_vcloud_sdk/xml/xml_templates/Error.xml +1 -0
  101. data/lib/ruby_vcloud_sdk/xml/xml_templates/EventRecord.xml +1 -0
  102. data/lib/ruby_vcloud_sdk/xml/xml_templates/ExternalNetwork.xml +1 -0
  103. data/lib/ruby_vcloud_sdk/xml/xml_templates/File.xml +1 -0
  104. data/lib/ruby_vcloud_sdk/xml/xml_templates/FirewallService.xml +1 -0
  105. data/lib/ruby_vcloud_sdk/xml/xml_templates/GeneralOrgSettings.xml +1 -0
  106. data/lib/ruby_vcloud_sdk/xml/xml_templates/Group.xml +1 -0
  107. data/lib/ruby_vcloud_sdk/xml/xml_templates/GroupRecord.xml +1 -0
  108. data/lib/ruby_vcloud_sdk/xml/xml_templates/GroupReference.xml +1 -0
  109. data/lib/ruby_vcloud_sdk/xml/xml_templates/GroupReferences.xml +1 -0
  110. data/lib/ruby_vcloud_sdk/xml/xml_templates/GuestCustomizationSection.xml +1 -0
  111. data/lib/ruby_vcloud_sdk/xml/xml_templates/HostRecord.xml +1 -0
  112. data/lib/ruby_vcloud_sdk/xml/xml_templates/HostReference.xml +1 -0
  113. data/lib/ruby_vcloud_sdk/xml/xml_templates/HostReferences.xml +1 -0
  114. data/lib/ruby_vcloud_sdk/xml/xml_templates/InstantiateOvfParams.xml +1 -0
  115. data/lib/ruby_vcloud_sdk/xml/xml_templates/InstantiateVAppTemplateParams.xml +1 -0
  116. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpScope.xml +12 -0
  117. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpsecVpnLocalPeer.xml +1 -0
  118. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpsecVpnPeer.xml +1 -0
  119. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpsecVpnRemotePeer.xml +1 -0
  120. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpsecVpnService.xml +1 -0
  121. data/lib/ruby_vcloud_sdk/xml/xml_templates/IpsecVpnThirdPartyPeer.xml +1 -0
  122. data/lib/ruby_vcloud_sdk/xml/xml_templates/Item.xml +3 -0
  123. data/lib/ruby_vcloud_sdk/xml/xml_templates/ItemVcd.xml +5 -0
  124. data/lib/ruby_vcloud_sdk/xml/xml_templates/LeaseSettingsSection.xml +1 -0
  125. data/lib/ruby_vcloud_sdk/xml/xml_templates/Link.xml +1 -0
  126. data/lib/ruby_vcloud_sdk/xml/xml_templates/Media.xml +6 -0
  127. data/lib/ruby_vcloud_sdk/xml/xml_templates/MediaInsertOrEjectParams.xml +4 -0
  128. data/lib/ruby_vcloud_sdk/xml/xml_templates/MediaRecord.xml +1 -0
  129. data/lib/ruby_vcloud_sdk/xml/xml_templates/MediaReference.xml +1 -0
  130. data/lib/ruby_vcloud_sdk/xml/xml_templates/MediaReferences.xml +1 -0
  131. data/lib/ruby_vcloud_sdk/xml/xml_templates/Metadata.xml +5 -0
  132. data/lib/ruby_vcloud_sdk/xml/xml_templates/MetadataEntry.xml +7 -0
  133. data/lib/ruby_vcloud_sdk/xml/xml_templates/MetadataValue.xml +8 -0
  134. data/lib/ruby_vcloud_sdk/xml/xml_templates/NatService.xml +1 -0
  135. data/lib/ruby_vcloud_sdk/xml/xml_templates/Network.xml +4 -0
  136. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkAssignment.xml +1 -0
  137. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkConfig.xml +21 -0
  138. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkConfigSection.xml +1 -0
  139. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkConnection.xml +11 -0
  140. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkConnectionSection.xml +1 -0
  141. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkPoolRecord.xml +1 -0
  142. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkPoolReference.xml +1 -0
  143. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkPoolReferences.xml +1 -0
  144. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkRecord.xml +1 -0
  145. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkReference.xml +1 -0
  146. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkReferences.xml +1 -0
  147. data/lib/ruby_vcloud_sdk/xml/xml_templates/NetworkService.xml +1 -0
  148. data/lib/ruby_vcloud_sdk/xml/xml_templates/Org.xml +1 -0
  149. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgEmailSettings.xml +1 -0
  150. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgList.xml +1 -0
  151. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgNetwork.xml +1 -0
  152. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgNetworkRecord.xml +1 -0
  153. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgNetworkReference.xml +1 -0
  154. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgNetworkReferences.xml +1 -0
  155. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgPasswordPolicySettings.xml +1 -0
  156. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgRecord.xml +1 -0
  157. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgReference.xml +1 -0
  158. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgReferences.xml +1 -0
  159. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgSettings.xml +1 -0
  160. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVAppTemplateLeaseSettings.xml +1 -0
  161. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVdcNetwork.xml +1 -0
  162. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVdcRecord.xml +1 -0
  163. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVdcReference.xml +1 -0
  164. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVdcReferences.xml +1 -0
  165. data/lib/ruby_vcloud_sdk/xml/xml_templates/OrgVdcResourcePoolRelationRecord.xml +1 -0
  166. data/lib/ruby_vcloud_sdk/xml/xml_templates/Owner.xml +1 -0
  167. data/lib/ruby_vcloud_sdk/xml/xml_templates/PortgroupRecord.xml +1 -0
  168. data/lib/ruby_vcloud_sdk/xml/xml_templates/ProductSectionList.xml +1 -0
  169. data/lib/ruby_vcloud_sdk/xml/xml_templates/ProviderVdc.xml +1 -0
  170. data/lib/ruby_vcloud_sdk/xml/xml_templates/ProviderVdcResourcePoolRelationRecord.xml +1 -0
  171. data/lib/ruby_vcloud_sdk/xml/xml_templates/PublishCatalogParams.xml +1 -0
  172. data/lib/ruby_vcloud_sdk/xml/xml_templates/QueryList.xml +1 -0
  173. data/lib/ruby_vcloud_sdk/xml/xml_templates/QueryResultRecords.xml +1 -0
  174. data/lib/ruby_vcloud_sdk/xml/xml_templates/RasdItemsList.xml +1 -0
  175. data/lib/ruby_vcloud_sdk/xml/xml_templates/RecomposeVAppParams.xml +1 -0
  176. data/lib/ruby_vcloud_sdk/xml/xml_templates/Record.xml +1 -0
  177. data/lib/ruby_vcloud_sdk/xml/xml_templates/Reference.xml +1 -0
  178. data/lib/ruby_vcloud_sdk/xml/xml_templates/References.xml +1 -0
  179. data/lib/ruby_vcloud_sdk/xml/xml_templates/RelocateParams.xml +1 -0
  180. data/lib/ruby_vcloud_sdk/xml/xml_templates/ResourceEntity.xml +1 -0
  181. data/lib/ruby_vcloud_sdk/xml/xml_templates/ResourcePoolRecord.xml +1 -0
  182. data/lib/ruby_vcloud_sdk/xml/xml_templates/Right.xml +1 -0
  183. data/lib/ruby_vcloud_sdk/xml/xml_templates/RightRecord.xml +1 -0
  184. data/lib/ruby_vcloud_sdk/xml/xml_templates/RightReference.xml +1 -0
  185. data/lib/ruby_vcloud_sdk/xml/xml_templates/RightReferences.xml +1 -0
  186. data/lib/ruby_vcloud_sdk/xml/xml_templates/Role.xml +1 -0
  187. data/lib/ruby_vcloud_sdk/xml/xml_templates/RoleRecord.xml +1 -0
  188. data/lib/ruby_vcloud_sdk/xml/xml_templates/RoleReference.xml +1 -0
  189. data/lib/ruby_vcloud_sdk/xml/xml_templates/RoleReferences.xml +1 -0
  190. data/lib/ruby_vcloud_sdk/xml/xml_templates/RuntimeInfoSection.xml +1 -0
  191. data/lib/ruby_vcloud_sdk/xml/xml_templates/ScreenTicket.xml +1 -0
  192. data/lib/ruby_vcloud_sdk/xml/xml_templates/Session.xml +1 -0
  193. data/lib/ruby_vcloud_sdk/xml/xml_templates/ShadowVMReferences.xml +1 -0
  194. data/lib/ruby_vcloud_sdk/xml/xml_templates/StaticRoutingService.xml +1 -0
  195. data/lib/ruby_vcloud_sdk/xml/xml_templates/StrandedUserRecord.xml +1 -0
  196. data/lib/ruby_vcloud_sdk/xml/xml_templates/Task.xml +0 -0
  197. data/lib/ruby_vcloud_sdk/xml/xml_templates/TaskRecord.xml +1 -0
  198. data/lib/ruby_vcloud_sdk/xml/xml_templates/TaskReference.xml +1 -0
  199. data/lib/ruby_vcloud_sdk/xml/xml_templates/TaskReferences.xml +1 -0
  200. data/lib/ruby_vcloud_sdk/xml/xml_templates/TasksList.xml +1 -0
  201. data/lib/ruby_vcloud_sdk/xml/xml_templates/UndeployVAppParams.xml +1 -0
  202. data/lib/ruby_vcloud_sdk/xml/xml_templates/UploadVAppTemplateParams.xml +1 -0
  203. data/lib/ruby_vcloud_sdk/xml/xml_templates/User.xml +1 -0
  204. data/lib/ruby_vcloud_sdk/xml/xml_templates/UserRecord.xml +1 -0
  205. data/lib/ruby_vcloud_sdk/xml/xml_templates/UserReference.xml +1 -0
  206. data/lib/ruby_vcloud_sdk/xml/xml_templates/UserReferences.xml +1 -0
  207. data/lib/ruby_vcloud_sdk/xml/xml_templates/VApp.xml +1 -0
  208. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppLeaseSettings.xml +1 -0
  209. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppNetwork.xml +1 -0
  210. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppNetworkRecord.xml +1 -0
  211. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppNetworkReference.xml +1 -0
  212. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppNetworkReferences.xml +1 -0
  213. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppOrgNetworkRelationRecord.xml +1 -0
  214. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppOrgNetworkRelationReference.xml +1 -0
  215. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppOrgNetworkRelationReferences.xml +1 -0
  216. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppRecord.xml +1 -0
  217. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppReference.xml +1 -0
  218. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppReferences.xml +1 -0
  219. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppTemplate.xml +1 -0
  220. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppTemplateRecord.xml +1 -0
  221. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppTemplateReference.xml +1 -0
  222. data/lib/ruby_vcloud_sdk/xml/xml_templates/VAppTemplateReferences.xml +1 -0
  223. data/lib/ruby_vcloud_sdk/xml/xml_templates/VCloud.xml +1 -0
  224. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMRecord.xml +1 -0
  225. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMReference.xml +1 -0
  226. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMReferences.xml +1 -0
  227. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMWProviderVdcRecord.xml +1 -0
  228. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMWProviderVdcReference.xml +1 -0
  229. data/lib/ruby_vcloud_sdk/xml/xml_templates/VMWProviderVdcReferences.xml +1 -0
  230. data/lib/ruby_vcloud_sdk/xml/xml_templates/Vdc.xml +1 -0
  231. data/lib/ruby_vcloud_sdk/xml/xml_templates/VdcReferences.xml +1 -0
  232. data/lib/ruby_vcloud_sdk/xml/xml_templates/VdcStorageProfile.xml +1 -0
  233. data/lib/ruby_vcloud_sdk/xml/xml_templates/VirtualCenterRecord.xml +1 -0
  234. data/lib/ruby_vcloud_sdk/xml/xml_templates/VirtualCenterReference.xml +1 -0
  235. data/lib/ruby_vcloud_sdk/xml/xml_templates/VirtualCenterReferences.xml +1 -0
  236. data/lib/ruby_vcloud_sdk/xml/xml_templates/Vm.xml +1 -0
  237. data/lib/ruby_vcloud_sdk/xml/xml_templates/VmPendingQuestion.xml +1 -0
  238. data/lib/ruby_vcloud_sdk/xml/xml_templates/VmQuestionAnswer.xml +1 -0
  239. data/lib/ruby_vcloud_sdk/xml/xml_templates/generate_dictionary.rb +8 -0
  240. data/spec/assets/admin_org_response.xml +75 -0
  241. data/spec/assets/catalog_add_item_response.xml +8 -0
  242. data/spec/assets/catalog_add_vapp_request.xml +5 -0
  243. data/spec/assets/catalog_item_added_response.xml +19 -0
  244. data/spec/assets/catalog_response.xml +19 -0
  245. data/spec/assets/existing_media_busy_response.xml +19 -0
  246. data/spec/assets/existing_media_catalog_item.xml +8 -0
  247. data/spec/assets/existing_media_delete_task_done.xml +6 -0
  248. data/spec/assets/existing_media_done_response.xml +11 -0
  249. data/spec/assets/existing_vapp_resolver_response.xml +3 -0
  250. data/spec/assets/existing_vapp_template_catalog_resolver_response.xml +3 -0
  251. data/spec/assets/existing_vapp_template_instantiate_response.xml +20 -0
  252. data/spec/assets/existing_vapp_template_instantiate_task_error_response.xml +7 -0
  253. data/spec/assets/existing_vapp_template_instantiate_task_start_response.xml +7 -0
  254. data/spec/assets/existing_vapp_template_instantiate_task_success_response.xml +7 -0
  255. data/spec/assets/existing_vapp_template_item_response.xml +8 -0
  256. data/spec/assets/existing_vapp_template_ready_response.xml +79 -0
  257. data/spec/assets/finalize_upload_task_done_response.xml +7 -0
  258. data/spec/assets/finalize_upload_task_response.xml +7 -0
  259. data/spec/assets/indy_disk_attach_request.xml +3 -0
  260. data/spec/assets/indy_disk_attach_task.xml +6 -0
  261. data/spec/assets/indy_disk_attach_task_error.xml +6 -0
  262. data/spec/assets/indy_disk_create_error.xml +1 -0
  263. data/spec/assets/indy_disk_create_request.xml +4 -0
  264. data/spec/assets/indy_disk_create_response.xml +19 -0
  265. data/spec/assets/indy_disk_delete_task.xml +6 -0
  266. data/spec/assets/indy_disk_detach_request.xml +3 -0
  267. data/spec/assets/indy_disk_detach_task.xml +6 -0
  268. data/spec/assets/indy_disk_response.xml +11 -0
  269. data/spec/assets/instantiated_suspended_vapp_response.xml +209 -0
  270. data/spec/assets/instantiated_vapp_delelete_done_task.xml +5 -0
  271. data/spec/assets/instantiated_vapp_delelete_running_task.xml +6 -0
  272. data/spec/assets/instantiated_vapp_network_config_add_network_request.xml +36 -0
  273. data/spec/assets/instantiated_vapp_network_config_modify_network_task_success.xml +6 -0
  274. data/spec/assets/instantiated_vapp_network_config_remove_network_request.xml +6 -0
  275. data/spec/assets/instantiated_vapp_network_config_section_response.xml +17 -0
  276. data/spec/assets/instantiated_vapp_off_response.xml +206 -0
  277. data/spec/assets/instantiated_vapp_on_response.xml +205 -0
  278. data/spec/assets/instantiated_vapp_power_task_running.xml +6 -0
  279. data/spec/assets/instantiated_vapp_power_task_success.xml +6 -0
  280. data/spec/assets/instantiated_vapp_response.xml +205 -0
  281. data/spec/assets/instantiated_vm_change_task_running.xml +6 -0
  282. data/spec/assets/instantiated_vm_change_task_success.xml +6 -0
  283. data/spec/assets/instantiated_vm_cpu_response.xml +11 -0
  284. data/spec/assets/instantiated_vm_insert_media_task_done.xml +6 -0
  285. data/spec/assets/instantiated_vm_memory_response.xml +11 -0
  286. data/spec/assets/instantiated_vm_modify_task_running.xml +6 -0
  287. data/spec/assets/instantiated_vm_modify_task_success.xml +5 -0
  288. data/spec/assets/instantiated_vm_network_section_response.xml +11 -0
  289. data/spec/assets/instantiated_vm_response.xml +149 -0
  290. data/spec/assets/media_add_to_catalog_request.xml +5 -0
  291. data/spec/assets/media_add_to_catalog_response.xml +8 -0
  292. data/spec/assets/media_delete_task_done.xml +6 -0
  293. data/spec/assets/media_upload_pending_response.xml +13 -0
  294. data/spec/assets/media_upload_request.xml +2 -0
  295. data/spec/assets/metadata_set_request.xml +3 -0
  296. data/spec/assets/metadata_set_task_done.xml +6 -0
  297. data/spec/assets/org_network_response.xml +22 -0
  298. data/spec/assets/reconfigure_vm_request.xml +133 -0
  299. data/spec/assets/reconfigure_vm_task.xml +8 -0
  300. data/spec/assets/session.xml +7 -0
  301. data/spec/assets/test-config.yml +38 -0
  302. data/spec/assets/undeploy_params.xml +1 -0
  303. data/spec/assets/vapp_template_catalog_resolver_response.xml +3 -0
  304. data/spec/assets/vapp_template_delelete_done_task.xml +5 -0
  305. data/spec/assets/vapp_template_delelete_running_task.xml +6 -0
  306. data/spec/assets/vapp_template_instantiate_request.xml +8 -0
  307. data/spec/assets/vapp_template_instantiate_with_locality_request.xml +14 -0
  308. data/spec/assets/vapp_template_no_disk_response.xml +27 -0
  309. data/spec/assets/vapp_template_ready_response.xml +79 -0
  310. data/spec/assets/vapp_template_upload_complete.xml +28 -0
  311. data/spec/assets/vapp_template_upload_failed.xml +28 -0
  312. data/spec/assets/vapp_template_upload_request.xml +4 -0
  313. data/spec/assets/vapp_template_upload_response.xml +25 -0
  314. data/spec/assets/vcloud_response.xml +56 -0
  315. data/spec/assets/vdc_response.xml +57 -0
  316. data/spec/spec_helper.rb +107 -0
  317. data/spec/unit/client_response.rb +700 -0
  318. data/spec/unit/client_spec.rb +1152 -0
  319. metadata +498 -0
@@ -0,0 +1,17 @@
1
+ module VCloudSdk
2
+
3
+ class Config
4
+ class << self
5
+ attr_accessor :logger
6
+ attr_accessor :rest_logger
7
+ attr_accessor :rest_throttle
8
+
9
+ def configure(config)
10
+ @logger = config["logger"] || @logger || Logger.new(STDOUT)
11
+ @rest_logger = config["rest_logger"] || @logger
12
+ @rest_throttle = config["rest_throttle"]
13
+ end
14
+ end
15
+ end
16
+
17
+ end
@@ -0,0 +1,163 @@
1
+ require "base64"
2
+ require "rest_client"
3
+
4
+ module VCloudSdk
5
+ module Connection
6
+
7
+ class Connection
8
+ SECURITY_CHECK = "/cloud/security_check"
9
+ ACCEPT = "application/*+xml;version=5.1"
10
+
11
+ def initialize(hostname_port, organization, request_timeout = nil,
12
+ rest_client = nil, site = nil, file_uploader = nil)
13
+ @organization = organization
14
+ @logger = Config.logger
15
+ @rest_logger = Config.rest_logger
16
+ @rest_throttle = Config.rest_throttle
17
+ rest_client = RestClient unless rest_client
18
+ rest_client.log = @rest_logger
19
+ request_timeout = 60 unless request_timeout
20
+ @site = site.nil? ? rest_client::Resource.new(hostname_port,
21
+ :timeout => request_timeout) : site
22
+ @file_uploader = file_uploader.nil? ? FileUploader : file_uploader
23
+ end
24
+
25
+ def connect(username, password)
26
+ login = "#{username}@#{@organization}"
27
+ login_password = "#{login}:#{password}"
28
+ auth_header_value = "Basic #{Base64.encode64(login_password)}"
29
+ response = @site["/api/sessions"].post(
30
+ {:Authorization=>auth_header_value, :Accept=>ACCEPT})
31
+ @logger.debug(response)
32
+ @cookies = response.cookies
33
+ unless @cookies["vcloud-token"].gsub!("+", "%2B").nil?
34
+ @logger.debug("@cookies: #{@cookies.inspect}.")
35
+ end
36
+ VCloudSdk::Xml::WrapperFactory.wrap_document(response)
37
+ end
38
+
39
+ # GET an object from REST and return the unmarshalled object
40
+ def get(destination)
41
+ @rest_logger.info "#{__method__.to_s.upcase} #{delay}\t " +
42
+ "#{self.class.get_href(destination)}"
43
+ sleep(delay)
44
+ response = @site[get_nested_resource(destination)].get({
45
+ :Accept=>ACCEPT,
46
+ :cookies=>@cookies
47
+ })
48
+ @rest_logger.debug(response)
49
+ Xml::WrapperFactory.wrap_document(response)
50
+ end
51
+
52
+ def post(destination, data, content_type = '*/*')
53
+ @rest_logger.info "#{__method__.to_s.upcase} #{delay}\t " +
54
+ "#{self.class.get_href(destination)}"
55
+ sleep(delay)
56
+ if content_type == "*/*"
57
+ @rest_logger.debug(
58
+ "Warning: content type not specified. Default to '*/*'")
59
+ end
60
+ @rest_logger.info("#{__method__.to_s.upcase} data:#{data.to_s}")
61
+ response = @site[get_nested_resource(destination)].post(data.to_s, {
62
+ :Accept=>ACCEPT,
63
+ :cookies=>@cookies,
64
+ :content_type=>content_type
65
+ })
66
+ raise ApiRequestError if http_error?(response)
67
+ @rest_logger.debug(response)
68
+ Xml::WrapperFactory.wrap_document(response)
69
+ end
70
+
71
+ def put(destination, data, content_type = "*/*")
72
+ @rest_logger.info "#{__method__.to_s.upcase} #{delay}\t " +
73
+ "#{self.class.get_href(destination)}"
74
+ sleep(delay)
75
+ unless content_type
76
+ @rest_logger.debug(
77
+ "Warning: content type not specified. Default to '*/*'")
78
+ end
79
+ @rest_logger.info("#{__method__.to_s.upcase} data:#{data.to_s}")
80
+ response = @site[get_nested_resource(destination)].put(data.to_s, {
81
+ :Accept=>ACCEPT,
82
+ :cookies=>@cookies,
83
+ :content_type=>content_type
84
+ })
85
+ raise ApiRequestError if http_error?(response)
86
+ @rest_logger.debug((response && !response.strip.empty?) ?
87
+ response : "Received empty response.")
88
+ if response && !response.strip.empty?
89
+ Xml::WrapperFactory.wrap_document(response)
90
+ else
91
+ nil
92
+ end
93
+ end
94
+
95
+ def delete(destination)
96
+ @rest_logger.info "#{__method__.to_s.upcase} #{delay}\t " +
97
+ "#{self.class.get_href(destination)}"
98
+ sleep(delay)
99
+ response = @site[get_nested_resource(destination)].delete({
100
+ :Accept=>ACCEPT,
101
+ :cookies=>@cookies
102
+ })
103
+ @rest_logger.debug(response)
104
+ if response && !response.strip.empty?
105
+ Xml::WrapperFactory.wrap_document(response)
106
+ else
107
+ nil
108
+ end
109
+ end
110
+
111
+ # The PUT method in rest-client cannot handle large files because it
112
+ # does not use the underlying Net::HTTP body_stream attribute.
113
+ # Without that, it will not use chunked transfer-encoding. It also
114
+ # reads in the whole file at once.
115
+ def put_file(destination, file)
116
+ href = self.class.get_href(destination)
117
+ @rest_logger.info "#{__method__.to_s.upcase}\t#{href}"
118
+ response = @file_uploader.upload(href, file, @cookies)
119
+ response
120
+ end
121
+
122
+ private
123
+ def log_exceptions(e)
124
+ if e.is_a? RestClient::Exception
125
+ @logger.error("HTTP Code: #{e.http_code}")
126
+ @logger.error("HTTP Body: #{e.http_body}")
127
+ @logger.error("Message: #{e.message}")
128
+ @logger.error("Response: #{e.response}")
129
+ end
130
+ end
131
+
132
+ def delay()
133
+ @rest_throttle["min"] + rand(@rest_throttle["max"] -
134
+ @rest_throttle["min"])
135
+ end
136
+
137
+ def get_nested_resource(destination)
138
+ href = self.class.get_href(destination)
139
+ if href.is_a?(String)
140
+ URI.parse(href).path
141
+ else
142
+ raise ApiError,
143
+ "href is not a string. href:#{href.inspect}, dst:#{destination}."
144
+ end
145
+ end
146
+
147
+ def http_error?(response)
148
+ response.respond_to?(:code) && response.code.to_i >= 400
149
+ end
150
+
151
+ class << self
152
+ def get_href(destination)
153
+ if destination.is_a?(Xml::Wrapper) && destination.href
154
+ destination.href
155
+ else
156
+ destination
157
+ end
158
+ end
159
+ end
160
+ end
161
+
162
+ end
163
+ end
@@ -0,0 +1,43 @@
1
+ module VCloudSdk
2
+ module Connection
3
+
4
+ class FileUploader
5
+ class << self
6
+ def upload(href, file, cookies = nil, http_method = :Put)
7
+ request = create_request(href, file, cookies, http_method)
8
+ net = create_connection(href)
9
+ net.start do |http|
10
+ response = http.request(request) {
11
+ |http_response| http_response.read_body }
12
+ raise ApiRequestError "Error Response: #{response.code}" if
13
+ response.code.to_i >= 400
14
+ response
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def create_request(href, file, cookies = nil, http_method = :Put)
21
+ headers = cookies ? {"Cookie" => cookies.map { |(key, val)|
22
+ "#{key.to_s}=#{CGI::unescape(val)}" }.sort.join(";")} : {}
23
+ # Ruby 1.8 does not have size on the file object
24
+ headers["Content-Length"] = File.size(file.path).to_s
25
+ headers["Transfer-Encoding"] = "chunked"
26
+ request_type = Net::HTTP.const_get(http_method)
27
+ request = request_type.new(href, headers)
28
+ request.body_stream = file
29
+ request
30
+ end
31
+
32
+ def create_connection(href)
33
+ uri = URI::parse(href)
34
+ net = Net::HTTP.new(uri.host, uri.port)
35
+ net.use_ssl = uri.is_a?(URI::HTTPS)
36
+ net.verify_mode = OpenSSL::SSL::VERIFY_NONE if net.use_ssl?
37
+ net
38
+ end
39
+ end
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,21 @@
1
+ module VCloudSdk
2
+
3
+ class CloudError < RuntimeError; end
4
+
5
+ class VappSuspendedError < CloudError; end
6
+ class VmSuspendedError < CloudError; end
7
+ class VappPoweredOffError < CloudError; end
8
+
9
+ class ObjectNotFoundError < CloudError; end
10
+
11
+ class DiskNotFoundError < ObjectNotFoundError; end
12
+ class CatalogMediaNotFoundError < ObjectNotFoundError; end
13
+
14
+ class ApiError < CloudError; end
15
+
16
+ class ApiRequestError < ApiError; end
17
+ class ApiTimeoutError < ApiError; end
18
+
19
+ class CpiError < CloudError; end
20
+
21
+ end
@@ -0,0 +1,45 @@
1
+ module VCloudSdk
2
+
3
+ class OVFDirectory
4
+ def initialize(directory)
5
+ raise CloudError, "Requires string-like object for directory" unless
6
+ directory.respond_to?(:to_s)
7
+ @directory = directory
8
+ @logger = Config.logger
9
+
10
+ # Quick sanity check. Raise an exception if OVF file not there
11
+ self.ovf_file
12
+ end
13
+
14
+ def ovf_file_path
15
+ ovf_files = Dir[File.join(@directory, "*.ovf")]
16
+ if ovf_files.length > 1
17
+ @logger.error "More than one OVF file found in dir #{@directory}"
18
+ raise "More than one OVF file found in directory #{@directory}"
19
+ end
20
+ if ovf_files.length < 1
21
+ @logger.error "No OVF file found in directory #{@directory}"
22
+ raise "No OVF file found in directory #{@directory}"
23
+ end
24
+ ovf_files.pop
25
+ end
26
+
27
+ def ovf_file
28
+ File.new(ovf_file_path)
29
+ end
30
+
31
+ def vmdk_file_path(filename)
32
+ file_path = File.join(@directory, filename)
33
+ unless File.exist? file_path
34
+ @logger.error "#{filename} not found in #{@directory}"
35
+ raise "#{filename} not found in #{@directory}"
36
+ end
37
+ file_path
38
+ end
39
+
40
+ def vmdk_file(filename)
41
+ File.new(self.vmdk_file_path(filename), "rb")
42
+ end
43
+ end
44
+
45
+ end
@@ -0,0 +1,21 @@
1
+ module VCloudSdk
2
+
3
+ class Util
4
+ class << self
5
+ def retry_operation(op, attempts, backoff, &b)
6
+ attempts.times do |attempt|
7
+ begin
8
+ return b.call
9
+ rescue ApiError => e
10
+ raise e if attempt >= attempts-1
11
+ delay = backoff ** attempt
12
+ Config.logger.error("Retry-attempt #{attempt+1}/#{attempts} " +
13
+ "failed to #{op}, retrying in #{delay} seconds.\t#{e}")
14
+ sleep (delay)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,3 @@
1
+ module VCloudSdk
2
+ VERSION = "0.4.8"
3
+ end
@@ -0,0 +1,427 @@
1
+ module VCloudSdk
2
+ module Xml
3
+ VCLOUD_NAMESPACE = "http://www.vmware.com/vcloud/v1.5"
4
+
5
+ OVF = "http://schemas.dmtf.org/ovf/envelope/1"
6
+
7
+ RASD = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/" +
8
+ "CIM_ResourceAllocationSettingData"
9
+
10
+ # http://blogs.vmware.com/vapp/2009/11/virtual-hardware-in-ovf-part-1.html
11
+ HARDWARE_TYPE = {
12
+ :CPU => "3",
13
+ :MEMORY => "4",
14
+ :SCSI_CONTROLLER => "6",
15
+ :NIC => "10",
16
+ :HARD_DISK => "17"
17
+ }
18
+
19
+ RASD_TYPES = {
20
+ :RESOURCE_TYPE => "ResourceType",
21
+ :HOST_RESOURCE => "HostResource",
22
+ :INSTANCE_ID => "InstanceID",
23
+ :RESOURCE_SUB_TYPE => "ResourceSubType",
24
+ :ADDRESS_ON_PARENT => "AddressOnParent",
25
+ :ADDRESS => "Address",
26
+ :CONNECTION => "Connection",
27
+ :PARENT => "Parent"
28
+ }
29
+
30
+ RESOURCE_SUB_TYPE = {
31
+ :VMXNET3 => "VMXNET3"
32
+ }
33
+
34
+ BUS_SUB_TYPE = {
35
+ :LSILOGIC => "lsilogic"
36
+ }
37
+
38
+ IMAGE_TYPES = {
39
+ :ISO => "iso",
40
+ :FLOPPY => "floppy"
41
+ }
42
+
43
+ IP_ADDRESSING_MODE = {
44
+ :NONE => "NONE",
45
+ :MANUAL => "MANUAL",
46
+ :POOL => "POOL",
47
+ :DHCP => "DHCP"
48
+ }
49
+
50
+ FENCE_MODES = {
51
+ :BRIDGED => "bridged",
52
+ :ISOLATED => "isolated",
53
+ :NAT_ROUTED => "natRouted"
54
+ }
55
+
56
+ HOST_RESOURCE_ATTRIBUTE = {
57
+ :CAPACITY => "capacity",
58
+ :BUS_SUB_TYPE => "busSubType",
59
+ :BUS_TYPE => "busType"
60
+ }
61
+
62
+ TASK_STATUS = {
63
+ :QUEUED => "queued",
64
+ :RUNNING => "running",
65
+ :SUCCESS => "success",
66
+ :ERROR => "error",
67
+ :CANCELED => "canceled",
68
+ :PRE_RUNNING => "pre-running",
69
+ :ABORTED => "aborted"
70
+ }
71
+
72
+ MAX_DISK_ID = 15
73
+
74
+ MEDIA_TYPE = {
75
+ :ENTITY => "application/vnd.vmware.vcloud.entity+xml",
76
+ :ORGANIZATION => "application/vnd.vmware.vcloud.org+xml",
77
+ :ORGANIZATION_LIST => "application/vnd.vmware.vcloud.orgList+xml",
78
+ :VDC => "application/vnd.vmware.vcloud.vdc+xml",
79
+ :UPLOAD_VAPP_TEMPLATE_PARAMS =>
80
+ "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml",
81
+ :INSTANTIATE_OVF_PARAMS =>
82
+ "application/vnd.vmware.vcloud.instantiateOvfParams+xml",
83
+ :INSTANTIATE_VAPP_TEMPLATE_PARAMS =>
84
+ "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml",
85
+ :CLONE_VAPP_PARAMS =>
86
+ "application/vnd.vmware.vcloud.cloneVAppParams+xml",
87
+ :CLONE_VAPP_TEMPLATE_PARAMS =>
88
+ "application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml",
89
+ :CLONE_MEDIA_PARAMS =>
90
+ "application/vnd.vmware.vcloud.cloneMediaParams+xml",
91
+ :DEPLOY_VAPP_PARAMS =>
92
+ "application/vnd.vmware.vcloud.deployVAppParams+xml",
93
+ :UNDEPLOY_VAPP_PARAMS =>
94
+ "application/vnd.vmware.vcloud.undeployVAppParams+xml",
95
+ :UNDEPLOY_VAPP_PARAMS_EXTENDED =>
96
+ "application/vnd.vmware.vcloud.undeployVAppParamsExtended+xml",
97
+ :CAPTURE_VAPP_PARAMS =>
98
+ "application/vnd.vmware.vcloud.captureVAppParams+xml",
99
+ :COMPOSE_VAPP_PARAMS =>
100
+ "application/vnd.vmware.vcloud.composeVAppParams+xml",
101
+ :VAPP_TEMPLATE => "application/vnd.vmware.vcloud.vAppTemplate+xml",
102
+ :VAPP => "application/vnd.vmware.vcloud.vApp+xml",
103
+ :VM => "application/vnd.vmware.vcloud.vm+xml",
104
+ :VMS => "application/vnd.vmware.vcloud.vms+xml",
105
+ :MEDIA => "application/vnd.vmware.vcloud.media+xml",
106
+ :VAPP_NETWORK => "application/vnd.vmware.vcloud.vAppNetwork+xml",
107
+ :ORG_NETWORK => "application/vnd.vmware.vcloud.orgNetwork+xml",
108
+ :NETWORK => "application/vnd.vmware.vcloud.network+xml",
109
+ :TASK => "application/vnd.vmware.vcloud.task+xml",
110
+ :TASKS_LIST => "application/vnd.vmware.vcloud.tasksList+xml",
111
+ :CATALOG => "application/vnd.vmware.vcloud.catalog+xml",
112
+ :CATALOG_ITEM => "application/vnd.vmware.vcloud.catalogItem+xml",
113
+ :ERROR => "application/vnd.vmware.vcloud.error+xml",
114
+ :SCREEN_TICKET => "application/vnd.vmware.vcloud.screenTicket+xml",
115
+ :CONTROL_ACCESS => "application/vnd.vmware.vcloud.controlAccess+xml",
116
+ :MEDIA_INSERT_EJECT_PARAMS =>
117
+ "application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml",
118
+ :QUESTION => "application/vnd.vmware.vcloud.vmPendingQuestion+xml",
119
+ :ANSWER => "application/vnd.vmware.vcloud.vmPendingAnswer+xml",
120
+ :RECOMPOSE_VAPP_PARAMS =>
121
+ "application/vnd.vmware.vcloud.recomposeVAppParams+xml",
122
+ :RELOCATE_VM_PARAMS =>
123
+ "application/vnd.vmware.vcloud.relocateVmParams+xml",
124
+ :OWNER => "application/vnd.vmware.vcloud.owner+xml",
125
+ :REFERENCES => "application/vnd.vmware.vcloud.query.references+xml",
126
+ :RECORDS => "application/vnd.vmware.vcloud.query.records+xml",
127
+ :IDRECORDS => "application/vnd.vmware.vcloud.query.idrecords+xml",
128
+ :QUERY_LIST => "application/vnd.vmware.vcloud.query.queryList+xml",
129
+ :SESSION => "application/vnd.vmware.vcloud.session+xml",
130
+ :SHADOW_VMS => "application/vnd.vmware.vcloud.shadowVms+xml",
131
+ :METADATA => "application/vnd.vmware.vcloud.metadata+xml",
132
+ :METADATA_ITEM_VALUE =>
133
+ "application/vnd.vmware.vcloud.metadata.value+xml",
134
+ :ENTITY_REFERENCE =>
135
+ "application/vnd.vmware.vcloud.entity.reference+xml",
136
+ :DISK => "application/vnd.vmware.vcloud.disk+xml",
137
+ :DISK_CREATE_PARAMS =>
138
+ "application/vnd.vmware.vcloud.diskCreateParams+xml",
139
+ :DISK_ATTACH_DETACH_PARAMS =>
140
+ "application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml",
141
+ :VDC_STORAGE_CLASS =>
142
+ "application/vnd.vmware.vcloud.vdcStorageClass+xml",
143
+ :VDC_STORAGE_PROFILE =>
144
+ "application/vnd.vmware.vcloud.vdcStorageProfile+xml",
145
+ :ALLOCATED_NETWORK_IPS =>
146
+ "application/vnd.vmware.vcloud.allocatedNetworkAddress+xml",
147
+ :LEASE_SETTINGS_SECTION =>
148
+ "application/vnd.vmware.vcloud.leaseSettingsSection+xml",
149
+ :STARTUP_SECTION =>
150
+ "application/vnd.vmware.vcloud.startupSection+xml",
151
+ :NETWORK_SECTION =>
152
+ "application/vnd.vmware.vcloud.networkSection+xml",
153
+ :NETWORK_CONFIG_SECTION =>
154
+ "application/vnd.vmware.vcloud.networkConfigSection+xml",
155
+ :PRODUCT_SECTIONS =>
156
+ "application/vnd.vmware.vcloud.productSections+xml",
157
+ :NETWORK_CONNECTION_SECTION =>
158
+ "application/vnd.vmware.vcloud.networkConnectionSection+xml",
159
+ :OPERATING_SYSTEM_SECTION =>
160
+ "application/vnd.vmware.vcloud.operatingSystemSection+xml",
161
+ :VIRTUAL_HARDWARE_SECTION =>
162
+ "application/vnd.vmware.vcloud.virtualHardwareSection+xml",
163
+ :RUNTIME_INFO_SECTION =>
164
+ "application/vnd.vmware.vcloud.runtimeInfoSection+xml",
165
+ :GUEST_CUSTOMIZATION_SECTION =>
166
+ "application/vnd.vmware.vcloud.guestCustomizationSection+xml",
167
+ :CUSTOMIZATION_SECTION =>
168
+ "application/vnd.vmware.vcloud.customizationSection+xml",
169
+ :RASD_ITEM => "application/vnd.vmware.vcloud.rasdItem+xml",
170
+ :RASD_ITEMS_LIST => "application/vnd.vmware.vcloud.rasdItemsList+xml",
171
+ :OVF => "text/xml",
172
+ :APPLICATION_XML => "application/*+xml"
173
+ }
174
+
175
+ ADMIN_MEDIA_TYPE = {
176
+ :ADMIN_MEDIA_TYPE_PREFIX => "application/vnd.vmware.admin.",
177
+ :VCLOUD => "application/vnd.vmware.admin.vcloud+xml",
178
+ :PROVIDER_VDC => "application/vnd.vmware.admin.providervdc+xml",
179
+ :ADMIN_VDC => "application/vnd.vmware.admin.vdc+xml",
180
+ :VDC => "application/vnd.vmware.vcloud.vdc+xml",
181
+ :VAPP_TEMPLATE => "application/vnd.vmware.vcloud.vAppTemplate+xml",
182
+ :VAPP => "application/vnd.vmware.vcloud.vApp+xml",
183
+ :VM => "application/vnd.vmware.vcloud.vm+xml",
184
+ :MEDIA => "application/vnd.vmware.vcloud.media+xml",
185
+ :SYSTEM_ADMIN_ORGANIZATION =>
186
+ "application/vnd.vmware.admin.systemOrganization+xml",
187
+ :ADMIN_ORGANIZATION => "application/vnd.vmware.admin.organization+xml",
188
+ :ORGANIZATION => "application/vnd.vmware.vcloud.org+xml",
189
+ :TASKS_LIST => "application/vnd.vmware.vcloud.tasksList+xml",
190
+ :USER => "application/vnd.vmware.admin.user+xml",
191
+ :GROUP => "application/vnd.vmware.admin.group+xml",
192
+ :ROLE => "application/vnd.vmware.admin.role+xml",
193
+ :RIGHT => "application/vnd.vmware.admin.right+xml",
194
+ :ADMIN_CATALOG => "application/vnd.vmware.admin.catalog+xml",
195
+ :CATALOG => "application/vnd.vmware.vcloud.catalog+xml",
196
+ :ADMIN_CATALOG_ITEM => "application/vnd.vmware.admin.catalogItem+xml",
197
+ :CATALOG_ITEM => "application/vnd.vmware.vcloud.catalogItem+xml",
198
+ :ADMIN_NETWORK => "application/vnd.vmware.admin.network+xml",
199
+ :NETWORK => "application/vnd.vmware.vcloud.network+xml",
200
+ :NETWORK_POOL => "application/vnd.vmware.admin.networkPool+xml",
201
+ :CATALOG_PUBLISH =>
202
+ "application/vnd.vmware.admin.publishCatalogParams+xml",
203
+ :OWNER => "application/vnd.vmware.vcloud.owner+xml",
204
+ :ORG_SETTINGS => "application/vnd.vmware.admin.orgSettings+xml",
205
+ :VAPP_TEMPLATE_LEASE_SETTINGS =>
206
+ "application/vnd.vmware.admin.vAppTemplateLeaseSettings+xml",
207
+ :VAPP_LEASE_SETTINGS =>
208
+ "application/vnd.vmware.admin.vAppLeaseSettings+xml",
209
+ :EMAIL_SETTINGS =>
210
+ "application/vnd.vmware.admin.organizationEmailSettings+xml",
211
+ :GENERAL_SETTINGS =>
212
+ "application/vnd.vmware.admin.organizationGeneralSettings+xml",
213
+ :ORGANIZATION_PASSWORD_POLICY_SETTINGS =>
214
+ "application/vnd.vmware.admin.organizationPasswordPolicySettings+xml",
215
+ }
216
+
217
+ XML_TYPE = {
218
+ :ADMINALLOCATEDEXTIPRECORD => "AdminAllocatedExtIpRecord",
219
+ :ADMINCATALOG => "AdminCatalog",
220
+ :ADMINCATALOGITEMRECORD => "AdminCatalogItemRecord",
221
+ :ADMINCATALOGRECORD => "AdminCatalogRecord",
222
+ :ADMINGROUPRECORD => "AdminGroupRecord",
223
+ :ADMINMEDIARECORD => "AdminMediaRecord",
224
+ :ADMINORG => "AdminOrg",
225
+ :ADMINORGNETWORKRECORD => "AdminOrgNetworkRecord",
226
+ :ADMINSHADOWVMRECORD => "AdminShadowVmRecord",
227
+ :ADMINTASKRECORD => "AdminTaskRecord",
228
+ :ADMINUSERRECORD => "AdminUserRecord",
229
+ :ADMINVAPPNETWORKRECORD => "AdminVAppNetworkRecord",
230
+ :ADMINVAPPRECORD => "AdminVAppRecord",
231
+ :ADMINVAPPREFERENCE => "AdminVAppReference",
232
+ :ADMINVAPPREFERENCES => "AdminVAppReferences",
233
+ :ADMINVAPPTEMPLATERECORD => "AdminVAppTemplateRecord",
234
+ :ADMINVDC => "AdminVdc",
235
+ :ADMINVDCRECORD => "AdminVdcRecord",
236
+ :ADMINVDCREFERENCE => "AdminVdcReference",
237
+ :ADMINVDCREFERENCES => "AdminVdcReferences",
238
+ :ADMINVMRECORD => "AdminVmRecord",
239
+ :ALLEULASACCEPTED => "AllEULAsAccepted",
240
+ :ALLOCATEDEXTIPRECORD => "AllocatedExtIpRecord",
241
+ :BLOCKINGTASKRECORD => "BlockingTaskRecord",
242
+ :BLOCKINGTASKREFERENCE => "BlockingTaskReference",
243
+ :BLOCKINGTASKREFERENCES => "BlockingTaskReferences",
244
+ :CAPTUREVAPPPARAMS => "CaptureVAppParams",
245
+ :CATALOG => "Catalog",
246
+ :CATALOGITEM => "CatalogItem",
247
+ :CATALOGITEMRECORD => "CatalogItemRecord",
248
+ :CATALOGITEMREFERENCE => "CatalogItemReference",
249
+ :CATALOGITEMREFERENCES => "CatalogItemReferences",
250
+ :CATALOGRECORD => "CatalogRecord",
251
+ :CATALOGREFERENCE => "CatalogReference",
252
+ :CATALOGREFERENCES => "CatalogReferences",
253
+ :CELLRECORD => "CellRecord",
254
+ :CLONEMEDIAPARAMS => "CloneMediaParams",
255
+ :CLONEVAPPPARAMS => "CloneVAppParams",
256
+ :CLONEVAPPTEMPLATEPARAMS => "CloneVAppTemplateParams",
257
+ :COMPOSEVAPPPARAMS => "ComposeVAppParams",
258
+ :CONTROLACCESSPARAMS => "ControlAccessParams",
259
+ :CUSTOMIZATIONSECTION => "CustomizationSection",
260
+ :DATASTOREPROVIDERVDCRELATIONRECORD =>
261
+ "DatastoreProviderVdcRelationRecord",
262
+ :DATASTORERECORD => "DatastoreRecord",
263
+ :DATASTOREREFERENCE => "DatastoreReference",
264
+ :DATASTOREREFERENCES => "DatastoreReferences",
265
+ :DEPLOYVAPPPARAMS => "DeployVAppParams",
266
+ :DHCPSERVICE => "DhcpService",
267
+ :DVSWITCHRECORD => "DvSwitchRecord",
268
+ :ENTITY => "Entity",
269
+ :ERROR => "Error",
270
+ :EVENTRECORD => "EventRecord",
271
+ :EXTERNALNETWORK => "ExternalNetwork",
272
+ :FILE => "File",
273
+ :FIREWALLSERVICE => "FirewallService",
274
+ :GENERALORGSETTINGS => "GeneralOrgSettings",
275
+ :GROUP => "Group",
276
+ :GROUPRECORD => "GroupRecord",
277
+ :GROUPREFERENCE => "GroupReference",
278
+ :GROUPREFERENCES => "GroupReferences",
279
+ :GUESTCUSTOMIZATIONSECTION => "GuestCustomizationSection",
280
+ :HOSTRECORD => "HostRecord",
281
+ :HOSTREFERENCE => "HostReference",
282
+ :HOSTREFERENCES => "HostReferences",
283
+ :INSTANTIATEOVFPARAMS => "InstantiateOvfParams",
284
+ :INSTANTIATEVAPPTEMPLATEPARAMS => "InstantiateVAppTemplateParams",
285
+ :IPSECVPNLOCALPEER => "IpsecVpnLocalPeer",
286
+ :IPSECVPNPEER => "IpsecVpnPeer",
287
+ :IPSECVPNREMOTEPEER => "IpsecVpnRemotePeer",
288
+ :IPSECVPNSERVICE => "IpsecVpnService",
289
+ :IPSECVPNTHIRDPARTYPEER => "IpsecVpnThirdPartyPeer",
290
+ :ITEM => "Item",
291
+ :LEASESETTINGSSECTION => "LeaseSettingsSection",
292
+ :LINK => "Link",
293
+ :MEDIA => "Media",
294
+ :MEDIAINSERTOREJECTPARAMS => "MediaInsertOrEjectParams",
295
+ :MEDIARECORD => "MediaRecord",
296
+ :MEDIAREFERENCE => "MediaReference",
297
+ :MEDIAREFERENCES => "MediaReferences",
298
+ :METADATA => "Metadata",
299
+ :METADATAVALUE => "MetadataValue",
300
+ :NATSERVICE => "NatService",
301
+ :NETWORKASSIGNMENT => "NetworkAssignment",
302
+ :NETWORKCONFIGSECTION => "NetworkConfigSection",
303
+ :NETWORKCONNECTION => "NetworkConnection",
304
+ :NETWORKCONNECTIONSECTION => "NetworkConnectionSection",
305
+ :NETWORKPOOLRECORD => "NetworkPoolRecord",
306
+ :NETWORKPOOLREFERENCE => "NetworkPoolReference",
307
+ :NETWORKPOOLREFERENCES => "NetworkPoolReferences",
308
+ :NETWORKRECORD => "NetworkRecord",
309
+ :NETWORKREFERENCE => "NetworkReference",
310
+ :NETWORKREFERENCES => "NetworkReferences",
311
+ :NETWORKSERVICE => "NetworkService",
312
+ :ORG => "Org",
313
+ :ORGEMAILSETTINGS => "OrgEmailSettings",
314
+ :ORGLIST => "OrgList",
315
+ :ORGNETWORK => "OrgNetwork",
316
+ :ORGNETWORKRECORD => "OrgNetworkRecord",
317
+ :ORGNETWORKREFERENCE => "OrgNetworkReference",
318
+ :ORGNETWORKREFERENCES => "OrgNetworkReferences",
319
+ :ORGPASSWORDPOLICYSETTINGS => "OrgPasswordPolicySettings",
320
+ :ORGRECORD => "OrgRecord",
321
+ :ORGREFERENCE => "OrgReference",
322
+ :ORGREFERENCES => "OrgReferences",
323
+ :ORGSETTINGS => "OrgSettings",
324
+ :ORGVAPPTEMPLATELEASESETTINGS => "OrgVAppTemplateLeaseSettings",
325
+ :ORGVDCRECORD => "OrgVdcRecord",
326
+ :ORGVDCREFERENCE => "OrgVdcReference",
327
+ :ORGVDCREFERENCES => "OrgVdcReferences",
328
+ :ORGVDCRESOURCEPOOLRELATIONRECORD => "OrgVdcResourcePoolRelationRecord",
329
+ :OWNER => "Owner",
330
+ :PORTGROUPRECORD => "PortgroupRecord",
331
+ :PRODUCTSECTIONLIST => "ProductSectionList",
332
+ :PROVIDERVDC => "ProviderVdc",
333
+ :PROVIDERVDCRESOURCEPOOLRELATIONRECORD =>
334
+ "ProviderVdcResourcePoolRelationRecord",
335
+ :PUBLISHCATALOGPARAMS => "PublishCatalogParams",
336
+ :QUERYLIST => "QueryList",
337
+ :QUERYRESULTRECORDS => "QueryResultRecords",
338
+ :RASDITEMSLIST => "RasdItemsList",
339
+ :RECOMPOSEVAPPPARAMS => "RecomposeVAppParams",
340
+ :RECORD => "Record",
341
+ :REFERENCE => "Reference",
342
+ :REFERENCES => "References",
343
+ :RELOCATEPARAMS => "RelocateParams",
344
+ :RESOURCEENTITY => "ResourceEntity",
345
+ :RESOURCEPOOLRECORD => "ResourcePoolRecord",
346
+ :RIGHT => "Right",
347
+ :RIGHTRECORD => "RightRecord",
348
+ :RIGHTREFERENCE => "RightReference",
349
+ :RIGHTREFERENCES => "RightReferences",
350
+ :ROLE => "Role",
351
+ :ROLERECORD => "RoleRecord",
352
+ :ROLEREFERENCE => "RoleReference",
353
+ :ROLEREFERENCES => "RoleReferences",
354
+ :RUNTIMEINFOSECTION => "RuntimeInfoSection",
355
+ :SCREENTICKET => "ScreenTicket",
356
+ :SESSION => "Session",
357
+ :SHADOWVMREFERENCES => "ShadowVMReferences",
358
+ :STATICROUTINGSERVICE => "StaticRoutingService",
359
+ :STRANDEDUSERRECORD => "StrandedUserRecord",
360
+ :TASK => "Task",
361
+ :TASKRECORD => "TaskRecord",
362
+ :TASKREFERENCE => "TaskReference",
363
+ :TASKREFERENCES => "TaskReferences",
364
+ :TASKSLIST => "TasksList",
365
+ :UNDEPLOYVAPPPARAMS => "UndeployVAppParams",
366
+ :UPLOADVAPPTEMPLATEPARAMS => "UploadVAppTemplateParams",
367
+ :USER => "User",
368
+ :USERRECORD => "UserRecord",
369
+ :USERREFERENCE => "UserReference",
370
+ :USERREFERENCES => "UserReferences",
371
+ :VAPP => "VApp",
372
+ :VAPPLEASESETTINGS => "VAppLeaseSettings",
373
+ :VAPPNETWORK => "VAppNetwork",
374
+ :VAPPNETWORKRECORD => "VAppNetworkRecord",
375
+ :VAPPNETWORKREFERENCE => "VAppNetworkReference",
376
+ :VAPPNETWORKREFERENCES => "VAppNetworkReferences",
377
+ :VAPPORGNETWORKRELATIONRECORD => "VAppOrgNetworkRelationRecord",
378
+ :VAPPORGNETWORKRELATIONREFERENCE => "VAppOrgNetworkRelationReference",
379
+ :VAPPORGNETWORKRELATIONREFERENCES => "VAppOrgNetworkRelationReferences",
380
+ :VAPPRECORD => "VAppRecord",
381
+ :VAPPREFERENCE => "VAppReference",
382
+ :VAPPREFERENCES => "VAppReferences",
383
+ :VAPPTEMPLATE => "VAppTemplate",
384
+ :VAPPTEMPLATERECORD => "VAppTemplateRecord",
385
+ :VAPPTEMPLATEREFERENCE => "VAppTemplateReference",
386
+ :VAPPTEMPLATEREFERENCES => "VAppTemplateReferences",
387
+ :VCLOUD => "VCloud",
388
+ :VDC => "Vdc",
389
+ :VDCREFERENCES => "VdcReferences",
390
+ :VIRTUALCENTERRECORD => "VirtualCenterRecord",
391
+ :VIRTUALCENTERREFERENCE => "VirtualCenterReference",
392
+ :VIRTUALCENTERREFERENCES => "VirtualCenterReferences",
393
+ :VM => "Vm",
394
+ :VMPENDINGQUESTION => "VmPendingQuestion",
395
+ :VMQUESTIONANSWER => "VmQuestionAnswer",
396
+ :VMRECORD => "VMRecord",
397
+ :VMREFERENCE => "VMReference",
398
+ :VMREFERENCES => "VMReferences",
399
+ :VMWPROVIDERVDCRECORD => "VMWProviderVdcRecord",
400
+ :VMWPROVIDERVDCREFERENCE => "VMWProviderVdcReference",
401
+ :VMWPROVIDERVDCREFERENCES => "VMWProviderVdcReferences"
402
+ }
403
+
404
+ RESOURCE_ENTITY_STATUS = {
405
+ :FAILED_CREATION => -1,
406
+ :UNRESOLVED => 0,
407
+ :RESOLVED => 1,
408
+ :DEPLOYED => 2,
409
+ :SUSPENDED => 3,
410
+ :POWERED_ON => 4,
411
+ :WAITING_FOR_INPUT => 5,
412
+ :UNKNOWN => 6,
413
+ :UNRECOGNIZED => 7,
414
+ :POWERED_OFF => 8,
415
+ :INCONSISTENT_STATE => 9,
416
+ :MIXED => 10,
417
+ :DESCRIPTOR_PENDING => 11,
418
+ :COPYING_CONTENTS => 12,
419
+ :DISK_CONTENTS_PENDING => 13,
420
+ :QUARANTINED => 14,
421
+ :QUARANTINE_EXPIRED => 15,
422
+ :REJECTED => 16,
423
+ :TRANSFER_TIMEOUT => 17
424
+ }
425
+
426
+ end
427
+ end