
Sample content of
inputfile
for an SNMP v1 key
{"key": { "type": "SNMP", "description": "v1Key", "snmp-config": {
"snmpversion": "v1", "readcommunityname": "public", "writecommunityname":
"public" } } }
Sample content of
inputfile
for an SNMP v3 key
{"key": { "type": "SNMP", "description": "authPriv", "snmp-config": {
"snmpversion": "v3", "username": "authPriv", "authorization": {
"type":"SHA", "password":"MySHApassword" }, "privacy": { "type":"AES",
"password":"MyAESpassword" } } } }
Deleting an SNMP key
To delete an SNMP key from the controller, enter the following curl command:
curl --header "X-Auth-Token:
token
" -sX DELETE
http://
controller_ip
:8080/sdn/v2.0/net/keys/SNMP/description/
description
Where
description
matches the description for the key you want to delete.
Sample command
curl --header "X-Auth-Token: 131eaa225ece4293bcebfd7f8e3cffd0" -sX DELETE
http://localhost:8080/sdn/v2.0/net/keys/SNMP/description/"authPriv"
Managing NETCONF keys
Some devices provide support NETCONF (Network Configuration Protocol).
The Key Service component of the controller allows network administrators to configure NETCONF
security keys so that the controller can communicate with those switches using the secure key.
Getting the NETCONF keys
To get the NETCONF keys known to the controller, enter the following curl command:
curl --header "X-Auth-Token:
token
" -sX GET http://
controller_ip
:8080/sdn/v2.0/net/keys/NETCONF
Sample command
curl --header "X-Auth-Token: 131eaa225ece4293bcebfd7f8e3cffd0" -sX GET
http://localhost:8080/sdn/v2.0/net/keys/NETCONF
Sample Response
{
"NETCONF": [
"Default Netconf key"
]
}
Adding NETCONF keys
To add one or more NETCONF keys to the controller, enter the following curl command:
curl --header "Content-Type: application/json" --header "X-Auth-Token:
token
" -sX POST -d @
inputfile
http://
controller_ip
/sdn/v2.0/net/keys
Where
inputfile
is a file in the local directory that contains the key information in JSON format.
Sample command
curl --header "Content-Type: application/json" --header "X-Auth-Token:18433683aaea4e0782fa632ee9f04953" -sX
POST -d @inputfile http://localhost:8080/sdn/v2.0/net/keys
Sample content of
inputfile
for a NETCONF key
{"key": { "type": "NETCONF", "description": "SampleNetconfKey" } }
Deleting a NETCONF key
To delete a NETCONF key from the controller, enter the following curl command:
curl --header "X-Auth-Token:
token
" -sX DELETE
http://
controller_ip
:8080/sdn/v2.0/net/keys/NETCONF/description/
description
Where
description
matches the description for the key you want to delete.
180
curl commands