Associating Components to User
Using this API, administrators can associate components to a user.
Note:
A few key values of the Body parameter are optional. These optional key values are mentioned separately in the below table.
URL: http://<eG manager IP:port>/api/eg/orchestration/associatecomponentstouser
Method: POST
Content-Type: application/json
Parameters | Key values | Example |
---|---|---|
Headers |
managerurl: Base URL of the eG Manager i.e., http://<IP address of the eG console:Port> user: eG username or domain/eG username pwd: Base64 encoded password |
Example with Default Key Values: { "userid":"john", "componenttype":"microsoft windows", "components":"dev153,win155,win156" } Example with both Default and Optional Key Values: { "userid":"john", "componenttype":"microsoft windows", "components":"dev153,win155,win156" "autossociatetype":"yes" } |
Body |
Default: { "userid":"User ID", "componenttype":"Component type", "components":"comma-separated list of Nick names", } |
|
Optional: { "autoassociatetype":"yes/no" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "Succeed": "One or more components have been associated successfully." } |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{ "Error": "One or more component names do not exist." } |
Figure 1 : Example to associate components to a user using Postman REST Client
Associating Components to User using cURL
To associate components to a user through the REST API using cURL, the command should be specified in the following format:
curl --location --request POST "http://<eG Manager IP:Port>/api/eg/orchestration/associatecomponentstouser" -H "managerurl:http://<eG Manager IP:Port>" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "Content-Type: application/json" --data-raw "{'userid':'User ID', 'componenttype':'Component type', 'components':'comma-separated list of Nick names', 'autoassociatetype':'yes/no'}"
Note that the command specified above contains both the Default and Optional key values.
Figure 2 shows an example of associating components to a user using cURL.