UIMAPI - PUT vs POST when updating multiple password keys of a probe config?
search cancel

UIMAPI - PUT vs POST when updating multiple password keys of a probe config?

book

Article ID: 374687

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

There are two API methods for updating a probe config key.  One is a PUT and the other a POST but there is no description in the techdocs clearly describing the difference.

PUT​/uimapi​/probes​/{domain}​/{hub}​/{robot}​/{probe}​/config
Updates the configuration information (key/value) of the specified UIM probe
POST​/uimapi​/probes​/{domain}​/{hub}​/{robot}​/{probe}​/config
Sets the configuration information (key/value) of the specified UIM probe

I need to update multiple config keys then apply the changes by restarting the probe. I don't want a situation where I update a config key and after each key update the probe is restarted each change. Every probe restart has an impact on existing alarms. I want to make all required changes then apply the changes.

For example for the sql_response probe I want to:

1. update the password key for several connection profiles

2. perform a restart to apply the changes

Based on swaggers lack of detail and that both put and post 'look' the same, I don't see where they do anything different.

What is the proper procedure for making multiple probe config changes to one probe and applying the changes once?

Environment

  • DX UIM 23.4 CU2
  • UIMAPI v23.4.0

Cause

  • Need for techdocs update

Resolution

You can run a GET call to view the entire configuration file. The GET wil show you all of the config parameters and it is long. You can pick out the paramaters youd like to change.

You MUST use a PUT API call not a POST.

Shown below is an example of the syntax, and this includes encryption as well.

Execute the PUT call after adding this as the "Request Body."

Make sure you use the correct connection name.

Replace the password below with the new password you want to change it to.

[{
"encrypt":"yes",
"key":"/connections/MyTestConn/password",
"value":"<password_string_1>"
}, 
{
"encrypt":"yes",
"key":"/connections/MyTestConn_2/password",
"value":"<password_string_2>"
}]

PUT commits the changes and the probe will automatically restart. There is no need for a separate command to restart the probe.

Check the probe configuration results via Raw Configure mode to confirm the changes after testing.

The passwords will show up in the probe config file as an encrypted string.

Additional Information

UIM APIs

Note that some special characters such as # or $ or = used in the Request Body payload for the password may not work as expected and generate a 500 error.