Class: Fog::Compute::VcloudDirector::Real
- Inherits:
-
Object
- Object
- Fog::Compute::VcloudDirector::Real
- Extended by:
- Deprecation
- Defined in:
- lib/fog/vcloud_director/compute.rb,
lib/fog/vcloud_director/requests/compute/get_vm.rb,
lib/fog/vcloud_director/requests/compute/put_vm.rb,
lib/fog/vcloud_director/requests/compute/get_vdc.rb,
lib/fog/vcloud_director/requests/compute/get_vms.rb,
lib/fog/vcloud_director/requests/compute/put_cpu.rb,
lib/fog/vcloud_director/requests/compute/get_disk.rb,
lib/fog/vcloud_director/requests/compute/get_href.rb,
lib/fog/vcloud_director/requests/compute/get_task.rb,
lib/fog/vcloud_director/requests/compute/get_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_media.rb,
lib/fog/vcloud_director/requests/compute/put_disks.rb,
lib/fog/vcloud_director/requests/compute/get_entity.rb,
lib/fog/vcloud_director/requests/compute/get_vcloud.rb,
lib/fog/vcloud_director/requests/compute/put_memory.rb,
lib/fog/vcloud_director/requests/compute/delete_disk.rb,
lib/fog/vcloud_director/requests/compute/delete_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_catalog.rb,
lib/fog/vcloud_director/requests/compute/get_network.rb,
lib/fog/vcloud_director/requests/compute/get_request.rb,
lib/fog/vcloud_director/requests/compute/put_network.rb,
lib/fog/vcloud_director/requests/compute/delete_media.rb,
lib/fog/vcloud_director/requests/compute/get_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_vm_disks.rb,
lib/fog/vcloud_director/requests/compute/delete_logout.rb,
lib/fog/vcloud_director/requests/compute/get_shadow_vm.rb,
lib/fog/vcloud_director/requests/compute/get_task_list.rb,
lib/fog/vcloud_director/requests/compute/get_thumbnail.rb,
lib/fog/vcloud_director/requests/compute/delete_network.rb,
lib/fog/vcloud_director/requests/compute/get_disk_owner.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_owner.rb,
lib/fog/vcloud_director/requests/compute/get_vm_network.rb,
lib/fog/vcloud_director/requests/compute/get_media_owner.rb,
lib/fog/vcloud_director/requests/compute/get_template_vm.rb,
lib/fog/vcloud_director/requests/compute/post_clone_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb,
lib/fog/vcloud_director/requests/compute/delete_shadow_vm.rb,
lib/fog/vcloud_director/requests/compute/get_catalog_item.rb,
lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb,
lib/fog/vcloud_director/requests/compute/get_org_settings.rb,
lib/fog/vcloud_director/requests/compute/get_organization.rb,
lib/fog/vcloud_director/requests/compute/get_template_vms.rb,
lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_attach_disk.rb,
lib/fog/vcloud_director/requests/compute/post_cancel_task.rb,
lib/fog/vcloud_director/requests/compute/post_clone_media.rb,
lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_detach_disk.rb,
lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_upload_disk.rb,
lib/fog/vcloud_director/requests/compute/get_cpu_rasd_item.rb,
lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_execute_query.rb,
lib/fog/vcloud_director/requests/compute/get_organizations.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb,
lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_upload_media.rb,
lib/fog/vcloud_director/requests/compute/get_media_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb,
lib/fog/vcloud_director/requests/compute/post_login_session.rb,
lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_undeploy_vapp.rb,
lib/fog/vcloud_director/requests/compute/put_metadata_value.rb,
lib/fog/vcloud_director/requests/compute/delete_catalog_item.rb,
lib/fog/vcloud_director/requests/compute/get_current_session.rb,
lib/fog/vcloud_director/requests/compute/get_startup_section.rb,
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_vm_capabilities.rb,
lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb,
lib/fog/vcloud_director/requests/compute/post_power_off_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb,
lib/fog/vcloud_director/requests/compute/put_vm_capabilities.rb,
lib/fog/vcloud_director/requests/compute/delete_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_memory_rasd_item.rb,
lib/fog/vcloud_director/requests/compute/get_network_complete.rb,
lib/fog/vcloud_director/requests/compute/get_network_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_org_vdc_gateways.rb,
lib/fog/vcloud_director/requests/compute/get_snapshot_section.rb,
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_vm_customization.rb,
lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb,
lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb,
lib/fog/vcloud_director/requests/compute/put_product_sections.rb,
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class.rb,
lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb,
lib/fog/vcloud_director/requests/compute/get_supported_versions.rb,
lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb,
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_ovf_descriptor.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb,
lib/fog/vcloud_director/requests/compute/get_vm_pending_question.rb,
lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb,
lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb,
lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb,
lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb,
lib/fog/vcloud_director/requests/compute/post_clone_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb,
lib/fog/vcloud_director/requests/compute/post_create_catalog_item.rb,
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_disks_rasd_items_list.rb,
lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb,
lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb,
lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb,
lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_update_vapp_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb,
lib/fog/vcloud_director/requests/compute/get_supported_systems_info.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_exit_maintenance_mode.rb,
lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb,
lib/fog/vcloud_director/requests/compute/get_vms_in_lease_from_query.rb,
lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb,
lib/fog/vcloud_director/requests/compute/post_enter_maintenance_mode.rb,
lib/fog/vcloud_director/requests/compute/get_network_cards_items_list.rb,
lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb,
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb,
lib/fog/vcloud_director/requests/compute/get_runtime_info_section_type.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb,
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb,
lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb,
lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_instantiate_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_answer_vm_pending_question.rb,
lib/fog/vcloud_director/requests/compute/put_config_network_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/put_disk_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/put_vapp_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_media_drives_rasd_items_list.rb,
lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template_ovf_descriptor.rb,
lib/fog/vcloud_director/requests/compute/put_media_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_control_access_params_catalog.rb,
lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/delete_vapp_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb,
lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb,
lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb,
lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb,
lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_organization_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/put_catalog_item_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/put_vapp_template_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/put_network_connection_system_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp.rb,
lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb,
lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb,
lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb,
lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#end_point ⇒ Object
readonly
Returns the value of attribute end_point.
-
#show_progress ⇒ Object
(also: #show_progress?)
readonly
Returns the value of attribute show_progress.
Instance Method Summary collapse
- #add_id_from_href!(data = {}) ⇒ Object
-
#delete_catalog_item(id) ⇒ Excon::Response
Delete a catalog item.
-
#delete_catalog_item_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from catalog item metadata.
-
#delete_disk(id) ⇒ Excon::Response
Delete a disk.
-
#delete_disk_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from disk metadata.
- #delete_logout ⇒ Excon::Response
-
#delete_media(id) ⇒ Excon::Response
Delete a media object.
-
#delete_media_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from media object metadata.
-
#delete_network(id) ⇒ Excon::Response
Delete an OrgVdcNetwork.
-
#delete_shadow_vm(id) ⇒ Excon::Response
deprecated
Deprecated.
Since vCloud API version 5.1 this operation may be removed in a future release.
-
#delete_vapp(id) ⇒ Excon::Response
Delete a vApp or VM.
-
#delete_vapp_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from vApp or VM metadata.
-
#delete_vapp_template(id) ⇒ Excon::Response
Delete a vApp template.
-
#delete_vapp_template_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from vApp template or VM metadata.
- #do_request(params) ⇒ Object private
-
#ensure_list!(hash, key1, key2 = nil) ⇒ Hash
private
Compensate for Fog::ToHashDocument shortcomings.
-
#get_allocated_ip_addresses(id) ⇒ Excon::Response
Retrieve a list of IP addresses allocated to the network.
-
#get_catalog(id) ⇒ Excon::Response
Retrieve a catalog.
-
#get_catalog_item(id) ⇒ Excon::Response
Retrieve a catalog item.
-
#get_catalog_item_metadata(id) ⇒ Excon::Response
Retrieve all metadata associated with a catalog item.
-
#get_catalog_item_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from catalog item metadata.
-
#get_catalog_metadata(id) ⇒ Excon::Response
Retrieve all catalog metadata.
-
#get_catalog_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from catalog metadata.
-
#get_catalogs_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of Catalogs by using REST API general QueryHandler.
-
#get_control_access_params_catalog(id, catalog_id) ⇒ Excon::Response
Retrieve access control information for a catalog.
-
#get_control_access_params_vapp(id) ⇒ Excon::Response
Retrieve access control information for a vApp.
-
#get_cpu_rasd_item(id) ⇒ Excon::Response
Retrieve the RASD item that specifies CPU properties of a VM.
-
#get_current_session ⇒ Excon::Response
Retrieve a representation of the current session.
-
#get_disk(id) ⇒ Excon::Response
Retrieve a disk.
-
#get_disk_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the disk.
-
#get_disk_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from disk metadata.
-
#get_disk_owner(id) ⇒ Excon::Response
Retrieve the owner of a disk.
-
#get_disks_from_query(options = {}) ⇒ Excon::Response
Retrieves a disk list by using REST API general QueryHandler.
-
#get_disks_rasd_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify hard disk and hard disk controller properties of a VM.
-
#get_edge_gateway(id) ⇒ Excon::Response
Retrieve an edge gateway.
-
#get_entity(id) ⇒ Excon:Response
Redirects to the URL of an entity with the given VCD ID.
-
#get_execute_query(type = nil, options = {}) ⇒ Excon::Response
REST API General queries handler.
-
#get_groups_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of groups for organization the org admin belongs to by using REST API general QueryHandler.
-
#get_guest_customization_system_section_vapp(id) ⇒ Excon::Response
Retrieves the guest customization section of a VM.
-
#get_guest_customization_system_section_vapp_template(id) ⇒ Excon::Response
Retrieves the guest customization section of a VM.
-
#get_href(href) ⇒ Object
private
This is used for manual testing.
-
#get_lease_settings_section_vapp(id) ⇒ Excon::Response
Retrieves the lease settings section of a vApp.
-
#get_lease_settings_section_vapp_template(id) ⇒ Excon::Response
Retrieves the lease settings section of a vApp template.
-
#get_media(id) ⇒ Excon::Response
Retrieve a media object.
-
#get_media_drives_rasd_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify CD-ROM, DVD, and floppy disk device and controller properties of a VM.
-
#get_media_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with a media object.
-
#get_media_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from media object metadata.
-
#get_media_owner(id) ⇒ Excon::Response
Retrieve the owner of a media object.
-
#get_medias_from_query(options = {}) ⇒ Excon::Response
Retrieves a media list by using REST API general QueryHandler.
-
#get_memory_rasd_item(id) ⇒ Excon::Response
Retrieve the RASD item that specifies memory properties of a VM.
-
#get_metadata(id) ⇒ Excon::Response
deprecated
Deprecated.
Use #get_vapp_metadata instead.
-
#get_network(id) ⇒ Excon::Response
deprecated
Deprecated.
Use #get_network_complete instead
-
#get_network_cards_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify network card properties of a VM.
-
#get_network_complete(id) ⇒ Excon::Response
Retrieve an organization network.
-
#get_network_config_section_vapp(id) ⇒ Excon::Response
Retrieve the network config section of a vApp.
-
#get_network_config_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network config section of a vApp template.
-
#get_network_connection_system_section_vapp(id) ⇒ Excon::Response
Retrieve the network connection section of a VM.
-
#get_network_connection_system_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network connection section of a VM.
-
#get_network_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the network.
-
#get_network_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from network metadata.
-
#get_network_section_vapp(id) ⇒ Excon::Response
Retrieve the network section of a vApp.
-
#get_network_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network section of a vApp template.
-
#get_operating_system_section(id) ⇒ Excon::Response
Retrieve the operating system section of a VM.
-
#get_org_settings(id) ⇒ Excon:Response
Retrieve settings for this organization.
-
#get_org_vdc_gateways(id) ⇒ Excon::Response
List all gateways for this Org vDC.
-
#get_organization(id) ⇒ Excon:Response
Retrieve an organization.
-
#get_organization_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the organization.
-
#get_organization_metadata_item_metadata(id, domain, key) ⇒ Excon::Response
Retrieve the value of the specified key in the specified domain from organization metadata.
-
#get_organizations ⇒ Excon::Response
Retrieve a list of organizations accessible to you.
-
#get_organizations_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of organizations by using REST API general QueryHandler.
-
#get_product_sections_vapp(id) ⇒ Excon::Response
Retrieve a list of ProductSection elements from a vApp or VM.
-
#get_product_sections_vapp_template(id) ⇒ Excon::Response
Retrieve a list of ProductSection elements from a vApp template or VM.
-
#get_request(uri) ⇒ Object
private
This is used for manual testing.
-
#get_runtime_info_section_type(id) ⇒ Excon::Response
Retrieve the runtime info section of a VM.
-
#get_serial_ports_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify serial port properties of a VM.
-
#get_shadow_vm(id) ⇒ Excon::Response
Retrieve a shadow VM.
-
#get_snapshot_section(id) ⇒ Excon::Response
Retrieve SnapshotSection element for a vApp or VM.
-
#get_startup_section(id) ⇒ Excon::Response
Retrieve the startup section of a vApp.
-
#get_supported_systems_info ⇒ Excon::Response
List operating systems available for use on virtual machines owned by this organization.
-
#get_supported_versions ⇒ Excon::Response
List all supported versions.
-
#get_task(id) ⇒ Excon::Response
Retrieve a task.
-
#get_task_list(id) ⇒ Excon::Response
Retrieve a list of this organization’s queued, running, or recently completed tasks.
-
#get_template_vms(id) ⇒ Excon::Response
Retrieve a vApp or VM.
-
#get_thumbnail(id) ⇒ Excon::Response
Retrieves a thumbnail image of a VM console.
-
#get_users_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of users for organization the org admin belongs to by using REST API general QueryHandler.
-
#get_vapp(id) ⇒ Excon::Response
Retrieve a vApp or VM.
-
#get_vapp_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vApp or VM.
-
#get_vapp_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from vApp or VM metadata.
-
#get_vapp_ovf_descriptor(id) ⇒ Excon::Response
Retrieve the OVF descriptor of a vApp directly.
-
#get_vapp_owner(id) ⇒ Excon::Response
Retrieve the owner of a vApp.
-
#get_vapp_template(id) ⇒ Excon::Response
Retrieve a vApp template.
-
#get_vapp_template_customization_system_section(id) ⇒ Excon::Response
Retrieves the customization section of a vApp template.
-
#get_vapp_template_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vApp template or VM.
-
#get_vapp_template_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from vApp template or VM metadata.
-
#get_vapp_template_ovf_descriptor(id) ⇒ Excon::Response
Retrieve the OVF descriptor of a vApp template.
-
#get_vapp_template_owner(id) ⇒ Excon::Response
Retrieve the owner of a vApp template.
-
#get_vapp_templates_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vAppTemplates using REST API general QueryHandler.
-
#get_vapps_in_lease_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vApps by using REST API general QueryHandler.
-
#get_vcloud ⇒ Excon:Response
Retrieve an administrative view of a cloud.
-
#get_vdc(id) ⇒ Excon::Response
Retrieve a vDC.
-
#get_vdc_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with a vDC.
-
#get_vdc_metadata_item_metadata(id, domain, key) ⇒ Excon::Response
Retrieve the value of the specified key from virtual datacenter metadata.
-
#get_vdc_storage_class(id) ⇒ Excon::Response
Returns storage class referred by the Id.
-
#get_vdc_storage_class_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vDC storage profile.
-
#get_vdc_storage_class_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve metadata associated with the vDC storage profile.
-
#get_vdcs_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vdcs in the organization.
-
#get_virtual_hardware_section(id) ⇒ Excon::Response
Retrieve the virtual hardware section of a VM.
-
#get_vm(id) ⇒ Excon::Response
Retrieve a vApp or VM.
-
#get_vm_capabilities(id) ⇒ Excon::Response
Gets capabilities for the VM identified by id.
-
#get_vm_compliance_results(id) ⇒ Excon::Response
Retrieve the results of a compliance check.
-
#get_vm_customization(id) ⇒ Excon::Response
deprecated
Deprecated.
Use #get_guest_customization_system_section_vapp instead.
-
#get_vm_disks(id) ⇒ Excon::Response
deprecated
Deprecated.
Use #get_disks_rasd_items_list instead.
-
#get_vm_network(id) ⇒ Excon::Response
deprecated
Deprecated.
Use #get_network_connection_system_section_vapp instead.
-
#get_vm_pending_question(id) ⇒ Excon::Response
Retrieve a question being asked by a VM.
-
#get_vms(id) ⇒ Excon::Response
Retrieve a vApp or VM.
- #get_vms_by_metadata(key, value) ⇒ Object
-
#get_vms_disk_attached_to(id) ⇒ Excon::Response
Retrieve a list of all VMs attached to a disk.
-
#get_vms_in_lease_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of VMs in lease by using REST API general QueryHandler.
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
-
#instantiate_vapp_template(vapp_name, template_id, options = {}) ⇒ Excon::Response
Create a vApp from a vApp template.
- #make_task_object(task_response) ⇒ Object
- #org_name ⇒ Object
-
#post_acquire_ticket(id) ⇒ Excon::Response
Retrieve a screen ticket that you can use with the VMRC browser plug-in to gain access to the console of a running VM.
-
#post_answer_pending_vm_question(id, choice_id, question_id) ⇒ Excon::Response
Answer a question being asked by a VM.
-
#post_attach_disk(id, disk_id, options = {}) ⇒ Excon::Response
Attach a disk to a VM.
-
#post_cancel_task(id) ⇒ Excon::Response
Cancel a task.
-
#post_capture_vapp(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a vApp template from a vApp.
-
#post_check_vm_compliance(id) ⇒ Excon::Response
Perform storage profile compliance check on a VM.
-
#post_clone_media(vdc_id, source_id, options = {}) ⇒ Excon::Response
Create a copy of a media object.
-
#post_clone_vapp(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a copy of a vApp.
-
#post_clone_vapp_template(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a copy of a vApp template.
-
#post_compose_vapp(id, options = {}) ⇒ Excon::Response
Compose a vApp from existing virtual machines.
-
#post_configure_edge_gateway_services(id, configuration) ⇒ Excon::Response
Configure edge gateway services like firewall, nat and load balancer.
-
#post_consolidate_vm_vapp(id) ⇒ Excon::Response
Consolidate VM snapshots.
-
#post_consolidate_vm_vapp_template(id) ⇒ Excon::Response
Consolidate VM snapshots.
-
#post_create_catalog_item(id, name, entity, options = {}) ⇒ Excon::Response
Add an item to a catalog.
-
#post_create_org_vdc_network(vdc_id, name, options = {}) ⇒ Excon::Response
Create an Org vDC network.
- #post_create_snapshot(id, options = {}) ⇒ Object
-
#post_deploy_vapp(id, options = {}) ⇒ Excon::Response
Deploy a vApp or VM.
-
#post_detach_disk(id, disk_id) ⇒ Excon::Response
Detach a disk from a VM.
-
#post_disable_nested_hv(id) ⇒ Excon::Response
Hide hardware-assisted CPU virtualization from guest OS.
-
#post_disable_vapp_template_download(id) ⇒ Excon::Response
Disable a vApp template for download.
-
#post_discard_vapp_state(id) ⇒ Excon::Response
Discard suspended state of a vApp or VM.
-
#post_eject_cd_rom(id, media_id) ⇒ Excon::Response
Eject virtual media.
-
#post_enable_nested_hv(id) ⇒ Excon::Response
Expose hardware-assisted CPU virtualization to guest OS.
-
#post_enable_vapp_template_download(id) ⇒ Excon::Response
Enable a vApp template for download.
-
#post_enter_maintenance_mode(id) ⇒ Excon::Response
Place the vApp in maintenance mode.
-
#post_exit_maintenance_mode(id) ⇒ Excon::Response
Take the vApp out of maintenance mode.
-
#post_insert_cd_rom(id, media_id) ⇒ Excon::Response
Insert virtual media.
-
#post_install_vmware_tools(id) ⇒ Excon::Response
Install VMware Tools on a running VM.
-
#post_instantiate_vapp_template(id, vapp_template_id, name, options = {}) ⇒ Excon::Response
Create a vApp from a vApp template.
-
#post_login_session ⇒ Excon::Response
Log in and create a Session object.
-
#post_power_off_vapp(id) ⇒ Excon::Response
Power off a vApp or VM.
-
#post_power_on_vapp(id) ⇒ Excon::Response
Power on a vApp or VM.
-
#post_reboot_vapp(id) ⇒ Excon::Response
Reboot a vApp or VM.
- #post_recompose_vapp(id, options = {}) ⇒ Object
-
#post_reconfigure_vm(id, options = {}) ⇒ Excon::Response
Updates VM configuration.
-
#post_remove_all_snapshots(id) ⇒ Excon::Response
Removes all user created snapshots for a vApp or virtual machine.
-
#post_reset_vapp(id) ⇒ Excon::Response
Reset a vApp or VM.
-
#post_revert_snapshot(id) ⇒ Excon::Response
Reverts a vApp or virtual machine to the current snapshot, if any.
-
#post_shutdown_vapp(id) ⇒ Excon::Response
Shut down a vApp or VM.
-
#post_suspend_vapp(id) ⇒ Excon::Response
Suspend a vApp or VM.
-
#post_undeploy_vapp(id, options = {}) ⇒ Excon::Response
Undeploy a vApp/VM.
-
#post_update_catalog_item_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing catalog item metadata.
-
#post_update_disk_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
-
#post_update_media_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
-
#post_update_vapp_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
-
#post_update_vapp_template_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
-
#post_upgrade_hw_version(id) ⇒ Excon::Response
Upgrade the virtual hardware version of a VM to the highest supported virtual hardware version of the vDC that contains it.
-
#post_upload_disk(id, name, size, options = {}) ⇒ Excon::Response
Create a disk.
-
#post_upload_media(vdc_id, name, image_type, size, options = {}) ⇒ Excon::Response
Upload a media image.
-
#post_upload_vapp_template(vdc_id, name, options = {}) ⇒ Excon::Response
Upload an OVF package to create a vApp template.
- #process_task(response_body) ⇒ Object
-
#put_catalog_item_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the metadata value for the specified key to the value provided, overwriting any existing value.
-
#put_config_network_section_vapp(id, options = {}) ⇒ Object
Update the network config section of a vApp.
-
#put_cpu(id, num_cpus) ⇒ Excon:Response
Update the RASD item that specifies CPU properties of a VM.
-
#put_disk_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
-
#put_disks(id, disks = []) ⇒ Excon::Response
Update all RASD items that specify hard disk and hard disk controller properties of a VM.
-
#put_guest_customization_section_vapp(id, options = {}) ⇒ Excon::Response
Updates the guest customization section of a VM.
-
#put_media_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
-
#put_memory(id, memory) ⇒ Excon::Response
Update the RASD item that specifies memory properties of a VM.
-
#put_metadata_value(vm_id, metadata_key, metadata_value) ⇒ Object
deprecated Use #put_vapp_metadata_item_metadata instead.
-
#put_network(id, name, options = {}) ⇒ Excon::Response
Update an Org vDC network.
-
#put_network_connection_system_section_vapp(id, options = {}) ⇒ Excon::Response
Update the network connection section of a VM.
-
#put_product_sections(id, sections) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
-
#put_vapp_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
-
#put_vapp_name_and_description(id, name, options = {}) ⇒ Excon::Response
Modify the name or description of a vApp.
-
#put_vapp_template_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
-
#put_vm(id, name, options) ⇒ Excon::Response
Update the name, description and storage profile for VM.
-
#put_vm_capabilities(id, options = {}) ⇒ Excon::Response
Update VM’s capabilities.
- #reload ⇒ Object
- #request(params) ⇒ Object
-
#undeploy(id) ⇒ Object
deprecated
Deprecated.
Use #post_undeploy_vapp instead.
- #user_name ⇒ Object
- #vcloud_token ⇒ Object
- #wait_and_raise_unless_success(task) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/fog/vcloud_director/compute.rb', line 347 def initialize(={}) @vcloud_director_password = [:vcloud_director_password] @vcloud_director_username = [:vcloud_director_username] @connection_options = [:connection_options] || {} @connection_options[:omit_default_port] = Fog::Compute::VcloudDirector::Defaults::OMIT_DEFAULT_PORT unless @connection_options[:omit_default_port] @host = [:vcloud_director_host] @path = [:path] || Fog::Compute::VcloudDirector::Defaults::PATH @persistent = [:persistent] || false @port = [:port] || Fog::Compute::VcloudDirector::Defaults::PORT @scheme = [:scheme] || Fog::Compute::VcloudDirector::Defaults::SCHEME @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) @end_point = "#{@scheme}://#{@host}#{@path}/" @api_version = [:vcloud_director_api_version] || Fog::Compute::VcloudDirector::Defaults::API_VERSION @show_progress = [:vcloud_director_show_progress] @show_progress = $stdin.tty? if @show_progress.nil? @vcloud_token = [:vcloud_token] end |
Instance Attribute Details
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
344 345 346 |
# File 'lib/fog/vcloud_director/compute.rb', line 344 def api_version @api_version end |
#end_point ⇒ Object (readonly)
Returns the value of attribute end_point.
344 345 346 |
# File 'lib/fog/vcloud_director/compute.rb', line 344 def end_point @end_point end |
#show_progress ⇒ Object (readonly) Also known as: show_progress?
Returns the value of attribute show_progress.
344 345 346 |
# File 'lib/fog/vcloud_director/compute.rb', line 344 def show_progress @show_progress end |
Instance Method Details
#add_id_from_href!(data = {}) ⇒ Object
452 453 454 |
# File 'lib/fog/vcloud_director/compute.rb', line 452 def add_id_from_href!(data={}) data[:id] = data[:href].split('/').last end |
#delete_catalog_item(id) ⇒ Excon::Response
Delete a catalog item.
12 13 14 15 16 17 18 |
# File 'lib/fog/vcloud_director/requests/compute/delete_catalog_item.rb', line 12 def delete_catalog_item(id) request( :expects => 204, :method => 'DELETE', :path => "catalogItem/#{id}" ) end |
#delete_catalog_item_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from catalog item metadata.
14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/delete_catalog_item_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}/metadata/#{URI.escape(key)}" ) end |
#delete_disk(id) ⇒ Excon::Response
Delete a disk.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/delete_disk.rb', line 16 def delete_disk(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}" ) end |
#delete_disk_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from disk metadata.
14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/delete_disk_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/metadata/#{URI.escape(key)}" ) end |
#delete_logout ⇒ Excon::Response
8 9 10 11 12 13 14 |
# File 'lib/fog/vcloud_director/requests/compute/delete_logout.rb', line 8 def delete_logout request( :expects => 204, :method => 'DELETE', :path => 'session' ) end |
#delete_media(id) ⇒ Excon::Response
Delete a media object.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
79 80 81 82 83 84 85 86 |
# File 'lib/fog/vcloud_director/requests/compute/delete_media.rb', line 79 def delete_media(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "media/#{id}" ) end |
#delete_media_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from media object metadata.
14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/delete_media_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/metadata/#{URI.escape(key)}" ) end |
#delete_network(id) ⇒ Excon::Response
Delete an OrgVdcNetwork
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/delete_network.rb', line 18 def delete_network(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "admin/network/#{id}" ) end |
#delete_shadow_vm(id) ⇒ Excon::Response
Since vCloud API version 5.1 this operation may be removed in a future release.
Deletes shadow VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
19 20 21 22 23 24 25 26 |
# File 'lib/fog/vcloud_director/requests/compute/delete_shadow_vm.rb', line 19 def delete_shadow_vm(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "shadowVm/#{id}" ) end |
#delete_vapp(id) ⇒ Excon::Response
Delete a vApp or VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/delete_vapp.rb', line 18 def delete_vapp(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}" ) end |
#delete_vapp_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from vApp or VM metadata.
19 20 21 22 23 24 25 26 |
# File 'lib/fog/vcloud_director/requests/compute/delete_vapp_metadata_item_metadata.rb', line 19 def (id, key) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/metadata/#{URI.escape(key)}" ) end |
#delete_vapp_template(id) ⇒ Excon::Response
Delete a vApp template.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/delete_vapp_template.rb', line 16 def delete_vapp_template(id) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}" ) end |
#delete_vapp_template_metadata_item_metadata(id, key) ⇒ Excon::Response
Delete the specified key and its value from vApp template or VM metadata.
15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/delete_vapp_template_metadata_item_metadata.rb', line 15 def (id, key) request( :expects => 202, :method => 'DELETE', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/metadata/#{URI.escape(key)}" ) end |
#do_request(params) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/fog/vcloud_director/compute.rb', line 402 def do_request(params) headers = { 'Accept' => "application/*+xml;version=#{@api_version}", 'x-vcloud-authorization' => vcloud_token } if params[:path] if params[:override_path] == true path = params[:path] else path = "#{@path}/#{params[:path]}" end else path = "#{@path}" end @connection.request({ :body => params[:body], :expects => params[:expects], :headers => headers.merge!(params[:headers] || {}), :idempotent => params[:idempotent], :method => params[:method], :parser => params[:parser], :path => path, :query => params[:query] }) rescue Excon::Errors::HTTPStatusError => error raise case error when Excon::Errors::BadRequest then BadRequest.slurp(error); when Excon::Errors::Unauthorized then Unauthorized.slurp(error); when Excon::Errors::Forbidden then Forbidden.slurp(error); when Excon::Errors::Conflict then Conflict.slurp(error); else ServiceError.slurp(error) end end |
#ensure_list!(hash, key1, key2 = nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Compensate for Fog::ToHashDocument shortcomings.
462 463 464 465 466 467 468 469 470 471 472 |
# File 'lib/fog/vcloud_director/compute.rb', line 462 def ensure_list!(hash, key1, key2=nil) if key2.nil? hash[key1] ||= [] hash[key1] = [hash[key1]] if hash[key1].is_a?(Hash) else hash[key1] ||= {key2 => []} hash[key1] = {key2 => []} if hash[key1].empty? hash[key1][key2] = [hash[key1][key2]] if hash[key1][key2].is_a?(Hash) end hash end |
#get_allocated_ip_addresses(id) ⇒ Excon::Response
Retrieve a list of IP addresses allocated to the network.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_allocated_ip_addresses.rb', line 13 def get_allocated_ip_addresses(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "network/#{id}/allocatedAddresses" ) end |
#get_catalog(id) ⇒ Excon::Response
Retrieve a catalog.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog.rb', line 15 def get_catalog(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalog/#{id}" ) ensure_list! response.body, :CatalogItems, :CatalogItem response end |
#get_catalog_item(id) ⇒ Excon::Response
Retrieve a catalog item.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog_item.rb', line 13 def get_catalog_item(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}" ) end |
#get_catalog_item_metadata(id) ⇒ Excon::Response
Retrieve all metadata associated with a catalog item.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}/metadata" ) end |
#get_catalog_item_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from catalog item metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog_item_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_catalog_metadata(id) ⇒ Excon::Response
Retrieve all catalog metadata.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalog/#{id}/metadata" ) end |
#get_catalog_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from catalog metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalog_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "catalog/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_catalogs_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of Catalogs by using REST API general QueryHandler.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb', line 56 def get_catalogs_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'catalogs/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :CatalogReference : :CatalogRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_control_access_params_catalog(id, catalog_id) ⇒ Excon::Response
Retrieve access control information for a catalog.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_control_access_params_catalog.rb', line 14 def get_control_access_params_catalog(id, catalog_id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "org/#{id}/catalog/#{catalog_id}/controlAccess" ) end |
#get_control_access_params_vapp(id) ⇒ Excon::Response
Retrieve access control information for a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_control_access_params_vapp.rb', line 13 def get_control_access_params_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/controlAccess" ) end |
#get_cpu_rasd_item(id) ⇒ Excon::Response
Retrieve the RASD item that specifies CPU properties of a VM.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_cpu_rasd_item.rb', line 16 def get_cpu_rasd_item(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/cpu" ) end |
#get_current_session ⇒ Excon::Response
Retrieve a representation of the current session.
A Session object contains one or more URLs from which you can begin browsing, as well as links to the query service and entity resolver. The list of URLs in the Session object is based on the role and privileges of the authenticated user.
A Session object expires after a configurable interval of client inactivity.
30 31 32 33 34 35 36 37 38 |
# File 'lib/fog/vcloud_director/requests/compute/get_current_session.rb', line 30 def get_current_session request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'session' ) end |
#get_disk(id) ⇒ Excon::Response
Retrieve a disk.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/vcloud_director/requests/compute/get_disk.rb', line 28 def get_disk(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}" ) ensure_list! response.body, :Link ensure_list! response.body, :Tasks, :Task ensure_list! response.body, :Files, :File response end |
#get_disk_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the disk.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_disk_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/metadata" ) end |
#get_disk_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from disk metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_disk_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_disk_owner(id) ⇒ Excon::Response
Retrieve the owner of a disk.
26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/vcloud_director/requests/compute/get_disk_owner.rb', line 26 def get_disk_owner(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/owner" ) end |
#get_disks_from_query(options = {}) ⇒ Excon::Response
Retrieves a disk list by using REST API general QueryHandler.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb', line 56 def get_disks_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'disks/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :DiskReference : :DiskRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_disks_rasd_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify hard disk and hard disk controller properties of a VM.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_disks_rasd_items_list.rb', line 14 def get_disks_rasd_items_list(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/disks" ) end |
#get_edge_gateway(id) ⇒ Excon::Response
Retrieve an edge gateway.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb', line 15 def get_edge_gateway(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/edgeGateway/#{id}" ) ensure_list! response.body[:Configuration], :GatewayInterfaces, :GatewayInterface edge_gateway_service_configuration = response.body[:Configuration][:EdgeGatewayServiceConfiguration] ensure_list! edge_gateway_service_configuration[:FirewallService], :FirewallRule if edge_gateway_service_configuration[:FirewallService] ensure_list! edge_gateway_service_configuration[:NatService], :NatRule if edge_gateway_service_configuration[:NatService] if edge_gateway_service_configuration[:LoadBalancerService] ensure_list! edge_gateway_service_configuration[:LoadBalancerService], :Pool edge_gateway_service_configuration[:LoadBalancerService][:Pool].each do |pool| ensure_list! pool, :ServicePort ensure_list! pool, :Member pool[:Member].each do |member| ensure_list! member, :ServicePort end end ensure_list! edge_gateway_service_configuration[:LoadBalancerService], :VirtualServer edge_gateway_service_configuration[:LoadBalancerService][:VirtualServer].each do |virtual_server| ensure_list! virtual_server, :ServiceProfile end end response end |
#get_entity(id) ⇒ Excon:Response
Redirects to the URL of an entity with the given VCD ID.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/vcloud_director/requests/compute/get_entity.rb', line 24 def get_entity(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "entity/#{id}" ) ensure_list! response.body, :Link response end |
#get_execute_query(type = nil, options = {}) ⇒ Excon::Response
REST API General queries handler.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/fog/vcloud_director/requests/compute/get_execute_query.rb', line 70 def get_execute_query(type=nil, ={}) if type.nil? response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'query' ) else query = { :type => type, } query[:sortAsc] = [:sortAsc] if [:sortAsc] query[:sortDesc] = [:sortDesc] if [:sortDesc] query[:page] = [:page] if [:page] query[:pageSize] = [:pageSize] if [:pageSize] query[:format] = [:format] if [:format] query[:fields] = Array([:fields]).join(',') if [:fields] query[:offset] = [:offset] if [:offset] query[:filter] = [:filter] if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'query', :query => query.map {|k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&').gsub('%3D', '=').gsub('%3B', ';') ) ensure_list! response.body, :Link # TODO: figure out the right key (this isn't it) #ensure_list! response.body, # response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? # "#{response.body[:name]}Reference".to_sym : # "#{response.body[:name]}Record".to_sym %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end end |
#get_groups_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of groups for organization the org admin belongs to by using REST API general QueryHandler.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb', line 57 def get_groups_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'admin/groups/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :GroupReference : :GroupRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_guest_customization_system_section_vapp(id) ⇒ Excon::Response
Retrieves the guest customization section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp.rb', line 13 def get_guest_customization_system_section_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/guestCustomizationSection" ) end |
#get_guest_customization_system_section_vapp_template(id) ⇒ Excon::Response
Retrieves the guest customization section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_guest_customization_system_section_vapp_template.rb', line 13 def get_guest_customization_system_section_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/guestCustomizationSection" ) end |
#get_href(href) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This is used for manual testing.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fog/vcloud_director/requests/compute/get_href.rb', line 8 def get_href(href) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :override_path => true, :path => URI.parse(href).path ) end |
#get_lease_settings_section_vapp(id) ⇒ Excon::Response
Retrieves the lease settings section of a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp.rb', line 13 def get_lease_settings_section_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/leaseSettingsSection" ) end |
#get_lease_settings_section_vapp_template(id) ⇒ Excon::Response
Retrieves the lease settings section of a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp_template.rb', line 13 def get_lease_settings_section_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/leaseSettingsSection" ) end |
#get_media(id) ⇒ Excon::Response
Retrieve a media object.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/get_media.rb', line 15 def get_media(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "media/#{id}" ) ensure_list! response.body, :Files, :File response end |
#get_media_drives_rasd_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify CD-ROM, DVD, and floppy disk device and controller properties of a VM.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_media_drives_rasd_items_list.rb', line 14 def get_media_drives_rasd_items_list(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/media" ) end |
#get_media_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with a media object.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_media_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/metadata" ) end |
#get_media_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from media object metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_media_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_media_owner(id) ⇒ Excon::Response
Retrieve the owner of a media object.
26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/vcloud_director/requests/compute/get_media_owner.rb', line 26 def get_media_owner(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/owner" ) end |
#get_medias_from_query(options = {}) ⇒ Excon::Response
Retrieves a media list by using REST API general QueryHandler.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb', line 56 def get_medias_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'mediaList/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :MediaReference : :MediaRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_memory_rasd_item(id) ⇒ Excon::Response
Retrieve the RASD item that specifies memory properties of a VM.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_memory_rasd_item.rb', line 16 def get_memory_rasd_item(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/memory" ) end |
#get_metadata(id) ⇒ Excon::Response
Use #get_vapp_metadata instead.
Log deprecation warning.
Retrieve metadata associated with the vApp or VM.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/vcloud_director/requests/compute/get_metadata.rb', line 16 def (id) require 'fog/vcloud_director/parsers/compute/metadata' request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Metadata.new, :path => "vApp/#{id}/metadata/" ) end |
#get_network(id) ⇒ Excon::Response
Use #get_network_complete instead
Retrieve an organization network.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fog/vcloud_director/requests/compute/get_network.rb', line 19 def get_network(id) Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]") request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Network.new, :path => "network/#{id}" ) end |
#get_network_cards_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify network card properties of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_cards_items_list.rb', line 13 def get_network_cards_items_list(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/networkCards" ) end |
#get_network_complete(id) ⇒ Excon::Response
Retrieve an organization network.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_complete.rb', line 15 def get_network_complete(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/network/#{id}" ) ensure_list! response.body[:Configuration][:IpScopes][:IpScope], :IpRanges, :IpRange response end |
#get_network_config_section_vapp(id) ⇒ Excon::Response
Retrieve the network config section of a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp.rb', line 13 def get_network_config_section_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/networkConfigSection/" ) end |
#get_network_config_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network config section of a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_config_section_vapp_template.rb', line 13 def get_network_config_section_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/networkConfigSection/" ) end |
#get_network_connection_system_section_vapp(id) ⇒ Excon::Response
Retrieve the network connection section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp.rb', line 13 def get_network_connection_system_section_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/networkConnectionSection/" ) end |
#get_network_connection_system_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network connection section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_connection_system_section_vapp_template.rb', line 13 def get_network_connection_system_section_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/networkConnectionSection/" ) end |
#get_network_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the network.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "network/#{id}/metadata" ) end |
#get_network_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from network metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/network/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_network_section_vapp(id) ⇒ Excon::Response
Retrieve the network section of a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_section_vapp.rb', line 13 def get_network_section_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/networkSection/" ) end |
#get_network_section_vapp_template(id) ⇒ Excon::Response
Retrieve the network section of a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_network_section_vapp_template.rb', line 13 def get_network_section_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/networkSection/" ) end |
#get_operating_system_section(id) ⇒ Excon::Response
Retrieve the operating system section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/operatingSystemSection/" ) end |
#get_org_settings(id) ⇒ Excon:Response
Retrieve settings for this organization.
Organization settings are divided into categories. This request retrieves all categories of organization settings.
26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/vcloud_director/requests/compute/get_org_settings.rb', line 26 def get_org_settings(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/org/#{id}/settings" ) end |
#get_org_vdc_gateways(id) ⇒ Excon::Response
List all gateways for this Org vDC.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fog/vcloud_director/requests/compute/get_org_vdc_gateways.rb', line 18 def get_org_vdc_gateways(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/vdc/#{id}/edgeGateways" ) ensure_list! response.body, :EdgeGatewayRecord response end |
#get_organization(id) ⇒ Excon:Response
Retrieve an organization.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/get_organization.rb', line 15 def get_organization(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "org/#{id}" ) ensure_list! response.body, :Tasks, :Task response end |
#get_organization_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the organization.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_organization_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "org/#{id}/metadata" ) end |
#get_organization_metadata_item_metadata(id, domain, key) ⇒ Excon::Response
Retrieve the value of the specified key in the specified domain from organization metadata.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_organization_metadata_item_metadata.rb', line 16 def (id, domain, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/org/#{id}/metadata/#{URI.escape(domain)}/#{URI.escape(key)})" ) end |
#get_organizations ⇒ Excon::Response
Retrieve a list of organizations accessible to you.
The system administrator has access to all organizations.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fog/vcloud_director/requests/compute/get_organizations.rb', line 20 def get_organizations response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'org' ) ensure_list! response.body, :Org response end |
#get_organizations_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of organizations by using REST API general QueryHandler.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb', line 57 def get_organizations_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'admin/orgs/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :OrganizationReference : :OrganizationRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_product_sections_vapp(id) ⇒ Excon::Response
Retrieve a list of ProductSection elements from a vApp or VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_product_sections_vapp.rb', line 13 def get_product_sections_vapp(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/productSections" ) end |
#get_product_sections_vapp_template(id) ⇒ Excon::Response
Retrieve a list of ProductSection elements from a vApp template or VM.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_product_sections_vapp_template.rb', line 14 def get_product_sections_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/productSections" ) end |
#get_request(uri) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This is used for manual testing.
8 9 10 11 12 13 14 15 |
# File 'lib/fog/vcloud_director/requests/compute/get_request.rb', line 8 def get_request(uri) request( :expects => 200, :idempotent => true, :method => 'GET', :path => uri ) end |
#get_runtime_info_section_type(id) ⇒ Excon::Response
Retrieve the runtime info section of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_runtime_info_section_type.rb', line 13 def get_runtime_info_section_type(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/runtimeInfoSection" ) end |
#get_serial_ports_items_list(id) ⇒ Excon::Response
Retrieve all RASD items that specify serial port properties of a VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_serial_ports_items_list.rb', line 13 def get_serial_ports_items_list(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/serialPorts" ) end |
#get_shadow_vm(id) ⇒ Excon::Response
Retrieve a shadow VM.
12 13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/get_shadow_vm.rb', line 12 def get_shadow_vm(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "shadowVm/#{id}" ) end |
#get_snapshot_section(id) ⇒ Excon::Response
Retrieve SnapshotSection element for a vApp or VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_snapshot_section.rb', line 13 def get_snapshot_section(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/snapshotSection" ) end |
#get_startup_section(id) ⇒ Excon::Response
Retrieve the startup section of a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_startup_section.rb', line 13 def get_startup_section(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/startupSection" ) end |
#get_supported_systems_info ⇒ Excon::Response
List operating systems available for use on virtual machines owned by this organization.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_supported_systems_info.rb', line 13 def get_supported_systems_info request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'supportedSystemsInfo' ) end |
#get_supported_versions ⇒ Excon::Response
List all supported versions.
12 13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/get_supported_versions.rb', line 12 def get_supported_versions @connection.request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "#{@path}/versions" ) end |
#get_task(id) ⇒ Excon::Response
Retrieve a task.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/fog/vcloud_director/requests/compute/get_task.rb', line 77 def get_task(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "task/#{id}" ) # vCloud Director bug: Owner may be absent for some tasks, fix # targeted for 5.1.3 (due out at the beginning Q1 2014). # # We'd prefer that Owner is always present; if nothing else, this # let's the tests pass. response.body[:Owner] ||= {:href => '', :name => nil, :type => nil} response end |
#get_task_list(id) ⇒ Excon::Response
Retrieve a list of this organization’s queued, running, or recently completed tasks.
90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/fog/vcloud_director/requests/compute/get_task_list.rb', line 90 def get_task_list(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "tasksList/#{id}" ) ensure_list! response.body, :Task response end |
#get_template_vms(id) ⇒ Excon::Response
This should probably be deprecated.
Retrieve a vApp or VM.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_template_vms.rb', line 16 def get_template_vms(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Vms.new, :path => "vAppTemplate/#{id}" ) end |
#get_thumbnail(id) ⇒ Excon::Response
Retrieves a thumbnail image of a VM console.
The content type of the response can be any of ‘image/png`, `image/gif`.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_thumbnail.rb', line 16 def get_thumbnail(id) request( :expects => 200, :headers => {'Accept' => "image/*;version=#{@api_version}"}, :idempotent => true, :method => 'GET', :path => "vApp/#{id}/screen" ) end |
#get_users_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of users for organization the org admin belongs to by using REST API general QueryHandler.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fog/vcloud_director/requests/compute/get_users_from_query.rb', line 57 def get_users_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'admin/users/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :UserReference : :UserRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_vapp(id) ⇒ Excon::Response
Retrieve a vApp or VM.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp.rb', line 13 def get_vapp(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}" ) ensure_list! response.body, :Children, :Vm response end |
#get_vapp_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vApp or VM.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb', line 13 def (id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/metadata/" ) ensure_list! response.body, :MetadataEntry response end |
#get_vapp_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from vApp or VM metadata.
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_metadata_item_metadata.rb', line 14 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_vapp_ovf_descriptor(id) ⇒ Excon::Response
Retrieve the OVF descriptor of a vApp directly.
13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_ovf_descriptor.rb', line 13 def get_vapp_ovf_descriptor(id) request( :expects => 200, :idempotent => true, :method => 'GET', :path => "vApp/#{id}/ovf" ) end |
#get_vapp_owner(id) ⇒ Excon::Response
Retrieve the owner of a vApp.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_owner.rb', line 13 def get_vapp_owner(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/owner" ) end |
#get_vapp_template(id) ⇒ Excon::Response
Retrieve a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template.rb', line 13 def get_vapp_template(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}" ) end |
#get_vapp_template_customization_system_section(id) ⇒ Excon::Response
Retrieves the customization section of a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template_customization_system_section.rb', line 13 def get_vapp_template_customization_system_section(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/customizationSection" ) end |
#get_vapp_template_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vApp template or VM.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/metadata/" ) end |
#get_vapp_template_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve the value of the specified key from vApp template or VM metadata.
15 16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template_metadata_item_metadata.rb', line 15 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_vapp_template_ovf_descriptor(id) ⇒ Excon::Response
Retrieve the OVF descriptor of a vApp template.
13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template_ovf_descriptor.rb', line 13 def get_vapp_template_ovf_descriptor(id) request( :expects => 200, :idempotent => true, :method => 'GET', :path => "vAppTemplate/#{id}/ovf" ) end |
#get_vapp_template_owner(id) ⇒ Excon::Response
Retrieve the owner of a vApp template.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_template_owner.rb', line 13 def get_vapp_template_owner(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/owner" ) end |
#get_vapp_templates_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vAppTemplates using REST API general QueryHandler.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb', line 57 def get_vapp_templates_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'vAppTemplates/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :VAppTemplateReference : :VAppTemplateRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_vapps_in_lease_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vApps by using REST API general QueryHandler.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb', line 56 def get_vapps_in_lease_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'vApps/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :VAppReference : :VAppRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_vcloud ⇒ Excon:Response
Retrieve an administrative view of a cloud.
The VCloud element provides access to cloud-wide namespace of objects that an administrator can view and, in most cases, modify.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/vcloud_director/requests/compute/get_vcloud.rb', line 32 def get_vcloud response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'admin/' ) ensure_list! response.body, :OrganizationReferences, :OrganizationReference ensure_list! response.body, :ProviderVdcReferences, :ProviderVdcReference ensure_list! response.body, :RightReferences, :RightReference ensure_list! response.body, :RoleReferences, :RoleReference ensure_list! response.body, :Networks, :Network response end |
#get_vdc(id) ⇒ Excon::Response
Retrieve a vDC.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc.rb', line 15 def get_vdc(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vdc/#{id}" ) ensure_list! response.body, :ResourceEntities, :ResourceEntity ensure_list! response.body, :AvailableNetworks, :Network ensure_list! response.body, :VdcStorageProfiles, :VdcStorageProfile response end |
#get_vdc_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with a vDC.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc_metadata.rb', line 13 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vdc/#{id}/metadata/" ) end |
#get_vdc_metadata_item_metadata(id, domain, key) ⇒ Excon::Response
Retrieve the value of the specified key from virtual datacenter metadata.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc_metadata_item_metadata.rb', line 16 def (id, domain, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "admin/vdc/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_vdc_storage_class(id) ⇒ Excon::Response
Returns storage class referred by the Id. All properties of the storage classes are visible to vcloud user, except for VDC Storage Class reference.
35 36 37 38 39 40 41 42 43 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc_storage_class.rb', line 35 def get_vdc_storage_class(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vdcStorageProfile/#{id}" ) end |
#get_vdc_storage_class_metadata(id) ⇒ Excon::Response
Retrieve metadata associated with the vDC storage profile.
15 16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata.rb', line 15 def (id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vdcStorageProfile/#{id}/metadata/" ) end |
#get_vdc_storage_class_metadata_item_metadata(id, key) ⇒ Excon::Response
Retrieve metadata associated with the vDC storage profile.
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdc_storage_class_metadata_item_metadata.rb', line 13 def (id, key) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vdcStorageProfile/#{id}/metadata/#{URI.escape(key)})" ) end |
#get_vdcs_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of vdcs in the organization.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb', line 56 def get_vdcs_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'admin/vdcs/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :OrgVdcReference : :OrgVdcRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#get_virtual_hardware_section(id) ⇒ Excon::Response
Retrieve the virtual hardware section of a VM.
This operation retrieves the entire VirtualHardwareSection of a VM. You can also retrieve many RASD item elements of a VirtualHardwareSection individually, or as groups of related items.
17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/vcloud_director/requests/compute/get_virtual_hardware_section.rb', line 17 def get_virtual_hardware_section(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/" ) end |
#get_vm(id) ⇒ Excon::Response
This should probably be deprecated.
Retrieve a vApp or VM.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm.rb', line 16 def get_vm(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Vm.new, :path => "vApp/#{id}" ) end |
#get_vm_capabilities(id) ⇒ Excon::Response
Gets capabilities for the VM identified by id.
18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_capabilities.rb', line 18 def get_vm_capabilities(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/vmCapabilities" ) end |
#get_vm_compliance_results(id) ⇒ Excon::Response
Retrieve the results of a compliance check.
12 13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_compliance_results.rb', line 12 def get_vm_compliance_results(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/complianceResult" ) end |
#get_vm_customization(id) ⇒ Excon::Response
Use #get_guest_customization_system_section_vapp instead.
Log deprecation warning.
Retrieves the guest customization section of a VM.
19 20 21 22 23 24 25 26 27 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_customization.rb', line 19 def get_vm_customization(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::VmCustomization.new, :path => "vApp/#{id}/guestCustomizationSection" ) end |
#get_vm_disks(id) ⇒ Excon::Response
Use #get_disks_rasd_items_list instead.
Log deprecation warning.
Retrieve all RASD items that specify hard disk and hard disk controller properties of a VM.
19 20 21 22 23 24 25 26 27 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_disks.rb', line 19 def get_vm_disks(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Disks.new, :path => "vApp/#{id}/virtualHardwareSection/disks" ) end |
#get_vm_network(id) ⇒ Excon::Response
Use #get_network_connection_system_section_vapp instead.
Log deprecation warning.
Retrieve the network connection section of a VM.
19 20 21 22 23 24 25 26 27 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_network.rb', line 19 def get_vm_network(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::VmNetwork.new, :path => "vApp/#{id}/networkConnectionSection/" ) end |
#get_vm_pending_question(id) ⇒ Excon::Response
Retrieve a question being asked by a VM.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fog/vcloud_director/requests/compute/get_vm_pending_question.rb', line 20 def get_vm_pending_question(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/question" ) ensure_list! response.body, :Choices response end |
#get_vms(id) ⇒ Excon::Response
This should probably be deprecated.
Retrieve a vApp or VM.
16 17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/get_vms.rb', line 16 def get_vms(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::Vms.new, :path => "vApp/#{id}" ) end |
#get_vms_by_metadata(key, value) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb', line 8 def (key,value) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::Parsers::Compute::VcloudDirector::VmsByMetadata.new, :path => "vms/query?format=records&filter=metadata:#{key}==STRING:#{value}" ) end |
#get_vms_disk_attached_to(id) ⇒ Excon::Response
Retrieve a list of all VMs attached to a disk.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb', line 13 def get_vms_disk_attached_to(id) response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/attachedVms" ) ensure_list! response.body, :VmReference response end |
#get_vms_in_lease_from_query(options = {}) ⇒ Excon::Response
Retrieves a list of VMs in lease by using REST API general QueryHandler.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fog/vcloud_director/requests/compute/get_vms_in_lease_from_query.rb', line 57 def get_vms_in_lease_from_query(={}) query = [] query << "sortAsc=#{[:sortAsc]}" if [:sortAsc] query << "sortDesc=#{[:sortDesc]}" if [:sortDesc] query << "page=#{[:page]}" if [:page] query << "pageSize=#{[:pageSize]}" if [:pageSize] query << "format=#{[:format]}" if [:format] query << "fields=#{Array([:fields]).join(',')}" if [:fields] query << "offset=#{[:offset]}" if [:offset] query << "filter=#{[:filter]}" if [:filter] response = request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::ToHashDocument.new, :path => 'vms/query', :query => query.map {|q| URI.escape(q)}.join('&') ) ensure_list! response.body, :Link ensure_list! response.body, response.body[:type] == 'application/vnd.vmware.vcloud.query.references+xml' ? :VMReference : :VMRecord %w[firstPage previousPage nextPage lastPage].each do |rel| if link = response.body[:Link].find {|l| l[:rel] == rel} href = Nokogiri::XML.fragment(link[:href]) query = CGI.parse(URI.parse(href.text).query) response.body[rel.to_sym] = query['page'].first.to_i response.body[:pageSize] ||= query['pageSize'].first.to_i end end response end |
#instantiate_vapp_template(vapp_name, template_id, options = {}) ⇒ Excon::Response
Create a vApp from a vApp template.
The response includes a Task element. You can monitor the task to to track the creation of the vApp.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb', line 21 def instantiate_vapp_template(vapp_name, template_id, ={}) params = populate_uris(.merge(:vapp_name => vapp_name, :template_id => template_id)) # @todo Move all the logic to a generator. data = generate_instantiate_vapp_template_request(params) request( :body => data, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{params[:vdc_id]}/action/instantiateVAppTemplate" ) end |
#make_task_object(task_response) ⇒ Object
442 443 444 445 |
# File 'lib/fog/vcloud_director/compute.rb', line 442 def make_task_object(task_response) task_response[:id] = task_response[:href].split('/').last tasks.new(task_response) end |
#org_name ⇒ Object
370 371 372 373 |
# File 'lib/fog/vcloud_director/compute.rb', line 370 def org_name login if @org_name.nil? @org_name end |
#post_acquire_ticket(id) ⇒ Excon::Response
Retrieve a screen ticket that you can use with the VMRC browser plug-in to gain access to the console of a running VM.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_acquire_ticket.rb', line 16 def post_acquire_ticket(id) request( :expects => 200, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/screen/action/acquireTicket" ) end |
#post_answer_pending_vm_question(id, choice_id, question_id) ⇒ Excon::Response
Answer a question being asked by a VM.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fog/vcloud_director/requests/compute/post_answer_vm_pending_question.rb', line 14 def post_answer_pending_vm_question(id, choice_id, question_id) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } VmAnswerQuestion(attrs) { ChoiceId choice_id QuestionId question_id } end.to_xml request( :body => body, :expects => 204, # this might be wrong :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vmPendingAnswer+xml'}, :method => 'POST', :path => "vApp/#{id}/quesiton/action/answer" ) end |
#post_attach_disk(id, disk_id, options = {}) ⇒ Excon::Response
Attach a disk to a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fog/vcloud_director/requests/compute/post_attach_disk.rb', line 23 def post_attach_disk(id, disk_id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } DiskAttachOrDetachParams(attrs) { Disk(:href => "#{end_point}disk/#{disk_id}") if .key?(:BusNumber) BusNumber [:BusNumber] end if .key?(:UnitNumber) BusNumber [:UnitNumber] end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/disk/action/attach" ) end |
#post_cancel_task(id) ⇒ Excon::Response
Cancel a task.
15 16 17 18 19 20 21 |
# File 'lib/fog/vcloud_director/requests/compute/post_cancel_task.rb', line 15 def post_cancel_task(id) request( :expects => 204, :method => 'POST', :path => "task/#{id}/action/cancel" ) end |
#post_capture_vapp(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a vApp template from a vApp.
The response includes a Task element. You can monitor the task to to track the creation of the vApp template.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb', line 27 def post_capture_vapp(vdc_id, name, source_id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1', :name => name } CaptureVAppParams(attrs) { if .key?(:Description) Description [:Description] end Source(:href => "#{end_point}vApp/#{source_id}") if section = [:LeaseSettingsSection] LeaseSettingsSection { self['ovf'].Info 'Lease settings section' if section.key?(:StorageLeaseInSeconds) StorageLeaseInSeconds section[:StorageLeaseInSeconds] end } end if section = [:CustomizationSection] attrs = {} attrs[:goldMaster] = section[:goldMaster] if section.key?(:goldMaster) CustomizationSection(attrs) { self['ovf'].Info 'VApp template customization section' CustomizeOnInstantiate section[:CustomizeOnInstantiate] } end } end.to_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.captureVAppParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/captureVApp" ) end |
#post_check_vm_compliance(id) ⇒ Excon::Response
Perform storage profile compliance check on a VM.
This operation is asynchronous and return a task. When the task completes, the compliance check on the VM has been completed and the results can be retrieved.
17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/post_check_vm_compliance.rb', line 17 def post_check_vm_compliance(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/checkCompliance" ) end |
#post_clone_media(vdc_id, source_id, options = {}) ⇒ Excon::Response
Create a copy of a media object.
The response includes a Task element. You can monitor the task to to track the creation of the vApp template.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fog/vcloud_director/requests/compute/post_clone_media.rb', line 23 def post_clone_media(vdc_id, source_id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } CloneMediaParams(attrs) { if .key?(:Description) Description [:Description] end Source(:href => "#{end_point}media/#{source_id}") if .key?(:IsSourceDelete) IsSourceDelete [:IsSourceDelete] end } end.to_xml response = request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.cloneMediaParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/cloneMedia" ) ensure_list! response.body, :Files, :File response end |
#post_clone_vapp(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a copy of a vApp.
The response includes a Task element. You can monitor the task to to track the creation of the vApp template.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/vcloud_director/requests/compute/post_clone_vapp.rb', line 28 def post_clone_vapp(vdc_id, name, source_id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', :name => name } attrs[:deploy] = [:deploy] if .key?(:deploy) attrs[:powerOn] = [:powerOn] if .key?(:powerOn) CloneVAppParams(attrs) { if .key?(:Description) Description [:Description] end InstantiationParams { # TODO } Source(:href => "#{end_point}vApp/#{source_id}") if .key?(:IsSourceDelete) IsSourceDelete [:IsSourceDelete] end } end.to_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.cloneVAppParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/cloneVApp" ) end |
#post_clone_vapp_template(vdc_id, name, source_id, options = {}) ⇒ Excon::Response
Create a copy of a vApp template.
The response includes a Task element. You can monitor the task to to track the creation of the vApp template.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_clone_vapp_template.rb', line 23 def post_clone_vapp_template(vdc_id, name, source_id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', :name => name } CloneVAppTemplateParams(attrs) { if .key?(:Description) Description [:Description] end Source(:href => "#{end_point}vAppTemplate/#{source_id}") if .key?(:IsSourceDelete) IsSourceDelete [:IsSourceDelete] end } end.to_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/cloneVAppTemplate" ) end |
#post_compose_vapp(id, options = {}) ⇒ Excon::Response
Compose a vApp from existing virtual machines.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
to exist beforehand. to exist beforehand. :name, :href, :isGuestCustomizationEnabled, :computer_name and :ipAllocationMode (e.g. ‘DHCP’).
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb', line 30 def post_compose_vapp(id, ={}) body = Fog::Generators::Compute::VcloudDirector::ComposeVapp.new().generate_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.composeVAppParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{id}/action/composeVApp" ) end |
#post_configure_edge_gateway_services(id, configuration) ⇒ Excon::Response
Configure edge gateway services like firewall, nat and load balancer.
The response includes a Task element. You can monitor the task to track the configuration of edge gateway services.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb', line 22 def post_configure_edge_gateway_services(id, configuration) body = Fog::Generators::Compute::VcloudDirector::EdgeGatewayServiceConfiguration.new(configuration).generate_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.admin.edgeGatewayServiceConfiguration+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "admin/edgeGateway/#{id}/action/configureServices" ) end |
#post_consolidate_vm_vapp(id) ⇒ Excon::Response
Consolidate VM snapshots.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp.rb', line 16 def post_consolidate_vm_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/consolidate" ) end |
#post_consolidate_vm_vapp_template(id) ⇒ Excon::Response
Consolidate VM snapshots.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_consolidate_vm_vapp_template.rb', line 16 def post_consolidate_vm_vapp_template(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/action/consolidate" ) end |
#post_create_catalog_item(id, name, entity, options = {}) ⇒ Excon::Response
Add an item to a catalog.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fog/vcloud_director/requests/compute/post_create_catalog_item.rb', line 22 def post_create_catalog_item(id, name, entity, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', :name => name, } attrs[:operationKey] = [:operationKey] if .key?(:operationKey) CatalogItem(attrs) { if .key?(:Description) Description [:Description] end Entity(entity) } end.to_xml begin request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.catalogItem+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "catalog/#{id}/catalogItems" ) rescue Fog::Compute::VcloudDirector::BadRequest => e if e.minor_error_code == 'DUPLICATE_NAME' raise Fog::Compute::VcloudDirector::DuplicateName.new(e.) end raise end end |
#post_create_org_vdc_network(vdc_id, name, options = {}) ⇒ Excon::Response
Create an Org vDC network.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
Produce media type(s): application/vnd.vmware.vcloud.orgVdcNetwork+xml Output type: OrgVdcNetworkType
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb', line 53 def post_create_org_vdc_network(vdc_id, name, ={}) body = Fog::Generators::Compute::VcloudDirector::OrgVdcNetwork.new(.merge(:name => name)).generate_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.orgVdcNetwork+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "admin/vdc/#{vdc_id}/networks" ) end |
#post_create_snapshot(id, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fog/vcloud_director/requests/compute/post_create_snapshot.rb', line 6 def post_create_snapshot(id, ={}) body = Fog::Generators::Compute::VcloudDirector::CreateSnapshot.new().generate_xml request( :body => body, :expects => 202, :headers => { 'Content-Type' => 'application/vnd.vmware.vcloud.createSnapshotParams+xml' }, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/createSnapshot" ) end |
#post_deploy_vapp(id, options = {}) ⇒ Excon::Response
Deploy a vApp or VM.
Deployment allocates all resources for the vApp and the virtual machines it contains.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb', line 28 def post_deploy_vapp(id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } attrs[:deploymentLeaseSeconds] = [:deploymentLeaseSeconds] if .key?(:deploymentLeaseSeconds) attrs[:forceCustomization] = [:forceCustomization] if .key?(:forceCustomization) attrs[:powerOn] = [:powerOn] if .key?(:powerOn) DeployVAppParams(attrs) end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.deployVAppParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/deploy" ) end |
#post_detach_disk(id, disk_id) ⇒ Excon::Response
Detach a disk from a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/post_detach_disk.rb', line 17 def post_detach_disk(id, disk_id) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } DiskAttachOrDetachParams(attrs) { Disk(:href => "#{end_point}disk/#{disk_id}") } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/disk/action/detach" ) end |
#post_disable_nested_hv(id) ⇒ Excon::Response
Hide hardware-assisted CPU virtualization from guest OS.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_disable_nested_hv.rb', line 16 def post_disable_nested_hv(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/disableNestedHypervisor" ) end |
#post_disable_vapp_template_download(id) ⇒ Excon::Response
Disable a vApp template for download.
13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/post_disable_vapp_template_download.rb', line 13 def post_disable_vapp_template_download(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/action/disableDownload" ) end |
#post_discard_vapp_state(id) ⇒ Excon::Response
Discard suspended state of a vApp or VM.
Discarding the suspended state of a vApp discards the suspended state of all VMs it contains.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
19 20 21 22 23 24 25 26 |
# File 'lib/fog/vcloud_director/requests/compute/post_discard_vapp_state.rb', line 19 def post_discard_vapp_state(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/discardSuspendedState" ) end |
#post_eject_cd_rom(id, media_id) ⇒ Excon::Response
Eject virtual media.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb', line 17 def post_eject_cd_rom(id, media_id) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } MediaInsertOrEjectParams(attrs) { Media(:href => "#{end_point}media/#{media_id}") } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/media/action/ejectMedia" ) end |
#post_enable_nested_hv(id) ⇒ Excon::Response
Expose hardware-assisted CPU virtualization to guest OS.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_enable_nested_hv.rb', line 16 def post_enable_nested_hv(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/enableNestedHypervisor" ) end |
#post_enable_vapp_template_download(id) ⇒ Excon::Response
Enable a vApp template for download.
13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/requests/compute/post_enable_vapp_template_download.rb', line 13 def post_enable_vapp_template_download(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/action/enableDownload" ) end |
#post_enter_maintenance_mode(id) ⇒ Excon::Response
Place the vApp in maintenance mode.
When a vApp is in maintenance mode, it is read-only to users. Only a system administrator can modify it. User-initiated tasks that are running when the vApp enters maintenance mode continue to run.
16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/post_enter_maintenance_mode.rb', line 16 def post_enter_maintenance_mode(id) request( :expects => 204, :method => 'POST', :path => "vApp/#{id}/action/enterMaintenanceMode" ) end |
#post_exit_maintenance_mode(id) ⇒ Excon::Response
Take the vApp out of maintenance mode.
12 13 14 15 16 17 18 |
# File 'lib/fog/vcloud_director/requests/compute/post_exit_maintenance_mode.rb', line 12 def post_exit_maintenance_mode(id) request( :expects => 204, :method => 'POST', :path => "vApp/#{id}/action/exitMaintenanceMode" ) end |
#post_insert_cd_rom(id, media_id) ⇒ Excon::Response
Insert virtual media.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb', line 17 def post_insert_cd_rom(id, media_id) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } MediaInsertOrEjectParams(attrs) { Media(:href => "#{end_point}media/#{media_id}") } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/media/action/insertMedia" ) end |
#post_install_vmware_tools(id) ⇒ Excon::Response
Install VMware Tools on a running VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_install_vmware_tools.rb', line 16 def post_install_vmware_tools(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/installVMwareTools" ) end |
#post_instantiate_vapp_template(id, vapp_template_id, name, options = {}) ⇒ Excon::Response
This may not work at all or may work only under certain circumstances.
Create a vApp from a vApp template.
The response includes a Task element. You can monitor the task to to track the creation of the vApp.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/fog/vcloud_director/requests/compute/post_instantiate_vapp_template.rb', line 52 def post_instantiate_vapp_template(id, vapp_template_id, name, ={}) body = Nokogiri::XML::Builder.new do attrs = { 'xmlns' => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1', :name => name } attrs[:deploy] = [:deploy] if .key?(:deploy) attrs[:powerOn] = [:powerOn] if .key?(:powerOn) InstantiateVAppTemplateParams(attrs) { if .key?(:Description) Description [:Description] end if instantiation_params = [:InstantiationParams] InstantiationParams { if section = instantiation_params[:LeaseSettingsSection] LeaseSettingsSection { self['ovf'].Info 'Lease settings section' if section.key?(:DeploymentLeaseInSeconds) DeploymentLeaseInSeconds section[:DeploymentLeaseInSeconds] end if section.key?(:StorageLeaseInSeconds) StorageLeaseInSeconds section[:StorageLeaseInSeconds] end if section.key?(:DeploymentLeaseExpiration) DeploymentLeaseExpiration section[:DeploymentLeaseExpiration].strftime('%Y-%m-%dT%H:%M:%S%z') end if section.key?(:StorageLeaseExpiration) StorageLeaseExpiration section[:StorageLeaseExpiration].strftime('%Y-%m-%dT%H:%M:%S%z') end } end if section = instantiation_params[:NetworkConfigSection] NetworkConfigSection { self['ovf'].Info 'Configuration parameters for logical networks' if network_configs = section[:NetworkConfig] network_configs = [network_configs] if network_configs.is_a?(Hash) network_configs.each do |network_config| NetworkConfig(:networkName => network_config[:networkName]) { if configuration = network_config[:Configuration] Configuration { ParentNetwork(configuration[:ParentNetwork]) FenceMode configuration[:FenceMode] } end } end end } end } end Source(:href => "#{end_point}vAppTemplate/#{vapp_template_id}") if .key?(:IsSourceDelete) IsSourceDelete [:IsSourceDelete] end if .key?(:AllEULAsAccepted) AllEULAsAccepted [:AllEULAsAccepted] end } end.to_xml begin request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{id}/action/instantiateVAppTemplate" ) rescue Fog::Compute::VcloudDirector::BadRequest => e if e.minor_error_code == 'DUPLICATE_NAME' raise Fog::Compute::VcloudDirector::DuplicateName.new(e.) end raise end end |
#post_login_session ⇒ Excon::Response
Log in and create a Session object.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/post_login_session.rb', line 22 def post_login_session headers = { 'Accept' => "application/*+xml;version=#{@api_version}", 'Authorization' => "Basic #{Base64.encode64("#{@vcloud_director_username}:#{@vcloud_director_password}").delete("\r\n")}" } @connection.request( :expects => 200, :headers => headers, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "#{@path}/sessions" ) end |
#post_power_off_vapp(id) ⇒ Excon::Response
Power off a vApp or VM.
If used on a vApp, powers off all VMs in the vApp. If used on a VM, powers off the VM. This operation is available only for a vApp or VM that is powered on.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
25 26 27 28 29 30 31 32 |
# File 'lib/fog/vcloud_director/requests/compute/post_power_off_vapp.rb', line 25 def post_power_off_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/powerOff" ) end |
#post_power_on_vapp(id) ⇒ Excon::Response
Power on a vApp or VM.
If used on a vApp, powers on all VMs in the vApp. If used on a VM, powers on the VM. This operation is available only for a vApp or VM that is powered off.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
25 26 27 28 29 30 31 32 |
# File 'lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb', line 25 def post_power_on_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/powerOn" ) end |
#post_reboot_vapp(id) ⇒ Excon::Response
Reboot a vApp or VM.
If used on a vApp, reboots all VMs in the vApp. If used on a VM, reboots the VM. This operation is available only for a vApp or VM that is powered on.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
22 23 24 25 26 27 28 29 |
# File 'lib/fog/vcloud_director/requests/compute/post_reboot_vapp.rb', line 22 def post_reboot_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/reboot" ) end |
#post_recompose_vapp(id, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb', line 6 def post_recompose_vapp(id, ={}) body = Fog::Generators::Compute::VcloudDirector::RecomposeVapp.new().generate_xml request( :body => body, :expects => 202, :headers => { 'Content-Type' => 'application/vnd.vmware.vcloud.recomposeVAppParams+xml' }, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/recomposeVApp" ) end |
#post_reconfigure_vm(id, options = {}) ⇒ Excon::Response
Updates VM configuration.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb', line 26 def post_reconfigure_vm(id, ={}) body = Nokogiri::XML::Builder.new do |xml| attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1', 'xmlns:rasd' => 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData', :name => [:name] } xml.Vm(attrs) do xml.Description [:description] if [:description] virtual_hardware_section(xml, ) end end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vm+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/reconfigureVm" ) end |
#post_remove_all_snapshots(id) ⇒ Excon::Response
Removes all user created snapshots for a vApp or virtual machine.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_remove_all_snapshots.rb', line 16 def post_remove_all_snapshots(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/removeAllSnapshots" ) end |
#post_reset_vapp(id) ⇒ Excon::Response
Reset a vApp or VM.
If used on a vApp, resets all VMs in the vApp. If used on a VM, resets the VM. This operation is available only for a vApp or VM that is powered on.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
22 23 24 25 26 27 28 29 |
# File 'lib/fog/vcloud_director/requests/compute/post_reset_vapp.rb', line 22 def post_reset_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/reset" ) end |
#post_revert_snapshot(id) ⇒ Excon::Response
Reverts a vApp or virtual machine to the current snapshot, if any.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
16 17 18 19 20 21 22 23 |
# File 'lib/fog/vcloud_director/requests/compute/post_revert_snapshot.rb', line 16 def post_revert_snapshot(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/revertToCurrentSnapshot" ) end |
#post_shutdown_vapp(id) ⇒ Excon::Response
Shut down a vApp or VM.
If used on a vApp, shuts down all VMs in the vApp. If used on a VM, shuts down the VM. This operation is available only for a vApp or VM that is powered on.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
22 23 24 25 26 27 28 29 |
# File 'lib/fog/vcloud_director/requests/compute/post_shutdown_vapp.rb', line 22 def post_shutdown_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/shutdown" ) end |
#post_suspend_vapp(id) ⇒ Excon::Response
Suspend a vApp or VM.
If used on a vApp, suspends all VMs in the vApp. If used on a VM, suspends the VM. This operation is available only for a vApp or VM that is powered on.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
22 23 24 25 26 27 28 29 |
# File 'lib/fog/vcloud_director/requests/compute/post_suspend_vapp.rb', line 22 def post_suspend_vapp(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/power/action/suspend" ) end |
#post_undeploy_vapp(id, options = {}) ⇒ Excon::Response
Undeploy a vApp/VM.
Undeployment deallocates all resources used by the vApp and the VMs it contains.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fog/vcloud_director/requests/compute/post_undeploy_vapp.rb', line 36 def post_undeploy_vapp(id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } UndeployVAppParams(attrs) { if [:UndeployPowerAction] UndeployPowerAction [:UndeployPowerAction] end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.undeployVAppParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/undeploy" ) end |
#post_update_catalog_item_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing catalog item metadata.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_update_catalog_item_metadata.rb', line 14 def (id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } Metadata(attrs) { .each do |key, value| MetadataEntry { Key key if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}/metadata/" ) end |
#post_update_disk_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_update_disk_metadata.rb', line 14 def (id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } Metadata(attrs) { .each do |key, value| MetadataEntry { Key key if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/metadata/" ) end |
#post_update_media_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_update_media_metadata.rb', line 14 def (id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } Metadata(attrs) { .each do |key, value| MetadataEntry { Key key if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/metadata/" ) end |
#post_update_vapp_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_update_vapp_metadata.rb', line 14 def (id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } Metadata(attrs) { .each do |key, value| MetadataEntry { Key key if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/metadata/" ) end |
#post_update_vapp_template_metadata(id, metadata = {}) ⇒ Excon::Response
Merge the metadata provided in the request with existing metadata.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fog/vcloud_director/requests/compute/post_update_vapp_template_metadata.rb', line 14 def (id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } Metadata(attrs) { .each do |key, value| MetadataEntry { Key key if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vAppTemplate/#{id}/metadata/" ) end |
#post_upgrade_hw_version(id) ⇒ Excon::Response
Upgrade the virtual hardware version of a VM to the highest supported virtual hardware version of the vDC that contains it.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
17 18 19 20 21 22 23 24 |
# File 'lib/fog/vcloud_director/requests/compute/post_upgrade_hw_version.rb', line 17 def post_upgrade_hw_version(id) request( :expects => 202, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/action/upgradeHardwareVersion" ) end |
#post_upload_disk(id, name, size, options = {}) ⇒ Excon::Response
Create a disk.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fog/vcloud_director/requests/compute/post_upload_disk.rb', line 46 def post_upload_disk(id, name, size, ={}) body = Nokogiri::XML::Builder.new do DiskCreateParams(:xmlns => 'http://www.vmware.com/vcloud/v1.5') { attrs = { :name => name, :size => size } attrs[:operationKey] = [:operationKey] if .key?(:operationKey) attrs[:busSubType] = [:busSubType] if .key?(:busSubType) attrs[:busType] = [:busType] if .key?(:busType) Disk(attrs) { if .key?(:Description) Description [:Description] end if .key?(:StorageProfile) attrs = { :href => [:StorageProfile][:href] } StorageProfile(attrs) end } } end.to_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.diskCreateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{id}/disk" ) end |
#post_upload_media(vdc_id, name, image_type, size, options = {}) ⇒ Excon::Response
Support vDC Storage Profiles.
Upload a media image.
The response includes an upload link for the media image.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fog/vcloud_director/requests/compute/post_upload_media.rb', line 26 def post_upload_media(vdc_id, name, image_type, size, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', :name => name, :imageType => image_type, :size => size } attrs[:operationKey] = [:operationKey] if .key?(:operationKey) Media(attrs) { if .key?(:Description) Description [:Description] end } end.to_xml response = request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.media+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/media" ) ensure_list! response.body, :Files, :File response end |
#post_upload_vapp_template(vdc_id, name, options = {}) ⇒ Excon::Response
Upload an OVF package to create a vApp template
The response includes an upload link for the OVF descriptor.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb', line 20 def post_upload_vapp_template(vdc_id, name, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', :name => name } attrs[:manifestRequired] = [:manifestRequired] if .key?(:manifestRequired) UploadVAppTemplateParams(attrs) { if .key?(:Description) Description [:Description] end } end.to_xml request( :body => body, :expects => 201, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/uploadVAppTemplate" ) end |
#process_task(response_body) ⇒ Object
436 437 438 439 440 |
# File 'lib/fog/vcloud_director/compute.rb', line 436 def process_task(response_body) task = make_task_object(response_body) wait_and_raise_unless_success(task) true end |
#put_catalog_item_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the metadata value for the specified key to the value provided, overwriting any existing value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/vcloud_director/requests/compute/put_catalog_item_metadata_item_metadata.rb', line 17 def (id, key, value) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } MetadataValue(attrs) { if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "catalogItem/#{id}/metadata/#{URI.escape(key)}" ) end |
#put_config_network_section_vapp(id, options = {}) ⇒ Object
Update the network config section of a vApp.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/put_config_network_section_vapp.rb', line 11 def put_config_network_section_vapp(id, ={}) body = Fog::Generators::Compute::VcloudDirector::NetworkConfigSection.new().generate_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.networkConfigSection+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/networkConfigSection" ) end |
#put_cpu(id, num_cpus) ⇒ Excon:Response
Update the RASD item that specifies CPU properties of a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fog/vcloud_director/requests/compute/put_cpu.rb', line 20 def put_cpu(id, num_cpus) data = <<EOF <Item xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns12="http://www.vmware.com/vcloud/v1.5" ns12:href="#{end_point}vApp/#{id}/virtualHardwareSection/cpu" ns12:type="application/vnd.vmware.vcloud.rasdItem+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 #{end_point}v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd"> <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> <rasd:Description>Number of Virtual CPUs</rasd:Description> <rasd:ElementName>#{num_cpus} virtual CPU(s)</rasd:ElementName> <rasd:InstanceID>4</rasd:InstanceID> <rasd:Reservation>0</rasd:Reservation> <rasd:ResourceType>3</rasd:ResourceType> <rasd:VirtualQuantity>#{num_cpus}</rasd:VirtualQuantity> <rasd:Weight>0</rasd:Weight> <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="#{end_point}vApp/#{id}/virtualHardwareSection/cpu"/> </Item> EOF request( :body => data, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItem+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/cpu" ) end |
#put_disk_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/vcloud_director/requests/compute/put_disk_metadata_item_metadata.rb', line 17 def (id, key, value) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } MetadataValue(attrs) { type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "disk/#{id}/metadata/#{URI.escape(key)}" ) end |
#put_disks(id, disks = []) ⇒ Excon::Response
Update all RASD items that specify hard disk and hard disk controller properties of a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/vcloud_director/requests/compute/put_disks.rb', line 24 def put_disks(id, disks=[]) data = Fog::Generators::Compute::VcloudDirector::Disks.new(disks) request( :body => data.generate_xml, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItemsList+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/disks" ) end |
#put_guest_customization_section_vapp(id, options = {}) ⇒ Excon::Response
Updates the guest customization section of a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb', line 56 def put_guest_customization_section_vapp(id, ={}) = .dup # Mutate options to new format. deprecated = { :enabled => :Enabled, :change_sid => :ChangeSid, :join_domain_enabled => :JoinDomainEnabled, :use_org_settings => :UseOrgSettings, :admin_password => :AdminPassword, :admin_password_enabled => :AdminPasswordEnabled, :admin_password_auto => :AdminPasswordAuto, :reset_password_required => :ResetPasswordRequired, :customization_script => :CustomizationScript, :computer_name => :ComputerName } deprecated.each do |from, to| [to] = .delete(from) if .key?(from) end body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1' } GuestCustomizationSection(attrs) { self['ovf'].Info 'Specifies Guest OS Customization Settings' if .key?(:Enabled) Enabled [:Enabled] end if .key?(:ChangeSid) ChangeSid [:ChangeSid] end if .key?(:JoinDomainEnabled) JoinDomainEnabled [:JoinDomainEnabled] end if .key?(:UseOrgSettings) UseOrgSettings [:UseOrgSettings] end if .key?(:DomainName) DomainName [:DomainName] end if .key?(:DomainUser) DomainUser [:DomainUser] end if .key?(:DomainUserPassword) DomainUserPassword [:DomainUserPassword] end if .key?(:MachineObjectOU) MachineObjectOU [:MachineObjectOU] end if .key?(:AdminPasswordEnabled) AdminPasswordEnabled [:AdminPasswordEnabled] end if .key?(:AdminPasswordAuto) AdminPasswordAuto [:AdminPasswordAuto] end # Don't add AdminPassword if AdminPasswordAuto is true if .key?(:AdminPassword) and ![:AdminPasswordAuto] AdminPassword [:AdminPassword] end if .key?(:ResetPasswordRequired) ResetPasswordRequired [:ResetPasswordRequired] end if .key?(:CustomizationScript) CustomizationScript [:CustomizationScript] end if .key?(:ComputerName) ComputerName [:ComputerName] end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.guestCustomizationSection+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/guestCustomizationSection" ) end |
#put_media_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/vcloud_director/requests/compute/put_media_metadata_item_metadata.rb', line 17 def (id, key, value) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } MetadataValue(attrs) { if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "media/#{id}/metadata/#{URI.escape(key)}" ) end |
#put_memory(id, memory) ⇒ Excon::Response
Update the RASD item that specifies memory properties of a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fog/vcloud_director/requests/compute/put_memory.rb', line 20 def put_memory(id, memory) data = <<EOF <Item xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns12="http://www.vmware.com/vcloud/v1.5" ns12:href="#{end_point}vApp/#{id}/virtualHardwareSection/memory" ns12:type="application/vnd.vmware.vcloud.rasdItem+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 #{end_point}v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd"> <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits> <rasd:Description>Memory Size</rasd:Description> <rasd:ElementName>#{memory} MB of memory</rasd:ElementName> <rasd:InstanceID>5</rasd:InstanceID> <rasd:Reservation>0</rasd:Reservation> <rasd:ResourceType>4</rasd:ResourceType> <rasd:VirtualQuantity>#{memory}</rasd:VirtualQuantity> <rasd:Weight>0</rasd:Weight> <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="#{end_point}vApp/#{id}/virtualHardwareSection/memory"/> </Item> EOF request( :body => data, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItem+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/virtualHardwareSection/memory" ) end |
#put_metadata_value(vm_id, metadata_key, metadata_value) ⇒ Object
deprecated Use #put_vapp_metadata_item_metadata instead.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/vcloud_director/requests/compute/put_metadata_value.rb', line 6 def (vm_id, , ) Fog::Logger.deprecation("#{self} => ##{} is deprecated, use ##{} instead [light_black](#{caller.first})[/]") body=" <MetadataValue xmlns=\"http://www.vmware.com/vcloud/v1.5\"> <Value>#{}</Value> </MetadataValue>" request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{vm_id}/metadata/#{URI.escape()}" ) end |
#put_network(id, name, options = {}) ⇒ Excon::Response
Update an Org vDC network.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
Produce media type(s): application/vnd.vmware.vcloud.orgVdcNetwork+xml Output type: TaskType
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fog/vcloud_director/requests/compute/put_network.rb', line 53 def put_network(id, name, ={}) body = Fog::Generators::Compute::VcloudDirector::OrgVdcNetwork.new(.merge(:name => name)).generate_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.orgVdcNetwork+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "admin/network/#{id}" ) end |
#put_network_connection_system_section_vapp(id, options = {}) ⇒ Excon::Response
Update the network connection section of a VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fog/vcloud_director/requests/compute/put_network_connection_system_section_vapp.rb', line 49 def put_network_connection_system_section_vapp(id, ={}) = .dup # Mutate options to new format. deprecated = { :needs_customization => :needsCustomization, :network => :network, :network_connection_index => :NetworkConnectionIndex, :ip_address => :IpAddress, :is_connected => :IsConnected, :mac_address => :MACAddress, :ip_address_allocation_mode => :IpAddressAllocationMode } option = .delete(:primary_network_connection_index) [:PrimaryNetworkConnectionIndex] ||= option unless option.nil? unless .key?(:NetworkConnection) deprecated.each do |from, to| if .key?(from) [:NetworkConnection] ||= [{}] [:NetworkConnection].first[to] = .delete(from) end end end [:NetworkConnection] = [[:NetworkConnection]] if [:NetworkConnection].is_a?(Hash) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1' } NetworkConnectionSection(attrs) { self[:ovf].Info 'Specifies the available VM network connections' if .key?(:PrimaryNetworkConnectionIndex) PrimaryNetworkConnectionIndex [:PrimaryNetworkConnectionIndex] end if network_connection = [:NetworkConnection] network_connection.each do |nic| attrs = { :network => nic[:network] } if nic.key?(:needsCustomization) attrs[:needsCustomization] = nic[:needsCustomization] end NetworkConnection(attrs) { NetworkConnectionIndex nic[:NetworkConnectionIndex] if nic.key?(:IpAddress) IpAddress nic[:IpAddress] end IsConnected nic[:IsConnected] if nic.key?(:MACAddress) MACAddress nic[:MACAddress] end IpAddressAllocationMode nic[:IpAddressAllocationMode] } end end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.networkConnectionSection+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/networkConnectionSection/" ) end |
#put_product_sections(id, sections) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/vcloud_director/requests/compute/put_product_sections.rb', line 15 def put_product_sections(id, sections) xml = '<ProductSectionList xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">' xml += '<ovf:ProductSection>' xml += '<ovf:Info>Global vApp Custom Properties</ovf:Info>' xml += '<ovf:Category>Global</ovf:Category>' sections.each do |section| section[:user_configurable] ||= true section[:type] ||= "string" section[:password] ||= false xml += "<ovf:Property ovf:userConfigurable='#{section[:user_configurable]}' ovf:type='#{section[:type]}' ovf:password='#{section[:password]}' ovf:key='#{section[:id]}' ovf:value='#{section[:value]}'>" xml += "<ovf:Label>#{section[:id]}</ovf:Label>" xml += "</ovf:Property>" end xml += '</ovf:ProductSection>' xml += "</ProductSectionList>" request( :body => xml, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.productSections+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/productSections" ) end |
#put_vapp_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/vcloud_director/requests/compute/put_vapp_metadata_item_metadata.rb', line 17 def (id, key, value) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } MetadataValue(attrs) { if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/metadata/#{URI.escape(key)}" ) end |
#put_vapp_name_and_description(id, name, options = {}) ⇒ Excon::Response
Modify the name or description of a vApp.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb', line 22 def put_vapp_name_and_description(id, name, ={}) body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, ).generate_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vApp+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}" ) end |
#put_vapp_template_metadata_item_metadata(id, key, value) ⇒ Excon::Response
Set the value for the specified metadata key to the value provided, overwriting any existing value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/vcloud_director/requests/compute/put_vapp_template_metadata_item_metadata.rb', line 17 def (id, key, value) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } MetadataValue(attrs) { if api_version.to_f < 5.1 Value value else type = case value when TrueClass, FalseClass then 'MetadataBooleanValue'; when DateTime then 'MetadataDateTimeValue'; when Fixnum then 'MetadataNumberValue'; else 'MetadataStringValue' end TypedValue('xsi:type' => type) { Value value } end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.metadata.value+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vappTemplate/#{id}/metadata/#{URI.escape(key)}" ) end |
#put_vm(id, name, options) ⇒ Excon::Response
Update the name, description and storage profile for VM.
This operation is asynchronous and returns a task that you can monitor to track the progress of the request.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/vcloud_director/requests/compute/put_vm.rb', line 24 def put_vm(id, name, ) body = Fog::Generators::Compute::VcloudDirector::Vm.new(.merge(:name => name)).generate_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vm+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}" ) end |
#put_vm_capabilities(id, options = {}) ⇒ Excon::Response
Update VM’s capabilities.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/vcloud_director/requests/compute/put_vm_capabilities.rb', line 17 def put_vm_capabilities(id, ={}) body = Nokogiri::XML::Builder.new do attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } VmCapabilities(attrs) { if .key?(:MemoryHotAddEnabled) MemoryHotAddEnabled [:MemoryHotAddEnabled] end if .key?(:CpuHotAddEnabled) MemoryHotAddEnabled [:CpuHotAddEnabled] end } end.to_xml request( :body => body, :expects => 202, :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vmCapabilitiesSection+xml'}, :method => 'PUT', :parser => Fog::ToHashDocument.new, :path => "vApp/#{id}/vmCapabilities" ) end |
#reload ⇒ Object
380 381 382 |
# File 'lib/fog/vcloud_director/compute.rb', line 380 def reload @connection.reset end |
#request(params) ⇒ Object
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/fog/vcloud_director/compute.rb', line 384 def request(params) begin do_request(params) rescue EOFError # This error can occur if Vcloud receives a request from a network # it deems to be unauthorized; no HTTP response is sent, but the # connection is sent a signal to terminate early. raise( MalformedResponse, "Connection unexpectedly terminated by vcloud" ) # this is to know if Excon::Errors::Unauthorized really happens #rescue Excon::Errors::Unauthorized # login # do_request(params) end end |
#undeploy(id) ⇒ Object
Use #post_undeploy_vapp instead.
59 60 61 62 |
# File 'lib/fog/vcloud_director/requests/compute/post_undeploy_vapp.rb', line 59 def undeploy(id) Fog::Logger.deprecation("#{self} => ##{undeploy} is deprecated, use ##{post_undeploy_vapp} instead [light_black](#{caller.first})[/]") post_undeploy_vapp(id, :UndeployPowerAction => 'shutdown') end |
#user_name ⇒ Object
375 376 377 378 |
# File 'lib/fog/vcloud_director/compute.rb', line 375 def user_name login if @user_name.nil? @user_name end |
#vcloud_token ⇒ Object
365 366 367 368 |
# File 'lib/fog/vcloud_director/compute.rb', line 365 def vcloud_token login if @vcloud_token.nil? @vcloud_token end |
#wait_and_raise_unless_success(task) ⇒ Object
447 448 449 450 |
# File 'lib/fog/vcloud_director/compute.rb', line 447 def wait_and_raise_unless_success(task) task.wait_for { non_running? } raise TaskError.new "status: #{task.status}, error: #{task.error}" unless task.success? end |