Filtering by service groups REST API

Hi :slight_smile:

I am trying to schedule a downtime via REST API… The problem I have is - when I deploy one app a lot of different services will go down as well (and those are not this host services or also I don’t want all services from this specific host to go down) - this is why I wanted to schedule a downtime by a filter like service group… But I can’t suceed in this… So i started to wonder if it’s actually possible, to filter via servcie group name in curl?

This are the examples I tried…

My service group

object ServiceGroup "deploy" {
  display_name = "Services under maintenance (deploy)"

  assign where host.vars.deploy == "my_App" && service.vars.deploy == true 
}

And this are my failed attempts:

-d '{ "type": "Service", "filter": "service.groups==\"deploy\"", "start_time": '"$START_TIME"', "end_time": '"$END_TIME"', "author": "admin_deploy", "comment": "Services under maintenance - app deploy", "pretty": true }'
 -d '{ "type": "Service", "filter": "servicegroup_name==\"deploy\"", "start_time": '"$START_TIME"', "end_time": '"$END_TIME"', "author": "admin_deploy", "comment": "Services under maintenance - app deploy", "pretty": true }'

I tried some other things as wel but can’t recall now… though they did not work :smiley:

I found the resolve :smiley:
In the end everything is possible :stuck_out_tongue:

I used this example

 -d '{ "type": "Service", "filter": "\"deploy\" in service.groups", "start_time": '"$START_TIME"', "end_time": '"$END_TIME"', "author": "admin_deploy", "comment": "Services under maintenance - app deploy", "pretty": true }'