API 与参考文档
本页介绍了可用于 Cloud NAT 的各种资源。
Cloud NAT API 和 gcloud 命令是 Compute Engine 的一部分。
Cloud NAT 使用新的 Cloud Router 命令和参数进行配置。
gcloud CLI 命令
现有的 Cloud Router 命令可在 Google Cloud CLI 界面文档中找到。
下表列出了常用的 Cloud NAT 命令:
| 命令 | 说明 | 
|---|---|
gcloud compute routers nats create | 
      将 NAT 配置添加到路由器。 | 
gcloud compute routers nats update | 
      更新路由器上的 NAT 配置。 | 
gcloud compute routers nats delete | 
      从路由器中移除 NAT 配置。 | 
gcloud compute routers nats list | 
      列出路由器上的 NAT 配置。 | 
gcloud compute routers nats describe | 
      显示路由器上的 NAT 配置。 | 
gcloud compute routers get-status | 
      获取指定 Cloud Router 路由器的运行时信息,包括 NAT 状态。 | 
gcloud compute routers get-nat-mapping-info | 
      显示 NAT IP:port-ranges。 | 
gcloud compute routers get-nat-ip-info | 
      显示 NAT IP 地址使用情况。 | 
gcloud compute routers nats rules create | 
      将 NAT 规则添加到现有 NAT 网关。 | 
gcloud compute routers nats rules update | 
      更新单个 NAT 规则。 | 
gcloud compute routers nats rules delete | 
      从 NAT 网关中删除 NAT 规则。 | 
gcloud compute routers nats rules describe | 
      描述 NAT 规则。 | 
gcloud compute routers nats rules list | 
      列出 NAT 网关中的所有 NAT 规则。 | 
Rest API
所有 NAT 操作均在路由器资源上执行。它们都需要 OAuth 2.0 身份验证。
下表列出了常用的 Cloud Router API:
| 命令 | 说明 | 
|---|---|
routers.insert | 
      创建 Cloud Router 路由器。您可以在创建路由器时指定 NAT 配置。 | 
routers.update | 
      更新 Cloud Router 路由器。您可以在更新路由器时指定 NAT 配置。 | 
routers.patch | 
      修补 Cloud Router 路由器。您可以在修补路由器时指定 NAT 配置。 | 
routers.getRouterStatus | 
      获取指定 Cloud Router 路由器的运行时信息,包括 NAT 状态。 | 
routers.getNatMappingInfo | 
      检索虚拟机端点的运行时 NAT 映射信息。 | 
routers.getNatIpInfo | 
      检索所指定 Cloud Router 的运行时 NAT IP 地址信息。 |