We're migrating our Spectrum platform from 9.4.3 to 10.1.1 and we want to gather all users from the old platform and to create them in the new one, so we're thinkg about creating a PAM process to do so using REST.
There's nothing in the documentation about creating users using rest, but models. In case we could create models (representing users), how do we get the relations among users and groups?
1.) Create the Group with /spectrum/restful/model, using mtypeid=0x1040a (UserGroup)
2.) Create the User with /spectrum/restful/model, using mtypeid=0x10004 (User)
3.) Associate the User with the UserGroup with /spectrum/restful/associations, using relation handle 0x10022 (Has_Member), and providing the User and UserGroup Model_Handle's returned from the above two calls
When reverse engineering things like this, I find it's helpful to first do it within the OneClick UI, and then to use the vnmsh "show associations" command to see how it's meant to look. And then just trying to piece it together and reproduce it using the API calls. Trial and error gets it done. :-)
"show relations" is also a good way to find the relation handles (since most are not documented anywhere).
One more tip:
If you have a DSS, run the first two API calls for every landscapeid in your environment. Without doing this, you may find a User is created in the Master Landscape but not in the rest, and thus won't have access to those other Landscapes. The association call, however, only needs to be run once using the Master Model Handle's for the User and UesrGroup.
How are the passwords assigned? Should I sent them in the URL as clear text or shall I send it as if it were an OID as you may see in the Security_Password (0x11f9a) attribute's value?
That's a good question. We're leveraging LDAP integration, so I never had to be concerned with storing passwords.
I would first try clear-text just to see if it works, and if that fails to then try creating the Octet String. I have a feeling it'll be the latter, but the clear-text is worth a try.
Justin, would you mind sharing the exact call you do for each step?
We're trying with this and similar syntax
but always get a VALUE_INVALID error message.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><create-model-response xmlns="http://www.ca.com/spectrum/restful/schema/response" error="Failure" error-message="SPC-OCC-11813: Error creating the model in landscape spxx: VALUE_INVALID."/>