Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Documented already exists status code

...

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.

Image Added

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 node
GET
POSThttp://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

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 objectReturns the credential set (With the password obscured).

Unsuccessful Response

HTTP Status

Body

Description

422Unprocessable EntityString 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"
}

...

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"