调用CreateQosCar接口创建QoS的限速规则。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateQosCar

系统规定参数。取值:CreateQosCar

Description String Qosdesc

QoS限速规则的描述信息。

RegionId String cn-shanghai

QoS策略实例所在的地域ID。

您可以调用DescribeRegions接口查询地域ID。

QosId String qos-xitd8690ucu8ro****

QoS策略的实例ID。

Priority Integer 2

设置限速规则的优先级。

取值范围:1~3。数值越小,优先级越高。同优先级时先下发的规则优先生效。

LimitType String Absolute

限速类型,取值:

  • Absolute:按带宽值。
  • Percent:按百分比。
MinBandwidthAbs Integer 2

最小带宽值,带宽值需要输入整数,单位:Mbps。

LimitTypeAbsolute时必填。

MaxBandwidthAbs Integer 6

最大带宽值,带宽值需要输入整数,单位:Mbps。

LimitTypeAbsolute时必填。

说明 输入的最大带宽值必须大于最小带宽值。
MinBandwidthPercent Integer 20

最小带宽百分比,单位:百分比(%),取值范围:1~100

LimitTypePercent时必填。

MaxBandwidthPercent Integer 90

最大带宽百分比,单位:百分比(%),取值范围:1~100

LimitTypePercent时必填。

说明 输入的最大带宽百分比必须大于最小带宽百分比。
PercentSourceType String CcnBandwidth

百分比限速时的带宽类型,取值:

  • CcnBandwidth:表示CCN带宽。
  • InternetUpBandwidth:表示Internet总带宽。
Name String nametest

QoS限速规则名称。

长度为2~128,以字母或中文开头,且只包含中文、字母、数字、半角句号(.)、下划线(_)和短划线(-)。

返回数据

名称 类型 示例值 描述
MinBandwidthAbs Integer 2

最小带宽值,单位:Mbps。

LimitTypeAbsolute时必填。

Description String Qosdesc

QoS限速规则描述。

RequestId String AC13E8FF-4D61-40AD-868E-817F2D3AC86A

请求ID。

QosCarId String qoscar-n5k8g97lihlph****

QoS限速规则的实例ID。

MaxBandwidthAbs Integer 6

最大带宽值,单位:Mbps。

LimitTypeAbsolute时必填。

MaxBandwidthPercent Integer 90

最大带宽百分比,单位:百分比(%)。

Priority Integer 2

规则的优先级。

QosId String qos-xitd8690ucu8ro****

QoS策略的实例ID。

PercentSourceType String CcnBandwidth

按百分比限速时的带宽类型,取值:

  • CcnBandwidth:表示CCN带宽。
  • InternetUpBandwidth:表示Internet总带宽。
MinBandwidthPercent Integer 20

最小带宽百分比,单位:百分比(%)。

LimitType String Percent

限速类型,取值:

  • Absolute:按带宽值。
  • Percent:按百分比。

示例

请求示例

http(s)://[Endpoint]/?Action=CreateQosCar
&Description=Qosdesc
&RegionId=cn-shanghai
&QosId=qos-xitd8690ucu8ro****
&Priority=2
&LimitType=Absolute
&MinBandwidthAbs=2
&MaxBandwidthAbs=6
&MinBandwidthPercent=20
&MaxBandwidthPercent=90
&PercentSourceType=CcnBandwidth
&Name=nametest
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateQosCarResponse>
    <MinBandwidthAbs>2</MinBandwidthAbs>
    <Description>Qosdesc</Description>
    <RequestId>AC13E8FF-4D61-40AD-868E-817F2D3AC86A</RequestId>
    <QosCarId>qoscar-n5k8g97lihlph****</QosCarId>
    <MaxBandwidthAbs>6</MaxBandwidthAbs>
    <MaxBandwidthPercent>90</MaxBandwidthPercent>
    <Priority>2</Priority>
    <QosId>qos-xitd8690ucu8ro****</QosId>
    <PercentSourceType>CcnBandwidth</PercentSourceType>
    <MinBandwidthPercent>20</MinBandwidthPercent>
    <LimitType>Percent</LimitType>
</CreateQosCarResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "MinBandwidthAbs" : 2,
  "Description" : "Qosdesc",
  "RequestId" : "AC13E8FF-4D61-40AD-868E-817F2D3AC86A",
  "QosCarId" : "qoscar-n5k8g97lihlph****",
  "MaxBandwidthAbs" : 6,
  "MaxBandwidthPercent" : 90,
  "Priority" : 2,
  "QosId" : "qos-xitd8690ucu8ro****",
  "PercentSourceType" : "CcnBandwidth",
  "MinBandwidthPercent" : 20,
  "LimitType" : "Percent"
}

错误码

HttpCode 错误码 错误信息 描述
400 MissParameter.RegionId You must specify RegionId. 您的输入中缺少必填参数RegionId。
400 MissParameter.QosId You must specify QosId. 您的输入中缺少必填参数QosId。
400 MissParameter.LimitType You must specify LimitType. 您的输入中缺少必填参数"LimitType"。
400 MissParameter.Priority You must specify Priority. 您的输入中缺少必填参数"Priority"。
400 InvalidParameter.LimitType You must specify LimitType. 您的输入中缺少必填参数"LimitType"。
400 MissParameter.MaxBandwidthAbs You must specify MaxBandwidthAbs. 您的输入中缺少必填参数"MaxBandwidthAbs"。
400 MissParameter.MaxBandwidthPercent You must specify MaxBandwidthPercent. 您的输入中缺少必填参数"MaxBandwidthPercent"。
400 MissParameter.MinBandwidthAbs You must specify MinBandwidthAbs. 您的输入中缺少必填参数"MinBandwidthAbs"。
400 MissParameter.MinBandwidthPercent You must specify MinBandwidthPercent. 您的输入中缺少必填参数"MinBandwidthPercent"。
400 InvalidBandwidthCompare The specified maximum bandwidth is smaller than the minimum bandwidth. Please check your input. 您输入的参数中最大带宽值小于最小带宽值,请检查您的输入。
400 MissParameter.PercentSourceType You must specify PercentSourceType. 您的输入中缺少必填参数"PercentSourceType"。
400 InvalidId.Qos The specified QosId is invalid. 您输入的参数QosId不合法。
400 Invalid.QosCar.Priority The specified priority of QosCarId is invalid. 指定的QosCar的优先级priority参数不合法。
400 QosCarPerQosAmountLimit The maximum number of QosCar in a QoS is exceeded. You can submit a ticket to increase the quota. 单个QoS策略中的限速规则数量已达上限。
400 InvalidParameter.Priority The specified Priority is invalid. 您输入的参数Priority不合法。
400 InvalidParameter.PercentSourceType The specified PercentSourceType is invalid. 您输入的参数"PercentSourceType"不合法。
400 InvalidParameter.Description The specified Description is invalid. 您输入的参数Description不合法。
400 InvalidParameter.LimitType The specified LimitType is invalid. 您输入的参数"LimitType"不合法。
400 InvalidParameter.Name The specified Name is invalid. 您输入的参数Name不合法。
403 InternalError An internal server error occurred. 内部服务错误。

访问错误中心查看更多错误码。