ves-io-schema-fleet-API-Create

Examples of creating fleet

Usecase:

Create a fleet of all superstore sites. Each store nodes with two interface, inside and outside. Connect inside network

Request using vesctl:

vesctl configuration create fleet -i fleet.yaml

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

metadata:
  name: superstore-fleet
  namespace: system
spec:
  fleetLabel: superstore-fleet
  interfaceList:
    interfaces:
    - name: int-eth0
      namespace: system
      tenant: acmecorp
    - name: int-eth1
      namespace: system
      tenant: acmecorp
  networkConnectors:
  - kind: network_connector
    name: connect-in-out
    namespace: system
    tenant: acmecorp
  networkFirewall:
  - kind: network_firewall
    name: superstore-firewall
    namespace: system
    tenant: acmecorp
  volterraSoftwareVersion: 2019-build-9981

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: superstore-fleet
  namespace: system
spec:
  fleetLabel: superstore-fleet
  insideVirtualNetwork: []
  networkConnectors:
  - kind: network_connector
    name: connect-in-out
    namespace: system
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  networkFirewall:
  - kind: network_firewall
    name: superstore-firewall
    namespace: system
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  outsideVirtualNetwork: []
  volterraSoftwareVersion: 2019-build-9981
systemMetadata:
  creationTimestamp: "2020-09-23T09:53:19.951758400Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 853764c2-fdab-4cc7-b05e-1f41fe292108

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"superstore-fleet","namespace":"system"},"spec":{"fleetLabel":"superstore-fleet","volterraSoftwareVersion":"2019-build-9981","networkConnectors":[{"kind":"network_connector","tenant":"acmecorp","namespace":"system","name":"connect-in-out"}],"networkFirewall":[{"kind":"network_firewall","tenant":"acmecorp","namespace":"system","name":"superstore-firewall"}],"interfaceList":{"interfaces":[{"tenant":"acmecorp","namespace":"system","name":"int-eth0"},{"tenant":"acmecorp","namespace":"system","name":"int-eth1"}]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/fleets'

curl response:

HTTP/1.1 200 OK
Content-Length: 1325
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:19 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "superstore-fleet",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "853764c2-fdab-4cc7-b05e-1f41fe292108",
    "creation_timestamp": "2020-09-23T09:53:19.951758400Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "fleet_label": "superstore-fleet",
    "volterra_software_version": "2019-build-9981",
    "network_connectors": [
      {
        "kind": "network_connector",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "system",
        "name": "connect-in-out"
      }
    ],
    "network_firewall": [
      {
        "kind": "network_firewall",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "system",
        "name": "superstore-firewall"
      }
    ],
    "operating_system_version": "",
    "outside_virtual_network": [
    ],
    "inside_virtual_network": [
    ],
    "enable_default_fleet_config_download": false
  }
}