Ibm cloud 错误:应在输入JSON for API的计划中至少指定一个计划规则
我在Bluemix UI中创建了一个自动缩放,保存了它,然后使用Ibm cloud 错误:应在输入JSON for API的计划中至少指定一个计划规则,ibm-cloud,autoscaling,devops-services,Ibm Cloud,Autoscaling,Devops Services,我在Bluemix UI中创建了一个自动缩放,保存了它,然后使用cf env检索策略。政策是: { "policyState": "ENABLED", "policyId": "", "instanceMinCount": 2, "instanceMaxCount": 5, "policyTriggers": [ { "metricType": "Memory", "statWindow":
cf env
检索策略。政策是:
{
"policyState": "ENABLED",
"policyId": "",
"instanceMinCount": 2,
"instanceMaxCount": 5,
"policyTriggers": [
{
"metricType": "Memory",
"statWindow": 300,
"breachDuration": 600,
"lowerThreshold": 30,
"upperThreshold": 80,
"instanceStepCountDown": 1,
"instanceStepCountUp": 1,
"stepDownCoolDownSecs": 600,
"stepUpCoolDownSecs": 600
}
],
"schedules": {
"timezone": "(GMT +01:00) Africa/Algiers",
"recurringSchedule": null,
"specificDate": null
}
}
然后,我尝试从IBM devops部署阶段应用策略:
curl https://ScalingAPI.ng.bluemix.net/v1/autoscaler/apps/xxxx/policy -X 'PUT' \
-H 'Content-Type:application/json' \
-H 'Accept:application/json' \
-H 'Authorization:Bearer *****' \
--data-binary @./autoscaling_policy.json \
-s -o response.txt -w '%{http_code}\n'
答复如下:
{“错误”:“CWSCV6003E:输入JSON字符串格式错误:应在输入JSON for API:Create/Update Policy for App xxxxx的计划中至少指定一个计划规则。”}
解决方法是删除schedules元素:
{
"policyState": "ENABLED",
"policyId": "",
"instanceMinCount": 2,
"instanceMaxCount": 5,
"policyTriggers": [
{
"metricType": "Memory",
"statWindow": 300,
"breachDuration": 600,
"lowerThreshold": 30,
"upperThreshold": 80,
"instanceStepCountDown": 1,
"instanceStepCountUp": 1,
"stepDownCoolDownSecs": 600,
"stepUpCoolDownSecs": 600
}
]
}
问题:为什么用户界面不抱怨计划,并允许我导出API调用不喜欢的无效计划