Scalr\Modules\Platforms\GoogleCE\GoogleCEPlatformModule::getInstanceType PHP Method

getInstanceType() public method

See also: Scalr\Modules\PlatformModuleInterface::getInstanceType()
public getInstanceType ( $instanceTypeId, Scalr_Environment $env, $cloudLocation = null )
$env Scalr_Environment
    public function getInstanceType($instanceTypeId, \Scalr_Environment $env, $cloudLocation = null)
    {
        $cloudLocationId = CloudLocation::calculateCloudLocationId(SERVER_PLATFORMS::GCE, $cloudLocation, $this->getEndpointUrl($env));
        $cit = CloudInstanceType::findPk($cloudLocationId, $instanceTypeId);
        if ($cit === null) {
            $instanceTypes = $this->getInstanceTypes($env, $cloudLocation, true);
            if (!empty($instanceTypes[$instanceTypeId])) {
                $cit = CloudInstanceType::findPk($cloudLocationId, $instanceTypeId);
            }
        }
        return $cit;
    }