fsi.cli ======= .. py:module:: fsi.cli Attributes ---------- .. autoapisummary:: fsi.cli.cli Functions --------- .. autoapisummary:: fsi.cli.do_ims_import fsi.cli.import_ims_data_cli fsi.cli.correct_ims_data_cli fsi.cli.import_teacher_data_cli fsi.cli.test_ldap fsi.cli.fetch_users_cli fsi.cli.fetch_users Module Contents --------------- .. py:data:: cli .. py:function:: do_ims_import(path: str, request: onegov.fsi.request.FsiRequest) -> None .. py:function:: import_ims_data_cli(path: str) -> collections.abc.Callable[[onegov.fsi.request.FsiRequest, onegov.fsi.app.FsiApp], None] .. py:function:: correct_ims_data_cli(path: str) -> collections.abc.Callable[[onegov.fsi.request.FsiRequest, onegov.fsi.app.FsiApp], None] .. py:function:: import_teacher_data_cli(path: str, clear: bool) -> collections.abc.Callable[[onegov.fsi.request.FsiRequest, onegov.fsi.app.FsiApp], None] .. py:function:: test_ldap(base: collections.abc.Sequence[str], search_filter: str, ldap_server: str, ldap_username: str, ldap_password: str, sort_by: str) -> None Examples: * Search for an email: ``(mail=walter.roderer@zg.ch)`` * Search for names: ``(&(zgXGivenName=Vorname)(zgXSurname=Nachname))`` * Search for mail ending in: ``(mail=*@phgz.ch)`` .. code-block:: bash onegov-fsi --select /fsi/zug test-ldap --base 'ou=Kanton,o=KTZG' \ --ldap-server 'ldaps://.....' \ --ldap-username 'user' \ --ldap-password 'xxxx' --search-filter "(mail=*@zg.ch)" .. py:function:: fetch_users_cli(ldap_server: str, ldap_username: str, ldap_password: str, admin_group: str, editor_group: str, verbose: bool, skip_deactivate: bool, dry_run: bool) -> collections.abc.Callable[[onegov.fsi.request.FsiRequest, onegov.fsi.app.FsiApp], None] Updates the list of users/course attendees by fetching matching users from a remote LDAP server. This is currently highly specific for the Canton of Zug and therefore most values are hard-coded. Example: .. code-block:: bash onegov-fsi --select /fsi/fsi fetch-users \ --ldap-server 'ldaps://1.2.3.4' \ --ldap-username 'foo' \ --ldap-password 'bar' \ --admin-group 'ou=Admins' \ --editor-group 'ou=Editors' .. py:function:: fetch_users(app: onegov.fsi.app.FsiApp, session: sqlalchemy.orm.Session, ldap_server: str, ldap_username: str, ldap_password: str, admin_group: str, editor_group: str, verbose: bool = False, skip_deactivate: bool = False, dry_run: bool = False, add_attendee: bool = True) -> None Implements the fetch-users cli command.