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-07-14T08:07:40.674490394Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: b07ce250-d79b-4a4c-b647-4c8202407be1

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-build381173587_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, 14 Jul 2021 08:07:40 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "connect-in-out",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "b07ce250-d79b-4a4c-b647-4c8202407be1",
    "creation_timestamp": "2021-07-14T08:07:40.674490394Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {

  }
}