Class: Fog::Compute::AzureRM::VirtualMachineExtension

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/compute/virtual_machine_extension.rb

Overview

This class is giving implementation For Virtual Machine Extension

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(vm_extension) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/azurerm/models/compute/virtual_machine_extension.rb', line 18

def self.parse(vm_extension)
  virtual_machine_extension = {}
  virtual_machine_extension[:id] = vm_extension.id
  virtual_machine_extension[:resource_group] = get_resource_group_from_id(vm_extension.id)
  virtual_machine_extension[:name] = vm_extension.name
  virtual_machine_extension[:location] = vm_extension.location
  virtual_machine_extension[:vm_name] = get_virtual_machine_from_id(vm_extension.id)
  virtual_machine_extension[:type] = vm_extension.virtual_machine_extension_type
  virtual_machine_extension[:publisher] = vm_extension.publisher
  virtual_machine_extension[:type_handler_version] = vm_extension.type_handler_version
  virtual_machine_extension[:auto_upgrade_minor_version] = vm_extension.auto_upgrade_minor_version
  virtual_machine_extension[:settings] = vm_extension.settings
  virtual_machine_extension[:protected_settings] = vm_extension.protected_settings
  virtual_machine_extension
end

Instance Method Details

#destroyObject



47
48
49
# File 'lib/fog/azurerm/models/compute/virtual_machine_extension.rb', line 47

def destroy
  service.delete_vm_extension(resource_group, vm_name, name)
end

#saveObject



34
35
36
37
38
# File 'lib/fog/azurerm/models/compute/virtual_machine_extension.rb', line 34

def save
  requires :resource_group, :location, :name, :vm_name, :type, :publisher, :type_handler_version, :settings
  vm_extension = service.create_or_update_vm_extension(vm_extension_params)
  merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
end

#update(vm_extension_input) ⇒ Object



40
41
42
43
44
45
# File 'lib/fog/azurerm/models/compute/virtual_machine_extension.rb', line 40

def update(vm_extension_input)
  validate_input(vm_extension_input)
  merge_attributes(vm_extension_input) unless vm_extension_input.empty?
  vm_extension = service.create_or_update_vm_extension(vm_extension_params)
  merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
end