Crée une passerelle NAT publique améliorée ou une passerelle NAT VPC.
Description de l'opération
Avant d'appeler cette opération, notez les points suivants :
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
|
vpc:CreateNatGateway |
create |
*NatGateway
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| RegionId |
string |
Oui |
L'identifiant de la région dans laquelle créer la passerelle NAT. Appelez l'opération DescribeRegions pour obtenir l'identifiant de la région. |
cn-hangzhou |
| VpcId |
string |
Oui |
L'identifiant du cloud privé virtuel (VPC) dans lequel vous souhaitez créer la passerelle NAT. |
vpc-bp1di7uewzmtvfuq8**** |
| Name |
string |
Non |
Le nom de la passerelle NAT. Il doit comporter de 2 à 128 caractères, commencer par une lettre ou un caractère chinois, et peut contenir des chiffres, des traits de soulignement (_) et des traits d'union (-). Si vous ne spécifiez pas ce paramètre, le système attribue automatiquement un nom à la passerelle NAT. |
fortest |
| Description |
string |
Non |
La description de la passerelle NAT. La description doit comporter de 2 à 256 caractères. Elle ne peut pas commencer par |
testnat |
| ClientToken |
string |
Non |
Le jeton client utilisé pour garantir l'idempotence de la requête. Vous pouvez créer le jeton, mais vous devez vous assurer qu'il est unique parmi les différentes requêtes. Remarque
Si vous ne spécifiez pas ce paramètre, le système utilise automatiquement l'identifiant de requête comme jeton client. L'identifiant de requête peut être différent pour chaque requête. |
5A2CFF0E-5718-45B5-9D4D-70B3FF3898 |
| Spec |
string |
Non |
Les passerelles NAT publiques par abonnement ne sont plus disponibles à l'achat. Ce paramètre est obsolète. |
Paramètre non valide |
| InstanceChargeType |
string |
Non |
Le mode de facturation de la passerelle NAT. Définissez la valeur sur : PostPaid (par défaut) : paiement à l'usage. Pour plus d'informations, consultez Facturation des passerelles NAT publiques et Facturation des passerelles NAT VPC. |
PostPaid |
| PricingCycle |
string |
Non |
Les passerelles NAT publiques par abonnement ne sont plus disponibles à l'achat. Ce paramètre n'est plus utilisé. |
Paramètre non valide |
| Duration |
string |
Non |
Les passerelles NAT publiques par abonnement ne sont plus disponibles à l'achat. Ce paramètre est obsolète. |
Paramètre non valide |
| AutoPay |
boolean |
Non |
Les passerelles NAT publiques par abonnement ne sont plus disponibles à l'achat. Ce paramètre est obsolète. |
Paramètre non valide |
| VSwitchId |
string |
Non |
L'identifiant du vSwitch auquel appartient la passerelle NAT. Lorsque vous créez une passerelle NAT, vous devez spécifier un vSwitch auquel la passerelle NAT appartient. Le système attribue ensuite une adresse IP privée à la passerelle NAT à partir du vSwitch.
Remarque
Appelez l'opération ListEnhancedNatGatewayAvailableZones pour interroger les zones disponibles et DescribeVSwitches pour interroger le nombre d'adresses IP libres dans un vSwitch. |
vsw-bp1e3se98n9fq8hle**** |
| NatType |
string |
Non |
Le type de passerelle NAT. Définissez la valeur sur Enhanced, ce qui spécifie une passerelle NAT améliorée. |
Enhanced |
| InternetChargeType |
string |
Non |
La méthode de facturation de la passerelle NAT. Définissez la valeur sur PayByLcu, ce qui indique que la passerelle NAT est une passerelle NAT à l'usage et est mesurée en LCU. |
PayByLcu |
| NetworkType |
string |
Non |
Le type de passerelle NAT à créer. Valeurs valides :
|
internet |
SecurityProtectionEnabled
deprecated
|
boolean |
Non |
Indique si la fonctionnalité de pare-feu doit être activée. Valeurs valides :
|
false |
| IcmpReplyEnabled |
boolean |
Non |
Indique si la réponse ICMP doit être activée. Valeurs valides :
|
true |
| PrivateLinkEnabled |
boolean |
Non |
Indique si PrivateLink doit être activé. Valeurs valides :
|
false |
| EipBindMode |
string |
Non |
Le mode d'association de l'EIP à la passerelle NAT. Valeurs valides :
|
MULTI_BINDED |
| Tag |
array<object> |
Non |
Les balises. |
MULTI_BINDED |
|
object |
Non |
|||
| Key |
string |
Non |
La clé de balise. Vous pouvez spécifier jusqu'à 20 clés de balise. La clé de balise ne peut pas être une chaîne vide. La clé de balise doit comporter de 1 à 128 caractères et ne peut pas commencer par |
TestKey |
| Value |
string |
Non |
La valeur de balise. Vous pouvez spécifier jusqu'à 20 valeurs de balise. La valeur de balise peut être une chaîne vide. La valeur de balise doit comporter de 0 à 128 caractères et ne peut pas commencer par |
TestValue |
| AccessMode |
object |
Non |
Le mode d'accès de la passerelle NAT VPC pour l'accès aux points de terminaison inversés. |
MULTI_BINDED |
| ModeValue |
string |
Non |
Le mode d'accès. Valeurs valides :
Remarque
Ce paramètre n'est valide que lorsque PrivateLinkEnabled est défini sur true. |
route |
| TunnelType |
string |
Non |
Le type de tunnel. Valeur valide :
Remarque
Ce paramètre n'est valide que lorsque le mode d'accès est tunnel. |
geneve |
| NatIp |
string |
Non |
L'adresse IP privée de la passerelle NAT. Utilisez une adresse IP inactive du bloc CIDR du vSwitch auquel la passerelle NAT appartient. Si ce paramètre est laissé vide, une adresse IP est attribuée aléatoirement. |
192.168.0.2 |
| Ipv4Prefix |
string |
Non |
Le préfixe d'adresse IP. Les adresses IP NAT sont créées à partir du préfixe. Utilisez un bloc CIDR réservé qui n'est pas alloué dans le vSwitch auquel la passerelle NAT appartient. |
192.168.0.0/28 |
| AvailabilityMode |
string |
Non |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
Le corps de la réponse. |
||
| NatGatewayId |
string |
L'identifiant de l'instance de la passerelle NAT. |
ngw-112za33e4**** |
| RequestId |
string |
L'identifiant de la requête. |
2315DEB7-5E92-423A-91F7-4C1EC9AD97C3 |
| ForwardTableIds |
object |
||
| ForwardTableId |
array |
La liste DNAT. |
|
|
string |
L'identifiant d'une table de transfert DNAT. |
ftb-11tc6xgmv**** |
|
| SnatTableIds |
object |
||
| SnatTableId |
array |
La liste SNAT. |
|
|
string |
L'identifiant d'une table SNAT. |
stb-SnatTableIds**** |
|
| FullNatTableIds |
object |
||
| FullNatTableId |
array |
La liste FULLNAT. |
|
|
string |
L'identifiant d'une table FULLNAT. |
fulltb-gw88z7hhlv43rmb26**** |
Exemples
JSON format
{
"NatGatewayId": "ngw-112za33e4****",
"RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD97C3",
"ForwardTableIds": {
"ForwardTableId": [
"ftb-11tc6xgmv****"
]
},
"SnatTableIds": {
"SnatTableId": [
"stb-SnatTableIds****"
]
},
"FullNatTableIds": {
"FullNatTableId": [
"fulltb-gw88z7hhlv43rmb26****"
]
}
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | Forbidden.NatPayBySpec | Pay-by-specification NAT is no longer supported. Newly purchased pay-as-you-go NAT gateways only support the pay-by-CU metering method. | Pay-by-specification NAT gateways are no longer available for purchase. Set InternetChargeType to PayByLcu. |
| 400 | DependencyViolation.FullNatEntry | The specified resource of %s depends on %s, so the operation cannot be completed. | |
| 400 | UnsupportedFeature.InternetChargeType | The feature of InternetChargeType is not supported. | |
| 400 | InvalidVPCStatus | vpc incorrect status. | |
| 400 | InvalidNatGatewayName.MalFormed | NatGateway name is not valid. | |
| 400 | InvalidNatGatewayDescription.MalFormed | NatGateway description is not valid. | |
| 400 | MissingParameter.BandwidthPackage | only support one BandwidthPackage be created with NatGateway. | |
| 400 | OperationDenied | The user cannot allow to create natgw, please call PD to authorize | |
| 400 | RouterEntryConflict.Duplicated | A route entry already exists, which CIDR is '0.0.0.0/0' | |
| 400 | MissingParameter | Miss mandatory parameter. | |
| 400 | QuotaExceeded.BandwidthPackageIps | The specified ipCount exceeded quota. | The number of IP addresses has reached the upper limit. Request a quota increase on the Quota Management page. |
| 400 | AllocateIpFailed | Alloc bandwidthPackage ips failed, maybe no available ip. | |
| 400 | InvalidParameter.Name.Malformed | The specified Name is not valid. | |
| 400 | InvalidParameter.Description.Malformed | The specified Description is not valid. | |
| 400 | ZONE_NO_AVAILABLE_IP | The Zone have no available ip. | |
| 400 | ParameterIllegal | ipCount,bandwidth parameter invalid | |
| 400 | InvalidParameter.BandwidthPackage.n.ISP.ValueNotSupport | The specified ISP of BandwidthPackage is not valid. | |
| 400 | InvalidNatGatewayId.NotFound | The NatGatewayId not exist. | |
| 400 | VpcStatusError | The Vpc is creating . | |
| 400 | InvalidParameter.Spec.ValueNotSupported | The specified Spec is not valid. | |
| 400 | TaskConflict | The operation is too frequent, TaskConflict. | The system is unavailable. Try again later. |
| 400 | COMMODITY.INVALID_COMPONENT | The instance component is invalid. | The instance component is invalid. |
| 400 | CreateNatGateway.RouteConflict.DynamicRoute | Route conflict exists in routing table. | |
| 400 | OperationUnsupported.MultiNatGateway | More than one natGateway per vpc is unsupported. | |
| 400 | Forbidden.CheckEntryRuleQuota | Route entry quota rule check error. | |
| 400 | OperationFailed.UnpaidBillsExist | The account has unpaid bills. Please pay your overdue bill first. | This account has unpaid orders. |
| 400 | IncorrectStatus.RouteEntry | Specified routeEntry status error. | |
| 400 | OperationFailed.RiskControl | Risk control check failed. | The error message returned because your payment method has security risks. Click the link for verification in your email or console message and submit your order after verification. |
| 400 | OperationFailed.TokenVerfiy | Token verify failed. | |
| 400 | IllegalParam.Name | The specified Name is invalid, shorter than 2 characters. | |
| 400 | OperationFailed.EnhancedQuotaExceed | Enhanced nat gateway per vpc quota is exceeded | The quota for creating enhanced NAT gateways in the current VPC has been exceeded. |
| 400 | NoPermission.CreateServiceLinkedRole | You are not authorized to create service linked role | |
| 400 | OperationFailed.EnhancedInventoryNotEnough | Operation failed because inventory is not enough. | |
| 400 | OperationFailed.VswNotBelongToVpc | Operation failed because the specified VSwitch is not bound to the same VPC with NAT gateway. | The vSwitch and NAT gateway do not belong to the same VPC. |
| 400 | OperationFailed.EnhancedUserIsUnAuthorized | Operation failed because the user is not authorized to create an enhanced NAT gateway. | Operation failed because the user is not authorized to create an enhanced NAT gateway. |
| 400 | OperationUnsupported.PrePaidPyByLcu | The operation failed because the subscription NAT gateway does not support the pay-by-LCU billing method. | The operation failed because the subscription NAT gateway does not support the pay-by-LCU billing method. |
| 400 | OperationFailed.NormalInventoryNotEnough | Standard NAT gateways are no longer offered. You can create enhanced NAT gateways and set the correct natType. | |
| 400 | OperationFailed.VSwitchNoAvailableIp | Operation failed because the specified vswitch does not have availabe ip. | |
| 400 | UnsupportedFeature.IcmpReplyEnabled | The feature of IcmpReplyEnabled is not supported. | The value of IcmpReplyEnabled cannot be modified. |
| 400 | UnsupportedFeature.SecurityProtectionEnabled | The feature of SecurityProtectionEnabled is not supported. | |
| 400 | OperationFailed.RegionConvert | Operation failed because do not find region info. | |
| 400 | UnsupportedFeature.VpcNat | The feature of VpcNat is not supported. | |
| 400 | InvalidVSWITCHID.NotFound | The specified resource of %s is not found. | |
| 400 | Forbidden.OperateShareResource | Operate share resource is forbidden. | |
| 400 | IncorrectStatus.VSWITCH | The status of VSWITCH is incorrect. | |
| 400 | OperationFailed.VpcNatGatewayInventoryNotEnough | The operation is failed because of inventory is not enough. | |
| 400 | OperationFailed.VpcNatGatewayCheckInventory | The operation is failed because of check inventory result is unexpected | |
| 400 | ExclusiveParam.%sAnd%s | The param of %s and %s are mutually exclusive. | You cannot specify %s and %s at the same time. |
| 400 | SecurityGroupType.NotSupported | The specified security group type is not supported. | The security group is already hosted and cannot be used. |
| 400 | SecurityGroup.NotExist | The specified security group is not exist. | The security group does not exist in this VPC. |
| 400 | OperationFailed.ContainForbiddenLabel | There is a label that prohibits ordering, please contact your distributor for processing. | There is a label that prohibits ordering, please contact your distributor for processing. |
| 400 | OperationDenied.PrePaidInstance | The operation is not allowed because prepaid instance is no longer supported. | Prepaid instance is no longer supported. |
| 400 | UnsupportedFeature.Geneve | The feature of Geneve is not supported. | The feature of Geneve is not supported. |
| 400 | OperationFailed.NoAvailableResource | The Zone have no available resource. | No resources are available in the region. |
| 400 | ExclusiveParam.AccessModeValueAndAccessTunnelType | The specified param AccessModeValue and AccessTunnelType are mutually exclusive. | The specified input AccessMode.ModeValue and AccessMode.TunnelType conflict |
| 400 | ExclusiveParam.PrivateLinkModeAndAccessMode | The specified param PrivateLinkMode and AccessMode are mutually exclusive. | The specified input PrivateLinkMode conflicts with the AccessMode. |
| 400 | ExclusiveParam.PrivateLinkEnabledAndAccessMode | The specified paramPrivateLinkEnabled and AccessMode are mutually exclusive. | The specified input PrivateLinkEnabled conflicts with the AccessMode. |
| 400 | UnsupportedFeature.AccessModeValue | The feature of AccessMode.ModeValue(%s) is not supported. | This operation is not supported for the VPC NAT AccessMode.ModeValue attribute |
| 400 | IllegalParam.AccessTunnelType | The request parameter AccessMode.TunnelType is illegal. | The request parameter AccessMode.TunnelType is illegal. |
| 400 | IllegalParam.AccessModeValue | The request parameter AccessMode.ModeValue is illegal. | The request parameter AccessMode.ModeValue is illegal. |
| 400 | OperationFailed.VSwitchStatusError | The vSwitch is creating . | The vSwitch is being created. |
| 400 | UnsupportedFeature.PrivateLinkMode | The feature of %s is not supported. | The feature of reverse access is not supported. |
| 400 | OperationFailed.EcsNetworkInterfaceQuotaNotSatisfy | ECS network interface quota is not satisfy. | The ECS ENI quota does not meet the requirements. |
| 400 | OperationFailed.NoNameAuthentication | You have not passed the real name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication. | You have not passed the real name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication. |
| 400 | Mismatch.NatIpAndNatIpCidr | The %s and %s are mismatched. | The specified %s and %s do not match. |
| 400 | Mismatch.Ipv4PrefixAndNatIpCidr | The %s and %s are mismatched. | |
| 400 | ResourceAlreadyExist.NatIp | The specified resource of NatIp has already exist. | Configured NatIp already exists |
| 400 | Mismatch.Ipv4PrefixAndCidrReservations | The %s and %s are mismatched. | The reserved network segments of the Ipv4Prefix and VSwitch do not match. |
| 400 | ResourceAlreadyAssociated.Ipv4Prefix | %s is already associated. | Ipv4Prefix have been allocated. |
| 400 | ResourceNotEnough.Ipv4Prefix | The resource of %s is not enough. | Insufficient Ipv4Prefix resources. |
| 400 | ResourceNotFound.Ipv4Prefix | The resource of s% is not found. | The resource Ipv4Prefix does not exist. |
| 400 | ResourceAlreadyAssociated.NatIp | The resource of %s was already associated. | NatIp resources have been allocated. |
| 400 | ResourceNotEnough.NatIp | The specified resource of NatIp is not enough. | Insufficient IP addresses in the specified CIDR block. |
| 400 | ResourceNotFound.NatIp | The specified resource of %s is not found. | The specified NatIp parameter is not found. |
| 400 | IllegalParam.Ipv4Prefix | The param of %s is illegal, must be /28 network segment. | The parameter Ipv4Prefix is invalid and must be/28 network segment. |
| 400 | IllegalParam.NatIp | The param of %s is illegal. | The parameter NatIp is illegal. |
| 400 | OperationUnsupported.EnhancedRegion | Region not support. | The current region is temporarily not supported. |
| 400 | IncorrectStatus.RouteTableStatus | The route table status is invaild. Please try again later. | The routing table status does not support this operation. Please try again later. |
| 400 | OperationUnsupported.User | The current user does not support this operation. | The current user does not support this operation. |
| 400 | OperationUnsupported.EnhancedCURegion | Operation failed because of this region not unsupported. | Operation failed due to unsupported pay-as-you-go region |
| 400 | OrderError.NoAvailablePaymentMethod | Order payment parameter is not available. | Order error. The payment type parameter is not available. |
| 400 | OrderError.BasicInfoUncompleted | Order basic parameter is not completed. | Order error, basic parameter information incomplete. |
| 400 | OperationUnsupported.Region | Operation unsupport this region parameter. | This operation does not support the region parameter |
| 400 | InvalidParameter.SingleZone | Operation failed because current user not support create single zone nat. | current user is not allowed to create a single az nat |
| 500 | OrderError.NatGateway | The Account failed to create order. | |
| 500 | OperationFailed.AccessTunnelId | AccessTunnelId param do operation failed. | VPC NAT failed to generate tunnel ID. Try again later |
| 500 | OperationFailed.EnhancedCheckInventory | The NAT gateway in the current zone is not in service, or the resource inventory is insufficient. | The NAT gateway in the current zone is not in service, or the resource inventory is insufficient. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | |
| 404 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | The VPC does not exist. Check whether the specified VPC is valid. |
| 404 | InvalidZoneId.NotFound | Specified value of ZoneId is not exists. | |
| 404 | VPC_ONLY_CAN_CREATE_ONE_NAT_GATEWAY | NatGateway in one vpc support only one. | |
| 404 | OperationFailed.CrateEntryTimeOut | Operation failed because create custom routeEntry timeout. | |
| 404 | Forbidden.CreateSpecialSpecNatGateway | You are not authorized to create special spec nat gateway. | |
| 404 | UnsupportedZoneForFwNat | The zone is unsupported for FW NAT. | The zone does not support protection-enabled NAT gateways. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.