def create_user(self, name, password, password_hash=None, tags=None):
        """
        Create a user

        :param name: The user's name
        :type name: str
        :param password: The user's password. Set to "" if no password is
            desired. Takes precedence if ``password_hash`` is also set.
        :type password: str
        :param password_hash: An optional password hash for the user.
        :type password_hash: str
        :param tags: A list of tags for the user. Currently recognised tags are
            "administrator", "monitoring" and "management". If no tags are
            supplied, the user will have no permissions.
        :type tags: list of str
        """
        data = {
            'tags': ', '.join(tags or [])
        }
        if password:
            data['password'] = password
        elif password_hash:
            data['password_hash'] = password_hash
        else:
            data['password_hash'] = ""

        self._api_put(
            '/api/users/{0}'.format(urllib.parse.quote_plus(name)),
            data=data,
        )
def create_user ( self , name , password , password_hash = None , tags = None ) : data = { 'tags' : ', ' . join ( tags or [ ] ) } if password : data [ 'password' ] = password elif password_hash : data [ 'password_hash' ] = password_hash else : data [ 'password_hash' ] = "" self . _api_put ( '/api/users/{0}' . format ( urllib . parse . quote_plus ( name ) ) , data = data , )
Create a user

        :param name: The user's name
        :type name: str
        :param password: The user's password. Set to "" if no password is
            desired. Takes precedence if ``password_hash`` is also set.
        :type password: str
        :param password_hash: An optional password hash for the user.
        :type password_hash: str
        :param tags: A list of tags for the user. Currently recognised tags are
            "administrator", "monitoring" and "management". If no tags are
            supplied, the user will have no permissions.
        :type tags: list of str