public function getEndpointUrl()
{
$type = $this->getType();
$cfg = $this->getOpenStack()->getConfig();
$region = $cfg->getRegion();
if ($cfg->getAuthToken() === null) {
$url = $cfg->getIdentityEndpoint();
} else {
if (!isset($this->cache['endpoint'])) {
$version = substr($this->getVersion(), 1);
$this->cache['endpoint'] = $cfg->getAuthToken()->getEndpointUrl($type, $region, $version);
}
$url = $this->cache['endpoint'];
}
return $url;
}