​
Select Service
ves-io-schema-virtual_host-API-Create
Published April 5, 2023 | Last modified June 26, 2025
Examples of creating virtual_host
Usecase:
Create "productpage" virtual_host which supports HTTPS
Request using vesctl:
vesctl configuration create virtual_host -i virtual_host.yaml
where file virtual_host.yaml has following contents (virtual_host.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
}
},
"spec": {
"domains": [
"www.bookinfo.com"
],
"routes": [
{
"kind": "route",
"name": "ppage-route"
}
],
"advertise_policies": [
{
"kind": "advertise_policy",
"name": "ppage-advertise"
}
],
"tls_cert_params": {
"certificates": [
{
"kind": "certificate",
"name": "cert1"
}
],
"validation_params": {
"trusted_ca_url": "",
"use_volterra_trusted_ca_url": true
},
"cipher_suites": []
},
"proxy": "UDP_PROXY",
"no_challenge": {}
}
}
Copied!
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "4749bc35-cac0-4c5b-a943-9d357d3bd272",
"creation_timestamp": "2025-06-26T23:57:13.343531Z",
"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": {
"domains": [
"www.bookinfo.com"
],
"routes": [
{
"kind": "route",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "ppage-route"
}
],
"advertise_policies": [
{
"kind": "advertise_policy",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "ppage-advertise"
}
],
"request_headers_to_add": [],
"response_headers_to_add": [],
"request_headers_to_remove": [],
"response_headers_to_remove": [],
"request_cookies_to_add": [],
"request_cookies_to_remove": [],
"response_cookies_to_add": [],
"response_cookies_to_remove": [],
"tls_cert_params": {
"certificates": [
{
"kind": "certificate",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "cert1"
}
],
"validation_params": {
"trusted_ca_url": "",
"skip_hostname_verification": false,
"verify_subject_alt_names": [],
"use_volterra_trusted_ca_url": true
},
"minimum_protocol_version": "TLS_AUTO",
"maximum_protocol_version": "TLS_AUTO",
"cipher_suites": [],
"require_client_certificate": false,
"no_client_certificate": {},
"crl": [],
"xfcc_header_elements": []
},
"type": "VIRTUAL_SERVICE",
"buffer_policy": null,
"cors_policy": null,
"proxy": "UDP_PROXY",
"waf_type": null,
"dynamic_reverse_proxy": null,
"add_location": false,
"compression_params": null,
"custom_errors": {},
"disable_default_error_pages": false,
"max_request_header_size": 0,
"no_challenge": {},
"user_identification": [],
"rate_limiter_allowed_prefixes": [],
"retry_policy": null,
"idle_timeout": 0,
"temporary_user_blocking": null,
"header_transformation_type": null,
"cookies_to_modify": [],
"connection_idle_timeout": 0,
"state": "VIRTUAL_HOST_READY",
"host_name": "",
"dns_info": [],
"auto_cert_info": null,
"auto_cert_error_msg": "",
"disable_dns_resolve": false,
"cdn_service": null,
"csrf_policy": null,
"dns_proxy_configuration": null,
"slow_ddos_mitigation": null,
"api_spec": null,
"domain_cert_map": {},
"http_protocol_options": null,
"ztna_proxy_configurations": null,
"max_direct_response_body_size": 0,
"masking_config": null,
"sensitive_data_policy": [],
"coalescing_options": null,
"l7_ddos_rps_threshold": 0
}
}
Copied!
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"domains":["www.bookinfo.com"],"routes":[{"kind":"route","name":"ppage-route"}],"advertise_policies":[{"kind":"advertise_policy","name":"ppage-advertise"}],"tls_cert_params":{"certificates":[{"kind":"certificate","name":"cert1"}],"validation_params":{"trusted_ca_url":"","use_volterra_trusted_ca_url":true},"cipher_suites":[]},"proxy":"UDP_PROXY","no_challenge":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build336959812_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/virtual_hosts'
Copied!
curl response:
HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 26 Jun 2025 23:57:13 GMT
Vary: Accept-Encoding
X-Volterra-Response-Fields-Deprecated: spec.cdn_service.cache_ttl,spec.cdn_service.service_domains.#
{
"metadata": {
"name": "productpage",
"namespace": "documentation",
"labels": {
"ves.io/app_type": "bookinfo"
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "4749bc35-cac0-4c5b-a943-9d357d3bd272",
"creation_timestamp": "2025-06-26T23:57:13.343531Z",
"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": {
"domains": [
"www.bookinfo.com"
],
"routes": [
{
"kind": "route",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "ppage-route"
}
],
"advertise_policies": [
{
"kind": "advertise_policy",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "ppage-advertise"
}
],
"request_headers_to_add": [
],
"response_headers_to_add": [
],
"request_headers_to_remove": [
],
"response_headers_to_remove": [
],
"request_cookies_to_add": [
],
"request_cookies_to_remove": [
],
"response_cookies_to_add": [
],
"response_cookies_to_remove": [
],
"tls_cert_params": {
"certificates": [
{
"kind": "certificate",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "documentation",
"name": "cert1"
}
],
"validation_params": {
"trusted_ca_url": "",
"skip_hostname_verification": false,
"verify_subject_alt_names": [
],
"use_volterra_trusted_ca_url": true
},
"minimum_protocol_version": "TLS_AUTO",
"maximum_protocol_version": "TLS_AUTO",
"cipher_suites": [
],
"require_client_certificate": false,
"no_client_certificate": {
},
"crl": [
],
"xfcc_header_elements": [
]
},
"type": "VIRTUAL_SERVICE",
"buffer_policy": null,
"cors_policy": null,
"proxy": "UDP_PROXY",
"waf_type": null,
"dynamic_reverse_proxy": null,
"add_location": false,
"compression_params": null,
"custom_errors": {
},
"disable_default_error_pages": false,
"max_request_header_size": 0,
"no_challenge": {
},
"user_identification": [
],
"rate_limiter_allowed_prefixes": [
],
"retry_policy": null,
"idle_timeout": 0,
"temporary_user_blocking": null,
"header_transformation_type": null,
"cookies_to_modify": [
],
"connection_idle_timeout": 0,
"state": "VIRTUAL_HOST_READY",
"host_name": "",
"dns_info": [
],
"auto_cert_info": null,
"auto_cert_error_msg": "",
"disable_dns_resolve": false,
"cdn_service": null,
"csrf_policy": null,
"dns_proxy_configuration": null,
"slow_ddos_mitigation": null,
"api_spec": null,
"domain_cert_map": {
},
"http_protocol_options": null,
"ztna_proxy_configurations": null,
"max_direct_response_body_size": 0,
"masking_config": null,
"sensitive_data_policy": [
],
"coalescing_options": null,
"l7_ddos_rps_threshold": 0
}
}
Copied!