ves-io-schema-site-API-Create

Examples of creating site

Usecase:

Create site-1

Request using vesctl:

vesctl configuration create site -i site.yaml

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

metadata:
  labels:
    host-os-version: coreos-2135-6-0
    hw-model: t3-2xlarge
    hw-serial-number: ec2a43d8-bbda-7aed-eb99-21ac6fd34ee5
    hw-vendor: amazon-ec2
    hw-version: ""
    provider: AWS
  name: site-1
  namespace: documentation
spec:
  address: Bangalore
  bgpPeerAddress: 2.3.4.5
  bgpRouterId: 1.2.3.4
  region: east-us-2
  siteToSiteTunnelIp: 1.2.3.4
  siteType: REGIONAL_EDGE
  tunnelType: SITE_TO_SITE_TUNNEL_IPSEC
  vipVrrpMode: VIP_VRRP_ENABLE

vesctl yaml response:

metadata:
  annotations: {}
  labels:
    host-os-version: coreos-2135-6-0
    hw-model: t3-2xlarge
    hw-serial-number: ec2a43d8-bbda-7aed-eb99-21ac6fd34ee5
    hw-vendor: amazon-ec2
    hw-version: ""
    provider: AWS
  name: site-1
  namespace: documentation
spec:
  address: Bangalore
  bgpPeerAddress: 2.3.4.5
  bgpRouterId: 1.2.3.4
  connectedRe: []
  connectedReForConfig: []
  region: east-us-2
  siteToSiteTunnelIp: 1.2.3.4
  siteType: REGIONAL_EDGE
  tunnelType: SITE_TO_SITE_TUNNEL_IPSEC
  vipVrrpMode: VIP_VRRP_ENABLE
systemMetadata:
  creationTimestamp: "2020-07-02T15:53:33.161084200Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 536d88b3-7549-490e-825f-e54a92f975d1

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"site-1","namespace":"documentation","labels":{"host-os-version":"coreos-2135-6-0","hw-model":"t3-2xlarge","hw-serial-number":"ec2a43d8-bbda-7aed-eb99-21ac6fd34ee5","hw-vendor":"amazon-ec2","hw-version":"","provider":"AWS"}},"spec":{"siteType":"REGIONAL_EDGE","address":"Bangalore","vipVrrpMode":"VIP_VRRP_ENABLE","siteToSiteTunnelIp":"1.2.3.4","bgpRouterId":"1.2.3.4","bgpPeerAddress":"2.3.4.5","tunnelType":"SITE_TO_SITE_TUNNEL_IPSEC","region":"east-us-2"}}' -H 'Content-Type: application/json' -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/sites'

curl response:

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

{
  "metadata": {
    "name": "site-1",
    "namespace": "documentation",
    "labels": {
      "host-os-version": "coreos-2135-6-0",
      "hw-model": "t3-2xlarge",
      "hw-serial-number": "ec2a43d8-bbda-7aed-eb99-21ac6fd34ee5",
      "hw-vendor": "amazon-ec2",
      "hw-version": "",
      "provider": "AWS"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "536d88b3-7549-490e-825f-e54a92f975d1",
    "creation_timestamp": "2020-07-02T15:53:33.161084200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "site_type": "REGIONAL_EDGE",
    "address": "Bangalore",
    "coordinates": null,
    "volterra_software_version": "",
    "connected_re": [
    ],
    "connected_re_for_config": [
    ],
    "inside_vip": "",
    "outside_vip": "",
    "vip_vrrp_mode": "VIP_VRRP_ENABLE",
    "site_to_site_network_type": "VIRTUAL_NETWORK_SITE_LOCAL",
    "site_to_site_tunnel_ip": "1.2.3.4",
    "volterra_software_overide": "SITE_SOFTWARE_OVERRIDE_SITE",
    "bgp_router_id": "1.2.3.4",
    "bgp_peer_address": "2.3.4.5",
    "inside_nameserver": "",
    "outside_nameserver": "",
    "desired_pool_count": 0,
    "tunnel_type": "SITE_TO_SITE_TUNNEL_IPSEC",
    "operating_system_version": "",
    "site_state": "ONLINE",
    "tunnel_dead_timeout": 0,
    "region": "east-us-2"
  }
}