Having an issue with checkboxes in API

Reply
L0 Member

Having an issue with checkboxes in API

I am having an issue with changing settings that use checkboxes through API. For example the setting under 

/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/services. If I try to set <disable-telnet></disable-telnet> it says that <disable-telnet></disable-telnet> is an invalid object. If I use the api browser and click on disable-telnet it returns success but code="7" which means invalid object and really isn't success. If I try the api browser and do a submit for just services it returns only a few of the checkboxes and what the settings are. We are currently on the latest version of 7. We have hit this in other parts of the config for checkboxes also. I did the debug to see what is happening when somebody sets a checkbox but it is the only part that doesn't seem to translate to api properlyl.

L4 Transporter

Re: Having an issue with checkboxes in API

Looks like these checkboxes are expecting "yes" or "no" as values.  As an example, if you want to enable HTTPS but disable telnet, this seems to be working for me (7.1.x):

 

Type: config

Action: set

 

(xpath) /config/devices/entry[@name='localhost.localdomain']/deviceconfig/system

(element)

<service>

  <disable-https>no</disable-https>

  <disable-telnet>yes</disable-telnet>

</service>

L0 Member

Re: Having an issue with checkboxes in API

Weird. I just got a response back from second level support that they were able to replicate the problem. They are going to enumerate through all the checkboxes to see all the ones that are causing the issue and try to provide a fix. 

L4 Transporter

Re: Having an issue with checkboxes in API

AFAIK, you can't `set` something to an empty value that's expecting a `yes` or a `no`.  Along those same lines, there are fields in the API that you can set as empty, while others will not tolerate it.  Could you refer them to my posts, and if they belive this is a bug, ask for a bug ID and share it here?

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!