Scalr\Api\Service\User\V1beta0\Controller\FarmRoles::fetchVariableAction PHP Méthode

fetchVariableAction() public méthode

Gets specific global var of the farm role
public fetchVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Numeric identifier of the Farm Role
$name string Name of variable
Résultat Scalr\Api\DataType\ResultEnvelope
    public function fetchVariableAction($farmRoleId, $name)
    {
        $farmRole = $this->getFarmRole($farmRoleId);
        $globalVar = $this->getVariableInstance();
        $fetch = $this->getGlobalVariable($name, $globalVar, $farmRole->roleId, $farmRole->farmId, $farmRoleId);
        if (empty($fetch)) {
            throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Requested Global Variable does not exist.");
        }
        return $this->result($this->adapter('globalVariable')->convertData($fetch));
    }