Class: AwsPricing::DatabaseType

Inherits:
CategoryType show all
Defined in:
lib/amazon-pricing/database-type.rb

Constant Summary collapse

@@Database_Name_Lookup =
{
  'mysql_standard'          => 'MySQL Community Edition',
  'mysql_multiaz'           => 'MySQL Community Edition (Multi-AZ)',
  'postgresql_standard'     => 'PostgreSql Community Edition(Beta)',
  'postgresql_multiaz'      => 'PostgreSql Community Edition(Beta) (Multi-AZ)',
  'oracle_se1_standard'     => 'Oracle Database Standard Edition One',
  'oracle_se1_multiaz'      => 'Oracle Database Standard Edition One (Multi-AZ)',
  'oracle_se1_byol'         => 'Oracle Database Standard Edition One (BYOL)',
  'oracle_se1_byol_multiaz' => 'Oracle Database Standard Edition One (BYOL Multi-AZ)',
  'oracle_se_byol'          => 'Oracle Database Standard Edition (BYOL)',
  'oracle_se_byol_multiaz'  => 'Oracle Database Standard Edition (BYOL Multi-AZ)',
  'oracle_ee_byol'          => 'Oracle Database Enterprise Edition (BYOL)',
  'oracle_ee_byol_multiaz'  => 'Oracle Database Enterprise Edition (BYOL Multi-AZ)',
  'sqlserver_ex'            => 'Microsoft SQL Server Express Edition',
  'sqlserver_web'           => 'Microsoft SQL Server Web Edition',
  'sqlserver_se_standard'   => 'Microsoft SQL Server Standard Edition',
  'sqlserver_se_byol'       => 'Microsoft SQL Server Standard Edition (BYOL)',
  'sqlserver_ee_byol'       => 'Microsoft SQL Server Enterprise Edition (BYOL)'
}
@@ProductDescription =
{
  'mysql'                    => 'mysql_standard',
  'mysql_multiaz'            => 'mysql_multiaz',
  'postgres'                 => 'postgresql_standard',
  'postgres_multiaz'         => 'postgresql_multiaz',
  'postgresql'               => 'postgresql_standard',
  'postgresql_multiaz'       => 'postgresql_multiaz',
  'oracle-se1(li)'           => 'oracle_se1_standard',
  'oracle-se1(byol)'         => 'oracle_se1_byol',
  'oracle-se1(li)_multiaz'   => 'oracle_se1_multiaz',
  'oracle-se1(byol)_multiaz' => 'oracle_se1_byol_multiaz',
  'oracle-se(byol)'          => 'oracle_se_byol',
  'oracle-ee(byol)'          => 'oracle_ee_byol',
  'oracle-se(byol)_multiaz'  => 'oracle_se_byol_multiaz',
  'oracle-ee(byol)_multiaz'  => 'oracle_ee_byol_multiaz',
  'sqlserver-ee(byol)'       => 'sqlserver_ee_byol',
  'sqlserver-ex(li)'         => 'sqlserver_ex',
  'sqlserver-se(byol)'       => 'sqlserver_se_byol',
  'sqlserver-se(li)'         => 'sqlserver_se_standard',
  'sqlserver-web(li)'        => 'sqlserver_web',
}
@@DB_Deploy_Types =
{
	:mysql        => [:standard, :multiaz],
	:postgresql   => [:standard, :multiaz],
	:oracle_se1   => [:standard, :multiaz, :byol, :byol_multiaz],
	:oracle_se    => [:byol, :byol_multiaz],
	:oracle_ee    => [:byol, :byol_multiaz],
	:sqlserver_se => [:standard, :byol],
	:sqlserver_ee => [:byol]
}

Instance Attribute Summary

Attributes inherited from CategoryType

#allupfront_prepay_1_year, #allupfront_prepay_3_year, #heavy_prepay_1_year, #heavy_prepay_3_year, #heavy_price_per_hour_1_year, #heavy_price_per_hour_3_year, #instance_type, #light_prepay_1_year, #light_prepay_3_year, #light_price_per_hour_1_year, #light_price_per_hour_3_year, #medium_prepay_1_year, #medium_prepay_3_year, #medium_price_per_hour_1_year, #medium_price_per_hour_3_year, #name, #noupfront_price_per_hour_1_year, #noupfront_price_per_hour_3_year, #ondemand_price_per_hour, #partialupfront_prepay_1_year, #partialupfront_prepay_3_year, #partialupfront_price_per_hour_1_year, #partialupfront_price_per_hour_3_year

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CategoryType

#allupfront_effective_rate_1_year, #allupfront_effective_rate_3_year, #available?, #get_breakeven_month, #initialize, #noupfront_effective_rate_1_year, #partialupfront_effective_rate_1_year, #partialupfront_effective_rate_3_year, #prepay, #price_per_hour, #set_prepay, #set_price_per_hour

Constructor Details

This class inherits a constructor from AwsPricing::CategoryType

Class Method Details

.db_mapping(product, is_multi_az) ⇒ Object


77
78
79
80
81
82
83
# File 'lib/amazon-pricing/database-type.rb', line 77

def self.db_mapping(product, is_multi_az)
  if is_multi_az
    display_name(@@ProductDescription["#{product}_multiaz"])  
  else
    display_name(@@ProductDescription["#{product}"])
 end
end

.display_name(name) ⇒ Object


65
66
67
# File 'lib/amazon-pricing/database-type.rb', line 65

def self.display_name(name)
  @@Database_Name_Lookup[name]
end

.get_available_types(db) ⇒ Object


73
74
75
# File 'lib/amazon-pricing/database-type.rb', line 73

def self.get_available_types(db)
  @@DB_Deploy_Types[db]	
end

.get_database_nameObject


69
70
71
# File 'lib/amazon-pricing/database-type.rb', line 69

def self.get_database_name
  [:mysql, :postgresql, :oracle_se1, :oracle_se, :oracle_ee, :sqlserver_ex, :sqlserver_web, :sqlserver_se, :sqlserver_ee]
end

Instance Method Details

#display_nameObject


85
86
87
# File 'lib/amazon-pricing/database-type.rb', line 85

def display_name
  self.class.display_name(name)
end