Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/resource_group.rb
# this method will create/update the resource group with the info passed in
this method will create/update the resource group with the info passed in
this method will create / update the resource group with the info passed in
def add(rg_name, location)
      begin
        resource_group = Azure::ARM::Resources::Models::ResourceGroup.new
        resource_group.location = location
        start_time = Time.now.to_i
        response =
          @client.resource_groups.create_or_update(rg_name,
                                                   resource_group).value!
        end_time = Time.now.to_i
        OOLog.info("Resource Group created in #{end_time - start_time} seconds")
      rescue MsRestAzure::AzureOperationError => e
        OOLog.fatal("Error creating resource group: #{e.body}")
      rescue => ex
        OOLog.fatal("Error creating resource group: #{ex.message}")
      end
    end
def add ( rg_name , location ) begin resource_group = Azure :: ARM :: Resources :: Models :: ResourceGroup . new resource_group . location = location start_time = Time . now . to_i response = @client . resource_groups . create_or_update ( rg_name , resource_group ) . value! end_time = Time . now . to_i OOLog . info ( "Resource Group created in #{end_time - start_time} seconds" ) rescue MsRestAzure :: AzureOperationError => e OOLog . fatal ( "Error creating resource group: #{e.body}" ) rescue => ex OOLog . fatal ( "Error creating resource group: #{ex.message}" ) end end
this method will create/update the resource group with the info passed in
this method will create / update the resource group with the info passed in
rg_name
<not_specific>
location
<not_specific>