Table of Contents |
---|
From opConfig 4.3.2, a new CLI with CRUD operations for credential sets is available.
...
act=list_credential_sets [name=Y]
act=create_credential_set file=Y.json
act=update_credential_set name=Y file=Y.json
act=delete_credential_sets name=Y
act=assign_credential_sets set name=Y node=Y
List Credential Sets
List all the credential sets in json format:
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=list-credential-sets debug=1
{
"testapi" : {
"always_privileged" : "0",
"description" : "new descript4",
"lastupdate" : 1645085578,
"password" : "*****",
"password_privileged" : "*****",
"setname" : "testapi",
"ssh_key" : "",
"username" : "nmis"
},
"ubu" : {
"always_privileged" : "0",
"description" : "test",
"lastupdate" : 1643796740,
"password" : "*****",
"password_privileged" : "*****",
"setname" : "ubu",
"ssh_key" : "",
"username" : "test"
}
}
|
List one credential set by name in json format:
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=list-credential-sets debug=1 name=asgard
{
"always_privileged" : "0",
"description" : "",
"lastupdate" : 1631098471,
"password" : "*****",
"password_privileged" : "*****",
"setname" : "asgard",
"ssh_key" : "",
"username" : "admin"
} |
Create Credential Set
Create a new credential set with a file in json format containing the credential set information.
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=create-credential-set file=/tmp/credset.json debug=1 |
Example of credset.json file:
Code Block |
---|
{"always_privileged": "0",
"description": "new test descript4",
"lastupdate": 1625045906,
"setname": "mycredset",
"ssh_key": "",
"username": "nmis",
"password": "pwd"
} |
Update Credential Set
Create a new credential set with a file in json format containing the credential set information.
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=update-credential-set file=/tmp/credset.json name=mycredset debug=1 |
Example of credset.json file:
Code Block |
---|
{"always_privileged": "0",
"description": "new test descript4",
"lastupdate": 1625045906,
"setname": "mycredset",
"ssh_key": "",
"username": "nmis",
"password": "pwd"
} |
Delete Credential Set
Delete a credential set using the name:
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=delete-credential-set name=mycredset debug=1 |
Assign Credential Set
Assign a credential set to a node:
Code Block |
---|
/usr/local/omk/bin/opconfig-cli.pl act=assign-credential-set name=mycredset node=mynode debug=1 |