Documentation Reference REST API reference API: networks
Reference For: developers
API: networks
Operations of the networks tag of the native REST API.
Host-bridge networks / standard port groups (create, update, delete)
POST /v1/distributed-portgroups
Creates a distributed port group on a switch.
CLI kyvernon network portgroup-create --body <json>
Request body
application/json: CreateDistributedPortgroupRequest
Name Type Required Description datacenterIdstring or nullThe datacenter of the switch (optional; checked when given). idempotencyKeystring or nullIdempotency key. ipv4HostBridgeIpv4Request or nullipv6PortgroupIpv6Request or nullnamestringyes Name (1 to 80 characters). staticAddressesobject or nullFixed IPv4 addresses by MAC. switchIdstringyes The switch. vlanIdinteger (int32) or nullVLAN id, 0 for untagged; ignored when vni is set. vniinteger (int32) or nullOverlay segment (Geneve VNI) instead of a VLAN.
Responses
Status Description Schema 201 Created ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
PUT /v1/distributed-portgroups/{id}
Changes a distributed port group (compare-and-set on expectedVersion). Addresses already allocated stay while they are in the subnet.
CLI kyvernon network portgroup-update <id> --body <json>
Parameters
Name In Type Required Description idpath stringyes Distributed port group id (dvportgroup-N)
Request body
application/json: UpdateDistributedPortgroupRequest
Name Type Required Description expectedVersioninteger (int64)yes Version the change is based on. ipv4HostBridgeIpv4Request or nullipv6PortgroupIpv6Request or nullnamestring or nullName. staticAddressesobject or nullFixed IPv4 addresses by MAC (replaces the map). vlanIdinteger (int32) or nullVLAN id (clears vni). vniinteger (int32) or nullVNI (replaces the VLAN).
Responses
Status Description Schema 200 OK ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
DELETE /v1/distributed-portgroups/{id}
Deletes a distributed port group no NIC uses.
CLI kyvernon network portgroup-delete <id>
Parameters
Name In Type Required Description idpath stringyes Distributed port group id (dvportgroup-N)
Responses
Status Description Schema 204 Done; no body 412 Failed precondition; the error body says which ErrorBody
POST /v1/distributed-switches
Creates a distributed switch in a datacenter's network folder.
CLI kyvernon network dvs-create --body <json>
Request body
application/json: CreateDistributedSwitchRequest
Name Type Required Description datacenterIdstringyes The datacenter; the switch goes into its network folder. hostUplinksarray of HostUplinksRequest or null The physical NICs of member hosts behind the uplinks. hostsarray of string or null Member hosts (default none). idempotencyKeystring or nullIdempotency key. mtuinteger (int32) or nullMTU (576 to 9216; default 1500). namestringyes Name (1 to 80 characters). uplinkNamesarray of string or null Uplink names (default uplink1 to uplink<uplinks>). uplinksinteger (int32) or nullNumber of uplinks (default 1).
Responses
Status Description Schema 201 Created ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
PUT /v1/distributed-switches/{id}
Changes a distributed switch (compare-and-set on expectedVersion).
CLI kyvernon network dvs-update <id> --body <json>
Parameters
Name In Type Required Description idpath stringyes Distributed switch id (dvs-N)
Request body
application/json: UpdateDistributedSwitchRequest
Name Type Required Description expectedVersioninteger (int64)yes Version the change is based on. hostUplinksarray of HostUplinksRequest or null The physical NICs of member hosts (replaces the list). hostsarray of string or null Member hosts. mtuinteger (int32) or nullMTU. namestring or nullName. uplinkNamesarray of string or null Uplink names. uplinksinteger (int32) or nullNumber of uplinks.
Responses
Status Description Schema 200 OK ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
DELETE /v1/distributed-switches/{id}
Deletes a distributed switch without port groups.
CLI kyvernon network dvs-delete <id>
Parameters
Name In Type Required Description idpath stringyes Distributed switch id (dvs-N)
Responses
Status Description Schema 204 Done; no body 412 Failed precondition; the error body says which ErrorBody
GET /v1/network/realization
Realization of the OVN logical networks (docs/network/DESIGN.md §6.3): the model generation, the Northbound connection and realization, the counters' state and every host's report. enabled: false when the controller has no [ovn].
CLI kyvernon network realization
Responses
POST /v1/networks
Creates a host-bridge network under a datacenter.
CLI kyvernon network create --body <json>
Request body
application/json: CreateNetworkRequest
Name Type Required Description backingHostBridgeBackingRequestyes How NICs reach the hosts (host-bridge only in this slice). datacenterIdstringyes Datacenter that owns the network (datacenter-N). hostsarray of string or null Hosts offering this network (host-N). Empty or omitted: all hosts under the datacenter. idempotencyKeystring or nullIdempotency key. namestringyes Display name (1..=80 characters). vlanIdinteger (int32) or nullVLAN id, 0 for untagged (default 0).
Responses
Status Description Schema 201 Created ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
PUT /v1/networks/{id}
Updates a host-bridge network (compare-and-set).
CLI kyvernon network update <id> --body <json>
Parameters
Name In Type Required Description idpath stringyes Id of the network
Request body
application/json: UpdateNetworkRequest
Name Type Required Description backingHostBridgeBackingRequest or nullexpectedVersioninteger (int64)yes Version the client read; fails with CONFLICT if it changed. hostsarray of string or null Replace the hosts list. namestring or nullNew display name. vlanIdinteger (int32) or nullNew VLAN id.
Responses
Status Description Schema 200 OK ObjectView400 Invalid argument; the error body names the field ErrorBody409 Conflict: the object exists, or expectedVersion is stale ErrorBody
DELETE /v1/networks/{id}
Deletes a network. Refuses when any VM still has a NIC on it.
CLI kyvernon network delete <id>
Parameters
Name In Type Required Description idpath stringyes Id of the network
Responses
Status Description Schema 204 Done; no body 400 Invalid argument; the error body names the field ErrorBody412 Failed precondition; the error body says which ErrorBody
Guides
Previous API: metrics Next API: nfc
Version 0.1.