lib/fog/azurerm/models/compute/availability_set.rb in fog-azure-rm-0.0.4 vs lib/fog/azurerm/models/compute/availability_set.rb in fog-azure-rm-0.0.5
- old
+ new
@@ -10,18 +10,18 @@
attribute :location
attribute :resource_group
attribute :platform_update_domain_count
attribute :platform_fault_domain_count
- def self.parse(as)
+ def self.parse(availability_set)
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['id'] = availability_set.id
+ hash['name'] = availability_set.name
+ hash['type'] = availability_set.type
+ hash['location'] = availability_set.location
+ hash['resource_group'] = get_resource_group_from_id(availability_set.id)
+ hash['platform_update_domain_count'] = availability_set.platform_update_domain_count
+ hash['platform_fault_domain_count'] = availability_set.platform_fault_domain_count
hash
end
def save
requires :name