ves-io-schema-views-http_loadbalancer-API-Create

Examples of creating http_loadbalancer

Usecase:

Create "productpage" HTTP loadbalancer which supports HTTPS

Request using vesctl:

vesctl configuration create http_loadbalancer -i http_loadbalancer.yaml

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

RequestJSON:

          {
    "metadata": {
        "name": "productpage",
        "namespace": "documentation",
        "labels": {
            "ves.io/app_type": "bookinfo"
        }
    },
    "spec": {
        "domains": [
            "www.bookinfo.com"
        ],
        "https": {
            "tls_cert_params": {
                "tls_config": {
                    "default_security": {}
                },
                "certificates": [
                    {
                        "name": "cert1"
                    }
                ],
                "no_mtls": {}
            },
            "enable_path_normalize": {},
            "port": 0,
            "header_transformation_type": {}
        },
        "advertise_on_public_default_vip": {},
        "default_route_pools": [
            {
                "pool": {
                    "name": "ppage-route"
                }
            }
        ],
        "disable_waf": {},
        "no_challenge": {},
        "user_id_client_ip": {},
        "disable_rate_limit": {},
        "waf_exclusion_rules": [
            {
                "any_domain": null,
                "path_regex": "",
                "methods": [
                    "ANY"
                ],
                "metadata": {
                    "name": "name"
                },
                "app_firewall_detection_control": {
                    "exclude_signature_contexts": [
                        {
                            "signature_id": 10000000
                        }
                    ],
                    "exclude_violation_contexts": [
                        {
                            "exclude_violation": "VIOL_ASM_COOKIE_MODIFIED"
                        }
                    ],
                    "exclude_attack_type_contexts": [
                        {
                            "exclude_attack_type": "ATTACK_TYPE_ABUSE_OF_FUNCTIONALITY"
                        }
                    ]
                }
            }
        ],
        "service_policies_from_namespace": {},
        "round_robin": {},
        "multi_lb_app": {}
    }
}
        

vesctl yaml response:

ResponseJSON:

          {
    "metadata": {
        "name": "productpage",
        "namespace": "documentation",
        "labels": {
            "ves.io/app_type": "bookinfo"
        },
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "fe514a5d-e6b7-4af7-a42f-1b9478a7a2a0",
        "creation_timestamp": "2024-03-21T14:08:42.253468Z",
        "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"
        ],
        "https": {
            "http_redirect": false,
            "add_hsts": false,
            "tls_cert_params": {
                "tls_config": {
                    "default_security": {}
                },
                "certificates": [
                    {
                        "tenant": "acmecorp",
                        "namespace": "documentation",
                        "name": "cert1"
                    }
                ],
                "no_mtls": {}
            },
            "enable_path_normalize": {},
            "port": 0,
            "header_transformation_type": {
                "default_header_transformation": {}
            },
            "connection_idle_timeout": 0,
            "http_protocol_options": null
        },
        "downstream_tls_certificate_expiration_timestamps": [],
        "advertise_on_public_default_vip": {},
        "default_route_pools": [
            {
                "pool": {
                    "tenant": "acmecorp",
                    "namespace": "documentation",
                    "name": "ppage-route"
                },
                "weight": 0,
                "priority": 0,
                "endpoint_subsets": {}
            }
        ],
        "origin_server_subset_rule_list": null,
        "routes": [],
        "cors_policy": null,
        "disable_waf": {},
        "add_location": false,
        "no_challenge": {},
        "more_option": null,
        "user_id_client_ip": {},
        "disable_rate_limit": {},
        "malicious_user_mitigation": null,
        "waf_exclusion_rules": [
            {
                "path_regex": "",
                "methods": [
                    "ANY"
                ],
                "expiration_timestamp": null,
                "metadata": {
                    "name": "name",
                    "description": "",
                    "disable": false
                },
                "app_firewall_detection_control": {
                    "exclude_signature_contexts": [
                        {
                            "signature_id": 10000000,
                            "context": "CONTEXT_ANY",
                            "context_name": ""
                        }
                    ],
                    "exclude_violation_contexts": [
                        {
                            "exclude_violation": "VIOL_ASM_COOKIE_MODIFIED",
                            "context": "CONTEXT_ANY",
                            "context_name": ""
                        }
                    ],
                    "exclude_attack_type_contexts": [
                        {
                            "exclude_attack_type": "ATTACK_TYPE_ABUSE_OF_FUNCTIONALITY",
                            "context": "CONTEXT_ANY",
                            "context_name": ""
                        }
                    ],
                    "exclude_bot_name_contexts": []
                }
            }
        ],
        "data_guard_rules": [],
        "blocked_clients": [],
        "trusted_clients": [],
        "api_protection_rules": null,
        "ddos_mitigation_rules": [],
        "service_policies_from_namespace": {},
        "round_robin": {},
        "disable_trust_client_ip_headers": {},
        "multi_lb_app": {},
        "disable_ddos_detection": {},
        "disable_malicious_user_detection": {},
        "disable_api_discovery": {},
        "disable_api_definition": {},
        "csrf_policy": null,
        "graphql_rules": [],
        "protected_cookies": [],
        "host_name": "",
        "dns_info": [],
        "state": "VIRTUAL_HOST_READY",
        "auto_cert_info": null,
        "internet_vip_info": [],
        "jwt_validation": null,
        "disable_threat_intelligence": {},
        "l7_ddos_action_default": {},
        "cert_state": "AutoCertDisabled"
    }
}
        

Request using curl:

          curl -X 'POST' -d '{"metadata":{"name":"productpage","namespace":"documentation","labels":{"ves.io/app_type":"bookinfo"}},"spec":{"domains":["www.bookinfo.com"],"https":{"tls_cert_params":{"tls_config":{"default_security":{}},"certificates":[{"name":"cert1"}],"no_mtls":{}},"enable_path_normalize":{},"port":0,"header_transformation_type":{}},"advertise_on_public_default_vip":{},"default_route_pools":[{"pool":{"name":"ppage-route"}}],"disable_waf":{},"no_challenge":{},"user_id_client_ip":{},"disable_rate_limit":{},"waf_exclusion_rules":[{"any_domain":null,"path_regex":"","methods":["ANY"],"metadata":{"name":"name"},"app_firewall_detection_control":{"exclude_signature_contexts":[{"signature_id":10000000}],"exclude_violation_contexts":[{"exclude_violation":"VIOL_ASM_COOKIE_MODIFIED"}],"exclude_attack_type_contexts":[{"exclude_attack_type":"ATTACK_TYPE_ABUSE_OF_FUNCTIONALITY"}]}}],"service_policies_from_namespace":{},"round_robin":{},"multi_lb_app":{}}}' -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/http_loadbalancers'
        

curl response:

          HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:08:42 GMT
Vary: Accept-Encoding
X-Volterra-Response-Fields-Deprecated: spec.jwt_validation.jwks

{
  "metadata": {
    "name": "productpage",
    "namespace": "documentation",
    "labels": {
      "ves.io/app_type": "bookinfo"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "fe514a5d-e6b7-4af7-a42f-1b9478a7a2a0",
    "creation_timestamp": "2024-03-21T14:08:42.253468Z",
    "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"
    ],
    "https": {
      "http_redirect": false,
      "add_hsts": false,
      "tls_cert_params": {
        "tls_config": {
          "default_security": {

          }
        },
        "certificates": [
          {
            "tenant": "acmecorp",
            "namespace": "documentation",
            "name": "cert1"
          }
        ],
        "no_mtls": {

        }
      },
      "enable_path_normalize": {

      },
      "port": 0,
      "header_transformation_type": {
        "default_header_transformation": {

        }
      },
      "connection_idle_timeout": 0,
      "http_protocol_options": null
    },
    "downstream_tls_certificate_expiration_timestamps": [
    ],
    "advertise_on_public_default_vip": {

    },
    "default_route_pools": [
      {
        "pool": {
          "tenant": "acmecorp",
          "namespace": "documentation",
          "name": "ppage-route"
        },
        "weight": 0,
        "priority": 0,
        "endpoint_subsets": {
        }
      }
    ],
    "origin_server_subset_rule_list": null,
    "routes": [
    ],
    "cors_policy": null,
    "disable_waf": {

    },
    "add_location": false,
    "no_challenge": {

    },
    "more_option": null,
    "user_id_client_ip": {

    },
    "disable_rate_limit": {

    },
    "malicious_user_mitigation": null,
    "waf_exclusion_rules": [
      {
        "path_regex": "",
        "methods": [
          "ANY"
        ],
        "expiration_timestamp": null,
        "metadata": {
          "name": "name",
          "description": "",
          "disable": false
        },
        "app_firewall_detection_control": {
          "exclude_signature_contexts": [
            {
              "signature_id": 10000000,
              "context": "CONTEXT_ANY",
              "context_name": ""
            }
          ],
          "exclude_violation_contexts": [
            {
              "exclude_violation": "VIOL_ASM_COOKIE_MODIFIED",
              "context": "CONTEXT_ANY",
              "context_name": ""
            }
          ],
          "exclude_attack_type_contexts": [
            {
              "exclude_attack_type": "ATTACK_TYPE_ABUSE_OF_FUNCTIONALITY",
              "context": "CONTEXT_ANY",
              "context_name": ""
            }
          ],
          "exclude_bot_name_contexts": [
          ]
        }
      }
    ],
    "data_guard_rules": [
    ],
    "blocked_clients": [
    ],
    "trusted_clients": [
    ],
    "api_protection_rules": null,
    "ddos_mitigation_rules": [
    ],
    "service_policies_from_namespace": {

    },
    "round_robin": {

    },
    "disable_trust_client_ip_headers": {

    },
    "multi_lb_app": {

    },
    "disable_ddos_detection": {

    },
    "disable_malicious_user_detection": {

    },
    "disable_api_discovery": {

    },
    "disable_api_definition": {

    },
    "csrf_policy": null,
    "graphql_rules": [
    ],
    "protected_cookies": [
    ],
    "host_name": "",
    "dns_info": [
    ],
    "state": "VIRTUAL_HOST_READY",
    "auto_cert_info": null,
    "internet_vip_info": [
    ],
    "jwt_validation": null,
    "disable_threat_intelligence": {

    },
    "l7_ddos_action_default": {

    },
    "cert_state": "AutoCertDisabled"
  }
}