Cria e anexa tags a recursos.
Descrição da operação
-
Uma tag consiste em uma chave de tag e um valor de tag. Tanto a chave quanto o valor da tag são obrigatórios.
-
Se você anexar várias tags a uma instância do Cloud Enterprise Network (CEN), as chaves de tag deverão ser exclusivas para essa instância.
-
Você pode anexar no máximo 20 tags a uma instância do CEN.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
cen:TagResources |
update |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ResourceType |
string |
Sim |
O tipo do recurso. Valores válidos: Cen: uma instância do CEN. BandwidthPackage: um plano de largura de banda. TransitRouter: uma instância de roteador de trânsito. TransitRouterVpcAttachment: uma conexão VPC. TransitRouterVbrAttachment: uma conexão VBR. TransitRouterPeerAttachment: uma conexão inter-região. TransitRouterVpnAttachment: uma conexão VPN. TransitRouterRouteTable: uma tabela de rotas. Flowlog: um log de fluxo. TransitRouterMulticastDomain: um domínio de multicast. |
cen |
| ResourceId |
array |
Sim |
A lista de IDs de recursos. |
cen-7qthudw0ll6jmc**** |
|
string |
Não |
O ID do recurso. Você pode inserir vários IDs de recursos. O valor de N varia de 1 a 20. |
cen-pfa6ugf3xl0qsd**** |
|
| Tag |
array<object> |
Sim |
A lista de tags. |
|
|
object |
Sim |
A tag. |
||
| Key |
string |
Sim |
A chave da tag. Você pode inserir várias chaves de tag. O valor de N varia de 1 a 20. A chave da tag pode ter até 64 caracteres. Não pode começar com aliyun ou acs:. Não pode conter http:// ou https://. |
TagKey |
| Value |
string |
Sim |
O valor da tag. Cada chave de tag deve ter um valor de tag. O valor de N varia de 1 a 20. O valor da tag pode ter até 128 caracteres. Não pode começar com aliyun ou acs:. Não pode conter http:// ou https://. |
TagValue |
| RegionId |
string |
Não |
O ID da região do recurso. Este parâmetro não é obrigatório para recursos dos tipos Cen e BandwidthPackage. É obrigatório para todos os outros tipos de recursos. |
cn-hangzhou |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
A resposta retornada. |
||
| RequestId |
string |
O ID da solicitação. |
C46FF5A8-C5F0-4024-8262-B16B639225A0 |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "C46FF5A8-C5F0-4024-8262-B16B639225A0"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidTagKey | The tag keys are not valid. | The error message returned because the specified tag key is invalid. |
| 400 | InvalidTagValue | The tag values are not valid. | The error message returned because the specified tag value is invalid. |
| 400 | MissingParam | %s | |
| 400 | InvalidInstanceType.NotFound | The instance type is not found | The error message returned because the specified instance type does not exist. |
| 400 | InvalidInstanceIds.NotFound | The instanceIds are not found | The error message returned because the specified instance does not exist. |
| 400 | Forbidden.TagKeys | The request do not allow to operate the tag keys | The error message returned because you cannot manage the specified tag key. |
| 400 | QuotaExceeded.TagNum | Custom Tags quota exceeded | The error message returned because the number of tags has reached the upper limit. |
| 400 | InvalidTagScope.NotFound | The tag scope is not found | The error message returned because the specified tag scope is invalid. |
| 400 | Forbidden.NotAllowedCategary | The System tag is not valid | The error message returned because you cannot configure system tags. |
| 400 | SizeLimitExceeded.ResourceIdNum | The ResourceIds parameter's number is exceed , Valid : 20 | |
| 400 | MissingParameter.TagValue | The specified parameter TagValue is missing | The error message returned because the TagValue parameter is not set. |
| 400 | DuplicatedParam.TagKey | The parameter TagKey is duplicated. | The error message returned because the TagKey parameter already exists. |
| 400 | IllegalParamLength.Tag | The specified length of Tag is invalid. | The error message returned because the length of the specified tag is invalid. Check the tag and try again. |
| 400 | IllegalParam.Region | The specified region is invalid. | |
| 400 | MissingParameter.TagKey | TagKey must be specified. | The error message returned because you must set the TagKey parameter. |
| 400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.