Exemplo n.º 1
0
def create(context, name, password, role, team_id):
    """create(context, name, password, role, team_id)

    Create a user.

    >>> dcictl user-create [OPTIONS]

    :param string name: Name of the user [required]
    :param string password: Password for the user [required]
    :param string role: Role of user (admin or user)
    :param string team_id: ID of the team to attach this user to [optional]
    """
    team_id = team_id or user.get(
        context, context.login).json()['user']['team_id']
    result = user.create(context, name=name, password=password,
                         role=role, team_id=team_id)
    utils.format_output(result, context.format, None, user.TABLE_HEADERS)
Exemplo n.º 2
0
def create(context, name, password, role, team_id):
    result = user.create(context, name=name, password=password, role=role, team_id=team_id)
    utils.format_output(result.json(), context.format, user.RESOURCE[:-1])