Class: Azure::VirtualMachineImageManagement::VirtualMachineDiskManagementService
- Inherits:
-
BaseManagement::BaseManagementService
- Object
- BaseManagement::BaseManagementService
- Azure::VirtualMachineImageManagement::VirtualMachineDiskManagementService
- Defined in:
- lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb
Instance Method Summary collapse
-
#delete_virtual_machine_disk(disk_name) ⇒ Object
Public: Deletes the specified data or operating system disk from the image repository.
- #get_virtual_machine_disk(disk_name) ⇒ Object
-
#initialize ⇒ VirtualMachineDiskManagementService
constructor
A new instance of VirtualMachineDiskManagementService.
-
#list_virtual_machine_disks ⇒ Object
Public: Gets a list of Disks from the server.
Methods inherited from BaseManagement::BaseManagementService
#create_affinity_group, #delete_affinity_group, #get_affinity_group, #list_affinity_groups, #list_locations, #list_role_sizes, #update_affinity_group, #validate_configuration
Constructor Details
#initialize ⇒ VirtualMachineDiskManagementService
Returns a new instance of VirtualMachineDiskManagementService.
59 60 61 |
# File 'lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb', line 59 def initialize super() end |
Instance Method Details
#delete_virtual_machine_disk(disk_name) ⇒ Object
Public: Deletes the specified data or operating system disk from the image repository.
Returns None
81 82 83 84 85 86 |
# File 'lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb', line 81 def delete_virtual_machine_disk(disk_name) Azure::Loggerx.info "Deleting Disk \"#{disk_name}\". " path = "/services/disks/#{disk_name}" request = BaseManagement::ManagementHttpRequest.new(:delete, path) request.call end |
#get_virtual_machine_disk(disk_name) ⇒ Object
73 74 75 76 |
# File 'lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb', line 73 def get_virtual_machine_disk(disk_name) disk = list_virtual_machine_disks.select { |x| x.name == disk_name } disk.first end |
#list_virtual_machine_disks ⇒ Object
Public: Gets a list of Disks from the server.
Returns an array of Azure::VirtualMachineDiskManagementService objects
66 67 68 69 70 71 |
# File 'lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb', line 66 def list_virtual_machine_disks request_path = '/services/disks' request = Azure::BaseManagement::ManagementHttpRequest.new(:get, request_path, nil) response = request.call Serialization.disks_from_xml(response) end |