ves-io-schema-views-origin_pool-API-Create
On This Page:
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 origin_pool.yaml has following contents (origin_pool.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
}
},
"spec": {
"origin_servers": [
{
"public_name": {
"dns_name": "volterra.io"
}
}
],
"no_tls": {},
"port": 80
}
}
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "28312a18-6621-424c-9df5-4b35290065cd",
"creation_timestamp": "2024-03-21T14:08:45.797895Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {}
},
"spec": {
"origin_servers": [
{
"public_name": {
"dns_name": "volterra.io",
"refresh_interval": 0
},
"labels": {}
}
],
"no_tls": {},
"port": 80,
"healthcheck": [],
"loadbalancer_algorithm": "ROUND_ROBIN",
"endpoint_selection": "DISTRIBUTED",
"advanced_options": null
}
}
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"origin_servers":[{"public_name":{"dns_name":"volterra.io"}}],"no_tls":{},"port":80}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_2__8qnt6fwd5dvglr1xqq6l8b7w0000gp_T_go-build3109416560_b001_apidocs.test/host=C02FN35BMD6R/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/origin_pools'
curl response:
HTTP/1.1 200 OK
Content-Length: 1016
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:08:45 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "28312a18-6621-424c-9df5-4b35290065cd",
"creation_timestamp": "2024-03-21T14:08:45.797895Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [
],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {
}
},
"spec": {
"origin_servers": [
{
"public_name": {
"dns_name": "volterra.io",
"refresh_interval": 0
},
"labels": {
}
}
],
"no_tls": {
},
"port": 80,
"healthcheck": [
],
"loadbalancer_algorithm": "ROUND_ROBIN",
"endpoint_selection": "DISTRIBUTED",
"advanced_options": null
}
}