Closed wtsidney2016 closed 2 years ago
Would also like to be able to set auto_pause_notifications_parameters from pd service:set
"auto_pause_notifications_parameters": {
"enabled": true,
"timeout": 300
}
Also tried to enable setting alert_grouping_parameters.type
% pd service:set -i=PXPW401 -k=alert_grouping_parameters.type -v='intelligent'
› Warning: pagerduty-cli update available from 0.1.0 to 0.1.3.
Setting alert_grouping_parameters.type = 'intelligent' on 1 services 1/1 👍, 0/1 👎... done
Failed to set value on service PXPW401
Hello,
Same issue here
$> pd version
pagerduty-cli/0.1.4 darwin-arm64 node-v16.15.0
AFAIU it seems to be due to the data submitted towards the API. I can't find the right CLI syntax to have a JSON object, it's a string.
data: {
service: {
id: 'Pxxxxxx',
type: 'service_reference',
'alert_grouping_parameters.type': 'intelligent'
}
or
data: {
service: {
id: 'Pxxxxxx',
type: 'service_reference',
alert_grouping_parameters: '{"type": "intelligent"}'
}
}
A workaround is to use the deprecated alert_grouping
parameter.
$> echo "Enable alert grouping" ; pd service:set -i Pxxxx -k alert_grouping -v "intelligent"
$> echo "Disable alert grouping" ; pd service:set -i Pxxxx -k alert_grouping -v ""
Regards
Sorry everyone, yes, as you have noticed, key paths and/or direct JSON is not supported by the *:set
commands... the best current workaround is to use rest put
instead, like this:
pd rest put -e services/MY_SERVICE_ID -d '{"service": {"auto_pause_notifications_parameters": {"enabled": true, "timeout": 300}}}'
I will start thinking on how to make the *:set
commands better for this sort of thing... I am thinking about two possible approaches --
Ideally I would do both
Extending the :set command to accept json would be nice.
I was able to use use pd CLI to enable auto_pause - Thank You!
Hi, I added the ability to give JSON as the value; you can also give JSON dot path notation as the key; also you can give -k
and -v
multiple times (in order) to set multiple key/values at once. Example screenshot:
This is in v0.1.5, now released as an RC, pd update rc
to try it, pd update stable
if you want to switch back to 0.1.4... can you give it a try and let me know if it's resolved for you? Thanks
JSON dot path notation works fine for me. Tested:
$> pd version
pagerduty-cli/0.1.5 darwin-arm64 node-v16.15.0
Thank you @sdenef-adeo! I will be looking to close this issue and promote this build to stable soon.
Hi, I just promoted this build to stable so closing this issue...
Unable to enable Intelligent Alert Grouping using pd services:set