You can call this operation to create a traffic throttling policy.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No CreateQosCar

The operation that you want to perform.

Set the value to CreateQosCar.

LimitType String Yes Absolute

The type of the traffic throttling policy. Valid values:

  • Absolute: throttles traffic by a specific bandwidth range.
  • Percent: throttles traffic by a specific range of bandwidth percentage.
MaxBandwidthAbs Integer Yes 6

The maximum bandwidth. This parameter is required when LimitType is set to Absolute.

MaxBandwidthPercent Integer Yes 90

The maximum percentage that is based on the maximum upstream bandwidth of the SAG instance.

This parameter is required when LimitType is set to Percent.

MinBandwidthAbs Integer Yes 2

The minimum bandwidth. This parameter is required when LimitType is set to Absolute.

MinBandwidthPercent Integer Yes 20

The minimum percentage that is based on the maximum upstream bandwidth of the SAG instance.

This parameter is required when LimitType is set to Percent.

Priority Integer Yes 2

The priority of the traffic throttling policy. A smaller value represents a higher priority. If policies are assigned the same priority, the one applied the earliest prevails. Valid values: 1 to 7.

QosId String Yes qos-hdg***************

The ID of the QoS policy.

RegionId String Yes cn-hangzhou

The ID of the region where the QoS policy is deployed.

Description String No Qosdesc

The description of the traffic throttling policy.

PercentSourceType String No CcnBandwidth

If the policy throttles traffic based on a specified bandwidth percentage, the following options are available:

  • CcnBandwidth: Cloud Enterprise Network (CCN) bandwidth.
  • InternetUpBandwidth: Internet upstream bandwidth.
Name String No nametest

The name of the traffic throttling policy. The name must be 2 to 128 characters in length, and can contain Chinese characters, letters, digits, periods (.), underscores (_), and hyphens (-).

Response parameters

Parameter Type Example Description
RequestId String AC13E8FF-4D61-40AD-868E-817F2D3AC86A

The ID of the request.

QosId String qos-awfxl1adxeqyk******

The ID of the QoS policy.

QosCarId String qoscar-n5k8g97lihlph*****

The ID of the traffic throttling policy.

Description String Qosdesc

The description of the traffic throttling policy.

Priority Integer 3

The priority of the QoS rule.

LimitType String Percent

The type of the traffic throttling policy. Valid values:

  • Absolute: throttles traffic based on a specific range of bandwidth.
  • Percent: throttles traffic based on a specific range of bandwidth percentage.
MinBandwidthAbs Integer 2

The minimum bandwidth. This parameter is returned when LimitType is set to Absolute.

MaxBandwidthAbs Integer 6

The maximum bandwidth. This parameter is returned when LimitType is set to Absolute.

MinBandwidthPercent Integer 20

The minimum percentage that is based on the maximum upstream bandwidth of the SAG instance.

MaxBandwidthPercent Integer 90

The maximum percentage that is based on the maximum upstream bandwidth of the SAG instance.

PercentSourceType String CcnBandwidth

If the policy throttles traffic based on a specified bandwidth percentage, the following options are available:

  • CcnBandwidth: CCN bandwidth.
  • InternetUpBandwidth: Internet upstream bandwidth.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateQosCar
&LimitType=Absolute
&MaxBandwidthAbs=6
&MaxBandwidthPercent=90
&MinBandwidthAbs=2
&MinBandwidthPercent=20
&Priority=2
&QosId=qos-hdg***************
&RegionId=cn-hangzhou
&<Common request parameter>

Sample success responses

XML format

<CreateQosCarResponse>
      <LimitType>Percent</LimitType>
      <MaxBandwidthPercent>20</MaxBandwidthPercent>
      <MinBandwidthPercent>10</MinBandwidthPercent>
      <PercentSourceType>CcnBandwidth</PercentSourceType>
      <Priority>3</Priority>
      <QosCarId>qoscar-n5k8g97lihlph*****</QosCarId>
      <QosId>qos-awfxl1adxeqyk*****</QosId>
      <RequestId>AC13E8FF-4D61-40AD-868E-817F2D3AC86A</RequestId>
    </CreateQosCarResponse>

JSON format

{
    "LimitType":"Percent",
    "MaxBandwidthPercent":20,
    "MinBandwidthPercent":10,
    "PercentSourceType":"CcnBandwidth",
    "Priority":3,
    "QosCarId":"qoscar-n5k8g97lihlph*****",
    "QosId":"qos-awfxl1adxeqyk*****",
    "RequestId":"AC13E8FF-4D61-40AD-868E-817F2D3AC86A"
}

Error codes

HttpCode Error code Error message Description
400 MissParameter.RegionId You must specify RegionId. The error message returned because the ID (RegionId) of the region is not specified.
400 MissParameter.QosId You must specify QosId. The error message returned because the ID (QosId) of the QoS policy is not specified.
400 MissParameter.LimitType You must specify LimitType. The error message returned because the specified type (LimitType) of the traffic throttling policy is not specified.
400 MissParameter.Priority You must specify Priority. The error message returned because the priority (Priority) of the QoS rule is not specified.
400 InvalidParameter.LimitType You must specify LimitType. The error message returned because the type (LimitType) of the traffic throttling policy is not specified.
400 MissParameter.MaxBandwidthAbs You must specify MaxBandwidthAbs. The error message returned because the maximum bandwidth (MaxBandwidthAbs) is not specified.
400 MissParameter.MaxBandwidthPercent You must specify MaxBandwidthPercent. The error message returned because the maximum bandwidth percentage (MaxBandwidthPercent) is not specified.
400 MissParameter.MinBandwidthAbs You must specify MinBandwidthAbs. The error message returned because the minimum bandwidth (MinBandwidthAbs) is not specified.
400 MissParameter.MinBandwidthPercent You must specify MinBandwidthPercent. The error message returned because the minimum bandwidth percentage (MinBandwidthPercent) is not specified.
400 InvalidBandwidthCompare The specified maximum bandwidth is smaller than the minimum bandwidth. Please check your input. The error message returned because the specified maximum bandwidth is smaller than the minimum bandwidth. Check whether the parameters are correctly set.
400 MissParameter.PercentSourceType You must specify PercentSourceType. The error message returned because the type of bandwidth that is throttled by percentage (PercentSourceType) is not specified.
400 InvalidId.Qos The specified QosId is invalid. The error message returned because the specified ID (QosId) of the QoS policy is invalid.
400 Invalid.QosCar.Priority The specified priority of QosCarId is invalid. The error message returned because the specified priority (Priority) of the QoS rule is invalid.
400 QosCarPerQosAmountLimit The maximum number of QosCar in a QoS is exceeded. You can submit a ticket to increase the quota. The error message returned because the number of traffic throttling policies that you have added to the QoS policy has reached the upper limit. You can submit a ticket to request a quota increase.
403 InternalError An internal server error occurred. The error message returned because an internal error occurred.
400 InvalidParameter.Priority The specified Priority is invalid. The error message returned because the specified priority (Priority) of the QoS rule is invalid.
400 InvalidParameter.PercentSourceType The specified PercentSourceType is invalid. The error message returned because the specified type of bandwidth throttled by percentage (PercentSourceType) is invalid.
400 InvalidParameter.Description The specified Description is invalid. The error message returned because the specified description (Description) of the traffic throttling policy is invalid.
400 InvalidParameter.LimitType The specified LimitType is invalid. The error message returned because the specified type (LimitType) of the traffic throttling policy is invalid.
400 InvalidParameter.Name The specified Name is invalid. The error message returned because the specified name (Name) of the traffic throttling policy parameter is invalid.

For a list of error codes, visit the API Error Center.