You got it wrong . I want to create a user. For example, I would like to create a user whose user name is ‘render724’, with password ‘123456’. How can I do it?
Ah. Currently you can inject the user but their password isn’t settable through the API. I did check for workarounds such as via deadlinecommand and the core API but it’s not available.
The curl command before actually did create a “somenew” user, but the password is only accessible via the Monitor interface.
I think you’ll have to have another system authenticate the users to your service and run from that.
Unfortunately it’s not possible. The design of the system is such that the Monitor has access to deeper functions than have been exposed via the API. It has to do with our heritage in that the UI is not a consumer of a client API here.
It allows you to do things such as import a user list but does not allow password changes.
I can understand your frustration. I believe the issues is that user authentication has not been a large enough customer requirement for password changing to be made a feature yet.
I am unsure at the moment. It would be saved by sending the UserInfo to SaveUserInfo.
This creates a user for me:
from Deadline.Scripting import RepositoryUtils
from Deadline.Users import UserInfo
USERNAME = 'edwin'
PASSWORD = 'pickles'
def __main__():
user = RepositoryUtils.GetUserInfo(USERNAME, True)
if user is None:
print("Creating new user")
user = UserInfo()
user.UserName = USERNAME
user.UserWebServicePassword = PASSWORD
RepositoryUtils.SaveUserInfo(user)
I’m not in a good spot to test at the moment. Can you give that a try? If it doesn’t work, I’ll try and build up a test jig and run some tests there. Also, please change the username and password.
You’re right. I’ve double checked and changing that parameter does not get set when saving the user. It turns out there is a hidden function available! This works:
from Deadline.Scripting import RepositoryUtils
from Deadline.Users import UserInfo
USERNAME = 'edwin'
PASSWORD = 'pickles'
def __main__():
user = RepositoryUtils.GetUserInfo(USERNAME, True)
if user is None:
print("Creating new user")
user = UserInfo()
user.UserName = USERNAME
user.UpdateWebPassword(PASSWORD)
RepositoryUtils.SaveUserInfo(user)
@eamsler How can I run this script outside of the Deadline environment? If this was part of the standalone API, I would copy the Deadline directory to my site-packages directory, but how do I access Deadline.Scripting from a standalone python script? I need to way to create password protected users programmatically when standing up a new deadline environment.
@zainali I’m trying to do the same and coming from the documentation you are referring to I can’t find that information.
eamsler achieved it by using a hidden function
from Deadline.Scripting import RepositoryUtils
from Deadline.Users import UserInfo
USERNAME = 'edwin'
PASSWORD = 'pickles'
def __main__():
user = RepositoryUtils.GetUserInfo(USERNAME, True)
if user is None:
print("Creating new user")
user = UserInfo()
user.UserName = USERNAME
user.UpdateWebPassword(PASSWORD)
RepositoryUtils.SaveUserInfo(user)
What would be the a curl query to achieve the same via rest api and is it possible?