Class: Fog::Network::AzureRM::PublicIp
- Inherits:
-
Model
- Object
- Model
- Fog::Network::AzureRM::PublicIp
- Defined in:
- lib/fog/azurerm/models/network/public_ip.rb
Overview
PublicIP model class for Network Service
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.parse(public_ip) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fog/azurerm/models/network/public_ip.rb', line 18 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? 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 |
Instance Method Details
#destroy ⇒ Object
47 48 49 |
# File 'lib/fog/azurerm/models/network/public_ip.rb', line 47 def destroy service.delete_public_ip(resource_group, name) end |
#save ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/fog/azurerm/models/network/public_ip.rb', line 38 def save requires :name requires :public_ip_allocation_method requires :location requires :resource_group public_ip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label) merge_attributes(Fog::Network::AzureRM::PublicIp.parse(public_ip)) end |
#update(input_hash) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/fog/azurerm/models/network/public_ip.rb', line 51 def update(input_hash) validate_input(input_hash) merge_attributes(input_hash) pip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label) merge_attributes(Fog::Network::AzureRM::PublicIp.parse(pip)) end |