CreateQosCar - 创建QoS的限速规则

更新时间:
复制 MD 格式

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

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

smartag:CreateQosCar

create

*Qos

acs:smartag:{#regionId}:{#accountId}:qos/{#QosId}

请求参数

名称

类型

必填

描述

示例值

Description

string

QoS 限速规则的描述信息。

Qosdesc

RegionId

string

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

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

cn-shanghai

QosId

string

QoS 策略的实例 ID。

qos-xitd8690ucu8ro****

Priority

integer

设置限速规则的优先级。

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

2

LimitType

string

限速类型,取值:

  • Absolute:按带宽值。

  • Percent:按百分比。

Absolute

MinBandwidthAbs

integer

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

LimitTypeAbsolute 时必填。

2

MaxBandwidthAbs

integer

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

LimitTypeAbsolute 时必填。

说明

输入的最大带宽值必须大于最小带宽值。

6

MinBandwidthPercent

integer

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

LimitTypePercent 时必填。

20

MaxBandwidthPercent

integer

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

LimitTypePercent 时必填。

说明

输入的最大带宽百分比必须大于最小带宽百分比。

90

PercentSourceType

string

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

  • CcnBandwidth:表示 CCN 带宽。

  • InternetUpBandwidth:表示 Internet 总带宽。

CcnBandwidth

Name

string

QoS 限速规则名称。

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

nametest

返回参数

名称

类型

描述

示例值

object

返回结果。

MinBandwidthAbs

integer

最小带宽值,单位:Mbps。

LimitTypeAbsolute 时必填。

2

Description

string

QoS 限速规则描述。

Qosdesc

RequestId

string

请求 ID。

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

QosCarId

string

QoS 限速规则的实例 ID。

qoscar-n5k8g97lihlph****

MaxBandwidthAbs

integer

最大带宽值,单位:Mbps。

LimitTypeAbsolute 时必填。

6

MaxBandwidthPercent

integer

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

90

Priority

integer

规则的优先级。

2

QosId

string

QoS 策略的实例 ID。

qos-xitd8690ucu8ro****

PercentSourceType

string

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

  • CcnBandwidth:表示 CCN 带宽。

  • InternetUpBandwidth:表示 Internet 总带宽。

CcnBandwidth

MinBandwidthPercent

integer

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

20

LimitType

string

限速类型,取值:

  • Absolute:按带宽值。

  • Percent:按百分比。

Percent

示例

正常返回示例

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"
}

错误码

HTTP status code

错误码

错误信息

描述

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.Name The specified Name is invalid. 您输入的参数Name不合法。
403 InternalError An internal server error occurred. 内部服务错误。

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

变更历史

更多信息,参考变更详情