예제 #1
0
    def set_credentials(cls,
                        api_host: str = None,
                        web_host: str = None,
                        files_host: str = None,
                        key: str = None,
                        secret: str = None) -> None:
        """
        Set new default TRAINS-server host and credentials.
        These configurations could be overridden by either OS environment variables
        or trains.conf configuration file.

        Note:
            Credentials need to be set *prior* to Logger initialization.

        Args:
            api_host: Trains API server url, example: ``host='http://localhost:8008'``
            web_host: Trains WEB server url, example: ``host='http://localhost:8080'``
            files_host: Trains Files server url, example: ``host='http://localhost:8081'``
            key: user key/secret pair, example: ``key='thisisakey123'``
            secret: user key/secret pair, example: ``secret='thisisseceret123'``
        """
        Task.set_credentials(api_host=api_host,
                             web_host=web_host,
                             files_host=files_host,
                             key=key,
                             secret=secret)
예제 #2
0
파일: trains.py 프로젝트: marcociccone/yapt
    def set_credentials(cls, api_host: str = None, web_host: str = None, files_host: str = None,
                        key: str = None, secret: str = None) -> None:
        """
        Set new default TRAINS-server host and credentials
        These configurations could be overridden by either OS environment variables
        or trains.conf configuration file

        Notice! credentials needs to be set *prior* to Logger initialization

        :param api_host: Trains API server url, example: host='http://localhost:8008'
        :param web_host: Trains WEB server url, example: host='http://localhost:8080'
        :param files_host: Trains Files server url, example: host='http://localhost:8081'
        :param key: user key/secret pair, example: key='thisisakey123'
        :param secret: user key/secret pair, example: secret='thisisseceret123'
        """
        Task.set_credentials(api_host=api_host, web_host=web_host, files_host=files_host,
                             key=key, secret=secret)