Cria um log de fluxo.
Descrição da operação
CreateFlowLog é uma operação assíncrona. Após invocar esta operação, o sistema retorna um ID de instância, mas o log de fluxo ainda não foi criado. O nó de criação ainda está em execução em segundo plano. Você pode invocar DescribeFlowLogs para consultar o status de criação do log de fluxo:\n- Se o log de fluxo estiver no estado Activating, o log de fluxo está sendo criado.\n- Se o log de fluxo estiver no estado Active, o log de fluxo foi criado e ativado.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
vpc:CreateFlowLog |
create |
VSwitch
*FlowLog
VPC
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| RegionId |
string |
Sim |
O ID da região do log de fluxo. Você pode chamar DescribeRegions para consultar a lista de regiões mais recente. |
cn-qingdao |
| FlowLogName |
string |
Não |
O nome do log de fluxo.\n\nO nome deve ter de 1 a 128 caracteres e não pode começar com |
myFlowlog |
| Description |
string |
Não |
A descrição do log de fluxo.\n\nA descrição deve ter de 1 a 256 caracteres e não pode começar com |
This is my Flowlog. |
| ResourceType |
string |
Sim |
O tipo de recurso do qual capturar o tráfego. Valores válidos:\n\n- NetworkInterface: controlador de interface de rede (NIC).\n \n- VSwitch: todos os controladores de interface de rede (NICs) em um vSwitch.\n \n- VPC: todos os controladores de interface de rede (NICs) em uma nuvem privada virtual (VPC). |
NetworkInterface |
| ResourceId |
string |
Sim |
O ID do recurso do qual capturar o tráfego. |
eni-askldfas**** |
| TrafficType |
string |
Sim |
O tipo de tráfego a ser coletado. Valores válidos:\n\n- All: todo o tráfego.\n \n- Allow: tráfego permitido pelo controle de acesso.\n \n- Drop: tráfego negado pelo controle de acesso. |
All |
| ProjectName |
string |
Não |
O nome do projeto que gerencia o tráfego capturado.\n- O nome do projeto pode conter apenas letras minúsculas, dígitos e hifens (-).\n- O nome deve começar e terminar com uma letra minúscula ou dígito.\n- O nome deve ter de 3 a 63 caracteres. |
FlowLogProject |
| LogStoreName |
string |
Não |
O nome do Logstore que armazena o tráfego capturado.\n- O nome do Logstore pode conter apenas letras minúsculas, dígitos, hifens (-) e sublinhados (_).\n- O nome deve começar e terminar com uma letra minúscula ou dígito.\n- O nome deve ter de 3 a 63 caracteres. |
FlowLogStore |
| AggregationInterval |
integer |
Não |
O intervalo de amostragem do log de fluxo. Unidade: minutos. Valores válidos: 1, 5 e 10 (padrão). |
10 |
| TrafficPath |
array |
Não |
O caminho de tráfego a ser capturado. Valores válidos:\n\n- all: captura todo o tráfego.\n- internetGateway: captura o tráfego da Internet. |
|
|
string |
Não |
O caminho de tráfego a ser capturado. Valores válidos:\n\n- all (padrão): captura todo o tráfego.\n\n\n\n\n\n> O recurso de caminho de tráfego não está ativado por padrão. Para usar este recurso, abra um ticket.. |
all |
|
| ResourceGroupId |
string |
Não |
O ID do grupo de recursos. |
rg-acfmxazdjdhd**** |
| Tag |
array<object> |
Não |
As tags do recurso. |
|
|
object |
Não |
A tag. |
||
| Key |
string |
Não |
A chave da tag do recurso. Você pode especificar até 20 chaves de tag. A chave da tag não pode ser uma string vazia.\n\nA chave da tag pode ter até 128 caracteres e não pode começar com |
FinanceDept |
| Value |
string |
Não |
O valor da tag do recurso. Você pode especificar até 20 valores de tag. O valor da tag pode ser uma string vazia.\n\nO valor da tag pode ter até 128 caracteres e não pode começar com |
FinanceJoshua |
| IpVersion |
string |
Não |
A versão do IP do tráfego capturado pelo log de fluxo. |
IPv4 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
O ID da solicitação. |
||
| RequestId |
string |
O ID da solicitação. |
54B48E3D-DF70-471B-AA93-08E683A1B457 |
| Success |
string |
Indica se a chamada foi bem-sucedida. Valores válidos:\n\n- true: A chamada foi bem-sucedida.\n- false: A chamada falhou. |
true |
| FlowLogId |
string |
O ID do log de fluxo. |
fl-m5e8vhz2t21sel1nq**** |
| ResourceGroupId |
string |
O ID do grupo de recursos. |
rg-acfmxazdjdhd**** |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Success": "true",
"FlowLogId": "fl-m5e8vhz2t21sel1nq****",
"ResourceGroupId": "rg-acfmxazdjdhd****"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | IncorrectBusinessStatus.FlowLog | The business status of flowLog is incorrect. | The error message returned because you cannot create flow logs in the current business state. |
| 400 | OptInRequired.FlowLog | You are not authorized to use the requested service of flowLog. Ensure that you have subscribed to the service you are trying to use. | The error message returned because you do not have the permissions to use the flow log feature. Make sure that the flow log feature is already enabled. |
| 400 | OperationUnsupported.AdvancedFeature | Advanced features of the vpc is unsupported. | This advanced feature is not supported. |
| 400 | InvalidInstanceId | vswitch does not exist. | The error message returned because the vSwitch does not exist. |
| 400 | ProjectOrLogstoreNotExist | The specified project or logstore does not exist. | The error message returned because the specified project or Logstore does not exist. |
| 400 | SourceProjectNotExist | The Source Project or logstore does not exist. | The error message returned because the source project or Logstore does not exist. |
| 400 | Unauthorized | This api does not support sub user or role. | The error message returned because you cannot call this operation as a RAM user. |
| 400 | OperationUnsupported.action | This action is not support. | The error message returned because the operation is not supported. |
| 400 | ParameterInvalid | Invalid parameter. | The error message returned because a parameter is invalid. |
| 400 | RuleExist | The rule has already existed. | |
| 400 | InvalidHdMonitorStatus | Current instance status is not valid for this action. | |
| 400 | QuotaExceeded.FlowlogCount | This user has reached the maximum instance number of flowlog. | The number of flow logs reaches the upper limit. |
| 400 | InvalidResourceId.NotFound | This resourceId already has flowlog instance existed. | A flow log is already enabled for the resource. |
| 400 | INVALID_PARAMETER | The parameter invalid. | |
| 400 | MissingParameter | Missing mandatory parameter | |
| 400 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 400 | InvalidResourceType.NotFound | Resource type no the same. | |
| 400 | OperationUnsupported.ResourceType | This resource type is not supported. | |
| 400 | IllegalParam.AggregationInterval | The param of aggregationInterval is illegal. | |
| 400 | UnsupportedFeature.UserDefinedTrafficPath | The feature of UserDefinedTrafficPath is not supported. | The current user does not have the permissions to specify trafficPath. |
| 400 | IllegalParam.TrafficPath | The param of trafficPath is illegal. | TrafficPath.N is set to an invalid value. |
| 400 | DuplicatedParam.TrafficPath | The param of trafficPath is duplicated. | The value of TrafficPath.N is duplicate. |
| 400 | IllegalParam.ResourceGroupId | Invalid ResourceGroupld value. | The specified resource group is invalid or does not exist. |
| 400 | OperationDenied.OperateShareResource | The operation is not allowed because of OperateShareResource. | Operating on shared resources causes the operation to fail |
| 400 | UnsupportedFeature.IpVersion | The ipversion type is not supported. | |
| 400 | UnsupportedFeature.VpcAdvancedFeature | The VPC does not support some advanced features. | The VPC does not support some advanced features. Please submit a ticket. |
| 400 | OperationFailed.EniTypeNotSupport | Operation failed because the ENI type is not supported. | Operation failed because the ENI type is not supported. |
| 400 | IllegalParam.IpVersion | The parameter of IpVersion is illegal. | |
| 400 | OperationDenied.NisTrafficAnalyzerAggregationIntervalMismatch | The sampling interval of the FlowLog is greater than the sampling interval of the NIS Traffic Analyzer. | The sampling interval of the FlowLog is greater than the sampling interval of the NIS Traffic Analyzer. |
| 400 | OperationDenied.NisTrafficAnalyzerNotFound | The specified NIS Traffic Analyzer does not exist. | The specified NIS Traffic Analyzer does not exist. |
| 400 | OperationDenied.NisTrafficAnalyzerNotActive | The specified NIS Traffic Analyzer is not enabled. | The specified NIS Traffic Analyzer is not enabled. |
| 400 | OperationFailed.InternalError | The request processing has failed due to some unknown error. | Unknown error. Please retry the operation. The error still exists. Please submit the work order for processing. |
| 400 | MissingParam.TrafficAnalyzerIdOrLogProjectOrLogStore | TrafficAnalyzerId and ProjectName and LogStoreName parameters are not passed in. | TrafficAnalyzerId and ProjectName and LogStoreName parameters are not passed in. |
| 400 | OperationDenied.AllTrafficPathOfManagedExist | The resource you specified has created a flow log instance that collects the traffic of all scenarios. You cannot create a flow log instance that collects only some scenarios. | The resource you specified has created a flow log instance that collects the traffic of all scenarios. You cannot create a flow log instance that collects only some scenarios. |
| 400 | UnsupportedFeature.UserDefinedTrafficPathIpv6 | Dual-stack flow log instances do not support custom trafficPath. | Dual-stack flow log instances do not support custom trafficPath. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.