Method: Fog::Network::AzureRM::PublicIp.parse

Defined in:
lib/fog/azurerm/models/network/public_ip.rb

.parse(public_ip) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/azurerm/models/network/public_ip.rb', line 19

def self.parse(public_ip)
  hash = {}
  hash['id'] = public_ip.id
  hash['name'] = public_ip.name
  hash['location'] = public_ip.location
  hash['resource_group'] = get_resource_group_from_id(public_ip.id)
  hash['public_ip_allocation_method'] = public_ip.public_ipallocation_method
  hash['ip_address'] = public_ip.ip_address
  hash['idle_timeout_in_minutes'] = public_ip.idle_timeout_in_minutes
  hash['ip_configuration_id'] = public_ip.ip_configuration.id unless public_ip.ip_configuration.nil?
  hash['tags'] = public_ip.tags

  unless public_ip.dns_settings.nil?
    hash['domain_name_label'] = public_ip.dns_settings.domain_name_label
    hash['fqdn'] = public_ip.dns_settings.fqdn
    hash['reverse_fqdn'] = public_ip.dns_settings.reverse_fqdn
  end

  hash
end