ves-io-schema-views-origin_pool-API-Create

Examples of creating origin_pool

Usecase:

Create "productpage" HTTP loadbalancer which supports HTTPS

Request using vesctl:

vesctl configuration create origin_pool -i origin_pool.yaml

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

metadata:
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  originServers:
  - publicName:
      dnsName: volterra.io
  port: 80

vesctl yaml response:

metadata:
  annotations: {}
  labels:
    ves.io/app_type: bookinfo
  name: productpage
  namespace: documentation
spec:
  healthcheck: []
  originServers:
  - publicName:
      dnsName: volterra.io
  port: 80
systemMetadata:
  creationTimestamp: "2020-09-16T10:51:03.436439300Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 326fc738-83e5-4139-9afa-ca60a7d3fa41

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"originServers":[{"publicName":{"dnsName":"volterra.io"}}],"port":80}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/origin_pools'

curl response:

HTTP/1.1 200 OK
Content-Length: 878
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:51:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "productpage",
    "namespace": "documentation",
    "labels": {
      "ves.io/app_type": "bookinfo"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "326fc738-83e5-4139-9afa-ca60a7d3fa41",
    "creation_timestamp": "2020-09-16T10:51:03.436439300Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "origin_servers": [
      {
        "public_name": {
          "dns_name": "volterra.io"
        }
      }
    ],
    "port": 80,
    "healthcheck": [
    ],
    "loadbalancer_algorithm": "ROUND_ROBIN",
    "endpoint_selection": "DISTRIBUTED"
  }
}