Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/subnet.rb
# this method will return all subnets in the RG and vnet.
this method will return all subnets in the RG and vnet.
this method will return all subnets in the RG and vnet .
def list(resource_group_name, vnet_name)
      begin
        OOLog.info("Getting all subnets from Resource Group '#{resource_group_name}'/vnet '#{vnet_name}'  ...")
        start_time = Time.now.to_i
        promise = @client.subnets.list(resource_group_name, vnet_name)
        response = promise.value!
        result = response.body
        end_time = Time.now.to_i
        duration = end_time - start_time
        OOLog("operation took #{duration} seconds")
        result
      rescue MsRestAzure::AzureOperationError => e
        OOLog.fatal("Error getting all subnets for vnet. Exception: #{e.body}")
      rescue => ex
        OOLog.fatal("Error getting all subnets for vnet. Exception: #{ex.message}")
      end
    end
def list ( resource_group_name , vnet_name ) begin OOLog . info ( "Getting all subnets from Resource Group '#{resource_group_name}'/vnet '#{vnet_name}'  ..." ) start_time = Time . now . to_i promise = @client . subnets . list ( resource_group_name , vnet_name ) response = promise . value! result = response . body end_time = Time . now . to_i duration = end_time - start_time OOLog ( "operation took #{duration} seconds" ) result rescue MsRestAzure :: AzureOperationError => e OOLog . fatal ( "Error getting all subnets for vnet. Exception: #{e.body}" ) rescue => ex OOLog . fatal ( "Error getting all subnets for vnet. Exception: #{ex.message}" ) end end
this method will return all subnets in the RG and vnet.
this method will return all subnets in the RG and vnet .
resource_group_name
<not_specific>
vnet_name
<not_specific>