Config

List config

Sample request 

Get configuration for all apps on this controller team:

GET /sdn/v2.0/configs

There is no request body for this API.

Sample response 

{
   "configs":[
      {
         "com.hp.sdn.adm.alert.impl.AlertManager":{
            "trim.alert.age":{
               "def_val":"14",
               "desc":"Days an alert remains in storage (1 - 31)",
               "val":"14"
            },
            "trim.enabled":{
               "def_val":"true",
               "desc":"Allow trim operation (true/false)",
               "val":"true"
            },
            "trim.frequency":{
               "def_val":"24",
               "desc":"Frequency in hours of trim operations (8 - 168)",
               "val":"24"
            }
         }
      },
      {
         "com.hp.sdn.adm.auditlog.impl.AuditLogManager":{
            "trim.auditlog.age":{
               "def_val":"365",
               "desc":"Days an audit log remains in storage (31 - 1870)",
               "val":"365"
            },
            "trim.enabled":{
               "def_val":"true",
               "desc":"Allow trim operation (true/false)",
               "val":"true"
            },
            "trim.frequency":{
               "def_val":"24",
               "desc":"Frequency in hours of trim operations (8 - 168)",
               "val":"24"
            }
         }
      }
   ]
}

Response codes 

  • Normal: OK (200)

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

Config/{component}

List config for a given component

Sample request 

Get configuration for the "com.hp.sdn.net" component:

GET /sdn/v2.0/configs/com.hp.sdn.adm.alert.impl.AlertManager

There is no request body for this API.

Sample response 

{
   "config":{
      "com.hp.sdn.adm.alert.impl.AlertManager":{
         "trim.alert.age":{
            "def_val":"14",
            "desc":"Days an alert remains in storage (1 - 31)",
            "val":"14"
         },
         "trim.enabled":{
            "def_val":"true",
            "desc":"Allow trim operation (true/false)",
            "val":"true"
         },
         "trim.frequency":{
            "def_val":"24",
            "desc":"Frequency in hours of trim operations (8 - 168)",
            "val":"24"
         }
      }
   }
}

Response codes 

  • Normal: OK (200)

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

Update (partial) config for a given component

Sample request 

Update configuration for the "com.hp.sdn.adm.alert.impl.AlertManager" component:

PUT /sdn/v2.0/configs/com.hp.sdn.adm.alert.impl.AlertManager
{
   "config":{
      "trim.frequency":"12"
   }
}

Sample response 

{
   "config":{
      "com.hp.sdn.adm.alert.impl.AlertManager":{
         "trim.alert.age":{
            "def_val":"14",
            "desc":"Days an alert remains in storage (1 - 31)",
            "val":"14"
         },
         "trim.enabled":{
            "def_val":"true",
            "desc":"Allow trim operation (true/false)",
            "val":"true"
         },
         "trim.frequency":{
            "def_val":"24",
            "desc":"Frequency in hours of trim operations (8 - 168)",
            "val":"12"
         }
      }
   }
}

Response codes 

  • Normal: OK (200)

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

Revert to default config for a given component

Sample request 

Delete specified configuration items for the "com.hp.sdn.net" component:

DELETE /sdn/v2.0/configs/com.hp.sdn.net
{"config":["trim.frequency"]}

Delete without any request body will revert all configuration items for the given component back to their defaults.

Sample response 

{
   "config":{
      "com.hp.sdn.adm.alert.impl.AlertManager":{
         "trim.alert.age":{
            "def_val":"14",
            "desc":"Days an alert remains in storage (1 - 31)",
            "val":"14"
         },
         "trim.enabled":{
            "def_val":"true",
            "desc":"Allow trim operation (true/false)",
            "val":"true"
         },
         "trim.frequency":{
            "def_val":"24",
            "desc":"Frequency in hours of trim operations (8 - 168)",
            "val":"24"
         }
      }
   }
}

Response codes 

  • Normal: OK (200)

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