Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/virtual_network.rb
# this method will return a list of vnets from the subscription
this method will return a list of vnets from the subscription
this method will return a list of vnets from the subscription
def list_all
      begin
        OOLog.info("Getting subscription vnets ...")
        start_time = Time.now.to_i
        promise = @client.virtual_networks.list_all()
        response = promise.value!
        result = response.body
        end_time = Time.now.to_i
        duration = end_time - start_time
        OOLog.info("operation took #{duration} seconds")
        result
      rescue MsRestAzure::AzureOperationError => e
        OOLog.fatal("Error getting all vnets for the sub. Exception: #{e.body}")
      rescue => ex
        OOLog.fatal("Error getting all vnets for the sub. Exception: #{ex.message}")
      end
    end
def list_all begin OOLog . info ( "Getting subscription vnets ..." ) start_time = Time . now . to_i promise = @client . virtual_networks . list_all ( ) response = promise . value! result = response . body end_time = Time . now . to_i duration = end_time - start_time OOLog . info ( "operation took #{duration} seconds" ) result rescue MsRestAzure :: AzureOperationError => e OOLog . fatal ( "Error getting all vnets for the sub. Exception: #{e.body}" ) rescue => ex OOLog . fatal ( "Error getting all vnets for the sub. Exception: #{ex.message}" ) end end
this method will return a list of vnets from the subscription
this method will return a list of vnets from the subscription