Skip to main content
Glama

create_tier1_gateway

Create a Tier-1 gateway in VMware NSX to establish network connectivity between segments and optionally link to Tier-0 gateways for routing.

Instructions

Create a new Tier-1 gateway.

Args: tier1_id: Unique ID for the Tier-1 gateway. display_name: Human-readable name. tier0_path: Policy path to link to a Tier-0 gateway (optional). edge_cluster_path: Policy path to an edge cluster for services (optional). route_advertisement: Comma-separated route advertisement types (optional). target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tier1_idYes
display_nameYes
tier0_pathNo
edge_cluster_pathNo
route_advertisementNo
targetNo

Implementation Reference

  • Core logic implementation of the create_tier1_gateway tool using NSX Policy API.
    def create_tier1_gateway(
        client: NsxClient,
        tier1_id: str,
        display_name: str,
        tier0_path: str | None = None,
        route_advertisement_types: list[str] | None = None,
    ) -> dict:
        """Create a new Tier-1 gateway via Policy API (PUT).
    
        Args:
            client: Authenticated NSX API client.
            tier1_id: Unique Tier-1 identifier.
            display_name: Human-readable name.
            tier0_path: Policy path to parent Tier-0 gateway.
            route_advertisement_types: List of route types to advertise
                (e.g., TIER1_CONNECTED, TIER1_STATIC_ROUTES, TIER1_NAT).
    
        Returns:
            Created Tier-1 gateway dict from NSX API.
        """
        _validate_id(tier1_id)
    
        body: dict[str, Any] = {
            "display_name": _sanitize(display_name),
        }
    
        if tier0_path:
            body["tier0_path"] = tier0_path
    
        if route_advertisement_types:
            valid_types = {
                "TIER1_CONNECTED",
                "TIER1_STATIC_ROUTES",
                "TIER1_NAT",
                "TIER1_LB_VIP",
                "TIER1_LB_SNAT",
                "TIER1_DNS_FORWARDER_IP",
                "TIER1_IPSEC_LOCAL_ENDPOINT",
            }
            for rt in route_advertisement_types:
                if rt not in valid_types:
                    raise ValueError(
                        f"Invalid route advertisement type: '{rt}'. "
                        f"Valid types: {', '.join(sorted(valid_types))}"
                    )
            body["route_advertisement_types"] = route_advertisement_types
    
        path = f"/policy/api/v1/infra/tier-1s/{tier1_id}"
        result = client.put(path, body)
        _log.info("Created Tier-1 gateway %s (%s)", tier1_id, display_name)
        return result
  • MCP tool registration and wrapper function that invokes the gateway_mgmt logic. Note: While the server code references vmware_nsx.ops.gateway_mgmt, the actual implementation is inside vmware_nsx/ops/segment_mgmt.py.
    def create_tier1_gateway(
        tier1_id: str,
        display_name: str,
        tier0_path: str | None = None,
        edge_cluster_path: str | None = None,
        route_advertisement: str | None = None,
        target: str | None = None,
    ) -> dict:
        """Create a new Tier-1 gateway.
    
        Args:
            tier1_id: Unique ID for the Tier-1 gateway.
            display_name: Human-readable name.
            tier0_path: Policy path to link to a Tier-0 gateway (optional).
            edge_cluster_path: Policy path to an edge cluster for services (optional).
            route_advertisement: Comma-separated route advertisement types (optional).
            target: Optional NSX Manager target name from config. Uses default if omitted.
        """
        from vmware_nsx.ops.gateway_mgmt import create_tier1_gateway as _create
    
        client = _get_connection(target)
        return _create(
            client, tier1_id,
            display_name=display_name,
            tier0_path=tier0_path,
            edge_cluster_path=edge_cluster_path,
            route_advertisement=route_advertisement,
        )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zw008/VMware-NSX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server