调用CreateQosPolicy创建Qos五元组规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 否 | CreateQosPolicy |
要执行的操作。 取值:CreateQosPolicy。 |
DestCidr | String | 是 | 10.10.10.0/24 |
目的网段。 |
DestPortRange | String | 是 | 80/80 |
目的端口范围。 |
IpProtocol | String | 是 | TCP |
传输层协议。 |
Priority | Integer | 是 | 6 |
流优先级,数值越小,优先级越高,同优先级时先下发的规则优先生效。 优先级范围:1~7。 |
QosId | String | 是 | qos-dhf*********** |
Qos策略的实例ID。 |
RegionId | String | 是 | cn-hangzhou |
Qos策略实例所在的地域ID。 |
SourceCidr | String | 是 | 10.10.10.9/24 |
源网段。 |
SourcePortRange | String | 是 | 80/80 |
传输层源端口范围。 |
Description | String | 否 | 五元组规则 |
Qos五元组规则的描述。 |
StartTime | String | 否 | 2019-07-14T16:41:33+0800 |
Qos策略生效开始时间。 |
EndTime | String | 否 | 2019-09-14T16:41:33+0800 |
Qos策略生效结束时间。 |
Name | String | 否 | nametest |
Qos五元组规则名称,长度为2-100,必须以大小字母或中文开头,可包含数字,"-","_"。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 97862812-2C7E-4D25-B0D5-B26DAC7FA293 |
请求ID。 |
QosId | String | qos-xhwhyuo43l******** |
Qos策略的实例ID。 |
QosPolicyId | String | qospy-xhwhyuo43l******** |
五元组的规则ID。 |
Description | String | bvt-test |
Qos五元组规则的描述。 |
Priority | Integer | 3 |
流优先级,数值越小,优先级越高,同优先级时先下发的规则优先生效。 优先级范围:1~7。 |
SourceCidr | String | 10.10.10.9/24 |
源网段。 |
DestCidr | String | 10.10.10.0/24 |
目的网段。 |
IpProtocol | String | TCP |
传输层协议。 |
SourcePortRange | String | 80/80 |
源端口范围。 |
DestPortRange | String | 80/80 |
目的端口范围。 |
StartTime | String | 2019-07-14T16:41:33+0800 |
Qos策略生效开始时间。 |
EndTime | String | 2019-09-14T16:41:33+0800 |
Qos策略生效结束时间。 |
Name | String | nametest |
Qos五元组规则名称,长度为2-100,必须以大小字母或中文开头,可包含数字,"-","_"。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateQosPolicy
&DestCidr=10.10.10.0/24
&DestPortRange=80/80
&IpProtocol=TCP
&Priority=6
&QosId=qos-dhf***********
&RegionId=cn-hangzhou
&SourceCidr=10.10.10.9/24
&SourcePortRange=80/80
&<公共请求参数>
正常返回示例
XML
格式
<CreateQosPolicyResponse>
<Description>bvt-test</Description>
<DestCidr>10.10.0.0/24</DestCidr>
<DestPortRange>-1/-1</DestPortRange>
<EndTime>2019-09-14T16:41:33+0800</EndTime>
<IpProtocol>ALL</IpProtocol>
<Priority>1</Priority>
<QosId>qos-awfxl1adxeqykl****</QosId>
<QosPolicyId>qospy-427m9fo6wkhofs****</QosPolicyId>
<RequestId>97862812-2C7E-4D25-B0D5-B26DAC7FA293</RequestId>
<SourceCidr>192.168.0.0/24</SourceCidr>
<SourcePortRange>-1/-1</SourcePortRange>
<StartTime>2019-07-14T16:41:33+0800</StartTime>
</CreateQosPolicyResponse>
JSON
格式
{
"Description":"bvt-test",
"DestCidr":"10.10.0.0/24",
"DestPortRange":"-1/-1",
"EndTime":"2019-09-14T16:41:33+0800",
"IpProtocol":"ALL",
"Priority":1,
"QosId":"qos-awfxl1adxeqykl****",
"QosPolicyId":"qospy-427m9fo6wkhofs1****",
"RequestId":"97862812-2C7E-4D25-B0D5-B26DAC7FA293",
"SourceCidr":"192.168.0.0/24",
"SourcePortRange":"-1/-1",
"StartTime":"2019-07-14T16:41:33+0800"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
403 | InternalError | An internal server error occurred. | 内部服务错误 |
400 | NotSupportedProtocol | The specified protocol of the QoS policy is not supported. | Qos规则不支持该协议。 |
403 | InvalidPortRange | The specified port range is invalid. | 您输入的端口范围不合法 |
400 | InvalidId.Qos | The specified QosId is invalid. | 您输入的参数"QosId"不合法。 |
400 | QosPyPerQosPyPerQosAmountLimitQosAmountLimit | The maximum number of policies in a QoS is exceeded. You can submit a ticket to increase the quota. | 单个Qos策略中的QosPolicy达到上限,您可以提交工单申请提高配额。 |
400 | MissParameter.RegionId | You must specify RegionId. | 您的输入中缺少必填参数"RegionId"。 |
400 | MissParameter.QosId | You must specify QosId. | 您的输入中缺少必填参数"QosId"。 |
400 | MissParameter.QosPolicyId | You must specify QosPolicyId. | 您的输入中缺少必填参数"QosPolicyId"。 |
400 | InvalidParameter.Priority | The specified Priority is invalid. | 您输入的参数"Priority"不合法。 |
400 | MissParameter.SourceCidr | You must specify SourceCidr. | 您的输入中缺少必填参数"SourceCidr"。 |
400 | MissParameter.SourcePortRange | You must specify SourcePortRange. | 您的输入中缺少必填参数"SourcePortRange"。 |
400 | MissParameter.DestCidr | You must specify DestCidr. | 您的输入中缺少必填参数"DestCidr"。 |
400 | MissParameter.DestPortRange | You must specify DestPortRange. | 您的输入中缺少必填参数"DestPortRange"。 |
400 | MissParameter.IpProtocol | You must specify IpProtocol. | 您的输入中缺少必填参数"IpProtocol"。 |
400 | InvalidParameter.Description | The specified Description is invalid. | 您输入的参数"Description"不合法。 |
400 | InvalidParameter.DestCidr | The specified DestCidr is invalid. | 您输入的参数"DestCidr"不合法。 |
400 | InvalidParameter.DestPortRange | The specified DestPortRange is invalid. | 您输入的参数"DestPortRange"不合法。 |
400 | InvalidParameter.SourceCidr | The specified SourceCidr is invalid. | 您输入的参数"SourceCidr"不合法。 |
400 | InvalidParameter.SourcePortRange | The specified SourcePortRange is invalid. | 您输入的参数"SourcePortRange"不合法。 |
400 | InvalidParameter.StartTime | The specified StartTime is invalid. | 您输入的参数"StartTime"不合法。 |
400 | InvalidParameter.EndTime | The specified EndTime is invalid. | 您输入的参数"EndTime"不合法。 |
400 | InvalidTimeRangeCompare | The specified end time is earlier than the start time. Please check your input. | 您输入的参数中结束时间小于开始时间,请检查您的输入。 |
400 | InvalidParameter.Name | The specified Name is invalid. | 您输入的参数"Name"不合法。 |
访问错误中心查看更多错误码。