|
| 1 | +""" |
| 2 | + createuser(instance::MLFlow, username::String, password::String) |
| 3 | +
|
| 4 | +# Arguments |
| 5 | +- `instance`: [`MLFlow`](@ref) configuration. |
| 6 | +- `username`: Username. |
| 7 | +- `password`: Password. |
| 8 | +
|
| 9 | +# Returns |
| 10 | +An [`User`](@ref) object. |
| 11 | +""" |
| 12 | +function createuser(instance::MLFlow, username::String, password::String)::User |
| 13 | + result = mlfpost(instance, "users/create"; username=username, password=password) |
| 14 | + return result["user"] |> User |
| 15 | +end |
| 16 | + |
| 17 | +""" |
| 18 | + getuser(instance::MLFlow, username::String) |
| 19 | +
|
| 20 | +# Arguments |
| 21 | +- `instance`: [`MLFlow`](@ref) configuration. |
| 22 | +- `username`: Username. |
| 23 | +
|
| 24 | +# Returns |
| 25 | +An [`User`](@ref) object. |
| 26 | +""" |
| 27 | +function getuser(instance::MLFlow, username::String)::User |
| 28 | + result = mlfget(instance, "users/get"; username=username) |
| 29 | + return result["user"] |> User |
| 30 | +end |
| 31 | + |
| 32 | +""" |
| 33 | + deleteuser(instance::MLFlow, username::String, password::String) |
| 34 | +
|
| 35 | +# Arguments |
| 36 | +- `instance`: [`MLFlow`](@ref) configuration. |
| 37 | +- `username`: Username. |
| 38 | +- `password`: New password. |
| 39 | +
|
| 40 | +# Returns |
| 41 | +`true` if successful. Otherwise, raises exception. |
| 42 | +""" |
| 43 | +function updateuserpassword(instance::MLFlow, username::String, password::String)::Bool |
| 44 | + mlfpatch(instance, "users/update-password"; username=username, password=password) |
| 45 | + return true |
| 46 | +end |
| 47 | + |
| 48 | +""" |
| 49 | + updateuseradmin(instance::MLFlow, username::String, is_admin::Bool) |
| 50 | +
|
| 51 | +# Arguments |
| 52 | +- `instance`: [`MLFlow`](@ref) configuration. |
| 53 | +- `username`: Username. |
| 54 | +- `is_admin`: New admin status. |
| 55 | +
|
| 56 | +# Returns |
| 57 | +`true` if successful. Otherwise, raises exception. |
| 58 | +""" |
| 59 | +function updateuseradmin(instance::MLFlow, username::String, is_admin::Bool)::Bool |
| 60 | + mlfpatch(instance, "users/update-admin"; username=username, is_admin=is_admin) |
| 61 | + return true |
| 62 | +end |
| 63 | + |
| 64 | +""" |
| 65 | + deleteuser(instance::MLFlow, username::String) |
| 66 | +
|
| 67 | +# Arguments |
| 68 | +- `instance`: [`MLFlow`](@ref) configuration. |
| 69 | +- `username`: Username. |
| 70 | +
|
| 71 | +# Returns |
| 72 | +`true` if successful. Otherwise, raises exception. |
| 73 | +""" |
| 74 | +function deleteuser(instance::MLFlow, username::String)::Bool |
| 75 | + mlfdelete(instance, "users/delete"; username=username) |
| 76 | + return true |
| 77 | +end |
0 commit comments