Scalr\Api\Service\User\V1beta0\Controller\Farms::fetchVariableAction PHP Метод

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

Gets specific global var of the farm
public fetchVariableAction ( integer $farmId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$farmId integer Numeric identifier of the Farm
$name string Name of variable
Результат Scalr\Api\DataType\ResultEnvelope
    public function fetchVariableAction($farmId, $name)
    {
        $this->getFarm($farmId);
        $globalVar = $this->getVariableInstance();
        $fetch = $this->getGlobalVariable($name, $globalVar, 0, $farmId);
        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));
    }