create_static_route
Creates a static route on a Tier-0 or Tier-1 gateway to reach destinations not covered by connected or advertised routes, such as VPN subnets.
Instructions
[WRITE] Create a static route on a Tier-0 or Tier-1 gateway via the Policy API.
Use for destinations not covered by connected or advertised routes (e.g. reaching a VPN or external subnet). Note: for the Tier-0 to advertise this route upstream, the gateway needs TIER1_STATIC_ROUTES route advertisement (set via update_tier1_gateway). Re-running with the same route_id overwrites it (PUT semantics). Returns the created route dict; on failure returns {"error", "hint"}. Recorded in the audit log (~/.vmware/audit.db).
Args: tier1_id: Gateway ID (Tier-0 or Tier-1, per gateway_type), as returned by list_tier0_gateways / list_tier1_gateways. route_id: Unique route identifier (alphanumerics, hyphens, underscores only). network: Destination network in CIDR notation, e.g. "10.0.0.0/8". next_hop: Next-hop IPv4 address, e.g. "192.168.1.254". gateway_type: Either "tier0" or "tier1" (default "tier1"). target: NSX Manager name from config.yaml. Uses the default target if omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| network | Yes | ||
| next_hop | Yes | ||
| route_id | Yes | ||
| tier1_id | Yes | ||
| gateway_type | No | tier1 |