magpie.cli.batch_update_users

Magpie helper to create or delete a list of users using a set of input parameters.

Useful for batch operations.

Attributes

UserConfig

LOGGER

ERROR_PARAMS

ERROR_EXEC

Functions

format_response(response)

get_login_session(magpie_url, username, password[, ...])

create_users(→ UserConfig)

Creates the users using provided configuration.

delete_users(→ UserConfig)

Deletes the specified users.

make_output(→ None)

Generates the output from obtained user creation/deletion results.

make_parser(→ argparse.ArgumentParser)

main(→ Any)

Module Contents

magpie.cli.batch_update_users.UserConfig[source]
magpie.cli.batch_update_users.LOGGER[source]
magpie.cli.batch_update_users.ERROR_PARAMS = 2[source]
magpie.cli.batch_update_users.ERROR_EXEC = 1[source]
magpie.cli.batch_update_users.format_response(response)[source]
magpie.cli.batch_update_users.get_login_session(magpie_url, username, password, return_response=False)[source]
magpie.cli.batch_update_users.create_users(user_config: UserConfig, magpie_url: magpie.typedefs.Str, magpie_admin_username: magpie.typedefs.Str, magpie_admin_password: magpie.typedefs.Str, password_length: int | None = None) UserConfig[source]

Creates the users using provided configuration.

Returns:

updated configuration with generated user-credentials.

magpie.cli.batch_update_users.delete_users(user_config: UserConfig, magpie_url: magpie.typedefs.Str, magpie_admin_username: magpie.typedefs.Str, magpie_admin_password: magpie.typedefs.Str, **__: Any) UserConfig[source]

Deletes the specified users.

Returns:

details about request success or failure for each user to be deleted.

magpie.cli.batch_update_users.make_output(user_results: UserConfig, is_delete: bool, output_location: magpie.typedefs.Str | None = None) None[source]

Generates the output from obtained user creation/deletion results.

magpie.cli.batch_update_users.make_parser() argparse.ArgumentParser[source]
magpie.cli.batch_update_users.main(args: Sequence[magpie.typedefs.Str] | None = None, parser: argparse.ArgumentParser | None = None, namespace: argparse.Namespace | None = None) Any[source]