Modifie les règles de routage des balises.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
mse:ApplyTagPolicies |
update |
*All Resource
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| Region |
string |
Non |
La région. |
cn-hangzhou |
| Namespace |
string |
Non |
L'espace de noms MSE de l'application. |
default |
| AppName |
string |
Non |
Le nom de l'application. |
example-app |
AppId
deprecated
|
string |
Oui |
L'identifiant de l'application. |
h5pohqu3gd@xxx |
| Rules |
object |
Non |
Les règles de routage. |
{ "blue": { # Tag key. "rate": 20, # Rate. A value of 20 indicates that 20% of the traffic is routed to the node identified by the tag. "name": "luoye-route-test", # Routing rule name. "carryData": false, # Specifies whether to enable pass-through. This parameter is applicable to end-to-end canary release. "rules": { # Rule information. "dubbo": \[{ # Dubbo rule. The system also supports Spring Cloud and Istio rule. "serviceName": "com.taobao.hsf.common.DemoService", # Service name (operation name). "group": "", # Group name. "version": "", # Service version. "methodName": "sayHello", # Method name. "condition": "AND", # Logical operator used by the following items. Valid values: AND and OR. "argumentItems": \[{ # Array of rule details. "index": 0, # Index field. "expr": "", # Expression. Its details is described below. "operator": "rawvalue", # The comparison mode. A value of rawvalue indicates direct comparison. A value of mode indicates the modulo operation. A value of list indicates using a whitelist. "value": "jim", # Base value. The value obtained by the expression will be compared with this value. If operator is set to list, separate the items specified for this parameter with commas (,). Example: 1,2,3. "cond": "==" # Comparison operator. Valid values: >=, <=, >, <, and ==. }] }] } }, "\_base": { # Another tag key. "rate": 80 # Rate. A value of 20 indicates that 20% of the traffic is routed to the node identified by the tag. } } |
|
object |
Non |
|||
| Status |
integer |
Non |
L'état. Valeurs valides :
|
0 |
| Rate |
integer |
Non |
Le pourcentage. |
10 |
| Enable |
boolean |
Non |
Indique si la règle doit être activée. |
true |
| Tag |
string |
Non |
L'environnement pour la règle de routage. |
gray |
| Name |
string |
Non |
Le nom de la règle de routage. |
gray |
| Id |
integer |
Non |
L'identifiant de la règle. |
1 |
| InstanceNum |
integer |
Non |
Le nombre d'instances. |
10 |
| Rules |
object |
Non |
Les détails de la règle. |
|
| springcloud |
array<object> |
Non |
Les règles Spring Cloud. |
|
|
array<object> |
Non |
|||
| condition |
string |
Non |
The logical operator for the items. Valid values: AND or OR. |
AND |
| restItems |
array<object> |
Non |
||
|
object |
Non |
|||
| datum |
string |
Non |
The value to compare for operators such as `rawvalue`. |
10 |
| operator |
string |
Non |
The operator. `rawvalue` indicates a direct comparison. `mode` indicates a modulo operation. `list` indicates a whitelist. |
rawvalue |
| nameList |
array |
Non |
The field required for the `list` operator. |
|
|
string |
Non |
The name. |
test1 |
|
| cond |
string |
Non |
The comparison operator. Valid values: >=, <=, >, <, and ==. |
== |
| divisor |
integer |
Non |
The divisor for the modulo operation. This parameter is required if `operator` is `mod`. |
30 |
| remainder |
integer |
Non |
The percentage value for the operation. |
30 |
| rate |
integer |
Non |
The percentage of traffic to route to the tagged nodes. For example, 20 means 20% of the traffic. |
20 |
| type |
string |
Non |
The type. |
test |
| name |
string |
Non |
The name. |
key |
| value |
any |
Non |
The value. |
test |
| triggerPolicy |
string |
Non |
The policy type. Valeurs valides :
|
CONTENT |
| enable |
boolean |
Non |
Specifies whether the rule is enabled. |
true |
| appId |
string |
Non |
The application ID. |
***@*** |
| priority |
integer |
Non |
The priority. |
1 |
| tags |
array |
Non |
The list of tags. |
|
|
string |
Non |
A tag. |
gray |
|
| paths |
array |
Non |
The list of paths. |
|
|
string |
Non |
A path. |
/hello |
|
| path |
string |
Non |
The path. |
/hello |
| dubbo |
array<object> |
Non |
Les règles Dubbo. |
|
|
array<object> |
Non |
Le contenu de la règle. |
||
| appId |
string |
Non |
The application ID. |
***@*** |
| tags |
array |
Non |
The list of tags. |
|
|
string |
Non |
A tag. |
gray |
|
| triggerPolicy |
string |
Non |
The policy type. |
CONTENT |
| serviceName |
string |
Non |
The service name (interface). |
HelloService |
| group |
string |
Non |
The group of the Dubbo service. |
default |
| version |
string |
Non |
The version of the Dubbo service. |
1.0.0 |
| methodName |
string |
Non |
The method name of the Dubbo service. |
hello |
| paramTypes |
array |
Non |
The list of parameter types. |
|
|
string |
Non |
The parameter type. |
int |
|
| condition |
string |
Non |
The logical operator for the items. Valid values: AND or OR. |
AND |
| argumentItems |
array<object> |
Non |
The list of arguments. |
|
|
object |
Non |
The argument details. |
||
| operator |
string |
Non |
The operator. `rawvalue` indicates a direct comparison. `mode` indicates a modulo operation. `list` indicates a whitelist. |
rawvalue |
| nameList |
array |
Non |
The list of names. |
|
|
string |
Non |
A name. |
demo |
|
| datum |
string |
Non |
The value to compare for operators such as `rawvalue`. |
30 |
| cond |
string |
Non |
The comparison operator. Valid values: >=, <=, >, <, and ==. |
== |
| divisor |
integer |
Non |
The divisor for the modulo operation. This parameter is required if `operator` is `mod`. |
30 |
| remainder |
integer |
Non |
The required percentage value for the percentage operation. |
30 |
| rate |
integer |
Non |
The percentage of traffic to route to the tagged nodes. For example, 20 means 20% of the traffic. |
10 |
| index |
integer |
Non |
The position of the parameter, starting from 0. |
0 |
| expr |
string |
Non |
The expression. |
|
| value |
any |
Non |
The value to compare. The result of the expression is compared with this value. If `operator` is `list`, use a comma (,) to separate multiple values. Example: 1,2,3. |
1,2,3 |
| NamespaceId |
string |
Non |
L'identifiant de l'espace de noms. Ce paramètre est facultatif. |
12233**** |
| Enable |
boolean |
Non |
Indique si la règle doit être activée. |
true |
| AcceptLanguage |
string |
Non |
La langue du message de réponse : |
zh |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| Message |
string |
Le message de réponse. |
succès |
| RequestId |
string |
L'identifiant de la requête. |
316F5F64-F73D-42DC-8632-01E308B6**** |
| Data |
array<object> |
Les données renvoyées. |
|
|
object |
Les données renvoyées. |
||
| Status |
integer |
L'état. |
1 |
| InstanceNum |
integer |
Le nombre d'instances. |
1 |
| Remove |
boolean |
Indique si la règle a été supprimée. |
|
| CarryData |
boolean |
Indique s'il s'agit d'une clé primaire. |
true |
| Tag |
string |
La balise. |
gray |
| Name |
string |
Le nom de la stratégie. |
test |
| Rules |
string |
La règle de balise. |
{\"_base\": {\"rate\": 100, \"remove\": true}, \"blue\": {\"rate\": 0}} |
| Id |
integer |
L'identifiant de la clé primaire. |
12 |
| Rate |
integer |
Le pourcentage. |
10 |
| Enable |
boolean |
Indique si la règle est activée.
|
true |
| Success |
boolean |
Indique si la requête a réussi. |
true |
Exemples
JSON format
{
"Message": "success",
"RequestId": "316F5F64-F73D-42DC-8632-01E308B6****",
"Data": [
{
"Status": 1,
"InstanceNum": 1,
"Remove": false,
"CarryData": true,
"Tag": "gray",
"Name": "test",
"Rules": "{\\\"_base\\\": {\\\"rate\\\": 100, \\\"remove\\\": true}, \\\"blue\\\": {\\\"rate\\\": 0}}",
"Id": 12,
"Rate": 10,
"Enable": true
}
],
"Success": true
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.