ves-io-schema-network_interface-API-Replace

Examples of replacing network_interface

Usecase:

Replace network-interface-1

Request using vesctl:

vesctl configuration replace network_interface -i network_interface.yaml

where file networkinterface.yaml has following contents (networkinterface.ReplaceRequest):

metadata:
  name: network-interface-1
  namespace: documentation
spec:
  DHCPServer: NETWORK_INTERFACE_DHCP_SERVER_ENABLE
  DNSServer:
    dnsMode: NETWORK_INTERFACE_DNS_USE_CONFIGURED
    dnsServer:
    - addr: 1.2.3.254
  defaultGateway:
    defaultGatewayAddress:
      addr: 1.2.3.254
    defaultGatewayMode: NETWORK_INTERFACE_GATEWAY_USE_CONFIGURED
  dhcpAddress: NETWORK_INTERFACE_DHCP_ENABLE
  mtu: 1500
  staticAddresses:
  - plen: 24
    prefix: 1.2.3.0
  virtualNetwork:
  - kind: virtual_network
    name: network1

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"network-interface-1","namespace":"documentation"},"spec":{"mtu":1500,"virtualNetwork":[{"kind":"virtual_network","name":"network1"}],"dhcpAddress":"NETWORK_INTERFACE_DHCP_ENABLE","defaultGateway":{"defaultGatewayMode":"NETWORK_INTERFACE_GATEWAY_USE_CONFIGURED","defaultGatewayAddress":{"addr":"1.2.3.254"}},"staticAddresses":[{"prefix":"1.2.3.0","plen":24}],"DNSServer":{"dnsMode":"NETWORK_INTERFACE_DNS_USE_CONFIGURED","dnsServer":[{"addr":"1.2.3.254"}]},"DHCPServer":"NETWORK_INTERFACE_DHCP_SERVER_ENABLE"}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/network_interfaces/network-interface-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:17 GMT
Vary: Accept-Encoding

{

}