Page 1 of 1

Branches hosts mask exclude

Posted: Mon Jun 29, 2020 11:41 am
by artem.lavilin
Hello :) ! Can i change hosts_mask_exclude in branch params with json-request protocol?

Code: Select all

{
  'action': 
    {
      'type': 'branches', 
      'name': '/', 
      'params': 
        {
          'hosts_mask_exclude' : 'some_mask',
        }
    }
}
I got

Code: Select all

{u'info': {u'text': u'Invalid action.', u'kind': u'error'}}

Re: Branches hosts mask exclude

Posted: Mon Jun 29, 2020 12:17 pm
by timurhai
Hi!

To see json actions, you can perform something from a GUI and look at WebGUI log, or AfWatch stdout.

Also, here is some examples:
https://github.com/CGRU/cgru/tree/master/examples/json

This is a good example on this topic:
https://github.com/CGRU/cgru/blob/maste ... arams.json

There is no "name" method to specify action node(s), use "ids" array or "mask" regular expression. In you case, you can just change "name" on "mask".
Also any action must have "user_name" and "host_name" fields (for now it is used for logging only, but later it designed for permissions).

Re: Branches hosts mask exclude

Posted: Mon Jun 29, 2020 12:36 pm
by artem.lavilin
Nice! It's work, thank you! :)