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_parameters":{"tls_config":{"default_security":{}},"tls_certificates":[{"certificate_url":"string:///\u003cBase64\u003e","private_key":{"blindfold_secret_info":{"location":"string:///\u003cBase64\u003e"}}}],"no_mtls":{}},"enable_path_normalize":{}},"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,"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": "9930a837-fe43-4a88-95de-9360bc97c3cc",
    "creation_timestamp": "2022-07-28T12:14:38.420684335Z",
    "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_parameters": {
        "tls_config": {
          "default_security": {

          }
        },
        "tls_certificates": [
          {
            "certificate_url": "string:///\u003cBase64\u003e",
            "private_key": {
              "blindfold_secret_info": {
                "decryption_provider": "",
                "store_provider": "",
                "location": "string:///\u003cBase64\u003e"
              },
              "blindfold_secret_info_internal": null,
              "secret_encoding_type": "EncodingNone"
            },
            "description": ""
          }
        ],
        "no_mtls": {

        }
      },
      "enable_path_normalize": {

      },
      "port": 0
    },
    "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": {
        }
      }
    ],
    "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"
        ],
        "exclude_rule_ids": [
        ],
        "expiration_timestamp": null,
        "metadata": {
          "name": "name",
          "description": "",
          "disable": false
        },
        "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"
            }
          ],
          "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_api_definition": {

    },
    "host_name": "",
    "dns_info": [
    ],
    "state": "VIRTUAL_HOST_READY",
    "auto_cert_info": null
  }
}```
`

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_parameters":{"tls_config":{"default_security":{}},"tls_certificates":[{"certificate_url":"string:///\u003cBase64\u003e","private_key":{"blindfold_secret_info":{"location":"string:///\u003cBase64\u003e"}}}],"no_mtls":{}},"enable_path_normalize":{}},"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,"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=_tmp_go-build1372770011_b001_apidocs.test/host=docker-desktop' '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, 28 Jul 2022 12:14:38 GMT Vary: Accept-Encoding

{ "metadata": { "name": "productpage", "namespace": "documentation", "labels": { "ves.io/app_type": "bookinfo" }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "9930a837-fe43-4a88-95de-9360bc97c3cc", "creation_timestamp": "2022-07-28T12:14:38.420684335Z", "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_parameters": { "tls_config": { "default_security": {

      }
    },
    "tls_certificates": [
      {
        "certificate_url": "string:///\u003cBase64\u003e",
        "private_key": {
          "blindfold_secret_info": {
            "decryption_provider": "",
            "store_provider": "",
            "location": "string:///\u003cBase64\u003e"
          },
          "blindfold_secret_info_internal": null,
          "secret_encoding_type": "EncodingNone"
        },
        "description": ""
      }
    ],
    "no_mtls": {

    }
  },
  "enable_path_normalize": {

  },
  "port": 0
},
"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": {
    }
  }
],
"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"
    ],
    "exclude_rule_ids": [
    ],
    "expiration_timestamp": null,
    "metadata": {
      "name": "name",
      "description": "",
      "disable": false
    },
    "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"
        }
      ],
      "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_api_definition": {

},
"host_name": "",
"dns_info": [
],
"state": "VIRTUAL_HOST_READY",
"auto_cert_info": null

} }