Class: Fog::Compute::AzureRM::AvailabilitySet
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::AzureRM::AvailabilitySet
- Defined in:
- lib/fog/azurerm/models/compute/availability_set.rb
Overview
This class is giving implementation of create/save and delete/destroy for Availability Set.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.parse(as) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/azurerm/models/compute/availability_set.rb', line 15 def self.parse(as) hash = {} hash['id'] = as['id'] hash['name'] = as['name'] hash['type'] = as['type'] hash['location'] = as['location'] hash['resource_group'] = as['id'].split('/')[4] hash['platform_update_domain_count'] = as['properties']['platformUpdateDomainCount'] hash['platform_fault_domain_count'] = as['properties']['platformFaultDomainCount'] hash end |
Instance Method Details
#destroy ⇒ Object
37 38 39 |
# File 'lib/fog/azurerm/models/compute/availability_set.rb', line 37 def destroy service.delete_availability_set(resource_group, name) end |
#save ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/azurerm/models/compute/availability_set.rb', line 27 def save requires :name requires :location requires :resource_group # need to create the availability set as = service.create_availability_set(resource_group, name, location) hash = Fog::Compute::AzureRM::AvailabilitySet.parse(as) merge_attributes(hash) end |