Exemplo n.º 1
0
    def upsertParameter(self, parameter):
        try:
            return ParameterManager().upsertParameter(parameter)
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('Error upserting parameter [%s]' %
                                       (parameter.getName()))

            raise TortugaException(exception=ex)
Exemplo n.º 2
0
    def upsertParameter(self, session: Session, parameter: Parameter) \
            -> None:
        try:
            return ParameterManager().upsertParameter(session, parameter)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception('Error upserting parameter [%s]' %
                                   (parameter.getName()))

            raise TortugaException(exception=ex)
Exemplo n.º 3
0
    def deleteParameter(self, session: Session, name: str) -> None:
        """
        Delete parameter by name
        """

        try:
            ParameterManager().deleteParameter(session, name)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception('Error deleting parameter [%s]' % (name))

            raise TortugaException(exception=ex)
Exemplo n.º 4
0
    def deleteParameter(self, name):
        """
        Delete parameter by name
        """

        try:
            return ParameterManager().deleteParameter(name)
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('Error deleting parameter [%s]' %
                                       (name))

            raise TortugaException(exception=ex)
Exemplo n.º 5
0
    def getParameterList(self):
        """
        Get all known parameters.

            Returns:
                [parameter]
            Throws:
                TortugaException
        """

        try:
            return ParameterManager().getParameterList()
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('%s' % (ex))
            raise TortugaException(exception=ex)
Exemplo n.º 6
0
    def getIntParameter(self, name, default=None):
        """
        Get int parameter.

        Raises:
            ParameterNotFound
            TortugaException
        """

        try:
            return ParameterManager().getIntParameter(name, default)
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('%s' % (ex))

            raise TortugaException(exception=ex)
Exemplo n.º 7
0
    def getParameterList(self, session: Session) -> TortugaObjectList:
        """
        Get all known parameters.

            Returns:
                [parameter]
            Throws:
                TortugaException
        """

        try:
            return ParameterManager().getParameterList(session)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception(str(ex))
            raise TortugaException(exception=ex)
Exemplo n.º 8
0
    def getParameter(self, name):
        """
        Get parameter.

            Returns:
                parameter
            Throws:
                ParameterNotFound
                TortugaException
        """

        try:
            return ParameterManager().getParameter(name)
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('%s' % (ex))

            raise TortugaException(exception=ex)
Exemplo n.º 9
0
    def getParameter(self, session: Session, name: str) -> Parameter:
        """
        Get parameter.

            Returns:
                parameter
            Throws:
                ParameterNotFound
                TortugaException
        """

        try:
            return ParameterManager().getParameter(session, name)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception(str(ex))

            raise TortugaException(exception=ex)
Exemplo n.º 10
0
    def getIntParameter(self,
                        session: Session,
                        name: str,
                        default: Optional[int] = None) -> int:
        """
        Get int parameter.

        Raises:
            ParameterNotFound
            TortugaException
        """

        try:
            return ParameterManager().getIntParameter(session, name, default)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception(str(ex))

            raise TortugaException(exception=ex)
Exemplo n.º 11
0
    def getBoolParameter(self,
                         session: Session,
                         name: str,
                         default: Optional[bool] = None) -> bool:
        """
        Get bool parameter.

        Raises:
            ParameterNotFound
            TortugaException
        """

        try:
            return ParameterManager().getBoolParameter(session, name, default)
        except TortugaException:
            raise
        except Exception as ex:
            self.getLogger().exception('%s' % (ex))

            raise TortugaException(exception=ex)