ves-io-schema-network_connector-API-Create

Examples of creating network_connector

Usecase:

Create network-connector connect-in-out that connects inside network with outside network with SNAT

Request using vesctl:

vesctl configuration create network_connector -i network_connector.yaml

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

metadata:
  name: connect-in-out
  namespace: system
spec:
  enableForwardProxy:
    maxConnectAttempts: 2
  sliToSloSnat:
    defaultGwSnat: {}
    interfaceIp: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: connect-in-out
  namespace: system
spec: {}
systemMetadata:
  creationTimestamp: "2021-08-25T09:03:30.965348409Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 49ed8ee4-ff40-4d85-85e9-6c8466e2918d

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"connect-in-out","namespace":"system"},"spec":{"sliToSloSnat":{"defaultGwSnat":{},"interfaceIp":{}},"enableForwardProxy":{"maxConnectAttempts":2}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/network_connectors'

curl response:

HTTP/1.1 200 OK
Content-Length: 592
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:30 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "connect-in-out",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "49ed8ee4-ff40-4d85-85e9-6c8466e2918d",
    "creation_timestamp": "2021-08-25T09:03:30.965348409Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {

  }
}