Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/virtual_network.rb
# this will create/update the vnet
this will create/update the vnet
this will create / update the vnet
def create_update(resource_group_name, virtual_network)
      begin
        OOLog.info("Creating Virtual Network '#{@name}' ...")
        start_time = Time.now.to_i
        promise = @client.virtual_networks.create_or_update(resource_group_name, @name, virtual_network)
        response = promise.value!
        end_time = Time.now.to_i
        duration = end_time - start_time
        OOLog.info('Successfully created/updated network name: ' + @name)
        OOLog.info("operation took #{duration} seconds")
        response
      rescue MsRestAzure::AzureOperationError => e
        OOLog.fatal("Failed creating/updating vnet: #{@name} with exception #{e.body}")
      rescue => ex
        OOLog.fatal("Failed creating/updating vnet: #{@name} with exception #{ex.message}")
      end
    end
def create_update ( resource_group_name , virtual_network ) begin OOLog . info ( "Creating Virtual Network '#{@name}' ..." ) start_time = Time . now . to_i promise = @client . virtual_networks . create_or_update ( resource_group_name , @name , virtual_network ) response = promise . value! end_time = Time . now . to_i duration = end_time - start_time OOLog . info ( 'Successfully created/updated network name: ' + @name ) OOLog . info ( "operation took #{duration} seconds" ) response rescue MsRestAzure :: AzureOperationError => e OOLog . fatal ( "Failed creating/updating vnet: #{@name} with exception #{e.body}" ) rescue => ex OOLog . fatal ( "Failed creating/updating vnet: #{@name} with exception #{ex.message}" ) end end
this will create/update the vnet
this will create / update the vnet
resource_group_name
<not_specific>
virtual_network
<not_specific>