PHP Класс Scalr\Stats\CostAnalytics\Prices

С версии: 5.0 (05.02.2014)
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$cadb ADODB_mysqli Analytics database connection

Открытые методы

Метод Описание
__construct ( ADODB_mysqli $cadb ) Constructor
get ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string $price ) : Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | boolean Gets price
getActualPrices ( string $platform, string $cloudLocation, string $url = null, DateTime $applied = null, integer $accountId = null, string $instanceType = null, integer $os = null ) : ArrayCollection Gets actual prices on specified date
getCloudLocations ( string $platform ) : array Gets all known cloud locations for the specified platform.
getDetails ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string $price ) : ArrayCollection Gets the collection of the prices for the specified price_id
getHistory ( string $platform, string $cloudLocation, string $url = null, string $accountId = null ) : ArrayCollection Gets the history of the changes of the specified price
getSupportedClouds ( ) : array Gets array of supported clouds
getUnsupportedClouds ( ) : array Gets array of unsupported clouds
hasPriceForUrl ( string $platform, string $url, string $cloudLocation = null ) : boolean Checks whether there is some price for specified platform and url
normalizeUrl ( string $url ) : string Normalizes an url from environment settings to use for price_history table
save ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity $price ) Saves price

Описание методов

__construct() публичный Метод

Constructor
public __construct ( ADODB_mysqli $cadb )
$cadb ADODB_mysqli

get() публичный Метод

Gets price
public get ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string $price ) : Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | boolean
$price Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string The identifier of the price or PriceHistoryEntity object. If you provide with object either priceId or both platform and cloudLocation properties must be set for it. Identifier must be provided as UUID without hyphens.
Результат Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | boolean Returns price history entity that contains current prices on success or false if nothing found.

getActualPrices() публичный Метод

Gets actual prices on specified date
public getActualPrices ( string $platform, string $cloudLocation, string $url = null, DateTime $applied = null, integer $accountId = null, string $instanceType = null, integer $os = null ) : ArrayCollection
$platform string The name of the cloud platform
$cloudLocation string The location of the cloud
$url string optional The keystone url for the private clouds
$applied DateTime optional The date in UTC
$accountId integer optional ID of the account (global level by default)
$instanceType string optional Type of the instance
$os integer optional Os type [Linux - 0, Windows - 1]
Результат Scalr\Model\Collections\ArrayCollection Returns a collection of price entities

getCloudLocations() публичный Метод

These locations are retrieved from prices table, not from the environment settings.
public getCloudLocations ( string $platform ) : array
$platform string The cloud platform
Результат array Returns array looks like array(url1 => array(cloudLocation1, cloudLocation2, ...), url2 => ...);

getDetails() публичный Метод

Gets the collection of the prices for the specified price_id
public getDetails ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string $price ) : ArrayCollection
$price Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity | string The PriceHistoryEntity or identifier of the price. Identifier must be provided as UUID without hyphens.
Результат Scalr\Model\Collections\ArrayCollection Returns all prices which are associated with this price history ID

getHistory() публичный Метод

Gets the history of the changes of the specified price
public getHistory ( string $platform, string $cloudLocation, string $url = null, string $accountId = null ) : ArrayCollection
$platform string The cloud platform
$cloudLocation string The cloud location
$url string optional The keystone url for the private cloud
$accountId string optional The identifier of the account for overridden price
Результат Scalr\Model\Collections\ArrayCollection Returns collection of the PriceHistoryEntity objects

getSupportedClouds() публичный Метод

Gets array of supported clouds
public getSupportedClouds ( ) : array
Результат array

getUnsupportedClouds() публичный Метод

Gets array of unsupported clouds
public getUnsupportedClouds ( ) : array
Результат array

hasPriceForUrl() публичный Метод

Checks whether there is some price for specified platform and url
public hasPriceForUrl ( string $platform, string $url, string $cloudLocation = null ) : boolean
$platform string Cloud platform
$url string The endpoint url
$cloudLocation string optional The cloud location
Результат boolean Returns TRUE if there is some price for specified platform and url or FALSE otherwise

normalizeUrl() публичный Метод

Normalizes an url from environment settings to use for price_history table
public normalizeUrl ( string $url ) : string
$url string Original url
Результат string Returns normalized url to use in price_history database table

save() публичный Метод

Saves price
public save ( Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity $price )
$price Scalr\Stats\CostAnalytics\Entity\PriceHistoryEntity The PriceHistoryEntity with details set.

Описание свойств

$cadb защищенное свойство

Analytics database connection
protected ADODB_mysqli $cadb
Результат ADODB_mysqli