lib/cloudcost/azure.rb
# We will collect all us locations but when building the price
# in the azure_build_price_file.rb script we will only get
# eastus data.
#Locations = {
# "eastus"         => "US East",
# "westus"         => "US West",
# "centralus"      => "US Central",
# "eastus2"        => "US East 2",
# "westus2"        => "US West 2",
# "northcentralus" => "US North Central",
# "southcentralus" => "US South Central",
# "westcentralus"  => "US West Central",
# }
We will collect all us locations but when building the price
in the azure_build_price_file.rb script we will only get
eastus data.
We will collect all us locations but when building the price in the azure_build_price_file . rb script we will only get eastus data .
def translate_location(loc)
        Log.info("Translate location: #{loc}")
        loc = loc.to_s
        keys = CFG['AZURE_LOCATIONS'].keys
        vals = CFG['AZURE_LOCATIONS'].values
        k = keys.index(loc)
        v = vals.index(loc)
        return vals[k] unless k.nil?
        return keys[v] unless v.nil?
        return nil
    end
def translate_location ( loc ) Log . info ( "Translate location: #{loc}" ) loc = loc . to_s keys = CFG [ 'AZURE_LOCATIONS' ] . keys vals = CFG [ 'AZURE_LOCATIONS' ] . values k = keys . index ( loc ) v = vals . index ( loc ) return vals [ k ] unless k . nil? return keys [ v ] unless v . nil? return nil end
We will collect all us locations but when building the price
in the azure_build_price_file.rb script we will only get
eastus data.
We will collect all us locations but when building the price in the azure_build_price_file . rb script we will only get eastus data .
loc