File: api.py

package info (click to toggle)
kytos-utils 2019.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396 kB
  • sloc: python: 1,310; sh: 15; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Translate cli commands to non-cli code."""
import logging

from kytos.utils.users import UsersManager

LOG = logging.getLogger(__name__)


class UsersAPI:
    """An API for the command-line interface.

    Use the config file only for required options. Static methods are called
    by the parser and they instantiate an object of this class to fulfill the
    request.
    """

    user_manager = UsersManager()

    @classmethod
    def register(cls, args):  # pylint: disable=unused-argument
        """Create a new user and register it on the Napps server."""
        result = cls.user_manager.register()
        print(result)