Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/public_ip.rb
# this function deletes the public ip
this function deletes the public ip
this function deletes the public ip
def delete(resource_group_name, public_ip_name)
      begin
        OOLog.info("Deleting public IP '#{public_ip_name}' from '#{resource_group_name}' ")
        start_time = Time.now.to_i
        promise = @client.public_ip_addresses.delete(resource_group_name, public_ip_name)
        response = promise.value!
        result = response.body
        end_time = Time.now.to_i
        duration = end_time - start_time
        OOLog.info("operation took #{duration} seconds")
        return result
      rescue MsRestAzure::AzureOperationError => e
        OOLog.fatal("Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.body}")
      rescue => e
        OOLog.fatal("Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.message}")
      end
    end
def delete ( resource_group_name , public_ip_name ) begin OOLog . info ( "Deleting public IP '#{public_ip_name}' from '#{resource_group_name}' " ) start_time = Time . now . to_i promise = @client . public_ip_addresses . delete ( resource_group_name , public_ip_name ) response = promise . value! result = response . body end_time = Time . now . to_i duration = end_time - start_time OOLog . info ( "operation took #{duration} seconds" ) return result rescue MsRestAzure :: AzureOperationError => e OOLog . fatal ( "Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.body}" ) rescue => e OOLog . fatal ( "Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.message}" ) end end
this function deletes the public ip
this function deletes the public ip
resource_group_name
<not_specific>
public_ip_name
<not_specific>