ves-io-schema-network_interface-API-Create

Examples of creating network_interface

Usecase:

Create network-interface-1

Request using vesctl:

vesctl configuration create network_interface -i network_interface.yaml

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

metadata:
  name: network-interface-1
  namespace: system
spec:
  ethernetInterface:
    cluster: {}
    device: eth0
    dhcpClient: {}
    isPrimary: {}
    mtu: 1500
    priority: 20
    siteLocalInsideNetwork: {}
    untagged: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: network-interface-1
  namespace: system
spec: {}
systemMetadata:
  creationTimestamp: "2021-04-20T13:49:05.355004986Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: a19bbf4c-bf2a-4b39-9e44-c899bfedeccd

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"network-interface-1","namespace":"system"},"spec":{"ethernetInterface":{"device":"eth0","cluster":{},"untagged":{},"dhcpClient":{},"siteLocalInsideNetwork":{},"mtu":1500,"priority":20,"isPrimary":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build936321446_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/network_interfaces'

curl response:

HTTP/1.1 200 OK
Content-Length: 597
Content-Type: application/json
Date: Tue, 20 Apr 2021 13:49:05 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "network-interface-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "a19bbf4c-bf2a-4b39-9e44-c899bfedeccd",
    "creation_timestamp": "2021-04-20T13:49:05.355004986Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {

  }
}