REST API - list

vcenter vm guest networking routes: list

Returns information about network routing in the guest operating system. This operation was added in vSphere API 7.0.0.

Request:

HTTP request

GET https://{server}/rest/vcenter/vm/{vm}/guest/networking/routes

Path Parameters

Name Type Description
Required
vm string Virtual machine ID.

Response:

HTTP Status Code: 200

Representation:

{
    "value"[
        {
            "gateway_address""string",
            "interface_index"1,
            "prefix_length"1,
            "network""string"
        },
        {
            "gateway_address""string",
            "interface_index"1,
            "prefix_length"1,
            "network""string"
        }
    ]
}

Response Type:

Name Type Description
bold = required
value info[] Information about the network routes configured in the guest operating system.
value[].network string IP Address of the destination IP network. IPv4 address is specified using dotted decimal notation. For example, "192.0.2.1". IPv6 addresses are 128-bit specified using as eight fields of up to four hexadecimal digits. A colon separates each field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol '::' to represent multiple 16-bit groups of contiguous 0's only once in an address as described in RFC 2373. This attribute was added in vSphere API 7.0.0.

value[].prefix_length long The prefix length. For IPv4 the value range is 0-32. For IPv6 prefixLength is a decimal value range 0-128. The property represents the number of contiguous, higher-order bits of the address that make up the network portion of the IP address. This attribute was added in vSphere API 7.0.0.

value[].gateway_address string Where to send the packets for this route. Unicast IP Address of the next hop router. IPv4 address is specified using dotted decimal notation. For example, "192.0.2.1". IPv6 addresses are 128-bit specified using as eight fields of up to four hexadecimal digits. A colon separates each field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol '::' to represent multiple 16-bit groups of contiguous 0's only once in an address as described in RFC 2373. This attribute was added in vSphere API 7.0.0.

Optional. If unset no gateway is set for the route.

Errors:

HTTP Status Code Type Description
500 error if the system reports an error while responding to the request.
404 not_found if the virtual machine is not found.
503 service_unavailable if VMware Tools is not running.