public login ( string $userName, string $password, string $domain = null ) : Scalr\Service\CloudStack\DataType\LoginResponseData | ||
$userName | string | Username |
$password | string | Password |
$domain | string | path of the domain that the user belongs to. Example: domain=/com/cloud/internal. If no domain is passed in, the ROOT domain is assumed. |
return | Scalr\Service\CloudStack\DataType\LoginResponseData |
public function login($userName, $password, $domain = null)
{
$result = null;
$response = $this->getClient()->call('login', array('username' => $this->escape($userName), 'password' => $this->escape($password), 'domain' => $this->escape($domain)));
if ($response->hasError() === false) {
$resultObject = $response->getResult();
if (!empty($resultObject)) {
$result = $this->_loadLoginData($resultObject);
}
}
return $result;
}