Cria um listener para uma instância de Gateway Load Balancer (GWLB).
Descrição da operação
A operação CreateListener é assíncrona. Após o envio de uma solicitação, o sistema retorna um ID de solicitação. O listener é criado em segundo plano. Você pode chamar a operação GetListenerAttribute para consultar o status de criação do listener:
-
Se um listener estiver no estado Provisioning, o listener está sendo criado.
-
Se um listener estiver no estado Running, o listener foi criado.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
gwlb:CreateListener |
create |
*LoadBalancer
*ServerGroup
*Listener
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| LoadBalancerId |
string |
Sim |
O ID da instância GWLB. |
gwlb-te609d6696632f7***** |
| ListenerDescription |
string |
Não |
A descrição do listener. A descrição deve ter de 2 a 256 caracteres. Pode conter caracteres chineses, letras, dígitos, vírgulas (,), pontos (.), ponto e vírgula (;), barras (/), arrobas (@), sublinhados (_) e hifens (-). |
listener-description |
| ServerGroupId |
string |
Sim |
O ID do grupo de servidores. |
sgp-ckh01px70dszof**** |
| TcpIdleTimeout |
integer |
Não |
O período de tempo limite de uma conexão TCP ociosa. Valores válidos: 60 a 6000 segundos. Valor padrão: 350 segundos. |
350 |
| DryRun |
boolean |
Não |
Especifica se deve ser realizado um dry run. Valores válidos:
|
false |
| ClientToken |
string |
Não |
O token de cliente usado para garantir a idempotência da solicitação. Você pode usar o cliente para gerar um token, mas deve garantir que o token seja exclusivo entre diferentes solicitações. O token pode conter apenas caracteres ASCII. Nota
Se você não especificar este parâmetro, o sistema usará automaticamente o RequestId da solicitação como o ClientToken. O RequestId pode ser diferente para cada solicitação. |
123e4567-e89b-12d3-a456-42665544**** |
| Tag |
array<object> |
Não |
As tags. Você pode especificar até 20 tags em cada chamada. |
|
|
object |
Não |
A tag. |
||
| Key |
string |
Não |
A chave da tag. Se você especificar este parâmetro, não poderá deixá-lo vazio. A chave da tag pode ter até 128 caracteres e não pode começar com |
testKey |
| Value |
string |
Não |
O valor da tag. O valor da tag pode ter até 256 caracteres e não pode conter |
testValue |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os dados retornados. |
||
| ListenerId |
string |
O ID do listener. |
lsn-wi3c0v30ivysrg**** |
| RequestId |
string |
O ID da solicitação. |
A045E652-D298-5E70-A978-7247135336FB |
Exemplos
Resposta de sucesso
JSON formato
{
"ListenerId": "lsn-wi3c0v30ivysrg****",
"RequestId": "A045E652-D298-5E70-A978-7247135336FB"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | IncorrectBusinessStatus.LoadBalancer | The business status of %s [%s] is incorrect. | Resource %s with business state %s does not support current operation |
| 400 | MissingParam.TagKey | The param of TagKey is missing. | The parameter of tag key is missing. |
| 400 | MissingParam.TagValue | The param of TagValue is missing. | The parameter of tag value is missing. |
| 400 | OperationDenied.TooManyListeners | The operation is not allowed because of TooManyListener. | The number of listeners of the load balancer instance exceeds the limit. The operation is denied. |
| 400 | IncorrectStatus.LoadBalancer | The status of %s [%s] is incorrect. | Resource %s current state %s does not support operation |
| 400 | ResourceInUse.IP | The specified resource of IP is in use. | |
| 400 | Mismatch.VpcId | The %s is mismatched for %s and %s. | The VPC IDs of the two resources do not match. |
| 400 | IncorrectStatus.ServerGroup | The status of %s [%s] is incorrect. | The status of %s [%s] is incorrect. |
| 400 | DuplicatedParam.TagKey | The param of %s is duplicated. | The parameter of tag key is duplicated. |
| 400 | IllegalParam.TagKey | The param of %s is illegal. | |
| 400 | IllegalParam.TagValue | The param of %s is illegal. | The parameter of tag value is illegal. |
| 400 | OperationDenied.TcpIdleTimeoutConflictWithScheduler | The TCP idle timeout of listener must be default value when the scheduling algorithm of server group is not 5TCH. | The TCP idle timeout of listener must be default value when the scheduling algorithm of server group is not 5TCH. |
| 404 | ResourceNotFound.LoadBalancer | The specified resource of %s is not found. | The specified resource of .LoadBalancer is not found. |
| 404 | ResourceNotFound.ServerGroup | The specified resource of %s is not found. | The specified server group resource does not exist. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.