def applog(cfg, args): """Load the applog entries.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.applog( args.days, args.status, args.filter)
def test_api_url(): """First simple test, check build_url""" api_url = 'https://bmark.us/api/v1' username = '******' api_key = '123456' segment = 'invite' api = AdminApi(api_url, username, api_key) eq_('https://bmark.us/api/v1/a/invite?api_key=123456', api._build_url(segment), 'The build url should be generated correctly.')
def invite_set(cfg, args): """Handle the invite set call to add invites to a user.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.invite_set(args.username, args.invite_ct)
def import_list(cfg, args): """Fetch some data """ api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.import_list()
def readable_reindex(cfg, args): """Reindex all the bookmarks in the system.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.readable_reindex()
def invite_list(cfg, args): """Handle the invite list call.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.invite_status()
def to_readable(cfg, args): """Check the list of urls we need to readable parse still.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.to_readable()
def del_user(cfg, args): """Remove a user from the system.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.del_user(args.username)
def user_add(cfg, args): """Add a new user to the system.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.new_user(args.username, args.email)
def user_list(cfg, args): """List the users in the system.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.user_list()
def import_reset(cfg, args): """Reset an import back to reprocess""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.import_reset(args.id)
def applog(cfg, args): """Load the applog entries.""" api = AdminApi(cfg.api_url, cfg.username, cfg.api_key) api.applog(args.days, args.status, args.filter)