gpt4 book ai didi

azure - 使用管理 REST API 创建自动缩放时出错

转载 作者:行者123 更新时间:2023-12-03 04:33:54 25 4
gpt4 key购买 nike

我正在测试 REST API 以创建自动缩放规则。但是出现以下错误:

HTTP/1.1 500 Internal Server Error

The server encountered an internal error. Please retry the request

我使用 SOAPUI 工具作为 REST 客户端。

该请求显然是根据https://msdn.microsoft.com/en-us/library/azure/dn510372.aspx

出了什么问题?

在哪里可以找到使用 REST API 创建 Auto Scaling 的示例?

下面是json格式的HTTP请求体

谢谢!

{
"Profiles": [
{
"Name": "name-of-profile-ONE",
"Capacity": {
"Minimum": "1",
"Maximum": "3",
"Default": "1"
},
"Rules": [
{
"MetricTrigger": {
"MetricName": "Percentage CPU",
"MetricNamespace": "",
"MetricSource": "/VirtualMachinesAvailabilitySet/test/set2",
"TimeGrain": "PT5M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "GreaterThanOrEqual",
"Threshold": "80"
},
"ScaleAction": {
"Direction": "Increase",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT20M"
},
},
{
"MetricTrigger": {
"MetricName": "Percentage CPU",
"MetricNamespace": "",
"MetricSource": "/VirtualMachinesAvailabilitySet/test/set2",
"TimeGrain": "PT5M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "LessThanOrEqual",
"Threshold": "60"
},
"ScaleAction": {
"Direction": "Decrease",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT20M"
},
},
],
}
],
"Enabled": true
}

最佳答案

我发现json有错误。遵循正确的 json ...

谢谢

{
"Profiles": [
{
"Name": "name-of-profile-UM",
"Capacity": {
"Minimum": "1",
"Maximum": "3",
"Default": "1"
},
"Rules": [
{
"MetricTrigger": {
"MetricName": "Percentage CPU",
"MetricNamespace": "",
"MetricSource": "/VirtualMachinesAvailabilitySet/romulo101s/set2",
"TimeGrain": "PT5M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "GreaterThanOrEqual",
"Threshold": "80"
},
"ScaleAction": {
"Direction": "Increase",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT20M"
}
},
{
"MetricTrigger": {
"MetricName": "Percentage CPU",
"MetricNamespace": "",
"MetricSource": "/VirtualMachinesAvailabilitySet/romulo101s/set2",
"TimeGrain": "PT5M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "LessThanOrEqual",
"Threshold": "60"
},
"ScaleAction": {
"Direction": "Decrease",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT20M"
}
}
]
}
],
"Enabled": true
}

关于azure - 使用管理 REST API 创建自动缩放时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31089255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com