Keys

List all keys of a specified type

Sample request 

GET /sdn/v2.0/net/keys/{type}

Type could have values SNMP or NETCONF.

There is no request body for this API.

Sample Response 

{
    "SNMP": [
        "Default SNMP key", 
        "Test Key1", 
        "Test Key2", 
		"Test Key3"
    ]
}

Response Codes 

  • Normal: OK(200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

List details of a specific key type matching a description

Sample request 

GET /sdn/v2.0/net/keys/{type}/description/{description}

Type could have values SNMP or NETCONF.

There is no request body for this API.

Sample Response 

{
    "SNMP": [
        "Default SNMP key"
    ]
}

Response Codes 

  • Normal: OK(200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Add a key using JSON

Sample request 

POST /sdn/v2.0/net/keys/

Note: This release only supports adding an SNMP key through this API.

{
   "key":{
      "type":"SNMP",
      "description":"Test Key1",
      "snmp-config":{
         "snmpversion":"v1",
         "community":{
            "readcommunityname":"User1Key",
            "writecommunityname":"User1Key"
         },
         "authorization":{
            "authtype":"",
            "authpwd":""
         },
         "privacy":{
            "ptype":"",
            "ppwd":""
         },
         "credentials":{
            "username":"",
            "password":""
         },
         "timeout":1,
         "retries":1
      },
      "netconf-config":{

      }
   }
}

Sample Response 

If success, response is a 200, else an error code is reported.

Response Codes 

  • Normal: OK(200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Delete a key of a specific type and description

DELETE /sdn/v2.0/net/devices/{uid}

There is no request body for this API.

Sample Response 

If success, response is a 200, else an error code is reported.

Response Codes 

  • Normal: OK(200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)