Crée et ajoute des balises aux ressources Elastic Compute Service (ECS).
Description de l'opération
Notes d'utilisation
Avant d'ajouter des balises à une ressource, Alibaba Cloud vérifie le nombre de balises existantes de la ressource. Si le nombre maximal de balises est atteint, un message d'erreur est renvoyé. Pour plus d'informations, consultez Limites 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
|
ecs:TagResources |
create |
DedicatedHost
Disk
NetworkInterface
Image
Instance
KeyPair
LaunchTemplate
ReservedInstance
SecurityGroup
Snapshot
AutoSnapshotPolicy
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| RegionId |
string |
Oui |
L'identifiant de la région de la ressource. Vous pouvez appeler l'opération DescribeRegions pour obtenir la liste la plus récente des régions. |
cn-hangzhou |
| ResourceType |
string |
Oui |
L'identifiant de la région de la ressource. Vous pouvez appeler l'opération DescribeRegions pour obtenir la liste la plus récente des régions. |
cn-hangzhou |
| ResourceId |
array |
Oui |
Le type de ressource auquel les balises sont ajoutées. Valeurs valides :
|
instance |
|
string |
Non |
The resource ID. |
r-XXX |
|
| Tag |
array<object> |
Oui |
Les identifiants des ressources. Vous pouvez spécifier jusqu'à 50 identifiants de ressources. |
i-bp67acfmxazb4ph**** |
|
object |
Non |
L'identifiant de la ressource N. |
r-XXX |
|
| Key |
string |
Oui |
The tag key. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with |
TestKey |
| Value |
string |
Oui |
The tag value. The tag value cannot be null but can be an empty string. The tag value can be up to 128 characters in length and cannot contain |
TestValue |
|
Non |
Les balises de l'instance réservée. Vous pouvez spécifier jusqu'à 20 balises. Si vous spécifiez plusieurs balises, les clés de balise ne peuvent pas être dupliquées.`` |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemples
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | NumberExceed.ResourceIds | The ResourceIds parameter's number is exceed , Valid : 50. | The number of ResourceIds parameters specified exceeds the limit. |
| 400 | NumberExceed.Tags | The Tags parameter's number is exceed , Valid : 20. | The number of labels specified exceeds the limit. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The specified Tag.N.Key parameter is invalid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
| 400 | OperationDenied.QuotaExceed | The quota of tags on resource is beyond permitted range. | |
| 400 | InvalidTag.Mismatch | The specified Tag.n.Key and Tag.n.Value are not match. | The specified Tag.N.Key and Tag.N.Value parameters do not correspond to each other. |
| 400 | InvalidTagCount | The specified tags are beyond the permitted range. | The number of specified tags exceeds the upper limit. |
| 400 | Invalid.Scope | The specified scope is invalid. | |
| 500 | ServiceUnavailable | The service is unavailable, please try again later. | The request timed out. Try again. |
| 403 | PermissionDenied.TagOwnerBid | The specified operator not have permission to set TagOwnerBid value. | |
| 403 | PermissionDenied.TagOwnerUid | The specified operator not have permission to set TagOwnerUid value. | You are not authorized to specify the TagOwnerUid parameter. |
| 403 | PermissionDenied.Scope | The specified operator not have permission to set Scope value. | You are not authorized to specify the Scope parameter. |
| 403 | InvalidResourceId.NotSupported | The specified ResourceId does not support tagging. | |
| 403 | NoPermissionKey.Scope | %s | |
| 403 | NoPermission.Tag | The operator is not permission for the tag. | You are not authorized to manage the tag. |
| 403 | QuotaExceed.Tags | %s | The number of specified tags exceeds the upper limit. %s is a variable. An error message is dynamically returned based on call conditions. |
| 403 | TagKey.Duplication | The TagKey has duplication with others, case-insensitive. | Duplicate values exist in the specified Tag.N.Key parameter. The value of this parameter is not case sensitive. Check whether duplicate parameter values are passed in. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | MissingParameter.ResourceIds | The parameter - ResourceIds.N should not be null. | |
| 404 | MissingParameter.TagOwnerUid | The parameter - TagOwnerUid should not be null. | |
| 404 | MissingParameter.TagOwnerBid | The parameter - TagOwnerBid should not be null. | |
| 404 | MissingParameter.ResourceType | The parameter - ResourceType should not be null. | The ResourceType parameter is required. |
| 404 | MissingParameter.Tags | The parameter - Tags should not be null. | |
| 404 | MissingParameter.RegionId | The parameter - RegionId should not be null. | The required parameter RegionId is empty. |
| 404 | InvalidResourceId.NotFound | The specified ResourceIds are not found in our records. | The specified resource does not exist. Check whether the ResourceId parameter is correct. |
| 404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. | The specified resource type does not exist. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.