...
http://server/en/omk/opConfig/api/v1/credential_set
Please note, that credential sets can also be managed in the opConfig GUI and the opconfig cli.
Summary
Operation | Method | API |
---|---|---|
Get a list of Credential Set | GET | http://server/en/omk/opConfig/api/v1/credential_set |
Get a Credential Set | GET | http://server/en/omk/opConfig/api/v1/credential_set/NAME |
Create a Credential Set | POST | http://server/en/omk/opConfig/api/v1/credential_set |
Update a Credential Set | PUT | http://server/en/omk/opConfig/api/v1/credential_set |
Delete a Credential Set | DELETE | http://server/en/omk/opConfig/api/v1/credential_set |
Assign a Credential Set to a node |
POST | http://server/en/omk/opConfig/api/v1/credential_set/NAME/NODE | |
Unassigns a Credential Set from a node | DELETE | http://server/en/omk/opConfig/api/v1/credential_set/NAME/NODE |
Methods
Get
GET http://server/en/omk/opConfig/api/v1/credential_set
...
Code Block |
---|
{ asgard: { always_privileged: "0", description: "", lastupdate: 1631098471, password: "*****", password_privileged: "*****", setname: "asgard", ssh_key: "", username: "admin" }, nmis: { always_privileged: "0", description: "the default nmis user", lastupdate: 1625045906, password: "*****", password_privileged: "*****", setname: "nmis", ssh_key: "", username: "nmis" }, } |
Get
GET http://server/en/omk/opConfig/api/v1/credential_set/nmis
...
POST http://server/en/omk/opConfig/api/v1/credential_set
Successful Response
HTTP Status | Body | Description |
---|---|---|
200 | JSON object | Returns the credential set (With the password obscured). |
Unsuccessful Response
HTTP Status | Body | Description |
---|---|---|
422Unprocessable Entity | String with an error message | Example: A resource called "router1credentials" already exists! |
Request example:
Code Block |
---|
{"always_privileged": "0", "description": "the default nmis user", "lastupdate": 1625045906, "setname": "nmis", "ssh_key": "", "username": "nmis", "namesetname": "testapitestapi2", "password": "1234v&SYI2,LQiQ4ZSgCQa" } |
Response:
Code Block |
---|
{ "always_privileged": "0", "description": "the default nmis user", "lastupdate": 1645007389, "password": "*****", "setname": "testapi2", "ssh_key": "", "username": "nmis" } |
...
PUT http://server/en/omk/opConfig/api/v1/credential_set/nmis
The name of the credential set is the setname property in the create.
Returns the credential set (With the password obscured).
...
Code Block |
---|
{"always_privileged": "0", "description": "new description", "lastupdate": 1625045906, "setname": "nmis", "ssh_key": "", "username": "nmis", "namesetname": "testapi", "password": "1234" } |
...
Code Block |
---|
{ "always_privileged": "0", "description": "new description", "lastupdate": 1645007389, "password": "*****", "setname": "testapi2testapi", "ssh_key": "", "username": "nmis" } |
Remove
DELETE http://server/en/omk/opConfig/api/v1/credential_set/nmis
Returns ok/error.
Response example:
Code Block |
---|
"Cannot update nonexistent resource \"testapi2\"!" |
Assign a credential set to a node
POST http://server/en/omk/opConfig/api/v1/credential_set/nmis/mynode
We can use the node name or the uuid
Returns ok/error.
Response example:
Code Block |
---|
"Successfully assigned credential set" |
Unassign a credential set from a node
DELETE http://server/en/omk/opConfig/api/v1/credential_set/nmis/mynode
We can use the node name or the uuid
Returns ok/error.
Response example:
Code Block |
---|
"Successfully unassigned credential set" |