03-15-2022 03:04 AM
Hi, I would like to register multiple users at once to CML2.
I looked at the WebUI and API documentation, but it seems that you can only create one person at a time.
Is there any way to do this?
Solved! Go to Solution.
03-27-2022 05:17 PM
Hi 00 stack,
you mentioned that you looked at the API Documentation. The API Documentation lists the path "/users/{user_id}" with the POST method, which will give you the option to programmatically create the users. Create a simple script that loops through your list of user accounts that you would like to create.
The more dangerous method would be to look at the local CML database via the CLI. I Did not try this but there is a SQLite database, which CML uses. It is located at "/var/local/virl2/config/controller.db" and contains a table called "user" with the following schema. Maybe this helps, however I highly recommend not doing that and instead use the API, which is what it is for.
# sqlite3 /var/local/virl2/config/controller.db
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .schema user
CREATE TABLE user (
id VARCHAR NOT NULL,
created DATETIME,
modified DATETIME,
username VARCHAR(20) NOT NULL,
password_hash VARCHAR NOT NULL,
fullname VARCHAR,
description VARCHAR,
admin BOOLEAN,
PRIMARY KEY (id),
UNIQUE (username)
);
Regards,
Shin
03-15-2022 05:30 AM
I think that is limitation i guess here. is this personal edition ?
03-15-2022 07:03 PM
Hi, I use CML2 enterprise.
I think that there is no choice but to process the API repeatedly with scripts etc.
03-16-2022 12:51 AM
May this is a feature request i guess here. ( iam CML personal user never tried multi users.)
03-16-2022 04:52 AM
I thought there might be a way to do this that I just don't know about, but there seems to be no way to do that.
I will ask this question to support teams.
Regards,
03-27-2022 05:17 PM
Hi 00 stack,
you mentioned that you looked at the API Documentation. The API Documentation lists the path "/users/{user_id}" with the POST method, which will give you the option to programmatically create the users. Create a simple script that loops through your list of user accounts that you would like to create.
The more dangerous method would be to look at the local CML database via the CLI. I Did not try this but there is a SQLite database, which CML uses. It is located at "/var/local/virl2/config/controller.db" and contains a table called "user" with the following schema. Maybe this helps, however I highly recommend not doing that and instead use the API, which is what it is for.
# sqlite3 /var/local/virl2/config/controller.db
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .schema user
CREATE TABLE user (
id VARCHAR NOT NULL,
created DATETIME,
modified DATETIME,
username VARCHAR(20) NOT NULL,
password_hash VARCHAR NOT NULL,
fullname VARCHAR,
description VARCHAR,
admin BOOLEAN,
PRIMARY KEY (id),
UNIQUE (username)
);
Regards,
Shin
03-28-2022 05:44 PM
Hi Shin,
Thank you for your reply.
I'll try to use API and scrpt.
The new version 2.3 seems to be able to use LDAP for user management, so I am going to try it sometime.
Regards,
03-29-2022 12:27 PM
Hi 00 stack,
nice, I just checked out the LDAP feature in the documentation and will give that a try as well! Thanks for sharing this info!
Regards,
Shin
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide