Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/virtual_network.rb
# this method will return a list of vnets from the resource group
this method will return a list of vnets from the resource group
this method will return a list of vnets from the resource group
def list(resource_group_name)
      begin
        OOLog.info("Getting vnets from Resource Group '#{resource_group_name}' ...")
        start_time = Time.now.to_i
        promise = @client.virtual_networks.list(resource_group_name)
        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 resource group. Exception: #{e.body}")
      rescue => ex
        OOLog.fatal("Error getting all vnets for resource group. Exception: #{ex.message}")
      end
    end
def list ( resource_group_name ) begin OOLog . info ( "Getting vnets from Resource Group '#{resource_group_name}' ..." ) start_time = Time . now . to_i promise = @client . virtual_networks . list ( resource_group_name ) 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 resource group. Exception: #{e.body}" ) rescue => ex OOLog . fatal ( "Error getting all vnets for resource group. Exception: #{ex.message}" ) end end
this method will return a list of vnets from the resource group
this method will return a list of vnets from the resource group
resource_group_name
<not_specific>