You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

From opConfig 4.3.2, a new API with CRUD operations for credential sets is available under:

http://server/en/omk/opConfig/api/v1/credential_set

Please note, that credential sets can also be managed in the opConfig GUI.

Summary

OperationMethodAPI
Get a list of Credential SetGEThttp://server/en/omk/opConfig/api/v1/credential_set
Get a Credential SetGEThttp://server/en/omk/opConfig/api/v1/credential_set/NAME
Create a Credential SetPOSThttp://server/en/omk/opConfig/api/v1/credential_set
Update a Credential SetPUThttp://server/en/omk/opConfig/api/v1/credential_set
Delete a Credential SetDELETEhttp://server/en/omk/opConfig/api/v1/credential_set
Assign a Credential Set to a nodePOSThttp://server/en/omk/opConfig/api/v1/credential_set/NAME/NODE
Unassigns a Credential Set from a nodeDELETEhttp://server/en/omk/opConfig/api/v1/credential_set/NAME/NODE

Get

GET http://server/en/omk/opConfig/api/v1/credential_set

Returns a list of credential set (With the password obscured).

Response:

{
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

Returns the credential set (With the password obscured).

Response:

{
always_privileged: "0",
description: "the default nmis user",
lastupdate: 1625045906,
password: "*****",
password_privileged: "*****",
setname: "nmis",
ssh_key: "",
username: "nmis"
}

Create

POST http://server/en/omk/opConfig/api/v1/credential_set

Returns the credential set (With the password obscured).

Request example:

{"always_privileged": "0",
"description": "the default nmis user",
"lastupdate": 1625045906,
"setname": "nmis",
"ssh_key": "",
"username": "nmis",
"setname": "testapi",
"password": "1234"
}


Response:

{
    "always_privileged": "0",
    "description": "the default nmis user",
    "lastupdate": 1645007389,
    "password": "*****",
    "setname": "testapi2",
    "ssh_key": "",
    "username": "nmis"
}

Update

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).

Request example:

{"always_privileged": "0",
"description": "new description",
"lastupdate": 1625045906,
"setname": "nmis",
"ssh_key": "",
"username": "nmis",
"setname": "testapi",
"password": "1234"
}


Response:

{
    "always_privileged": "0",
    "description": "new description",
    "lastupdate": 1645007389,
    "password": "*****",
    "setname": "testapi2",
    "ssh_key": "",
    "username": "nmis"
}

Remove

DELETE http://server/en/omk/opConfig/api/v1/credential_set/nmis

Returns ok/error.

Response example:

"Cannot update nonexistent resource \"testapi2\"!"
  • No labels