From 1bd96e3507f078c2e0e5b757c04a519999d083be Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Mon, 4 Nov 2019 11:48:47 +0100 Subject: [PATCH 001/121] BUG/MINOR: Fix tracked field in stats It used to be type integer, making it unparsable, now it is string --- build/haproxy_spec.yaml | 3 +-- models/stats.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 9e051f6..d1f75e2 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2365,10 +2365,9 @@ definitions: type: server x-nullable: true tracked: - type: integer + type: string x-dependency: type: server - x-nullable: true ttime: type: integer x-dependency: diff --git a/models/stats.yaml b/models/stats.yaml index 3e53b6f..cc0e4f7 100644 --- a/models/stats.yaml +++ b/models/stats.yaml @@ -162,8 +162,7 @@ native: x-dependency: type: [server, backend] tracked: - type: integer - x-nullable: true + type: string x-dependency: type: server rate: From 776471d8c2773e607fc9632c8ddb0ac5e4ef9011 Mon Sep 17 00:00:00 2001 From: Hrvoje Marjanovic Date: Mon, 18 Nov 2019 10:46:38 +0100 Subject: [PATCH 002/121] DOC: Clarify build of MacOS users. --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96ccb77..4d54802 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,22 @@ This is the [OpenAPI 2.0 (fka Swagger)](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) specification for the [HAProxy Data Plane API project](https://github.com/haproxytech/dataplaneapi) -## Contributing +## Contributing -When contributing change files located it paths/ and models/ directories and the haproxy-spec.yaml, and then build the resulting one-file spec using the build binary in build directory: +When contributing, change files located in paths/ and models/ directories and the haproxy-spec.yaml, and then build the resulting one-file spec `build/haproxy_spec.yaml`. -``` +On linux, use the `build` binary: + +```bash +cd build ./build -file ../haproxy-spec.yaml > haproxy_spec.yaml ``` +On MacOS, you will need golang installed: + +```bash +cd build +go run build.go -file ../haproxy-spec.yaml > haproxy_spec.yaml +``` + For commit messages and general style please follow the haproxy project's [CONTRIBUTING guide](https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING) and use that where applicable. From 69b28f8f34f439745e470bb11d87b8798fe6da34 Mon Sep 17 00:00:00 2001 From: Hrvoje Marjanovic Date: Mon, 11 Nov 2019 13:10:58 +0100 Subject: [PATCH 003/121] CLEANUP: Editorconfig setup. --- .editorconfig | 7 + models/configuration.yaml | 334 +++++++++++++++++++------------------- models/general.yaml | 4 +- models/runtime.yaml | 4 +- models/simple.yaml | 20 +-- paths/configuration.yaml | 2 +- paths/simple.yaml | 2 +- 7 files changed, 190 insertions(+), 183 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..54a0cd3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +# don't look above this dir +root = true + +[**.{yaml,yml}] +indent_style = space +indent_style = 2 +trim_trailing_whitespace = true diff --git a/models/configuration.yaml b/models/configuration.yaml index 551a332..6e815d7 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -54,7 +54,7 @@ global: type: array x-display-name: Runtime APIs x-go-name: RuntimeAPIs - items: + items: type: object x-go-name: RuntimeAPI required: @@ -84,7 +84,7 @@ defaults: description: HAProxy defaults configuration type: object properties: - mode: + mode: type: string enum: [tcp, http] balance: @@ -133,7 +133,7 @@ defaults: log_separate_errors: type: string enum: [enabled, disabled] - clitcpka: + clitcpka: type: string enum: [enabled, disabled] x-display-name: Client TCP Keep Alive @@ -188,7 +188,7 @@ defaults: default_backend: type: string pattern: '^[A-Za-z0-9-_.:]+$' - x-dynamic-enum: + x-dynamic-enum: operation: getBackends property: name default_server: @@ -216,20 +216,20 @@ frontend: httplog: type: boolean x-display-name: HTTP Log - x-dependency: - mode: + x-dependency: + mode: value: http clflog: type: boolean x-display-name: CLF Log - x-dependency: - mode: + x-dependency: + mode: value: http tcplog: type: boolean x-display-name: TCP Log - x-dependency: - mode: + x-dependency: + mode: value: tcp log_format: type: string @@ -249,8 +249,8 @@ frontend: http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] - x-dependency: - mode: + x-dependency: + mode: value: http client_timeout: type: integer @@ -258,14 +258,14 @@ frontend: http_request_timeout: type: integer x-nullable: true - x-dependency: - mode: + x-dependency: + mode: value: http http_keep_alive_timeout: type: integer x-nullable: true - x-dependency: - mode: + x-dependency: + mode: value: http maxconn: type: integer @@ -279,26 +279,26 @@ frontend: default_backend: type: string pattern: '^[A-Za-z0-9-_.:]+$' - x-dynamic-enum: + x-dynamic-enum: operation: getBackends property: name contstats: type: string enum: [enabled] x-display-name: Continous Statistics - clitcpka: + clitcpka: type: string enum: [enabled, disabled] x-display-name: Client TCP Keep Alive - x-dependency: - mode: + x-dependency: + mode: value: tcp http-use-htx: type: string enum: [enabled, disabled] x-display-name: HTTP Use HTX - x-dependency: - mode: + x-dependency: + mode: value: http additionalProperties: false example: @@ -341,14 +341,14 @@ backend: http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] - x-dependency: - mode: + x-dependency: + mode: value: http http_pretend_keepalive: type: string enum: [enabled, disabled] - x-dependency: - mode: + x-dependency: + mode: value: http forwardfor: $ref: "#/definitions/forwardfor" @@ -357,9 +357,9 @@ backend: value: http cookie: $ref: '#/definitions/cookie' - x-dependency: - mode: - value: http + x-dependency: + mode: + value: http default_server: $ref: "#/definitions/default_server" check_timeout: @@ -390,8 +390,8 @@ backend: http_request_timeout: type: integer x-nullable: true - x-dependency: - mode: + x-dependency: + mode: value: http http_keep_alive_timeout: type: integer @@ -440,18 +440,18 @@ backend: http-use-htx: type: string enum: [enabled, disabled] - x-dependency: - mode: + x-dependency: + mode: value: http additionalProperties: false example: name: test_backend mode: http - balance: + balance: algorithm: roundrobin - forwardfor: + forwardfor: enabled: enabled - httpchk: + httpchk: uri: "/check" method: OPTIONS version: HTTP/1.1 @@ -488,15 +488,15 @@ bind: ssl_certificate: type: string pattern: '^[^\s]+$' - x-dependency: - ssl: + x-dependency: + ssl: value: true ssl_cafile: type: string x-display-name: SSL CA File pattern: '^[^\s]+$' - x-dependency: - ssl: + x-dependency: + ssl: value: true alpn: type: string @@ -616,21 +616,21 @@ server: ssl_certificate: type: string pattern: '^[^\s]+$' - x-dependency: - ssl: + x-dependency: + ssl: value: enabled ssl_cafile: type: string x-display-name: SSL CA File pattern: '^[^\s]+$' - x-dependency: - ssl: + x-dependency: + ssl: value: enabled tls_tickets: type: string enum: [enabled, disabled] - x-dependency: - ssl: + x-dependency: + ssl: value: enabled verify: type: string @@ -665,51 +665,51 @@ http_request_rule: type: string x-display-name: Authentication Realm pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: auth redir_type: type: string x-display-name: Redirect Type enum: [location, prefix, scheme] - x-dependency: - type: + x-dependency: + type: value: redirect required: true redir_value: type: string x-display-name: Redirect Value pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: redirect required: true redir_code: type: integer x-display-name: Redirect Code enum: [301, 302, 303] - x-dependency: - type: + x-dependency: + type: value: redirect redir_option: type: string x-display-name: Redirect Option - x-dependency: - type: + x-dependency: + type: value: redirect required: true deny_status: type: integer x-nullable: false - x-dependency: - type: + x-dependency: + type: value: [deny, tarpit] hdr_name: type: string x-display-name: Header Name pattern: '^[^\s]+$' x-dependency: - type: + type: value: [add-header, replace-header, del-header, set-header, replace-value] required: true hdr_match: @@ -717,7 +717,7 @@ http_request_rule: x-display-name: Header Match pattern: '^[^\s]+$' x-dependency: - type: + type: value: [replace-header, replace-value] required: true hdr_format: @@ -725,14 +725,14 @@ http_request_rule: x-display-name: Header Format pattern: '^[^\s]+$' x-dependency: - type: + type: value: [replace-header, replace-value, set-header, add-header] required: true log_level: type: string enum: [emerg, alert, crit, err, warning, notice, info, debug, silent] - x-dependency: - type: + x-dependency: + type: value: set-log-level required: true path_fmt: @@ -744,22 +744,22 @@ http_request_rule: var_name: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: set-var required: true var_scope: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: set-var required: true var_expr: type: string x-display-name: Var Expression - x-dependency: - type: + x-dependency: + type: value: set-var required: true query-fmt: @@ -778,16 +778,16 @@ http_request_rule: type: string x-display-name: SPOE Engine pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: send-spoe-group required: true spoe_group: type: string x-display-name: SPOE Group pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: send-spoe-group required: true acl_file: @@ -795,7 +795,7 @@ http_request_rule: x-display-name: ACL File pattern: '^[^\s]+$' x-dependency: - type: + type: value: [add-acl, del-acl] required: true acl_keyfmt: @@ -803,7 +803,7 @@ http_request_rule: x-display-name: ACL Key Format pattern: '^[^\s]+$' x-dependency: - type: + type: value: [add-acl, del-acl] required: true cond: @@ -817,8 +817,8 @@ http_request_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: - cond: + x-dependency: + cond: required: true additionalProperties: false example: @@ -847,30 +847,30 @@ http_response_rule: type: string x-display-name: Redirect Type enum: [location, prefix, scheme] - x-dependency: - type: + x-dependency: + type: value: redirect required: true redir_value: type: string x-display-name: Redirect Value pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: redirect required: true redir_code: type: integer x-display-name: Redirect Code enum: [301, 302, 303] - x-dependency: - type: + x-dependency: + type: value: redirect redir_option: type: string x-display-name: Redirect Option - x-dependency: - type: + x-dependency: + type: value: redirect required: true hdr_name: @@ -878,7 +878,7 @@ http_response_rule: x-display-name: Header Name pattern: '^[^\s]+$' x-dependency: - type: + type: value: [add-header, replace-header, del-header, set-header, replace-value] required: true hdr_match: @@ -886,7 +886,7 @@ http_response_rule: x-display-name: Header Match pattern: '^[^\s]+$' x-dependency: - type: + type: value: [replace-header, replace-value] required: true hdr_format: @@ -894,35 +894,35 @@ http_response_rule: x-display-name: Header Format pattern: '^[^\s]+$' x-dependency: - type: + type: value: [replace-header, replace-value, set-header, add-header] required: true log_level: type: string enum: [emerg, alert, crit, err, warning, notice, info, debug, silent] - x-dependency: - type: + x-dependency: + type: value: set-log-level required: true var_name: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: set-var required: true var_scope: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: set-var required: true var_expr: type: string x-display-name: Var Expression - x-dependency: - type: + x-dependency: + type: value: set-var required: true status: @@ -930,42 +930,42 @@ http_response_rule: minimum: 100 maximum: 999 x-nullable: false - x-dependency: - type: + x-dependency: + type: value: set-status required: true status_reason: type: string - x-dependency: - type: + x-dependency: + type: value: set-status spoe_engine: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: send-spoe-group required: true spoe_group: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: send-spoe-group required: true acl_file: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: [add-acl, del-acl] required: true acl_keyfmt: type: string x-display-name: ACK Key Format pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: [add-acl, del-acl] required: true cond: @@ -979,8 +979,8 @@ http_response_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: - cond: + x-dependency: + cond: required: true additionalProperties: false example: @@ -1005,27 +1005,27 @@ tcp_request_rule: type: string enum: [connection, content, inspect-delay, session] x-nullable: false - action: + action: type: string enum: [accept, reject] x-nullable: false - x-dependency: - type: + x-dependency: + type: value: [connection, content, session] required: true timeout: type: integer x-nullable: true - x-dependency: - type: + x-dependency: + type: value: inspect-delay required: true cond: type: string x-display-name: Condition enum: [if, unless] - x-dependency: - type: + x-dependency: + type: value: [connection, content, session] cond_test: type: string @@ -1034,8 +1034,8 @@ tcp_request_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: - cond: + x-dependency: + cond: required: true type: value: [connection, content, session] @@ -1061,27 +1061,27 @@ tcp_response_rule: type: string enum: [content, inspect-delay] x-nullable: false - action: + action: type: string enum: [accept, reject] x-nullable: false - x-dependency: - type: + x-dependency: + type: value: content required: true timeout: type: integer x-nullable: true - x-dependency: - type: + x-dependency: + type: value: inspect-delay required: true cond: type: string x-display-name: Condition enum: [if, unless] - x-dependency: - type: + x-dependency: + type: value: content cond_test: type: string @@ -1090,10 +1090,10 @@ tcp_response_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: + x-dependency: cond: required: true - type: + type: value: content additionalProperties: false example: @@ -1131,7 +1131,7 @@ backend_switching_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: + x-dependency: cond: required: true additionalProperties: false @@ -1169,7 +1169,7 @@ server_switching_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: + x-dependency: cond: required: true additionalProperties: false @@ -1196,44 +1196,44 @@ filter: trace_name: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: trace trace_rnd_parsing: type: boolean x-display-name: Trace Random Parsing - x-dependency: - type: + x-dependency: + type: value: trace trace_rnd_forwarding: type: boolean x-display-name: Trace Random Forwarding - x-dependency: - type: + x-dependency: + type: value: trace trace_hexdump: type: boolean - x-dependency: - type: + x-dependency: + type: value: trace spoe_engine: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: spoe spoe_config: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: spoe required: true cache_name: type: string pattern: '^[^\s]+$' - x-dependency: - type: + x-dependency: + type: value: cache required: true additionalProperties: false @@ -1276,7 +1276,7 @@ stick_rule: operation: getACLs property: acl_name freeFormat: true - x-dependency: + x-dependency: cond: required: true additionalProperties: false @@ -1284,7 +1284,7 @@ stick_rule: id: 0 type: storeonly pattern: src -log_target: +log_target: title: Log Target description: Per-instance logging of events and traffic. type: object @@ -1301,60 +1301,60 @@ log_target: address: type: string pattern: '^[^\s]+$' - x-dependency: - global: + x-dependency: + global: value: false required: true - nolog: + nolog: value: false required: true length: type: integer - x-dependency: - global: + x-dependency: + global: value: false - nolog: + nolog: value: false format: type: string enum: [rfc3164, rfc5424, short, raw] - x-dependency: - global: + x-dependency: + global: value: false - nolog: + nolog: value: false facility: type: string enum: [kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, auth2, ftp, ntp, audit, alert, cron2, local0,local1, local2, local3, local4, local5, local6, local7] - x-dependency: - global: + x-dependency: + global: value: false required: true - nolog: + nolog: value: false required: true level: type: string enum: [emerg, alert, crit, err, warning, notice, info, debug] - x-dependency: - global: + x-dependency: + global: value: false - nolog: + nolog: value: false minlevel: type: string enum: [emerg, alert, crit, err, warning, notice, info, debug] - x-dependency: - global: + x-dependency: + global: value: false - nolog: + nolog: value: false level: required: false additionalProperties: false acl: title: ACL Lines - description: | + description: | The use of Access Control Lists (ACL) provides a flexible solution to perform content switching and generally to take decisions based on content extracted from the request, the response or any environmental status. @@ -1368,7 +1368,7 @@ acl: id: type: integer x-nullable: true - acl_name: + acl_name: type: string pattern: '^[^\s]+$' x-nullable: false @@ -1528,7 +1528,7 @@ errorfile: type: object x-display-name: Error File properties: - code: + code: type: integer enum: [200, 400, 403, 405, 408, 425, 429, 500, 502, 503, 504] file: diff --git a/models/general.yaml b/models/general.yaml index 959c983..796c0fc 100644 --- a/models/general.yaml +++ b/models/general.yaml @@ -84,7 +84,7 @@ transaction: id: type: string pattern: '^[^\s]+$' - status: + status: type: string enum: [failed, in_progress, success] _version: @@ -103,7 +103,7 @@ reload: pattern: '^\d{4}-\d{2}-\d{2}-\d+$' reload_timestamp: type: integer - status: + status: type: string enum: [failed, in_progress, succeeded] response: diff --git a/models/runtime.yaml b/models/runtime.yaml index 569bd0f..b3b0362 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -2,7 +2,7 @@ process_infos: title: HAProxy Information description: General HAProxy process information type: array - items: + items: type: object x-go-name: ProcessInfo properties: @@ -57,7 +57,7 @@ process_infos: pool_failed: type: integer x-nullable: true - ulimit_n: + ulimit_n: type: integer x-nullable: true max_sock: diff --git a/models/simple.yaml b/models/simple.yaml index 1e6f310..cb26463 100644 --- a/models/simple.yaml +++ b/models/simple.yaml @@ -3,13 +3,13 @@ site: description: | Site configuration. Sites are considered as one service and all farms connected to that service. Farms are connected to service using use-backend and default_backend directives. Sites let you - configure simple HAProxy configurations, for more advanced options use /haproxy/configuration + configure simple HAProxy configurations, for more advanced options use /haproxy/configuration endpoints. type: object required: - name properties: - name: + name: type: string pattern: '^[A-Za-z0-9-_.:]+$' x-nullable: false @@ -24,7 +24,7 @@ site: x-display-name: HTTP Connection Mode enum: [http-tunnel, httpclose, forced-close, http-server-close, http-keep-alive] x-dependency: - mode: + mode: value: http maxconn: type: integer @@ -47,7 +47,7 @@ site: type: string pattern: '^[A-Za-z0-9-_.:]+$' x-nullable: false - use_as: + use_as: type: string enum: [default, conditional] x-nullable: false @@ -56,14 +56,14 @@ site: x-display-name: Condition enum: [if, unless] x-dependency: - use_as: + use_as: value: conditional required: true cond_test: type: string x-display-name: Condition Test x-dependency: - use_as: + use_as: value: conditional required: true balance: @@ -73,9 +73,9 @@ site: enum: [http, tcp] forwardfor: $ref: "#/definitions/forwardfor" - servers: + servers: type: array - items: + items: $ref: "#/definitions/server" additionalProperties: false example: @@ -94,10 +94,10 @@ site: farms: - name: www_backend use_as: default - balance: + balance: algorithm: roundrobin mode: http - servers: + servers: - name: www_server address: 127.0.1.1 port: 4567 diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 3744d86..8a2b194 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -2516,7 +2516,7 @@ stick_rules: $ref: '#/responses/DefaultError' stick_rules_one: get: - summary: Return one Stick Rule + summary: Return one Stick Rule description: Returns one Stick Rule configuration by it's ID in the specified backend. operationId: getStickRule tags: diff --git a/paths/simple.yaml b/paths/simple.yaml index ef96eca..98cd850 100644 --- a/paths/simple.yaml +++ b/paths/simple.yaml @@ -73,7 +73,7 @@ sites_one: description: Site frontend name required: true type: string - - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/transaction_id" responses: '200': description: Successful operation From e87c6f1030a7da5811d402051bae304a8ee9f6bc Mon Sep 17 00:00:00 2001 From: Hrvoje Marjanovic Date: Mon, 11 Nov 2019 13:44:46 +0100 Subject: [PATCH 004/121] MINOR: backend: add abortonclose option --- build/haproxy_spec.yaml | 10 ++++++++++ models/configuration.yaml | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index d1f75e2..78ca83d 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -234,6 +234,11 @@ definitions: additionalProperties: false description: HAProxy defaults configuration properties: + abortonclose: + enum: + - enabled + - disabled + type: string adv_check: enum: - ssl-hello-chk @@ -516,6 +521,11 @@ definitions: mode: http name: test_backend properties: + abortonclose: + enum: + - enabled + - disabled + type: string adv_check: enum: - ssl-hello-chk diff --git a/models/configuration.yaml b/models/configuration.yaml index 6e815d7..32da341 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -105,6 +105,9 @@ defaults: http_pretend_keepalive: type: string enum: [enabled, disabled] + abortonclose: + type: string + enum: [enabled, disabled] http-use-htx: type: string enum: [enabled, disabled] @@ -350,6 +353,9 @@ backend: x-dependency: mode: value: http + abortonclose: + type: string + enum: [enabled, disabled] forwardfor: $ref: "#/definitions/forwardfor" x-dependency: From 2f776ad15c9bf57f5e8ff5aaa3ea0d1023f1feda Mon Sep 17 00:00:00 2001 From: Hrvoje Marjanovic Date: Mon, 11 Nov 2019 13:53:25 +0100 Subject: [PATCH 005/121] CLEANUP: config: Remove duplicate forwardfor yaml key --- models/configuration.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/models/configuration.yaml b/models/configuration.yaml index 32da341..f48b64e 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -181,8 +181,6 @@ defaults: type: string pattern: '^[^\s]+$' x-display-name: External Check Command - forwardfor: - $ref: "#/definitions/forwardfor" redispatch: $ref: "#/definitions/redispatch" retries: From f865a1889c283a47f11092abac2746ce0705c872 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Tue, 3 Dec 2019 01:03:00 +0100 Subject: [PATCH 006/121] MINOR: server: add support for init-addr --- build/haproxy_spec.yaml | 6 ++++++ models/configuration.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 78ca83d..f0aea8f 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -834,6 +834,9 @@ definitions: minimum: 1 type: integer x-nullable: true + init-addr: + pattern: ^[^\s]+$ + type: string inter: type: integer x-nullable: true @@ -3094,6 +3097,9 @@ definitions: fastinter: type: integer x-nullable: true + init-addr: + pattern: ^[^\s]+$ + type: string inter: type: integer x-nullable: true diff --git a/models/configuration.yaml b/models/configuration.yaml index f48b64e..198bfec 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -556,6 +556,9 @@ server: weight: type: integer x-nullable: true + init-addr: + pattern: ^[^\s]+$ + type: string inter: type: integer x-nullable: true @@ -1387,6 +1390,9 @@ acl: default_server: type: object properties: + init-addr: + pattern: ^[^\s]+$ + type: string inter: type: integer x-nullable: true From 5d0a0dc3f42b250ec5fd4ba2c882ad04611d5e73 Mon Sep 17 00:00:00 2001 From: Hrvoje Marjanovic Date: Mon, 25 Nov 2019 16:20:08 +0100 Subject: [PATCH 007/121] MINOR: testing: Run yamllint on push Regenerate spec to fix linting errors. Fix linting errors in source files. Add .gitlab-ci.yml Add yaml document start --- .github/workflows/compare_build.yml | 13 +++++++++++++ .github/workflows/lint.yml | 12 ++++++++++++ .gitlab-ci.yml | 23 +++++++++++++++++++++++ .yamllint.yml | 14 ++++++++++++++ build/haproxy_spec.yaml | 9 +++++---- models/configuration.yaml | 28 ++++++++++++++-------------- models/errors.yaml | 1 + models/general.yaml | 1 + models/runtime.yaml | 1 + models/simple.yaml | 1 + models/stats.yaml | 1 + paths/configuration.yaml | 1 + paths/general.yaml | 1 + paths/runtime.yaml | 1 + paths/simple.yaml | 1 + paths/stats.yaml | 1 + 16 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/compare_build.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .gitlab-ci.yml create mode 100644 .yamllint.yml diff --git a/.github/workflows/compare_build.yml b/.github/workflows/compare_build.yml new file mode 100644 index 0000000..9f5f9b3 --- /dev/null +++ b/.github/workflows/compare_build.yml @@ -0,0 +1,13 @@ +name: Compare build +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Compare + run: | + cd build + ./build -file ../haproxy-spec.yaml > haproxy_spec_to_compare.yaml + diff -u haproxy_spec.yaml haproxy_spec_to_compare.yaml + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..38d0733 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: Yaml Lint +on: [push, pull_request] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: yaml-lint + uses: ibiqlik/action-yamllint@master + with: + file_or_dir: . + config_file: .yamllint.yml \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..aad6784 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +--- +compare build: + image: + # I just like pinning things, this version is latest, not special in any way + name: alpine:3.10.3 + entrypoint: [""] + tags: + - docker + script: + # try building it and compare if resulting file is equal to what is commited. + - cd build + - ./build -file ../haproxy-spec.yaml > haproxy_spec_to_compare.yaml + - diff -u haproxy_spec_to_compare.yaml haproxy_spec.yaml + +yamllint: + image: + name: cytopia/yamllint:latest + entrypoint: [""] + tags: + - docker + script: + # to test locally, run: docker run --rm -v $(pwd):/data cytopia/yamllint . + - /bin/sh -c "yamllint -f colored ." diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..cb99c69 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,14 @@ +--- +extends: default + +ignore: | + build/ + +rules: + line-length: disable + trailing-spaces: + level: warning + new-line-at-end-of-file: + level: warning + empty-lines: + level: warning diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f0aea8f..b2ec513 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -16,10 +16,11 @@ externalDocs: definitions: site: additionalProperties: false - description: "Site configuration. Sites are considered as one service and all farms - connected to that service.\nFarms are connected to service using use-backend and - default_backend directives. Sites let you\nconfigure simple HAProxy configurations, - for more advanced options use /haproxy/configuration \nendpoints.\n" + description: | + Site configuration. Sites are considered as one service and all farms connected to that service. + Farms are connected to service using use-backend and default_backend directives. Sites let you + configure simple HAProxy configurations, for more advanced options use /haproxy/configuration + endpoints. example: farms: - balance: diff --git a/models/configuration.yaml b/models/configuration.yaml index 198bfec..3f54507 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -193,7 +193,7 @@ defaults: operation: getBackends property: name default_server: - $ref: "#/definitions/default_server" + $ref: "#/definitions/default_server" error_files: type: array x-go-name: ErrorFiles @@ -365,7 +365,7 @@ backend: mode: value: http default_server: - $ref: "#/definitions/default_server" + $ref: "#/definitions/default_server" check_timeout: type: integer x-nullable: true @@ -666,7 +666,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl ] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl] x-nullable: false auth_realm: type: string @@ -770,17 +770,17 @@ http_request_rule: value: set-var required: true query-fmt: - type: string - x-dependency: - type: - required: true - value: set-query + type: string + x-dependency: + type: + required: true + value: set-query uri-fmt: - type: string - x-dependency: - type: - required: true - value: set-uri + type: string + x-dependency: + type: + required: true + value: set-uri spoe_engine: type: string x-display-name: SPOE Engine @@ -1332,7 +1332,7 @@ log_target: value: false facility: type: string - enum: [kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, auth2, ftp, ntp, audit, alert, cron2, local0,local1, local2, local3, local4, local5, local6, local7] + enum: [kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, auth2, ftp, ntp, audit, alert, cron2, local0, local1, local2, local3, local4, local5, local6, local7] x-dependency: global: value: false diff --git a/models/errors.yaml b/models/errors.yaml index c097ac7..4ff4033 100644 --- a/models/errors.yaml +++ b/models/errors.yaml @@ -1,3 +1,4 @@ +--- error: title: Error description: API Error diff --git a/models/general.yaml b/models/general.yaml index 796c0fc..435db1b 100644 --- a/models/general.yaml +++ b/models/general.yaml @@ -1,3 +1,4 @@ +--- endpoint: title: Endpoint description: Endpoint definition diff --git a/models/runtime.yaml b/models/runtime.yaml index b3b0362..59169c4 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -1,3 +1,4 @@ +--- process_infos: title: HAProxy Information description: General HAProxy process information diff --git a/models/simple.yaml b/models/simple.yaml index cb26463..781b722 100644 --- a/models/simple.yaml +++ b/models/simple.yaml @@ -1,3 +1,4 @@ +--- site: title: Site description: | diff --git a/models/stats.yaml b/models/stats.yaml index cc0e4f7..1905580 100644 --- a/models/stats.yaml +++ b/models/stats.yaml @@ -1,3 +1,4 @@ +--- native_stats: x-go-name: NativeStats title: Stats Array diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 8a2b194..6a0b47e 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -1,3 +1,4 @@ +--- global: get: summary: Return a global part of configuration diff --git a/paths/general.yaml b/paths/general.yaml index 0f8ee15..d7cd071 100644 --- a/paths/general.yaml +++ b/paths/general.yaml @@ -1,3 +1,4 @@ +--- root: get: tags: diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 7745b81..815233c 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -1,3 +1,4 @@ +--- process_info: get: tags: diff --git a/paths/simple.yaml b/paths/simple.yaml index 98cd850..3074581 100644 --- a/paths/simple.yaml +++ b/paths/simple.yaml @@ -1,3 +1,4 @@ +--- sites: get: summary: Return an array of sites diff --git a/paths/stats.yaml b/paths/stats.yaml index 29d9d6c..3fc7899 100644 --- a/paths/stats.yaml +++ b/paths/stats.yaml @@ -1,3 +1,4 @@ +--- native: get: summary: Gets stats From 257b85d376d5bc65b4a3c8472dfc0f1c0713d7d0 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Mon, 9 Dec 2019 16:14:25 +0100 Subject: [PATCH 008/121] FEATURE/MINOR: Add capture option for http-request and http-response --- build/haproxy_spec.yaml | 39 +++++++++++++++++++++++++++++++++++ models/configuration.yaml | 43 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index b2ec513..51ab1f8 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -970,6 +970,28 @@ definitions: type: value: auth x-display-name: Authentication Realm + capture_id: + type: integer + x-dependency: + type: + required: true + value: capture + x-display-name: Capture SlotID + capture_len: + type: integer + x-dependency: + type: + required: true + value: capture + x-display-name: Capture Len + capture_sample: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: capture + x-display-name: Capture Sample cond: enum: - if @@ -1132,6 +1154,7 @@ definitions: - send-spoe-group - add-acl - del-acl + - capture type: string x-nullable: false uri-fmt: @@ -1203,6 +1226,21 @@ definitions: - add-acl - del-acl x-display-name: ACK Key Format + capture_id: + type: integer + x-dependency: + type: + required: true + value: capture + x-display-name: Capture SlotID + capture_sample: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: capture + x-display-name: Capture Sample cond: enum: - if @@ -1353,6 +1391,7 @@ definitions: - replace-value - add-acl - del-acl + - capture type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index 3f54507..4760c58 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -666,8 +666,30 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture] x-nullable: false + capture_sample: + pattern: '^[^\s]+$' + x-display-name: Capture Sample + type: string + x-dependency: + type: + value: capture + required: true + capture_len: + type: integer + x-display-name: Capture Len + x-dependency: + type: + value: capture + required: true + capture_id: + type: integer + x-display-name: Capture SlotID + x-dependency: + type: + value: capture + required: true auth_realm: type: string x-display-name: Authentication Realm @@ -848,8 +870,23 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture] x-nullable: false + capture_sample: + type: string + x-display-name: Capture Sample + pattern: '^[^\s]+$' + x-dependency: + type: + value: capture + required: true + capture_id: + type: integer + x-display-name: Capture SlotID + x-dependency: + type: + value: capture + required: true redir_type: type: string x-display-name: Redirect Type @@ -1578,4 +1615,4 @@ cookie: type: integer pattern: '^[^\d+$]' dynamic: - type: boolean \ No newline at end of file + type: boolean From bcdffa908e8816157787734bcb7bdeeb4a1002e9 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Tue, 17 Dec 2019 14:49:57 +0100 Subject: [PATCH 009/121] BUG/MINOR: make capture_id nullable --- build/haproxy_spec.yaml | 1 + models/configuration.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 51ab1f8..cbb5c74 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -977,6 +977,7 @@ definitions: required: true value: capture x-display-name: Capture SlotID + x-nullable: true capture_len: type: integer x-dependency: diff --git a/models/configuration.yaml b/models/configuration.yaml index 4760c58..5de2b60 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -685,6 +685,7 @@ http_request_rule: required: true capture_id: type: integer + x-nullable: true x-display-name: Capture SlotID x-dependency: type: From 1f5b7224afff4095cc10b99872a35832bfa8220b Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Wed, 18 Dec 2019 11:42:53 +0100 Subject: [PATCH 010/121] BUG/MINOR: http_response_rules: make capture_id nullable --- build/haproxy_spec.yaml | 1 + models/configuration.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index cbb5c74..a4364bf 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1234,6 +1234,7 @@ definitions: required: true value: capture x-display-name: Capture SlotID + x-nullable: true capture_sample: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index 5de2b60..691ca2c 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -883,6 +883,7 @@ http_response_rule: required: true capture_id: type: integer + x-nullable: true x-display-name: Capture SlotID x-dependency: type: From 21c54788e259ad7cffaeeb4609f983f1b55b8900 Mon Sep 17 00:00:00 2001 From: Jean-Louis Dupond Date: Mon, 27 Jan 2020 13:54:27 +0100 Subject: [PATCH 011/121] MINOR: server: Add SNI stuff --- build/haproxy_spec.yaml | 12 ++++++++++++ models/configuration.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index a4364bf..2b3cc9b 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -816,6 +816,9 @@ definitions: - enabled - disabled type: string + check-sni: + pattern: ^[^\s]+$ + type: string check-ssl: enum: - enabled @@ -884,6 +887,9 @@ definitions: - enabled - disabled type: string + sni: + pattern: ^[^\s]+$ + type: string ssl: enum: - enabled @@ -3125,6 +3131,9 @@ definitions: x-display-name: ForwardFor default_server: properties: + check-sni: + pattern: ^[^\s]+$ + type: string check-ssl: enum: - enabled @@ -3153,6 +3162,9 @@ definitions: rise: type: integer x-nullable: true + sni: + pattern: ^[^\s]+$ + type: string type: object httpchk: properties: diff --git a/models/configuration.yaml b/models/configuration.yaml index 691ca2c..9a9633f 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -614,9 +614,15 @@ server: send-proxy-v2: type: string enum: [enabled, disabled] + sni: + type: string + pattern: '^[^\s]+$' ssl: type: string enum: [enabled, disabled] + check-sni: + type: string + pattern: '^[^\s]+$' check-ssl: type: string enum: [enabled, disabled] @@ -1447,6 +1453,12 @@ default_server: fall: type: integer x-nullable: true + check-sni: + type: string + pattern: '^[^\s]+$' + sni: + type: string + pattern: '^[^\s]+$' check-ssl: type: string enum: [enabled, disabled] From 6f4c2f64013290de5004258692734648ea85bce3 Mon Sep 17 00:00:00 2001 From: Kashif Minhaj Date: Thu, 27 Feb 2020 14:42:19 +0530 Subject: [PATCH 012/121] MINOR: server: add proto option --- build/haproxy_spec.yaml | 3 +++ models/configuration.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 2b3cc9b..f0d1385 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -877,6 +877,9 @@ definitions: minimum: 1 type: integer x-nullable: true + proto: + pattern: ^[^\s]+$ + type: string send-proxy: enum: - enabled diff --git a/models/configuration.yaml b/models/configuration.yaml index 9a9633f..412e51f 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -596,6 +596,9 @@ server: x-nullable: true agent-send: type: string + proto: + type: string + pattern: '^[^\s]+$' maintenance: type: string enum: [enabled, disabled] From 614632bfb75adbe1160ead5a9a5b04e69abee259 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Mon, 16 Mar 2020 13:22:39 +0100 Subject: [PATCH 013/121] REFACTOR: Clean the inner objects in the spec --- build/haproxy_spec.yaml | 1394 +++++++++++++++++++-------------------- haproxy-spec.yaml | 8 + models/runtime.yaml | 411 ++++++------ models/stats.yaml | 799 +++++++++++----------- 4 files changed, 1300 insertions(+), 1312 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f0d1385..4ec00c3 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1962,63 +1962,11 @@ definitions: native_stats: description: HAProxy stats array items: - description: Stats from one runtime API - properties: - error: - type: string - runtimeAPI: - type: string - stats: - items: - $ref: '#/definitions/native_stat' - type: array - title: Stats collection - type: object - x-go-name: NativeStatsCollection + $ref: '#/definitions/native_stats_collection' title: Stats Array type: array - x-go-name: NativeStats native_stat: description: Current stats for one object. - example: - name: frontend_test - stats: - bin: 4326578 - bout: 889901290 - comp_byp: 0 - comp_in: 0 - comp_out: 0 - comp_rsp: 0 - conn_rate: 12 - conn_rate_max: 456 - conn_tot: 45682 - dcon: 0 - dreq: 4 - dresp: 1 - dses: 0 - ereq: 54 - hrsp_1xx: 0 - hrsp_2xx: 165 - hrsp_3xx: 12 - hrsp_4xx: 50 - hrsp_5xx: 4 - hrsp_other: 0 - iid: 0 - intercepted: 346 - mode: http - pid: 3204 - rate: 64 - rate_lim: 20000 - rate_max: 4000 - req_rate: 49 - req_rate_max: 3965 - req_total: 1254786 - scur: 129 - slim: 2000 - smax: 2000 - status: UP - stot: 12902 - type: frontend properties: backend_name: type: string @@ -2027,450 +1975,499 @@ definitions: name: type: string stats: - properties: - act: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - addr: - type: string - x-dependency: - type: server - agent_code: - type: integer - x-dependency: - type: server - x-nullable: true - agent_desc: - type: string - x-dependency: - type: server - agent_duration: - type: integer - x-dependency: - type: server - x-nullable: true - agent_fall: - type: integer - x-dependency: - type: server - x-nullable: true - agent_health: - type: integer - x-dependency: - type: server - x-nullable: true - agent_rise: - type: integer - x-dependency: - type: server - x-nullable: true - agent_status: - enum: - - UNK - - INI - - SOCKERR - - L40K - - L4TOUT - - L4CON - - L7OK - - L7STS - type: string - x-dependency: - type: server - algo: - type: string - x-dependency: - type: backend - bck: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - bin: - type: integer - x-nullable: true - bout: - type: integer - x-nullable: true - check_code: - type: integer - x-dependency: - type: server - x-nullable: true - check_desc: - type: string - x-dependency: - type: server - check_duration: - type: integer - x-dependency: - type: server - x-nullable: true - check_fall: - type: integer - x-dependency: - type: server - x-nullable: true - check_health: - type: integer - x-dependency: - type: server - x-nullable: true - check_rise: - type: integer - x-dependency: - type: server - x-nullable: true - check_status: - enum: - - UNK - - INI - - SOCKERR - - L40K - - L4TOUT - - L4CON - - L6OK - - L6TOUT - - L6RSP - - L7OK - - L7OKC - - L7TOUT - - L7RSP - - L7STS - type: string - x-dependency: - type: server - chkdown: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - chkfail: - type: integer - x-dependency: - type: server - x-nullable: true - cli_abrt: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - comp_byp: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - comp_in: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - comp_out: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - comp_rsp: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - conn_rate: - type: integer - x-dependency: - type: frontend - x-nullable: true - conn_rate_max: - type: integer - x-dependency: - type: frontend - x-nullable: true - conn_tot: - type: integer - x-dependency: - type: frontend - x-nullable: true - cookie: - type: string - x-dependency: - type: - - server - - backend - ctime: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - dcon: - type: integer - x-dependency: - type: frontend - x-nullable: true - downtime: - type: integer - x-dependency: - type: server - x-nullable: true - dreq: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - dresp: - type: integer - x-nullable: true - dses: - type: integer - x-dependency: - type: frontend - x-nullable: true - econ: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - ereq: - type: integer - x-dependency: - type: frontend - x-nullable: true - eresp: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - hanafail: - type: string - x-dependency: - type: server - hrsp_1xx: - type: integer - x-nullable: true - hrsp_2xx: - type: integer - x-nullable: true - hrsp_3xx: - type: integer - x-nullable: true - hrsp_4xx: - type: integer - x-nullable: true - hrsp_5xx: - type: integer - x-nullable: true - hrsp_other: - type: integer - x-nullable: true - iid: - type: integer - x-nullable: true - intercepted: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - lastchg: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - lastsess: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - lbtot: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - mode: - enum: - - tcp - - http - - health - - unknown - type: string - pid: - type: integer - x-nullable: true - qcur: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - qlimit: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - qmax: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - qtime: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - rate: - type: integer - x-nullable: true - rate_lim: - type: integer - x-dependency: - type: frontend - x-nullable: true - rate_max: - type: integer - x-nullable: true - req_rate: - type: integer - x-dependency: - type: frontend - x-nullable: true - req_rate_max: - type: integer - x-dependency: - type: frontend - x-nullable: true - req_tot: - type: integer - x-dependency: - type: - - frontend - - backend - x-nullable: true - rtime: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - scur: - type: integer - x-nullable: true - sid: - type: integer - x-dependency: - type: server - x-nullable: true - slim: - type: integer - x-nullable: true - smax: - type: integer - x-nullable: true - srv_abrt: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - status: - enum: - - UP - - DOWN - - NOLB - - MAINT - - no check - type: string - stot: - type: integer - x-nullable: true - throttle: - type: integer - x-dependency: - type: server - x-nullable: true - tracked: - type: string - x-dependency: - type: server - ttime: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - weight: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - wredis: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - wretr: - type: integer - x-dependency: - type: - - server - - backend - x-nullable: true - type: object - x-go-name: NativeStatStats + $ref: '#/definitions/native_stat_stats' type: enum: - - backend - - server - - frontend + - backend + - server + - frontend + type: string + title: Stats + type: object + native_stat_stats: + example: + bin: 4326578 + bout: 889901290 + comp_byp: 0 + comp_in: 0 + comp_out: 0 + comp_rsp: 0 + conn_rate: 12 + conn_rate_max: 456 + conn_tot: 45682 + dcon: 0 + dreq: 4 + dresp: 1 + dses: 0 + ereq: 54 + hrsp_1xx: 0 + hrsp_2xx: 165 + hrsp_3xx: 12 + hrsp_4xx: 50 + hrsp_5xx: 4 + hrsp_other: 0 + iid: 0 + intercepted: 346 + mode: http + pid: 3204 + rate: 64 + rate_lim: 20000 + rate_max: 4000 + req_rate: 49 + req_rate_max: 3965 + req_total: 1254786 + scur: 129 + slim: 2000 + smax: 2000 + status: UP + stot: 12902 + properties: + act: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + addr: + type: string + x-dependency: + type: server + agent_code: + type: integer + x-dependency: + type: server + x-nullable: true + agent_desc: + type: string + x-dependency: + type: server + agent_duration: + type: integer + x-dependency: + type: server + x-nullable: true + agent_fall: + type: integer + x-dependency: + type: server + x-nullable: true + agent_health: + type: integer + x-dependency: + type: server + x-nullable: true + agent_rise: + type: integer + x-dependency: + type: server + x-nullable: true + agent_status: + enum: + - UNK + - INI + - SOCKERR + - L40K + - L4TOUT + - L4CON + - L7OK + - L7STS + type: string + x-dependency: + type: server + algo: + type: string + x-dependency: + type: backend + bck: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + bin: + type: integer + x-nullable: true + bout: + type: integer + x-nullable: true + check_code: + type: integer + x-dependency: + type: server + x-nullable: true + check_desc: + type: string + x-dependency: + type: server + check_duration: + type: integer + x-dependency: + type: server + x-nullable: true + check_fall: + type: integer + x-dependency: + type: server + x-nullable: true + check_health: + type: integer + x-dependency: + type: server + x-nullable: true + check_rise: + type: integer + x-dependency: + type: server + x-nullable: true + check_status: + enum: + - UNK + - INI + - SOCKERR + - L40K + - L4TOUT + - L4CON + - L6OK + - L6TOUT + - L6RSP + - L7OK + - L7OKC + - L7TOUT + - L7RSP + - L7STS + type: string + x-dependency: + type: server + chkdown: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + chkfail: + type: integer + x-dependency: + type: server + x-nullable: true + cli_abrt: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + comp_byp: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + comp_in: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + comp_out: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + comp_rsp: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + conn_rate: + type: integer + x-dependency: + type: frontend + x-nullable: true + conn_rate_max: + type: integer + x-dependency: + type: frontend + x-nullable: true + conn_tot: + type: integer + x-dependency: + type: frontend + x-nullable: true + cookie: + type: string + x-dependency: + type: + - server + - backend + ctime: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + dcon: + type: integer + x-dependency: + type: frontend + x-nullable: true + downtime: + type: integer + x-dependency: + type: server + x-nullable: true + dreq: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + dresp: + type: integer + x-nullable: true + dses: + type: integer + x-dependency: + type: frontend + x-nullable: true + econ: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + ereq: + type: integer + x-dependency: + type: frontend + x-nullable: true + eresp: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + hanafail: + type: string + x-dependency: + type: server + hrsp_1xx: + type: integer + x-nullable: true + hrsp_2xx: + type: integer + x-nullable: true + hrsp_3xx: + type: integer + x-nullable: true + hrsp_4xx: + type: integer + x-nullable: true + hrsp_5xx: + type: integer + x-nullable: true + hrsp_other: + type: integer + x-nullable: true + iid: + type: integer + x-nullable: true + intercepted: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + lastchg: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + lastsess: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + lbtot: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + mode: + enum: + - tcp + - http + - health + - unknown + type: string + pid: + type: integer + x-nullable: true + qcur: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + qlimit: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + qmax: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + qtime: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + rate: + type: integer + x-nullable: true + rate_lim: + type: integer + x-dependency: + type: frontend + x-nullable: true + rate_max: + type: integer + x-nullable: true + req_rate: + type: integer + x-dependency: + type: frontend + x-nullable: true + req_rate_max: + type: integer + x-dependency: + type: frontend + x-nullable: true + req_tot: + type: integer + x-dependency: + type: + - frontend + - backend + x-nullable: true + rtime: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + scur: + type: integer + x-nullable: true + sid: + type: integer + x-dependency: + type: server + x-nullable: true + slim: + type: integer + x-nullable: true + smax: + type: integer + x-nullable: true + srv_abrt: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + status: + enum: + - UP + - DOWN + - NOLB + - MAINT + - no check type: string - title: Stats + stot: + type: integer + x-nullable: true + throttle: + type: integer + x-dependency: + type: server + x-nullable: true + tracked: + type: string + x-dependency: + type: server + ttime: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + weight: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + wredis: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + wretr: + type: integer + x-dependency: + type: + - server + - backend + x-nullable: true + type: object + native_stats_collection: + description: Stats from one runtime API + properties: + error: + type: string + runtimeAPI: + type: string + stats: + items: + $ref: '#/definitions/native_stat' + type: array + title: Stats collection type: object - x-go-name: NativeStat error: additionalProperties: type: string @@ -2509,218 +2506,211 @@ definitions: $ref: '#/definitions/endpoint' process_infos: description: General HAProxy process information - example: - haproxy: - address: 127.0.0.1 - pid: 1234 - processes: 4 - release_date: "2016-03-11" - time: "2018-07-02T12:00:00.124Z" - uptime: 8 - version: 1.7-dev1-868ab3-148 items: - properties: - error: - type: string - info: - properties: - active_peers: - type: integer - x-nullable: true - busy_polling: - type: integer - x-nullable: true - bytes_out_rate: - type: integer - x-nullable: true - compress_bps_in: - type: integer - x-nullable: true - compress_bps_out: - type: integer - x-nullable: true - compress_bps_rate_lim: - type: integer - x-nullable: true - conn_rate: - type: integer - x-nullable: true - conn_rate_limit: - type: integer - x-nullable: true - connected_peers: - type: integer - x-nullable: true - cum_conns: - type: integer - x-nullable: true - cum_req: - type: integer - x-nullable: true - cum_ssl_conns: - type: integer - x-nullable: true - curr_conns: - type: integer - x-nullable: true - curr_ssl_conns: - type: integer - x-nullable: true - dropped_logs: - type: integer - x-nullable: true - failed_resolutions: - type: integer - x-nullable: true - hard_max_conn: - type: integer - x-nullable: true - idle_pct: - type: integer - x-nullable: true - jobs: - type: integer - x-nullable: true - listeners: - type: integer - x-nullable: true - max_conn: - type: integer - x-nullable: true - max_conn_rate: - type: integer - x-nullable: true - max_pipes: - type: integer - x-nullable: true - max_sess_rate: - type: integer - x-nullable: true - max_sock: - type: integer - x-nullable: true - max_ssl_conns: - type: integer - x-nullable: true - max_ssl_rate: - type: integer - x-nullable: true - max_zlib_mem_usage: - type: integer - x-nullable: true - mem_max_mb: - type: integer - x-nullable: true - nbthread: - description: Number of threads - type: integer - x-display-name: Number of Threads - x-nullable: true - node: - type: string - pid: - description: Process id of the replying worker process - type: integer - x-display-name: PID - x-nullable: true - pipes_free: - type: integer - x-nullable: true - pipes_used: - type: integer - x-nullable: true - pool_alloc_mb: - type: integer - x-nullable: true - pool_failed: - type: integer - x-nullable: true - pool_used_mb: - type: integer - x-nullable: true - process_num: - description: Process number - type: integer - x-display-name: Process Number - x-nullable: true - processes: - description: Number of spawned processes - type: integer - x-display-name: Number of processes - x-nullable: true - release_date: - description: HAProxy version release date - format: date - type: string - run_queue: - type: integer - x-nullable: true - sess_rate: - type: integer - x-nullable: true - sess_rate_limit: - type: integer - x-nullable: true - ssl_backend_key_rate: - type: integer - x-nullable: true - ssl_backend_max_key_rate: - type: integer - x-nullable: true - ssl_cache_lookups: - type: integer - x-nullable: true - ssl_cache_misses: - type: integer - x-nullable: true - ssl_frontend_key_rate: - type: integer - x-nullable: true - ssl_frontend_max_key_rate: - type: integer - x-nullable: true - ssl_frontend_session_reuse: - type: integer - x-nullable: true - ssl_rate: - type: integer - x-nullable: true - ssl_rate_limit: - type: integer - x-nullable: true - stopping: - type: integer - x-nullable: true - tasks: - type: integer - x-nullable: true - total_bytes_out: - type: integer - x-nullable: true - ulimit_n: - type: integer - x-nullable: true - unstoppable: - type: integer - x-nullable: true - uptime: - description: HAProxy uptime in s - type: integer - x-nullable: true - version: - description: HAProxy version string - type: string - zlib_mem_usage: - type: integer - x-nullable: true - type: object - x-go-name: ProcessInfoItem - runtimeAPI: - type: string - type: object - x-go-name: ProcessInfo + $ref: '#/definitions/process_info' title: HAProxy Information type: array + process_info: + properties: + error: + type: string + info: + $ref: '#/definitions/process_info_item' + runtimeAPI: + type: string + type: object + process_info_item: + properties: + active_peers: + type: integer + x-nullable: true + busy_polling: + type: integer + x-nullable: true + bytes_out_rate: + type: integer + x-nullable: true + compress_bps_in: + type: integer + x-nullable: true + compress_bps_out: + type: integer + x-nullable: true + compress_bps_rate_lim: + type: integer + x-nullable: true + conn_rate: + type: integer + x-nullable: true + conn_rate_limit: + type: integer + x-nullable: true + connected_peers: + type: integer + x-nullable: true + cum_conns: + type: integer + x-nullable: true + cum_req: + type: integer + x-nullable: true + cum_ssl_conns: + type: integer + x-nullable: true + curr_conns: + type: integer + x-nullable: true + curr_ssl_conns: + type: integer + x-nullable: true + dropped_logs: + type: integer + x-nullable: true + failed_resolutions: + type: integer + x-nullable: true + hard_max_conn: + type: integer + x-nullable: true + idle_pct: + type: integer + x-nullable: true + jobs: + type: integer + x-nullable: true + listeners: + type: integer + x-nullable: true + max_conn: + type: integer + x-nullable: true + max_conn_rate: + type: integer + x-nullable: true + max_pipes: + type: integer + x-nullable: true + max_sess_rate: + type: integer + x-nullable: true + max_sock: + type: integer + x-nullable: true + max_ssl_conns: + type: integer + x-nullable: true + max_ssl_rate: + type: integer + x-nullable: true + max_zlib_mem_usage: + type: integer + x-nullable: true + mem_max_mb: + type: integer + x-nullable: true + nbthread: + description: Number of threads + type: integer + x-display-name: Number of Threads + x-nullable: true + node: + type: string + pid: + description: Process id of the replying worker process + type: integer + x-display-name: PID + x-nullable: true + pipes_free: + type: integer + x-nullable: true + pipes_used: + type: integer + x-nullable: true + pool_alloc_mb: + type: integer + x-nullable: true + pool_failed: + type: integer + x-nullable: true + pool_used_mb: + type: integer + x-nullable: true + process_num: + description: Process number + type: integer + x-display-name: Process Number + x-nullable: true + processes: + description: Number of spawned processes + type: integer + x-display-name: Number of processes + x-nullable: true + release_date: + description: HAProxy version release date + format: date + type: string + run_queue: + type: integer + x-nullable: true + sess_rate: + type: integer + x-nullable: true + sess_rate_limit: + type: integer + x-nullable: true + ssl_backend_key_rate: + type: integer + x-nullable: true + ssl_backend_max_key_rate: + type: integer + x-nullable: true + ssl_cache_lookups: + type: integer + x-nullable: true + ssl_cache_misses: + type: integer + x-nullable: true + ssl_frontend_key_rate: + type: integer + x-nullable: true + ssl_frontend_max_key_rate: + type: integer + x-nullable: true + ssl_frontend_session_reuse: + type: integer + x-nullable: true + ssl_rate: + type: integer + x-nullable: true + ssl_rate_limit: + type: integer + x-nullable: true + stopping: + type: integer + x-nullable: true + tasks: + type: integer + x-nullable: true + total_bytes_out: + type: integer + x-nullable: true + ulimit_n: + type: integer + x-nullable: true + unstoppable: + type: integer + x-nullable: true + uptime: + description: HAProxy uptime in s + type: integer + x-nullable: true + version: + description: HAProxy version string + type: string + zlib_mem_usage: + type: integer + x-nullable: true + type: object transaction: description: HAProxy configuration transaction example: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index c516db6..7f16fad 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -146,6 +146,10 @@ definitions: $ref: "models/stats.yaml#/native_stats" native_stat: $ref: "models/stats.yaml#/native" + native_stat_stats: + $ref: "models/stats.yaml#/native_stat_stats" + native_stats_collection: + $ref: "models/stats.yaml#/native_stats_collection" error: $ref: "models/errors.yaml#/error" endpoint: @@ -158,6 +162,10 @@ definitions: $ref: '#/definitions/endpoint' process_infos: $ref: "models/runtime.yaml#/process_infos" + process_info: + $ref: "models/runtime.yaml#/process_info" + process_info_item: + $ref: "models/runtime.yaml#/process_info_item" transaction: $ref: "models/general.yaml#/transaction" transactions: diff --git a/models/runtime.yaml b/models/runtime.yaml index 59169c4..cf9a78a 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -4,215 +4,208 @@ process_infos: description: General HAProxy process information type: array items: - type: object - x-go-name: ProcessInfo - properties: - runtimeAPI: - type: string - error: - type: string - info: - type: object - x-go-name: ProcessInfoItem - properties: - version: - type: string - description: HAProxy version string - release_date: - type: string - format: date - description: HAProxy version release date - nbthread: - type: integer - description: Number of threads - x-display-name: Number of Threads - x-nullable: true - processes: - type: integer - description: Number of spawned processes - x-nullable: true - x-display-name: Number of processes - process_num: - type: integer - description: Process number - x-display-name: Process Number - x-nullable: true - pid: - type: integer - description: Process id of the replying worker process - x-nullable: true - x-display-name: PID - uptime: - type: integer - description: HAProxy uptime in s - x-nullable: true - mem_max_mb: - type: integer - x-nullable: true - pool_alloc_mb: - type: integer - x-nullable: true - pool_used_mb: - type: integer - x-nullable: true - pool_failed: - type: integer - x-nullable: true - ulimit_n: - type: integer - x-nullable: true - max_sock: - type: integer - x-nullable: true - max_conn: - type: integer - x-nullable: true - hard_max_conn: - type: integer - x-nullable: true - curr_conns: - type: integer - x-nullable: true - cum_conns: - type: integer - x-nullable: true - cum_req: - type: integer - x-nullable: true - max_ssl_conns: - type: integer - x-nullable: true - curr_ssl_conns: - type: integer - x-nullable: true - cum_ssl_conns: - type: integer - x-nullable: true - max_pipes: - type: integer - x-nullable: true - pipes_used: - type: integer - x-nullable: true - pipes_free: - type: integer - x-nullable: true - conn_rate: - type: integer - x-nullable: true - conn_rate_limit: - type: integer - x-nullable: true - max_conn_rate: - type: integer - x-nullable: true - sess_rate: - type: integer - x-nullable: true - sess_rate_limit: - type: integer - x-nullable: true - max_sess_rate: - type: integer - x-nullable: true - ssl_rate: - type: integer - x-nullable: true - ssl_rate_limit: - type: integer - x-nullable: true - max_ssl_rate: - type: integer - x-nullable: true - ssl_frontend_key_rate: - type: integer - x-nullable: true - ssl_frontend_max_key_rate: - type: integer - x-nullable: true - ssl_frontend_session_reuse: - type: integer - x-nullable: true - ssl_backend_key_rate: - type: integer - x-nullable: true - ssl_backend_max_key_rate: - type: integer - x-nullable: true - ssl_cache_lookups: - type: integer - x-nullable: true - ssl_cache_misses: - type: integer - x-nullable: true - compress_bps_in: - type: integer - x-nullable: true - compress_bps_out: - type: integer - x-nullable: true - compress_bps_rate_lim: - type: integer - x-nullable: true - zlib_mem_usage: - type: integer - x-nullable: true - max_zlib_mem_usage: - type: integer - x-nullable: true - tasks: - type: integer - x-nullable: true - run_queue: - type: integer - x-nullable: true - idle_pct: - type: integer - x-nullable: true - node: - type: string - stopping: - type: integer - x-nullable: true - jobs: - type: integer - x-nullable: true - unstoppable: - type: integer - x-nullable: true - listeners: - type: integer - x-nullable: true - active_peers: - type: integer - x-nullable: true - connected_peers: - type: integer - x-nullable: true - dropped_logs: - type: integer - x-nullable: true - busy_polling: - type: integer - x-nullable: true - failed_resolutions: - type: integer - x-nullable: true - total_bytes_out: - type: integer - x-nullable: true - bytes_out_rate: - type: integer - x-nullable: true - example: - haproxy: - version: 1.7-dev1-868ab3-148 - release_date: "2016-03-11" - address: 127.0.0.1 - time: 2018-07-02T12:00:00.124Z - processes: 4 - pid: 1234 - uptime: 8 + $ref: '#/definitions/process_info' +process_info: + type: object + properties: + runtimeAPI: + type: string + error: + type: string + info: + $ref: '#/definitions/process_info_item' +process_info_item: + type: object + properties: + version: + type: string + description: HAProxy version string + release_date: + type: string + format: date + description: HAProxy version release date + nbthread: + type: integer + description: Number of threads + x-display-name: Number of Threads + x-nullable: true + processes: + type: integer + description: Number of spawned processes + x-nullable: true + x-display-name: Number of processes + process_num: + type: integer + description: Process number + x-display-name: Process Number + x-nullable: true + pid: + type: integer + description: Process id of the replying worker process + x-nullable: true + x-display-name: PID + uptime: + type: integer + description: HAProxy uptime in s + x-nullable: true + mem_max_mb: + type: integer + x-nullable: true + pool_alloc_mb: + type: integer + x-nullable: true + pool_used_mb: + type: integer + x-nullable: true + pool_failed: + type: integer + x-nullable: true + ulimit_n: + type: integer + x-nullable: true + max_sock: + type: integer + x-nullable: true + max_conn: + type: integer + x-nullable: true + hard_max_conn: + type: integer + x-nullable: true + curr_conns: + type: integer + x-nullable: true + cum_conns: + type: integer + x-nullable: true + cum_req: + type: integer + x-nullable: true + max_ssl_conns: + type: integer + x-nullable: true + curr_ssl_conns: + type: integer + x-nullable: true + cum_ssl_conns: + type: integer + x-nullable: true + max_pipes: + type: integer + x-nullable: true + pipes_used: + type: integer + x-nullable: true + pipes_free: + type: integer + x-nullable: true + conn_rate: + type: integer + x-nullable: true + conn_rate_limit: + type: integer + x-nullable: true + max_conn_rate: + type: integer + x-nullable: true + sess_rate: + type: integer + x-nullable: true + sess_rate_limit: + type: integer + x-nullable: true + max_sess_rate: + type: integer + x-nullable: true + ssl_rate: + type: integer + x-nullable: true + ssl_rate_limit: + type: integer + x-nullable: true + max_ssl_rate: + type: integer + x-nullable: true + ssl_frontend_key_rate: + type: integer + x-nullable: true + ssl_frontend_max_key_rate: + type: integer + x-nullable: true + ssl_frontend_session_reuse: + type: integer + x-nullable: true + ssl_backend_key_rate: + type: integer + x-nullable: true + ssl_backend_max_key_rate: + type: integer + x-nullable: true + ssl_cache_lookups: + type: integer + x-nullable: true + ssl_cache_misses: + type: integer + x-nullable: true + compress_bps_in: + type: integer + x-nullable: true + compress_bps_out: + type: integer + x-nullable: true + compress_bps_rate_lim: + type: integer + x-nullable: true + zlib_mem_usage: + type: integer + x-nullable: true + max_zlib_mem_usage: + type: integer + x-nullable: true + tasks: + type: integer + x-nullable: true + run_queue: + type: integer + x-nullable: true + idle_pct: + type: integer + x-nullable: true + node: + type: string + stopping: + type: integer + x-nullable: true + jobs: + type: integer + x-nullable: true + unstoppable: + type: integer + x-nullable: true + listeners: + type: integer + x-nullable: true + active_peers: + type: integer + x-nullable: true + connected_peers: + type: integer + x-nullable: true + dropped_logs: + type: integer + x-nullable: true + busy_polling: + type: integer + x-nullable: true + failed_resolutions: + type: integer + x-nullable: true + total_bytes_out: + type: integer + x-nullable: true + bytes_out_rate: + type: integer + x-nullable: true server: title: Runtime Server description: Runtime transient server properties diff --git a/models/stats.yaml b/models/stats.yaml index 1905580..9d96601 100644 --- a/models/stats.yaml +++ b/models/stats.yaml @@ -1,26 +1,25 @@ --- native_stats: - x-go-name: NativeStats title: Stats Array description: HAProxy stats array type: array items: - type: object - title: Stats collection - description: Stats from one runtime API - x-go-name: NativeStatsCollection - properties: - runtimeAPI: - type: string - stats: - type: array - items: - $ref: "#/definitions/native_stat" - error: - type: string + $ref: "#/definitions/native_stats_collection" +native_stats_collection: + type: object + title: Stats collection + description: Stats from one runtime API + properties: + runtimeAPI: + type: string + stats: + type: array + items: + $ref: "#/definitions/native_stat" + error: + type: string native: title: Stats - x-go-name: NativeStat description: Current stats for one object. type: object properties: @@ -34,390 +33,388 @@ native: x-dependency: type: server stats: - type: object - x-go-name: NativeStatStats - properties: - qcur: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - qmax: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - scur: - type: integer - x-nullable: true - smax: - type: integer - x-nullable: true - slim: - type: integer - x-nullable: true - stot: - type: integer - x-nullable: true - bin: - type: integer - x-nullable: true - bout: - type: integer - x-nullable: true - dreq: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - dresp: - type: integer - x-nullable: true - ereq: - type: integer - x-nullable: true - x-dependency: - type: frontend - econ: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - eresp: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - wretr: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - wredis: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - status: - type: string - enum: [UP, DOWN, NOLB, MAINT, no check] - weight: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - act: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - bck: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - chkfail: - type: integer - x-nullable: true - x-dependency: - type: server - chkdown: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - lastchg: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - downtime: - type: integer - x-nullable: true - x-dependency: - type: server - qlimit: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - pid: - type: integer - x-nullable: true - iid: - type: integer - x-nullable: true - sid: - type: integer - x-nullable: true - x-dependency: - type: server - throttle: - type: integer - x-nullable: true - x-dependency: - type: server - lbtot: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - tracked: - type: string - x-dependency: - type: server - rate: - type: integer - x-nullable: true - rate_lim: - type: integer - x-nullable: true - x-dependency: - type: frontend - rate_max: - type: integer - x-nullable: true - check_status: - type: string - enum: [UNK, INI, SOCKERR, L40K, L4TOUT, L4CON, L6OK, L6TOUT, L6RSP, L7OK, L7OKC, L7TOUT, L7RSP, L7STS] - x-dependency: - type: server - check_code: - type: integer - x-nullable: true - x-dependency: - type: server - check_duration: - type: integer - x-nullable: true - x-dependency: - type: server - hrsp_1xx: - type: integer - x-nullable: true - hrsp_2xx: - type: integer - x-nullable: true - hrsp_3xx: - type: integer - x-nullable: true - hrsp_4xx: - type: integer - x-nullable: true - hrsp_5xx: - type: integer - x-nullable: true - hrsp_other: - type: integer - x-nullable: true - hanafail: - type: string - x-dependency: - type: server - req_rate: - type: integer - x-nullable: true - x-dependency: - type: frontend - req_rate_max: - type: integer - x-nullable: true - x-dependency: - type: frontend - req_tot: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - cli_abrt: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - srv_abrt: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - comp_in: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - comp_out: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - comp_byp: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - comp_rsp: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - lastsess: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - qtime: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - ctime: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - rtime: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - ttime: - type: integer - x-nullable: true - x-dependency: - type: [server, backend] - agent_status: - type: string - enum: [UNK, INI, SOCKERR, L40K, L4TOUT, L4CON, L7OK, L7STS] - x-dependency: - type: server - agent_code: - type: integer - x-nullable: true - x-dependency: - type: server - agent_duration: - type: integer - x-nullable: true - x-dependency: - type: server - check_desc: - type: string - x-dependency: - type: server - agent_desc: - type: string - x-dependency: - type: server - check_rise: - type: integer - x-nullable: true - x-dependency: - type: server - check_fall: - type: integer - x-nullable: true - x-dependency: - type: server - check_health: - type: integer - x-nullable: true - x-dependency: - type: server - agent_rise: - type: integer - x-nullable: true - x-dependency: - type: server - agent_fall: - type: integer - x-nullable: true - x-dependency: - type: server - agent_health: - type: integer - x-nullable: true - x-dependency: - type: server - addr: - type: string - x-dependency: - type: server - cookie: - type: string - x-dependency: - type: [server, backend] - mode: - type: string - enum: [tcp, http, health, unknown] - algo: - type: string - x-dependency: - type: backend - conn_rate: - type: integer - x-nullable: true - x-dependency: - type: frontend - conn_rate_max: - type: integer - x-nullable: true - x-dependency: - type: frontend - conn_tot: - type: integer - x-nullable: true - x-dependency: - type: frontend - intercepted: - type: integer - x-nullable: true - x-dependency: - type: [frontend, backend] - dcon: - type: integer - x-nullable: true - x-dependency: - type: frontend - dses: - type: integer - x-nullable: true - x-dependency: - type: frontend + $ref: "#/definitions/native_stat_stats" +native_stat_stats: + type: object + properties: + qcur: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + qmax: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + scur: + type: integer + x-nullable: true + smax: + type: integer + x-nullable: true + slim: + type: integer + x-nullable: true + stot: + type: integer + x-nullable: true + bin: + type: integer + x-nullable: true + bout: + type: integer + x-nullable: true + dreq: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + dresp: + type: integer + x-nullable: true + ereq: + type: integer + x-nullable: true + x-dependency: + type: frontend + econ: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + eresp: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + wretr: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + wredis: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + status: + type: string + enum: [UP, DOWN, NOLB, MAINT, no check] + weight: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + act: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + bck: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + chkfail: + type: integer + x-nullable: true + x-dependency: + type: server + chkdown: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + lastchg: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + downtime: + type: integer + x-nullable: true + x-dependency: + type: server + qlimit: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + pid: + type: integer + x-nullable: true + iid: + type: integer + x-nullable: true + sid: + type: integer + x-nullable: true + x-dependency: + type: server + throttle: + type: integer + x-nullable: true + x-dependency: + type: server + lbtot: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + tracked: + type: string + x-dependency: + type: server + rate: + type: integer + x-nullable: true + rate_lim: + type: integer + x-nullable: true + x-dependency: + type: frontend + rate_max: + type: integer + x-nullable: true + check_status: + type: string + enum: [UNK, INI, SOCKERR, L40K, L4TOUT, L4CON, L6OK, L6TOUT, L6RSP, L7OK, L7OKC, L7TOUT, L7RSP, L7STS] + x-dependency: + type: server + check_code: + type: integer + x-nullable: true + x-dependency: + type: server + check_duration: + type: integer + x-nullable: true + x-dependency: + type: server + hrsp_1xx: + type: integer + x-nullable: true + hrsp_2xx: + type: integer + x-nullable: true + hrsp_3xx: + type: integer + x-nullable: true + hrsp_4xx: + type: integer + x-nullable: true + hrsp_5xx: + type: integer + x-nullable: true + hrsp_other: + type: integer + x-nullable: true + hanafail: + type: string + x-dependency: + type: server + req_rate: + type: integer + x-nullable: true + x-dependency: + type: frontend + req_rate_max: + type: integer + x-nullable: true + x-dependency: + type: frontend + req_tot: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + cli_abrt: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + srv_abrt: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + comp_in: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + comp_out: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + comp_byp: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + comp_rsp: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + lastsess: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + qtime: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + ctime: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + rtime: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + ttime: + type: integer + x-nullable: true + x-dependency: + type: [server, backend] + agent_status: + type: string + enum: [UNK, INI, SOCKERR, L40K, L4TOUT, L4CON, L7OK, L7STS] + x-dependency: + type: server + agent_code: + type: integer + x-nullable: true + x-dependency: + type: server + agent_duration: + type: integer + x-nullable: true + x-dependency: + type: server + check_desc: + type: string + x-dependency: + type: server + agent_desc: + type: string + x-dependency: + type: server + check_rise: + type: integer + x-nullable: true + x-dependency: + type: server + check_fall: + type: integer + x-nullable: true + x-dependency: + type: server + check_health: + type: integer + x-nullable: true + x-dependency: + type: server + agent_rise: + type: integer + x-nullable: true + x-dependency: + type: server + agent_fall: + type: integer + x-nullable: true + x-dependency: + type: server + agent_health: + type: integer + x-nullable: true + x-dependency: + type: server + addr: + type: string + x-dependency: + type: server + cookie: + type: string + x-dependency: + type: [server, backend] + mode: + type: string + enum: [tcp, http, health, unknown] + algo: + type: string + x-dependency: + type: backend + conn_rate: + type: integer + x-nullable: true + x-dependency: + type: frontend + conn_rate_max: + type: integer + x-nullable: true + x-dependency: + type: frontend + conn_tot: + type: integer + x-nullable: true + x-dependency: + type: frontend + intercepted: + type: integer + x-nullable: true + x-dependency: + type: [frontend, backend] + dcon: + type: integer + x-nullable: true + x-dependency: + type: frontend + dses: + type: integer + x-nullable: true + x-dependency: + type: frontend example: - type: frontend - name: frontend_test - stats: - scur: 129 - smax: 2000 - slim: 2000 - stot: 12902 - bin: 4326578 - bout: 889901290 - dreq: 4 - dresp: 1 - ereq: 54 - status: UP - pid: 3204 - iid: 0 - rate: 64 - rate_lim: 20000 - rate_max: 4000 - hrsp_1xx: 0 - hrsp_2xx: 165 - hrsp_3xx: 12 - hrsp_4xx: 50 - hrsp_5xx: 4 - hrsp_other: 0 - req_rate: 49 - req_rate_max: 3965 - req_total: 1254786 - comp_in: 0 - comp_out: 0 - comp_byp: 0 - comp_rsp: 0 - mode: http - conn_rate: 12 - conn_rate_max: 456 - conn_tot: 45682 - intercepted: 346 - dcon: 0 - dses: 0 + scur: 129 + smax: 2000 + slim: 2000 + stot: 12902 + bin: 4326578 + bout: 889901290 + dreq: 4 + dresp: 1 + ereq: 54 + status: UP + pid: 3204 + iid: 0 + rate: 64 + rate_lim: 20000 + rate_max: 4000 + hrsp_1xx: 0 + hrsp_2xx: 165 + hrsp_3xx: 12 + hrsp_4xx: 50 + hrsp_5xx: 4 + hrsp_other: 0 + req_rate: 49 + req_rate_max: 3965 + req_total: 1254786 + comp_in: 0 + comp_out: 0 + comp_byp: 0 + comp_rsp: 0 + mode: http + conn_rate: 12 + conn_rate_max: 456 + conn_tot: 45682 + intercepted: 346 + dcon: 0 + dses: 0 From c036902b082c15678d84c46d45f59737e3cc549b Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Fri, 20 Mar 2020 10:37:29 +0100 Subject: [PATCH 014/121] REFACTOR: cookie: change domains type --- build/haproxy_spec.yaml | 9 +++++++-- models/configuration.yaml | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4ec00c3..32429fb 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3215,9 +3215,14 @@ definitions: properties: domain: items: - pattern: ^[^\s]+$ - type: string + properties: + value: + pattern: ^[^\s]+$ + type: string + type: object + x-go-name: Domain type: array + x-go-name: Domains dynamic: type: boolean httponly: diff --git a/models/configuration.yaml b/models/configuration.yaml index 412e51f..f0c83bb 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1622,9 +1622,14 @@ cookie: type: boolean domain: type: array + x-go-name: Domains items: - type: string - pattern: '^[^\s]+$' + type: object + x-go-name: Domain + properties: + value: + type: string + pattern: '^[^\s]+$' maxidle: type: integer pattern: '^[^\d+$]' From 1c124d4ee464e166ac478cc68f9f62afde54e975 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Wed, 5 Feb 2020 11:20:45 +0100 Subject: [PATCH 015/121] FEATURE/MEDIUM: cluster: add cluster options --- build/haproxy_spec.yaml | 57 +++++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 4 +++ models/cluster.yaml | 15 +++++++++++ paths/cluster.yaml | 39 ++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 models/cluster.yaml create mode 100644 paths/cluster.yaml diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 32429fb..9cffa7f 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3017,6 +3017,25 @@ definitions: type: array items: $ref: "#/definitions/stick_table_entry" + cluster_settings: + description: Settings for git cluster. + properties: + bootstrap_key: + type: string + mode: + enum: + - single + - cluster + type: string + status: + enum: + - active + - unreachable + - waiting_approval + readOnly: true + type: string + title: Cluster Settings + type: object balance: properties: algorithm: @@ -3430,6 +3449,44 @@ paths: summary: Return API, hardware and OS information tags: - Information + /cluster: + get: + description: Returns cluster data + operationId: getCluster + produces: + - application/json + responses: + "200": + description: Success + schema: + $ref: '#/definitions/cluster_settings' + default: + $ref: '#/responses/DefaultError' + summary: Return cluster data + tags: + - Discovery + post: + description: Post cluster settings + operationId: postCluster + parameters: + - in: body + name: data + required: true + schema: + $ref: '#/definitions/cluster_settings' + - $ref: '#/parameters/version' + responses: + "200": + description: Cluster settings changed + schema: + $ref: '#/definitions/cluster_settings' + "400": + $ref: '#/responses/BadRequest' + default: + $ref: '#/responses/DefaultError' + summary: Post cluster settings + tags: + - Cluster /services: get: description: Returns a list of API managed services endpoints. diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 7f16fad..7793cb8 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -208,6 +208,8 @@ definitions: type: array items: $ref: "#/definitions/stick_table_entry" + cluster_settings: + $ref: "models/cluster.yaml#/settings" balance: $ref: "models/configuration.yaml#/balance" forwardfor: @@ -355,6 +357,8 @@ paths: $ref: "paths/general.yaml#/specification" /info: $ref: "paths/general.yaml#/info" + /cluster: + $ref: "paths/cluster.yaml#/cluster" /services: $ref: "paths/general.yaml#/services" /services/haproxy: diff --git a/models/cluster.yaml b/models/cluster.yaml new file mode 100644 index 0000000..49e1d25 --- /dev/null +++ b/models/cluster.yaml @@ -0,0 +1,15 @@ +--- +settings: + title: Cluster Settings + description: Settings for git cluster. + type: object + properties: + bootstrap_key: + type: string + mode: + type: string + enum: [single, cluster] + status: + type: string + enum: [active, unreachable, waiting_approval] + readOnly: true diff --git a/paths/cluster.yaml b/paths/cluster.yaml new file mode 100644 index 0000000..e10a1f0 --- /dev/null +++ b/paths/cluster.yaml @@ -0,0 +1,39 @@ +--- +cluster: + get: + tags: + - Discovery + summary: Return cluster data + description: Returns cluster data + operationId: getCluster + produces: + - application/json + responses: + '200': + description: Success + schema: + $ref: '#/definitions/cluster_settings' + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Post cluster settings + description: Post cluster settings + operationId: postCluster + parameters: + - name: data + required: true + in: body + schema: + $ref: "#/definitions/cluster_settings" + - $ref: "#/parameters/version" + tags: + - Cluster + responses: + '200': + description: Cluster settings changed + schema: + $ref: "#/definitions/cluster_settings" + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' From 853b9803483d3f42b5513ca5be2e8cd7281c5681 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Mon, 17 Feb 2020 16:22:53 +0100 Subject: [PATCH 016/121] MINOR: fix description for cluster settings --- build/haproxy_spec.yaml | 2 +- models/cluster.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 9cffa7f..fb48a27 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3018,7 +3018,7 @@ definitions: items: $ref: "#/definitions/stick_table_entry" cluster_settings: - description: Settings for git cluster. + description: Settings related to a cluster. properties: bootstrap_key: type: string diff --git a/models/cluster.yaml b/models/cluster.yaml index 49e1d25..2b3319e 100644 --- a/models/cluster.yaml +++ b/models/cluster.yaml @@ -1,7 +1,7 @@ --- settings: title: Cluster Settings - description: Settings for git cluster. + description: Settings related to a cluster. type: object properties: bootstrap_key: From 9a9e81f94c2a099c47a77e91a27d10b50fa7515f Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Mon, 17 Feb 2020 17:19:17 +0100 Subject: [PATCH 017/121] MEDIUM: add general cluster controller information to dataplane When interacting with a dataplane to configure connecting to a controller, displaying general controller information like name and address is useful for identifying to which controller this particular datdataplane is connected to. Allowing write to these settings can allow to reconfigure connecting to a different controller, but also to a controller to send updates about its own information (name, description). --- build/haproxy_spec.yaml | 18 ++++++++++++++++++ models/cluster.yaml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index fb48a27..665f00d 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3022,6 +3022,24 @@ definitions: properties: bootstrap_key: type: string + cluster: + properties: + address: + pattern: ^[^\s]+$ + type: string + api_base_path: + type: string + description: + type: string + name: + type: string + port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true + title: Cluster controller information + type: object mode: enum: - single diff --git a/models/cluster.yaml b/models/cluster.yaml index 2b3319e..0aa0ffc 100644 --- a/models/cluster.yaml +++ b/models/cluster.yaml @@ -13,3 +13,21 @@ settings: type: string enum: [active, unreachable, waiting_approval] readOnly: true + cluster: + properties: + name: + type: string + description: + type: string + address: + pattern: ^[^\s]+$ + type: string + port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true + api_base_path: + type: string + title: Cluster controller information + type: object From cd0fbca32b046c9c9574aca984db8a9b72079d76 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Wed, 18 Mar 2020 12:03:13 +0100 Subject: [PATCH 018/121] FEATURE/MINOR: add peers section and entries --- build/haproxy_spec.yaml | 425 +++++++++++++++++++++++++++++++++++++- haproxy-spec.yaml | 40 +++- models/configuration.yaml | 33 +++ paths/configuration.yaml | 363 ++++++++++++++++++++++++++++++++ 4 files changed, 846 insertions(+), 15 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 665f00d..f19196c 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -140,7 +140,7 @@ definitions: description: | Sites array. Sites are considered as one service and all farms connected to that service. Farms are connected to service using use-backend and default_backend directives. Sites let you - configure simple HAProxy configurations, for more advanced options use /haproxy/configuration + configure simple HAProxy configurations, for more advanced options use /haproxy/configuration endpoints. type: array items: @@ -696,6 +696,51 @@ definitions: type: array items: $ref: '#/definitions/backend' + peer_section: + additionalProperties: false + description: HAProxy peer_section configuration + properties: + name: + pattern: ^[A-Za-z0-9-_.:]+$ + type: string + x-nullable: false + required: + - name + title: Peer Section + type: object + peer_sections: + title: Peer_Section + description: HAProxy peer_section array + type: array + items: + $ref: '#/definitions/peer_section' + peer_entry: + description: Peer Entry from peers table + properties: + address: + pattern: ^[^\s]+$ + type: string + name: + pattern: ^[A-Za-z0-9-_.:]+$ + type: string + x-nullable: false + port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true + required: + - name + - address + - port + title: Peer Entry + type: object + peer_entries: + title: Peer entries + description: HAProxy peer entries array + type: array + items: + $ref: '#/definitions/peer_entry' bind: additionalProperties: false description: HAProxy frontend bind configuration @@ -3329,7 +3374,7 @@ responses: x-nullable: false schema: $ref: '#/definitions/error' -parameters: +parameters: transaction_id: name: transaction_id in: query @@ -3368,21 +3413,21 @@ tags: - name: Specification - name: Transactions description: | - Managing transactions. Configuration changes can be grouped in the transaction. You start the - transaction with trasactions POST, and call the configuration changes you need with parameter + Managing transactions. Configuration changes can be grouped in the transaction. You start the + transaction with trasactions POST, and call the configuration changes you need with parameter transaction_id. When you want to commit the transaction, you call the transactions PUT and all changes - in that transaction is commited. If you call a configuration change without the transaction_id, + in that transaction is commited. If you call a configuration change without the transaction_id, transaction mechanism is implicitly called with one operation in transaction. - name: Reloads description: | Checking reload success. To avoid constant reloading we reload in intervals that are configurable when - with reload-delay option. When a change to configuration is made and force_reload url query string + with reload-delay option. When a change to configuration is made and force_reload url query string parameter is false we issue a request for reload, and return the reload ID in response header. You can then use reloads endpoints to check the status of that reload ID. If force_reload is true, we override all of this and reload immediately. - name: Sites description: | - Managing sites (simple configuration mode). Sites are considered as one frontend with multiple backends + Managing sites (simple configuration mode). Sites are considered as one frontend with multiple backends connected to it via default_backend or use-backend directives. - name: Stats description: Stats container @@ -4221,6 +4266,372 @@ paths: tags: - Frontend - HAProxy configuration management + /services/haproxy/configuration/peer_section: + get: + description: Returns an array of all configured peer_section. + operationId: getPeerSections + parameters: + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/peer_section' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of peer_section + tags: + - Peer + - HAProxy configuration management + post: + description: Adds a new peer to the configuration file. + operationId: createPeer + parameters: + - in: body + name: data + required: true + schema: + $ref: '#/definitions/peer_section' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "201": + description: Peer created + schema: + $ref: '#/definitions/peer_section' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/peer_section' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a peer + tags: + - Peer + - HAProxy configuration management + /services/haproxy/configuration/peer_section/{name}: + delete: + description: Deletes a peer from the configuration by it's name. + operationId: deletePeer + parameters: + - description: Peer name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + "204": + description: Peer deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a peer + tags: + - Peer + - HAProxy configuration management + get: + description: Returns one peer configuration by it's name. + operationId: getPeerSection + parameters: + - description: Peer name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/peer_section' + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a peer + tags: + - Peer + - HAProxy configuration management + put: + description: Replaces a peer configuration by it's name. + operationId: replacePeer + parameters: + - description: Peer name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/peer_section' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "200": + description: Peer replaced + schema: + $ref: '#/definitions/peer_section' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/peer_section' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a peer + tags: + - Peer + - HAProxy configuration management + /services/haproxy/configuration/peer_entries: + get: + description: Returns an array of all peer_entries that are configured in specified + peer section. + operationId: getPeerEntries + parameters: + - description: Parent peer section name + in: query + name: peer_section + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/peer_entries' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of peer_entries + tags: + - PeerEntry + - HAProxy configuration management + post: + description: Adds a new peer entry in the specified peer section in the configuration + file. + operationId: createPeerEntry + parameters: + - description: Parent peer section name + in: query + name: peer_section + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/peer_entry' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "201": + description: PeerEntry created + schema: + $ref: '#/definitions/peer_entry' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/peer_entry' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new peer_entry + tags: + - Peer_Entry + - HAProxy configuration management + /services/haproxy/configuration/peer_entries/{name}: + delete: + description: Deletes a peer entry configuration by it's name in the specified peer + section. + operationId: deletePeerEntry + parameters: + - description: PeerEntry name + in: path + name: name + required: true + type: string + - description: Parent peers name + in: query + name: peer_section + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + "204": + description: PeerEntry deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a peer_entry + tags: + - Peer_Entry + - HAProxy configuration management + - Peers options + get: + description: Returns one peer_entry configuration by it's name in the specified + peer section. + operationId: getPeerEntry + parameters: + - description: PeerEntry name + in: path + name: name + required: true + type: string + - description: Parent peers name + in: query + name: peer_section + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/peer_entry' + type: object + "404": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Return one peer_entry + tags: + - PeerEntry + - HAProxy configuration management + put: + description: Replaces a peer entry configuration by it's name in the specified peer + section. + operationId: replacePeerEntry + parameters: + - description: PeerEntry name + in: path + name: name + required: true + type: string + - description: Parent peers name + in: query + name: peer_section + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/peer_entry' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "200": + description: PeerEntry replaced + schema: + $ref: '#/definitions/peer_entry' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/peer_entry' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a peer_entry + tags: + - PeerEntry + - HAProxy configuration management + - Peers options /services/haproxy/configuration/backends: get: description: Returns an array of all configured backends. diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 7793cb8..74a9f94 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -21,7 +21,7 @@ definitions: description: | Sites array. Sites are considered as one service and all farms connected to that service. Farms are connected to service using use-backend and default_backend directives. Sites let you - configure simple HAProxy configurations, for more advanced options use /haproxy/configuration + configure simple HAProxy configurations, for more advanced options use /haproxy/configuration endpoints. type: array items: @@ -46,6 +46,22 @@ definitions: type: array items: $ref: '#/definitions/backend' + peer_section: + $ref: "models/configuration.yaml#/peer_section" + peer_sections: + title: Peer_Section + description: HAProxy peer_section array + type: array + items: + $ref: '#/definitions/peer_section' + peer_entry: + $ref: "models/configuration.yaml#/peer_entry" + peer_entries: + title: Peer entries + description: HAProxy peer entries array + type: array + items: + $ref: '#/definitions/peer_entry' bind: $ref: "models/configuration.yaml#/bind" binds: @@ -261,7 +277,7 @@ responses: x-nullable: false schema: $ref: '#/definitions/error' -parameters: +parameters: transaction_id: name: transaction_id in: query @@ -300,21 +316,21 @@ tags: - name: Specification - name: Transactions description: | - Managing transactions. Configuration changes can be grouped in the transaction. You start the - transaction with trasactions POST, and call the configuration changes you need with parameter + Managing transactions. Configuration changes can be grouped in the transaction. You start the + transaction with trasactions POST, and call the configuration changes you need with parameter transaction_id. When you want to commit the transaction, you call the transactions PUT and all changes - in that transaction is commited. If you call a configuration change without the transaction_id, + in that transaction is commited. If you call a configuration change without the transaction_id, transaction mechanism is implicitly called with one operation in transaction. - name: Reloads description: | Checking reload success. To avoid constant reloading we reload in intervals that are configurable when - with reload-delay option. When a change to configuration is made and force_reload url query string + with reload-delay option. When a change to configuration is made and force_reload url query string parameter is false we issue a request for reload, and return the reload ID in response header. You can then use reloads endpoints to check the status of that reload ID. If force_reload is true, we override all of this and reload immediately. - name: Sites description: | - Managing sites (simple configuration mode). Sites are considered as one frontend with multiple backends + Managing sites (simple configuration mode). Sites are considered as one frontend with multiple backends connected to it via default_backend or use-backend directives. - name: Stats description: Stats container @@ -380,7 +396,7 @@ paths: /services/haproxy/reloads/{id}: $ref: "paths/general.yaml#/reloads_one" /services/haproxy/configuration: - $ref: "paths/general.yaml#/configuration" + $ref: "paths/general.yaml#/configuration" /services/haproxy/configuration/global: $ref: "paths/configuration.yaml#/global" /services/haproxy/configuration/defaults: @@ -389,6 +405,14 @@ paths: $ref: "paths/configuration.yaml#/frontends" /services/haproxy/configuration/frontends/{name}: $ref: "paths/configuration.yaml#/frontends_one" + /services/haproxy/configuration/peer_section: + $ref: "paths/configuration.yaml#/peer_section" + /services/haproxy/configuration/peer_section/{name}: + $ref: "paths/configuration.yaml#/peer_section_one" + /services/haproxy/configuration/peer_entries: + $ref: "paths/configuration.yaml#/peer_entries" + /services/haproxy/configuration/peer_entries/{name}: + $ref: "paths/configuration.yaml#/peer_entries_one" /services/haproxy/configuration/backends: $ref: "paths/configuration.yaml#/backends" /services/haproxy/configuration/backends/{name}: diff --git a/models/configuration.yaml b/models/configuration.yaml index f0c83bb..72f4d6f 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -459,6 +459,39 @@ backend: uri: "/check" method: OPTIONS version: HTTP/1.1 +peer_section: + title: Peer Section + description: HAProxy peer_section configuration + type: object + required: + - name + properties: + name: + type: string + pattern: '^[A-Za-z0-9-_.:]+$' + x-nullable: false + additionalProperties: false +peer_entry: + title: Peer Entry + description: Peer Entry from peers table + type: object + required: + - name + - address + - port + properties: + name: + type: string + pattern: '^[A-Za-z0-9-_.:]+$' + x-nullable: false + address: + type: string + pattern: '^[^\s]+$' + port: + type: integer + x-nullable: true + minimum: 1 + maximum: 65535 bind: title: Bind description: HAProxy frontend bind configuration diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 6a0b47e..c7a8d8e 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -453,6 +453,369 @@ backends_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' +peer_section: + get: + summary: Return an array of peer_section + description: Returns an array of all configured peer_section. + operationId: getPeerSections + parameters: + - $ref: "#/parameters/transaction_id" + tags: + - Peer + - HAProxy configuration management + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + required: + - data + properties: + data: + $ref: "#/definitions/peer_section" + _version: + type: integer + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a peer + description: Adds a new peer to the configuration file. + operationId: createPeer + parameters: + - name: data + required: true + in: body + schema: + $ref: "#/definitions/peer_section" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + tags: + - Peer + - HAProxy configuration management + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/peer_section" + '201': + description: Peer created + schema: + $ref: "#/definitions/peer_section" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +peer_section_one: + get: + summary: Return a peer + description: Returns one peer configuration by it's name. + operationId: getPeerSection + tags: + - Peer + - HAProxy configuration management + parameters: + - name: name + in: path + description: Peer name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/peer_section" + _version: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a peer + description: Replaces a peer configuration by it's name. + operationId: replacePeer + tags: + - Peer + - HAProxy configuration management + parameters: + - name: name + in: path + description: Peer name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/peer_section" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/peer_section" + '200': + description: Peer replaced + schema: + $ref: "#/definitions/peer_section" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a peer + description: Deletes a peer from the configuration by it's name. + operationId: deletePeer + tags: + - Peer + - HAProxy configuration management + parameters: + - name: name + in: path + description: Peer name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + '204': + description: Peer deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + +peer_entries: + get: + summary: Return an array of peer_entries + description: Returns an array of all peer_entries that are configured in specified peer section. + operationId: getPeerEntries + tags: + - PeerEntry + - HAProxy configuration management + parameters: + - name: peer_section + in: query + description: Parent peer section name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + required: + - data + properties: + data: + $ref: "#/definitions/peer_entries" + _version: + type: integer + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new peer_entry + description: Adds a new peer entry in the specified peer section in the configuration file. + operationId: createPeerEntry + tags: + - Peer_Entry + - HAProxy configuration management + parameters: + - name: peer_section + in: query + description: Parent peer section name + required: true + type: string + - name: data + in: body + required: true + schema: + $ref: '#/definitions/peer_entry' + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/peer_entry" + '201': + description: PeerEntry created + schema: + $ref: "#/definitions/peer_entry" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +peer_entries_one: + get: + summary: Return one peer_entry + description: Returns one peer_entry configuration by it's name in the specified peer section. + operationId: getPeerEntry + tags: + - PeerEntry + - HAProxy configuration management + parameters: + - name: name + in: path + description: PeerEntry name + required: true + type: string + - name: peer_section + in: query + description: Parent peers name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/peer_entry" + _version: + type: integer + '404': + $ref: '#/responses/AlreadyExists' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a peer_entry + description: Replaces a peer entry configuration by it's name in the specified peer section. + operationId: replacePeerEntry + tags: + - PeerEntry + - HAProxy configuration management + - Peers options + parameters: + - name: name + in: path + description: PeerEntry name + required: true + type: string + - name: peer_section + in: query + description: Parent peers name + required: true + type: string + - name: data + in: body + required: true + schema: + $ref: '#/definitions/peer_entry' + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/peer_entry" + '200': + description: PeerEntry replaced + schema: + $ref: "#/definitions/peer_entry" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a peer_entry + description: Deletes a peer entry configuration by it's name in the specified peer section. + operationId: deletePeerEntry + tags: + - Peer_Entry + - HAProxy configuration management + - Peers options + parameters: + - name: name + in: path + description: PeerEntry name + required: true + type: string + - name: peer_section + in: query + description: Parent peers name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + '204': + description: PeerEntry deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + binds: get: summary: Return an array of binds From a656e6bc65226cf50795fc930d07335bec76cbe7 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Tue, 10 Mar 2020 14:03:47 +0100 Subject: [PATCH 019/121] add track-sc --- build/haproxy_spec.yaml | 48 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 47 +++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f19196c..9f705c2 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1189,6 +1189,51 @@ definitions: required: true value: send-spoe-group x-display-name: SPOE Group + track-sc0-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc0 + x-display-name: track-sc0 Key + track-sc0-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc0 + x-display-name: track-sc0 Table + track-sc1-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc1 + x-display-name: track-sc1 Key + track-sc1-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc1 + x-display-name: track-sc1 Table + track-sc2-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc2 + x-display-name: track-sc2 Key + track-sc2-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc2 + x-display-name: track-sc2 Table type: enum: - allow @@ -1210,6 +1255,9 @@ definitions: - add-acl - del-acl - capture + - track-sc0 + - track-sc1 + - track-sc2 type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index 72f4d6f..9cd0757 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -708,7 +708,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -733,6 +733,51 @@ http_request_rule: type: value: capture required: true + track-sc0-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc0 Key + x-dependency: + type: + value: track-sc0 + required: true + track-sc0-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc0 Table + x-dependency: + type: + value: track-sc0 + track-sc1-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc1 Key + x-dependency: + type: + value: track-sc1 + required: true + track-sc1-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc1 Table + x-dependency: + type: + value: track-sc1 + track-sc2-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc2 Key + x-dependency: + type: + value: track-sc2 + required: true + track-sc2-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc2 Table + x-dependency: + type: + value: track-sc2 auth_realm: type: string x-display-name: Authentication Realm From cc7dfb7037f8957dd2823cbd2b2c2be4c10bf9f2 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Wed, 25 Mar 2020 09:20:36 +0100 Subject: [PATCH 020/121] FEATURE/MINOR: add http-reuse --- build/haproxy_spec.yaml | 17 +++++++++++++++++ models/configuration.yaml | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 9f705c2..be3c769 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -336,6 +336,13 @@ definitions: http_request_timeout: type: integer x-nullable: true + http_reuse: + enum: + - aggressive + - always + - never + - safe + type: string httpchk: $ref: '#/definitions/httpchk' httplog: @@ -628,6 +635,16 @@ definitions: mode: value: http x-nullable: true + http_reuse: + enum: + - aggressive + - always + - never + - safe + type: string + x-dependency: + mode: + value: http httpchk: $ref: '#/definitions/httpchk' x-dependency: diff --git a/models/configuration.yaml b/models/configuration.yaml index 9cd0757..669ca77 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -163,6 +163,9 @@ defaults: http_keep_alive_timeout: type: integer x-nullable: true + http_reuse: + type: string + enum: [aggressive, always, never, safe] server_timeout: type: integer x-nullable: true @@ -416,6 +419,12 @@ backend: x-dependency: mode: value: http + http_reuse: + type: string + enum: [aggressive, always, never, safe] + x-dependency: + mode: + value: http stick_table: type: object properties: From c9a67e83126d753a546fd27fcf6ff3d7aafc83ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Wed, 25 Mar 2020 13:51:04 +0000 Subject: [PATCH 021/121] FEATURE/MINOR: http-check: add http-check option --- build/haproxy_spec.yaml | 42 +++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 2 ++ models/configuration.yaml | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index be3c769..79b8549 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -313,6 +313,8 @@ definitions: x-display-name: External Check Path forwardfor: $ref: '#/definitions/forwardfor' + http-check: + $ref: '#/definitions/http-check' http-use-htx: enum: - enabled @@ -598,6 +600,8 @@ definitions: - avalanche type: string type: object + http-check: + $ref: '#/definitions/http-check' http-use-htx: enum: - enabled @@ -3325,6 +3329,44 @@ definitions: type: string type: object x-display-name: HTTP Check + http-check: + properties: + exclamation_mark: + type: boolean + x-dependency: + type: + value: expect + x-display-name: Expect Exclamation Mark + match: + enum: + - status + - rstatus + - string + - rstring + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: expect + x-display-name: Expect Match + pattern: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: expect + x-display-name: Expect Pattern + type: + enum: + - disable-on-404 + - expect + - send-state + type: string + required: + - type + type: object redispatch: properties: enabled: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 74a9f94..ed3cfdc 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -234,6 +234,8 @@ definitions: $ref: "models/configuration.yaml#/default_server" httpchk: $ref: "models/configuration.yaml#/httpchk" + http-check: + $ref: "models/configuration.yaml#/http-check" redispatch: $ref: "models/configuration.yaml#/redispatch" errorfile: diff --git a/models/configuration.yaml b/models/configuration.yaml index 669ca77..7051314 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -99,6 +99,8 @@ defaults: enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check] httpchk: $ref: "#/definitions/httpchk" + http-check: + $ref: "#/definitions/http-check" http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] @@ -336,6 +338,8 @@ backend: modifier: type: string enum: [avalanche] + http-check: + $ref: "#/definitions/http-check" mode: type: string enum: [http, tcp] @@ -1725,3 +1729,34 @@ cookie: pattern: '^[^\d+$]' dynamic: type: boolean +http-check: + type: object + required: + - type + properties: + type: + type: string + enum: [disable-on-404, expect, send-state] + exclamation_mark: + type: boolean + x-display-name: Expect Exclamation Mark + x-dependency: + type: + value: expect + match: + type: string + enum: [status, rstatus, string, rstring] + x-display-name: Expect Match + pattern: '^[^\s]+$' + x-dependency: + type: + value: expect + required: true + pattern: + type: string + x-display-name: Expect Pattern + pattern: '^[^\s]+$' + x-dependency: + type: + value: expect + required: true From 8f432dd15b0d5cb3f8961bc8751f6c1979a94e99 Mon Sep 17 00:00:00 2001 From: Moemen MHEDHBI Date: Wed, 25 Mar 2020 15:26:57 +0100 Subject: [PATCH 022/121] MINOR: add chroot, user, group, ssl-default-server-ciphers, ssl-default-server-options to global section --- build/haproxy_spec.yaml | 18 ++++++++++++++++++ models/configuration.yaml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 79b8549..113998d 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -149,6 +149,10 @@ definitions: additionalProperties: false description: HAProxy global configuration properties: + chroot: + pattern: ^[^\s]+$ + type: string + x-display-name: Chroot cpu_maps: items: properties: @@ -174,6 +178,10 @@ definitions: external_check: type: boolean x-display-name: External Check + group: + pattern: ^[^\s]+$ + type: string + x-display-name: Group master-worker: type: boolean x-display-name: Master Worker Mode @@ -223,12 +231,22 @@ definitions: ssl_default_bind_options: type: string x-display-name: SSL Default Bind Options + ssl_default_server_ciphers: + type: string + x-display-name: SSL Default Server Ciphers + ssl_default_server_options: + type: string + x-display-name: SSL Default Server Options stats_timeout: type: integer x-nullable: true tune_ssl_default_dh_param: type: integer x-display-name: SSL Default DH Parameter Size + user: + pattern: ^[^\s]+$ + type: string + x-display-name: User title: Global type: object defaults: diff --git a/models/configuration.yaml b/models/configuration.yaml index 7051314..9a477e0 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -3,6 +3,18 @@ global: description: HAProxy global configuration type: object properties: + chroot: + type: string + pattern: '^[^\s]+$' + x-display-name: Chroot + group: + type: string + pattern: '^[^\s]+$' + x-display-name: Group + user: + type: string + pattern: '^[^\s]+$' + x-display-name: User daemon: type: string enum: [enabled, disabled] @@ -33,6 +45,12 @@ global: ssl_default_bind_ciphers: type: string x-display-name: SSL Default Bind Ciphers + ssl_default_server_options: + type: string + x-display-name: SSL Default Server Options + ssl_default_server_ciphers: + type: string + x-display-name: SSL Default Server Ciphers cpu_maps: x-go-name: CPUMaps type: array From a8cef4e204cd75692ea01c3d63e64e9393512d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Thu, 26 Mar 2020 14:26:12 +0000 Subject: [PATCH 023/121] FEATURE/MINOR: bind-process: add support --- build/haproxy_spec.yaml | 9 +++++++++ haproxy-spec.yaml | 2 ++ models/configuration.yaml | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 113998d..f167ab7 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -271,6 +271,8 @@ definitions: x-display-name: Advanced Check balance: $ref: '#/definitions/balance' + bind_process: + $ref: '#/definitions/bind_process' check_timeout: type: integer x-nullable: true @@ -416,6 +418,8 @@ definitions: mode: http name: test_frontend properties: + bind_process: + $ref: '#/definitions/bind_process' clflog: type: boolean x-dependency: @@ -567,6 +571,8 @@ definitions: x-display-name: Advanced Check balance: $ref: '#/definitions/balance' + bind_process: + $ref: '#/definitions/bind_process' check_timeout: type: integer x-nullable: true @@ -3385,6 +3391,9 @@ definitions: required: - type type: object + bind_process: + pattern: ^[^\s]+$ + type: string redispatch: properties: enabled: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index ed3cfdc..541b008 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -236,6 +236,8 @@ definitions: $ref: "models/configuration.yaml#/httpchk" http-check: $ref: "models/configuration.yaml#/http-check" + bind_process: + $ref: "models/configuration.yaml#/bind_process" redispatch: $ref: "models/configuration.yaml#/redispatch" errorfile: diff --git a/models/configuration.yaml b/models/configuration.yaml index 9a477e0..aba4eee 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -119,6 +119,8 @@ defaults: $ref: "#/definitions/httpchk" http-check: $ref: "#/definitions/http-check" + bind_process: + $ref: "#/definitions/bind_process" http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] @@ -243,6 +245,8 @@ frontend: x-dependency: mode: value: http + bind_process: + $ref: "#/definitions/bind_process" clflog: type: boolean x-display-name: CLF Log @@ -358,6 +362,8 @@ backend: enum: [avalanche] http-check: $ref: "#/definitions/http-check" + bind_process: + $ref: "#/definitions/bind_process" mode: type: string enum: [http, tcp] @@ -1778,3 +1784,6 @@ http-check: type: value: expect required: true +bind_process: + type: string + pattern: '^[^\s]+$' From 9ed5a1dd00271f938aabb95f7d5fc52a29e2216b Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Fri, 10 Jan 2020 11:19:18 +0100 Subject: [PATCH 024/121] FEATURE: support for resolvers section Resolvers configure a Domain Name resolution section in HAProxy which can be used by other features. --- build/haproxy_spec.yaml | 407 ++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 26 +++ models/configuration.yaml | 59 ++++++ paths/configuration.yaml | 334 +++++++++++++++++++++++++++++++ 4 files changed, 826 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f167ab7..51685ca 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3471,6 +3471,77 @@ definitions: required: - name type: object + resolver: + description: Runtime DNS configuration + properties: + accepted_payload_size: + minimum: 1232 + type: integer + hold_nx: + type: integer + hold_obsolete: + type: integer + hold_other: + type: integer + hold_refused: + type: integer + hold_timeout: + type: integer + hold_valid: + type: integer + name: + pattern: ^[A-Za-z0-9-_.:]+$ + type: string + x-nullable: false + parse-resolv-conf: + type: boolean + resolve_retries: + minimum: 1 + type: integer + timeout_resolve: + type: integer + timeout_retry: + type: integer + required: + - name + title: Resolver + type: object + resolvers: + title: Resolvers + description: HAProxy resolvers array + type: array + items: + $ref: '#/definitions/resolver' + nameserver: + description: Nameserver used in Runtime DNS configuration + example: + address: 10.0.0.1 + name: ns1 + port: 53 + properties: + address: + pattern: ^[^\s]+$ + type: string + name: + pattern: ^[A-Za-z0-9-_.:]+$ + type: string + x-nullable: false + port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true + required: + - name + - address + title: Nameserver + type: object + nameservers: + title: Nameservers + description: Nameservers array + type: array + items: + $ref: '#/definitions/nameserver' responses: BadRequest: description: Bad request @@ -3595,6 +3666,8 @@ tags: - name: StickRule - name: LogTarget - name: ACL + - name: Resolver + - name: Nameserver security: - basic_auth: [] paths: @@ -7599,6 +7672,340 @@ paths: - Backend options - Frontend options - ACL + /services/haproxy/configuration/resolvers: + get: + description: Returns an array of all configured resolvers. + operationId: getResolvers + parameters: + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/resolvers' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of resolvers + tags: + - Resolver + - HAProxy configuration management + post: + description: Adds a new resolver section to the configuration file. + operationId: createResolver + parameters: + - in: body + name: data + required: true + schema: + $ref: '#/definitions/resolver' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "201": + description: Resolver created + schema: + $ref: '#/definitions/resolver' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/resolver' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a resolver + tags: + - Resolver + - HAProxy configuration management + /services/haproxy/configuration/resolvers/{name}: + delete: + description: Deletes a resolver from the configuration by it's name. + operationId: deleteResolver + parameters: + - description: Resolver name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + "204": + description: Resolver deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a resolver + tags: + - Resolver + - HAProxy configuration management + get: + description: Returns one resolver section configuration by it's name. + operationId: getResolver + parameters: + - description: Resolver name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/resolver' + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a resolver + tags: + - Resolver + - HAProxy configuration management + put: + description: Replaces a resolver configuration by it's name. + operationId: replaceResolver + parameters: + - description: Resolver name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/resolver' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "200": + description: Resolver replaced + schema: + $ref: '#/definitions/resolver' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/resolver' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a resolver + tags: + - Resolver + - HAProxy configuration management + /services/haproxy/configuration/nameservers: + get: + description: Returns an array of all configured nameservers. + operationId: getNameservers + parameters: + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/nameservers' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of nameservers + tags: + - Nameserver + - HAProxy configuration management + post: + description: Adds a new nameserver to the resolvers section. + operationId: createNameserver + parameters: + - in: body + name: data + required: true + schema: + $ref: '#/definitions/nameserver' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "201": + description: Nameserver created + schema: + $ref: '#/definitions/nameserver' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/nameserver' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a nameserver + tags: + - Nameserver + - HAProxy configuration management + /services/haproxy/configuration/nameservers/{name}: + delete: + description: Deletes a nameserver from the resolvers section by it's name. + operationId: deleteNameserver + parameters: + - description: Nameserver name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + "204": + description: Nameserver deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a nameserver + tags: + - Nameserver + - HAProxy configuration management + get: + description: Returns one nameserver configuration by it's name. + operationId: getNameserver + parameters: + - description: Nameserver name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/nameserver' + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a nameserver + tags: + - Nameserver + - HAProxy configuration management + put: + description: Replaces a nameserver configuration by it's name. + operationId: replaceNameserver + parameters: + - description: Nameserver name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/nameserver' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + - $ref: '#/parameters/force_reload' + responses: + "200": + description: Nameserver replaced + schema: + $ref: '#/definitions/nameserver' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/nameserver' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a nameserver + tags: + - Nameserver + - HAProxy configuration management /services/haproxy/configuration/raw: get: description: Returns HAProxy configuration file in plain text diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 541b008..c578d00 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -244,6 +244,22 @@ definitions: $ref: "models/configuration.yaml#/errorfile" cookie: $ref: "models/configuration.yaml#/cookie" + resolver: + $ref: "models/configuration.yaml#/resolver" + resolvers: + title: Resolvers + description: HAProxy resolvers array + type: array + items: + $ref: '#/definitions/resolver' + nameserver: + $ref: "models/configuration.yaml#/nameserver" + nameservers: + title: Nameservers + description: Nameservers array + type: array + items: + $ref: '#/definitions/nameserver' responses: BadRequest: description: Bad request @@ -368,6 +384,8 @@ tags: - name: StickRule - name: LogTarget - name: ACL + - name: Resolver + - name: Nameserver security: - basic_auth: [] paths: @@ -469,6 +487,14 @@ paths: $ref: "paths/configuration.yaml#/acls" /services/haproxy/configuration/acls/{id}: $ref: "paths/configuration.yaml#/acls_one" + /services/haproxy/configuration/resolvers: + $ref: "paths/configuration.yaml#/resolvers" + /services/haproxy/configuration/resolvers/{name}: + $ref: "paths/configuration.yaml#/resolvers_one" + /services/haproxy/configuration/nameservers: + $ref: "paths/configuration.yaml#/nameservers" + /services/haproxy/configuration/nameservers/{name}: + $ref: "paths/configuration.yaml#/nameservers_one" /services/haproxy/configuration/raw: $ref: "paths/configuration.yaml#/configuration" /services/haproxy/runtime: diff --git a/models/configuration.yaml b/models/configuration.yaml index aba4eee..12b7d24 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -225,6 +225,65 @@ defaults: items: $ref: "#/definitions/errorfile" additionalProperties: false +resolver: + title: Resolver + description: Runtime DNS configuration + type: object + required: + - name + properties: + name: + type: string + pattern: '^[A-Za-z0-9-_.:]+$' + x-nullable: false + accepted_payload_size: + type: integer + minimum: 1232 + hold_nx: + type: integer + hold_obsolete: + type: integer + hold_other: + type: integer + hold_refused: + type: integer + hold_timeout: + type: integer + hold_valid: + type: integer + parse-resolv-conf: + type: boolean + resolve_retries: + type: integer + minimum: 1 + timeout_resolve: + type: integer + timeout_retry: + type: integer +nameserver: + title: Nameserver + description: Nameserver used in Runtime DNS configuration + type: object + required: + - name + - address + properties: + name: + type: string + pattern: '^[A-Za-z0-9-_.:]+$' + x-nullable: false + address: + type: string + pattern: '^[^\s]+$' + port: + type: integer + x-nullable: true + minimum: 1 + maximum: 65535 + example: + name: ns1 + address: 10.0.0.1 + port: 53 frontend: title: Frontend description: HAProxy frontend configuration diff --git a/paths/configuration.yaml b/paths/configuration.yaml index c7a8d8e..49c6a10 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -1013,6 +1013,340 @@ binds_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' +resolvers: + get: + summary: Return an array of resolvers + description: Returns an array of all configured resolvers. + operationId: getResolvers + parameters: + - $ref: "#/parameters/transaction_id" + tags: + - Resolver + - HAProxy configuration management + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + required: + - data + properties: + data: + $ref: "#/definitions/resolvers" + _version: + type: integer + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a resolver + description: Adds a new resolver section to the configuration file. + operationId: createResolver + parameters: + - name: data + required: true + in: body + schema: + $ref: "#/definitions/resolver" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + tags: + - Resolver + - HAProxy configuration management + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/resolver" + '201': + description: Resolver created + schema: + $ref: "#/definitions/resolver" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +resolvers_one: + get: + summary: Return a resolver + description: Returns one resolver section configuration by it's name. + operationId: getResolver + tags: + - Resolver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Resolver name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/resolver" + _version: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a resolver + description: Replaces a resolver configuration by it's name. + operationId: replaceResolver + tags: + - Resolver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Resolver name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/resolver" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/resolver" + '200': + description: Resolver replaced + schema: + $ref: "#/definitions/resolver" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a resolver + description: Deletes a resolver from the configuration by it's name. + operationId: deleteResolver + tags: + - Resolver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Resolver name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + '204': + description: Resolver deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +nameservers: + get: + summary: Return an array of nameservers + description: Returns an array of all configured nameservers. + operationId: getNameservers + parameters: + - $ref: "#/parameters/transaction_id" + tags: + - Nameserver + - HAProxy configuration management + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + required: + - data + properties: + data: + $ref: "#/definitions/nameservers" + _version: + type: integer + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a nameserver + description: Adds a new nameserver to the resolvers section. + operationId: createNameserver + parameters: + - name: data + required: true + in: body + schema: + $ref: "#/definitions/nameserver" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + tags: + - Nameserver + - HAProxy configuration management + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/nameserver" + '201': + description: Nameserver created + schema: + $ref: "#/definitions/nameserver" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +nameservers_one: + get: + summary: Return a nameserver + description: Returns one nameserver configuration by it's name. + operationId: getNameserver + tags: + - Nameserver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Nameserver name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/nameserver" + _version: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a nameserver + description: Replaces a nameserver configuration by it's name. + operationId: replaceNameserver + tags: + - Nameserver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Nameserver name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/nameserver" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/nameserver" + '200': + description: Nameserver replaced + schema: + $ref: "#/definitions/nameserver" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a nameserver + description: Deletes a nameserver from the resolvers section by it's name. + operationId: deleteNameserver + tags: + - Nameserver + - HAProxy configuration management + parameters: + - name: name + in: path + description: Nameserver name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + '204': + description: Nameserver deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' servers: get: summary: Return an array of servers From 81253c503af3d0d3f90da90c07eb7ca15a573df3 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Thu, 26 Mar 2020 21:41:40 +0100 Subject: [PATCH 025/121] MINOR: add parameters for nameserver --- build/haproxy_spec.yaml | 25 +++++++++++++++++++++++++ paths/configuration.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 51685ca..5c83788 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -7844,6 +7844,11 @@ paths: description: Returns an array of all configured nameservers. operationId: getNameservers parameters: + - description: Parent resolver name + in: query + name: resolver + required: true + type: string - $ref: '#/parameters/transaction_id' responses: "200": @@ -7872,6 +7877,11 @@ paths: description: Adds a new nameserver to the resolvers section. operationId: createNameserver parameters: + - description: Parent resolver name + in: query + name: resolver + required: true + type: string - in: body name: data required: true @@ -7913,6 +7923,11 @@ paths: name: name required: true type: string + - description: Parent resolver name + in: query + name: resolver + required: true + type: string - $ref: '#/parameters/transaction_id' - $ref: '#/parameters/version' - $ref: '#/parameters/force_reload' @@ -7942,6 +7957,11 @@ paths: name: name required: true type: string + - description: Parent resolver name + in: query + name: resolver + required: true + type: string - $ref: '#/parameters/transaction_id' responses: "200": @@ -7975,6 +7995,11 @@ paths: name: name required: true type: string + - description: Parent resolver name + in: query + name: resolver + required: true + type: string - in: body name: data required: true diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 49c6a10..7ede8d1 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -1186,6 +1186,11 @@ nameservers: description: Returns an array of all configured nameservers. operationId: getNameservers parameters: + - name: resolver + in: query + description: Parent resolver name + required: true + type: string - $ref: "#/parameters/transaction_id" tags: - Nameserver @@ -1214,6 +1219,11 @@ nameservers: description: Adds a new nameserver to the resolvers section. operationId: createNameserver parameters: + - name: resolver + in: query + description: Parent resolver name + required: true + type: string - name: data required: true in: body @@ -1258,6 +1268,11 @@ nameservers_one: description: Nameserver name required: true type: string + - name: resolver + in: query + description: Parent resolver name + required: true + type: string - $ref: "#/parameters/transaction_id" responses: '200': @@ -1291,6 +1306,11 @@ nameservers_one: description: Nameserver name required: true type: string + - name: resolver + in: query + description: Parent resolver name + required: true + type: string - name: data required: true in: body @@ -1331,6 +1351,11 @@ nameservers_one: description: Nameserver name required: true type: string + - name: resolver + in: query + description: Parent resolver name + required: true + type: string - $ref: "#/parameters/transaction_id" - $ref: "#/parameters/version" - $ref: "#/parameters/force_reload" From e1ef9f1db16058823aa92b6cd8d5abd20b72edaa Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Fri, 27 Mar 2020 10:58:34 +0100 Subject: [PATCH 026/121] MINOR: remove put parameter for peer_section --- build/haproxy_spec.yaml | 40 ---------------------------------------- paths/configuration.yaml | 40 ---------------------------------------- 2 files changed, 80 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 5c83788..e7e7dde 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4600,46 +4600,6 @@ paths: tags: - Peer - HAProxy configuration management - put: - description: Replaces a peer configuration by it's name. - operationId: replacePeer - parameters: - - description: Peer name - in: path - name: name - required: true - type: string - - in: body - name: data - required: true - schema: - $ref: '#/definitions/peer_section' - - $ref: '#/parameters/transaction_id' - - $ref: '#/parameters/version' - - $ref: '#/parameters/force_reload' - responses: - "200": - description: Peer replaced - schema: - $ref: '#/definitions/peer_section' - "202": - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: '#/definitions/peer_section' - "400": - $ref: '#/responses/BadRequest' - "404": - $ref: '#/responses/NotFound' - default: - $ref: '#/responses/DefaultError' - summary: Replace a peer - tags: - - Peer - - HAProxy configuration management /services/haproxy/configuration/peer_entries: get: description: Returns an array of all peer_entries that are configured in specified diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 7ede8d1..1f71d4d 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -551,46 +551,6 @@ peer_section_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - put: - summary: Replace a peer - description: Replaces a peer configuration by it's name. - operationId: replacePeer - tags: - - Peer - - HAProxy configuration management - parameters: - - name: name - in: path - description: Peer name - required: true - type: string - - name: data - required: true - in: body - schema: - $ref: "#/definitions/peer_section" - - $ref: "#/parameters/transaction_id" - - $ref: "#/parameters/version" - - $ref: "#/parameters/force_reload" - responses: - '202': - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: "#/definitions/peer_section" - '200': - description: Peer replaced - schema: - $ref: "#/definitions/peer_section" - '400': - $ref: '#/responses/BadRequest' - '404': - $ref: '#/responses/NotFound' - 'default': - $ref: '#/responses/DefaultError' delete: summary: Delete a peer description: Deletes a peer from the configuration by it's name. From 96dd56b1ce39052d91d15dad0b4b365d0383b700 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Thu, 26 Mar 2020 22:23:36 +0100 Subject: [PATCH 027/121] FEATURE/MINOR: add unique-id-format|header --- build/haproxy_spec.yaml | 18 ++++++++++++++++++ models/configuration.yaml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index e7e7dde..0f3dbbf 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -406,6 +406,15 @@ definitions: tcplog: type: boolean x-display-name: TCP Log + unique_id_format: + type: string + x-display-name: Unique ID format + unique_id_header: + type: string + x-dependency: + unique_id_format: + required: true + x-display-name: Unique ID header title: Defaults type: object frontend: @@ -528,6 +537,15 @@ definitions: mode: value: tcp x-display-name: TCP Log + unique_id_format: + type: string + x-display-name: Unique ID format + unique_id_header: + type: string + x-dependency: + unique_id_format: + required: true + x-display-name: Unique ID header required: - name title: Frontend diff --git a/models/configuration.yaml b/models/configuration.yaml index 12b7d24..1e2ad93 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -224,6 +224,15 @@ defaults: x-go-name: ErrorFiles items: $ref: "#/definitions/errorfile" + unique_id_format: + type: string + x-display-name: Unique ID format + unique_id_header: + type: string + x-display-name: Unique ID header + x-dependency: + unique_id_format: + required: true additionalProperties: false resolver: title: Resolver @@ -387,6 +396,15 @@ frontend: x-dependency: mode: value: http + unique_id_format: + type: string + x-display-name: Unique ID format + unique_id_header: + type: string + x-display-name: Unique ID header + x-dependency: + unique_id_format: + required: true additionalProperties: false example: name: test_frontend From d9cbdbc8e07e2d681bdbd0075b51ff52888ed7dd Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sat, 28 Mar 2020 13:49:26 +0100 Subject: [PATCH 028/121] REFACTOR: change ID with Index in rules Changing ID to Index in rules in order to more accurately represent that field, that is not an unique ID for each rule, it is an index in an array of rules marking it's position inside the config file. --- build/haproxy_spec.yaml | 254 +++++++++++++++++++------------------- haproxy-spec.yaml | 20 +-- models/configuration.yaml | 40 +++--- paths/configuration.yaml | 180 +++++++++++++-------------- 4 files changed, 250 insertions(+), 244 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0f3dbbf..03f568e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1169,7 +1169,7 @@ definitions: - set-header - replace-value x-display-name: Header Name - id: + index: type: integer x-nullable: true log_level: @@ -1351,7 +1351,7 @@ definitions: required: true value: set-var required: - - id + - index - type title: HTTP Request Rule type: object @@ -1459,7 +1459,7 @@ definitions: - set-header - replace-value x-display-name: Header Name - id: + index: type: integer x-nullable: true log_level: @@ -1583,7 +1583,7 @@ definitions: required: true value: set-var required: - - id + - index - type title: HTTP Response Rule type: object @@ -1643,7 +1643,7 @@ definitions: freeFormat: true operation: getACLs property: acl_name - id: + index: type: integer x-nullable: true timeout: @@ -1662,7 +1662,7 @@ definitions: type: string x-nullable: false required: - - id + - index - type title: TCP Request Rule type: object @@ -1712,7 +1712,7 @@ definitions: freeFormat: true operation: getACLs property: acl_name - id: + index: type: integer x-nullable: true timeout: @@ -1729,7 +1729,7 @@ definitions: type: string x-nullable: false required: - - id + - index - type title: TCP Response Rule type: object @@ -1765,7 +1765,7 @@ definitions: freeFormat: true operation: getACLs property: acl_name - id: + index: type: integer x-nullable: true name: @@ -1777,7 +1777,7 @@ definitions: property: name x-nullable: false required: - - id + - index - name title: Backend Switching Rule type: object @@ -1813,7 +1813,7 @@ definitions: freeFormat: true operation: getACLs property: acl_name - id: + index: type: integer x-nullable: true target_server: @@ -1824,7 +1824,7 @@ definitions: property: name x-nullable: false required: - - id + - index - target_server title: Server Switching Rule type: object @@ -1850,7 +1850,7 @@ definitions: type: required: true value: cache - id: + index: type: integer x-nullable: true spoe_config: @@ -1898,7 +1898,7 @@ definitions: type: string x-nullable: false required: - - id + - index - type title: Filter type: object @@ -1933,7 +1933,7 @@ definitions: freeFormat: true operation: getACLs property: acl_name - id: + index: type: integer x-nullable: true pattern: @@ -1952,7 +1952,7 @@ definitions: type: string x-nullable: false required: - - id + - index - type - pattern title: Stick Rule @@ -2025,7 +2025,7 @@ definitions: value: false global: type: boolean - id: + index: type: integer x-nullable: true length: @@ -2072,7 +2072,7 @@ definitions: nolog: type: boolean required: - - id + - index title: Log Target type: object log_targets: @@ -2096,14 +2096,14 @@ definitions: pattern: ^[^\s]+$ type: string x-nullable: false - id: + index: type: integer x-nullable: true value: type: string x-nullable: false required: - - id + - index - acl_name - criterion - value @@ -5473,15 +5473,15 @@ paths: - Backend options - Frontend options - HTTPRequestRule - /services/haproxy/configuration/http_request_rules/{id}: + /services/haproxy/configuration/http_request_rules/{index}: delete: - description: Deletes a HTTP Request Rule configuration by it's ID from the specified + description: Deletes a HTTP Request Rule configuration by it's index from the specified parent. operationId: deleteHTTPRequestRule parameters: - - description: HTTP Request Rule ID + - description: HTTP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5520,13 +5520,13 @@ paths: - Frontend options - HTTPRequestRule get: - description: Returns one HTTP Request Rule configuration by it's ID in the specified + description: Returns one HTTP Request Rule configuration by it's index in the specified parent. operationId: getHTTPRequestRule parameters: - - description: HTTP Request Rule ID + - description: HTTP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5569,13 +5569,13 @@ paths: - Frontend options - HTTPRequestRule put: - description: Replaces a HTTP Request Rule configuration by it's ID in the specified + description: Replaces a HTTP Request Rule configuration by it's index in the specified parent. operationId: replaceHTTPRequestRule parameters: - - description: HTTP Request Rule ID + - description: HTTP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5719,15 +5719,15 @@ paths: - Backend options - Frontend options - HTTPResponseRule - /services/haproxy/configuration/http_response_rules/{id}: + /services/haproxy/configuration/http_response_rules/{index}: delete: - description: Deletes a HTTP Response Rule configuration by it's ID from the specified + description: Deletes a HTTP Response Rule configuration by it's index from the specified parent. operationId: deleteHTTPResponseRule parameters: - - description: HTTP Response Rule ID + - description: HTTP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5766,13 +5766,13 @@ paths: - Frontend options - HTTPResponseRule get: - description: Returns one HTTP Response Rule configuration by it's ID in the specified + description: Returns one HTTP Response Rule configuration by it's index in the specified parent. operationId: getHTTPResponseRule parameters: - - description: HTTP Response Rule ID + - description: HTTP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5815,13 +5815,13 @@ paths: - Frontend options - HTTPResponseRule put: - description: Replaces a HTTP Response Rule configuration by it's ID in the specified + description: Replaces a HTTP Response Rule configuration by it's index in the specified parent. operationId: replaceHTTPResponseRule parameters: - - description: HTTP Response Rule ID + - description: HTTP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -5966,15 +5966,15 @@ paths: - Backend options - Frontend options - TCPRequestRule - /services/haproxy/configuration/tcp_request_rules/{id}: + /services/haproxy/configuration/tcp_request_rules/{index}: delete: - description: Deletes a TCP Request Rule configuration by it's ID from the specified + description: Deletes a TCP Request Rule configuration by it's index from the specified parent. operationId: deleteTCPRequestRule parameters: - - description: TCP Request Rule ID + - description: TCP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -6013,13 +6013,13 @@ paths: - Frontend options - TCPRequestRule get: - description: Returns one TCP Request Rule configuration by it's ID in the specified + description: Returns one TCP Request Rule configuration by it's index in the specified parent. operationId: getTCPRequestRule parameters: - - description: TCP Request Rule ID + - description: TCP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -6062,13 +6062,13 @@ paths: - Frontend options - TCPRequestRule put: - description: Replaces a TCP Request Rule configuration by it's ID in the specified + description: Replaces a TCP Request Rule configuration by it's index in the specified parent. operationId: replaceTCPRequestRule parameters: - - description: TCP Request Rule ID + - description: TCP Request Rule Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -6196,15 +6196,15 @@ paths: - Backend options - Frontend options - TCPResponseRule - /services/haproxy/configuration/tcp_response_rules/{id}: + /services/haproxy/configuration/tcp_response_rules/{index}: delete: - description: Deletes a TCP Response Rule configuration by it's ID from the specified + description: Deletes a TCP Response Rule configuration by it's index from the specified backend. operationId: deleteTCPResponseRule parameters: - - description: TCP Response Rule ID + - description: TCP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent backend name @@ -6235,13 +6235,13 @@ paths: - Frontend options - TCPResponseRule get: - description: Returns one TCP Response Rule configuration by it's ID in the specified + description: Returns one TCP Response Rule configuration by it's index in the specified backend. operationId: getTCPResponseRule parameters: - - description: TCP Response Rule ID + - description: TCP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent backend name @@ -6276,13 +6276,13 @@ paths: - Frontend options - TCPResponseRule put: - description: Replaces a TCP Response Rule configuration by it's ID in the specified + description: Replaces a TCP Response Rule configuration by it's Index in the specified backend. operationId: replaceTCPResponseRule parameters: - - description: TCP Response Rule ID + - description: TCP Response Rule Index in: path - name: id + name: index required: true type: integer - description: Parent backend name @@ -6401,15 +6401,15 @@ paths: - HAProxy configuration management - Frontend options - BackendSwitchingRule - /services/haproxy/configuration/backend_switching_rules/{id}: + /services/haproxy/configuration/backend_switching_rules/{index}: delete: - description: Deletes a Backend Switching Rule configuration by it's ID from the + description: Deletes a Backend Switching Rule configuration by it's index from the specified frontend. operationId: deleteBackendSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Frontend name @@ -6439,13 +6439,13 @@ paths: - Frontend options - BackendSwitchingRule get: - description: Returns one Backend Switching Rule configuration by it's ID in the + description: Returns one Backend Switching Rule configuration by it's index in the specified frontend. operationId: getBackendSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Frontend name @@ -6479,13 +6479,13 @@ paths: - Frontend options - BackendSwitchingRule put: - description: Replaces a Backend Switching Rule configuration by it's ID in the specified - frontend. + description: Replaces a Backend Switching Rule configuration by it's index in the + specified frontend. operationId: replaceBackendSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Frontend name @@ -6603,15 +6603,15 @@ paths: - HAProxy configuration management - Backend options - ServerSwitchingRule - /services/haproxy/configuration/server_switching_rules/{id}: + /services/haproxy/configuration/server_switching_rules/{index}: delete: - description: Deletes a Server Switching Rule configuration by it's ID from the specified - backend. + description: Deletes a Server Switching Rule configuration by it's index from the + specified backend. operationId: deleteServerSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -6641,13 +6641,13 @@ paths: - Backend options - ServerSwitchingRule get: - description: Returns one Server Switching Rule configuration by it's ID in the specified - backend. + description: Returns one Server Switching Rule configuration by it's index in the + specified backend. operationId: getServerSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -6681,13 +6681,13 @@ paths: - Backend options - ServerSwitchingRule put: - description: Replaces a Server Switching Rule configuration by it's ID in the specified - backend. + description: Replaces a Server Switching Rule configuration by it's index in the + specified backend. operationId: replaceServerSwitchingRule parameters: - - description: Switching Rule ID + - description: Switching Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -6821,14 +6821,14 @@ paths: - Backend options - Frontend options - Filter - /services/haproxy/configuration/filters/{id}: + /services/haproxy/configuration/filters/{index}: delete: - description: Deletes a Filter configuration by it's ID from the specified parent. + description: Deletes a Filter configuration by it's index from the specified parent. operationId: deleteFilter parameters: - - description: Filter ID + - description: Filter Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -6867,12 +6867,12 @@ paths: - Frontend options - Filter get: - description: Returns one Filter configuration by it's ID in the specified parent. + description: Returns one Filter configuration by it's index in the specified parent. operationId: getFilter parameters: - - description: Filter ID + - description: Filter Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -6915,12 +6915,12 @@ paths: - Frontend options - Filter put: - description: Replaces a Filter configuration by it's ID in the specified parent. + description: Replaces a Filter configuration by it's index in the specified parent. operationId: replaceFilter parameters: - - description: Filter ID + - description: Filter Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7045,14 +7045,15 @@ paths: - HAProxy configuration management - Backend options - StickRule - /services/haproxy/configuration/stick_rules/{id}: + /services/haproxy/configuration/stick_rules/{index}: delete: - description: Deletes a Stick Rule configuration by it's ID from the specified backend. + description: Deletes a Stick Rule configuration by it's index from the specified + backend. operationId: deleteStickRule parameters: - - description: Stick Rule ID + - description: Stick Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -7082,12 +7083,13 @@ paths: - Backend options - StickRule get: - description: Returns one Stick Rule configuration by it's ID in the specified backend. + description: Returns one Stick Rule configuration by it's index in the specified + backend. operationId: getStickRule parameters: - - description: Stick Rule ID + - description: Stick Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -7121,12 +7123,13 @@ paths: - Backend options - StickRule put: - description: Replaces a Stick Rule configuration by it's ID in the specified backend. + description: Replaces a Stick Rule configuration by it's index in the specified + backend. operationId: replaceStickRule parameters: - - description: Stick Rule ID + - description: Stick Rule Index in: path - name: id + name: index required: true type: integer - description: Backend name @@ -7260,14 +7263,15 @@ paths: - Backend options - Frontend options - LogTarget - /services/haproxy/configuration/log_targets/{id}: + /services/haproxy/configuration/log_targets/{index}: delete: - description: Deletes a Log Target configuration by it's ID from the specified parent. + description: Deletes a Log Target configuration by it's index from the specified + parent. operationId: deleteLogTarget parameters: - - description: Log Target ID + - description: Log Target Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7306,12 +7310,13 @@ paths: - Frontend options - LogTarget get: - description: Returns one Log Target configuration by it's ID in the specified parent. + description: Returns one Log Target configuration by it's index in the specified + parent. operationId: getLogTarget parameters: - - description: Log Target ID + - description: Log Target Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7354,12 +7359,13 @@ paths: - Frontend options - LogTarget put: - description: Replaces a Log Target configuration by it's ID in the specified parent. + description: Replaces a Log Target configuration by it's index in the specified + parent. operationId: replaceLogTarget parameters: - - description: Log Target ID + - description: Log Target Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7502,14 +7508,14 @@ paths: - Backend options - Frontend options - ACL - /services/haproxy/configuration/acls/{id}: + /services/haproxy/configuration/acls/{index}: delete: - description: Deletes a ACL line configuration by it's ID from the specified parent. + description: Deletes a ACL line configuration by it's index from the specified parent. operationId: deleteAcl parameters: - - description: ACL line ID + - description: ACL line Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7548,12 +7554,12 @@ paths: - Frontend options - ACL get: - description: Returns one ACL line configuration by it's ID in the specified parent. + description: Returns one ACL line configuration by it's index in the specified parent. operationId: getAcl parameters: - - description: ACL line ID + - description: ACL line Index in: path - name: id + name: index required: true type: integer - description: Parent name @@ -7596,12 +7602,12 @@ paths: - Frontend options - ACL put: - description: Replaces a ACL line configuration by it's ID in the specified parent. + description: Replaces a ACL line configuration by it's index in the specified parent. operationId: replaceAcl parameters: - - description: ACL line ID + - description: ACL line Index in: path - name: id + name: index required: true type: integer - description: Parent name diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index c578d00..3a11293 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -449,43 +449,43 @@ paths: $ref: "paths/configuration.yaml#/servers_one" /services/haproxy/configuration/http_request_rules: $ref: "paths/configuration.yaml#/http_request_rules" - /services/haproxy/configuration/http_request_rules/{id}: + /services/haproxy/configuration/http_request_rules/{index}: $ref: "paths/configuration.yaml#/http_request_rules_one" /services/haproxy/configuration/http_response_rules: $ref: "paths/configuration.yaml#/http_response_rules" - /services/haproxy/configuration/http_response_rules/{id}: + /services/haproxy/configuration/http_response_rules/{index}: $ref: "paths/configuration.yaml#/http_response_rules_one" /services/haproxy/configuration/tcp_request_rules: $ref: "paths/configuration.yaml#/tcp_request_rules" - /services/haproxy/configuration/tcp_request_rules/{id}: + /services/haproxy/configuration/tcp_request_rules/{index}: $ref: "paths/configuration.yaml#/tcp_request_rules_one" /services/haproxy/configuration/tcp_response_rules: $ref: "paths/configuration.yaml#/tcp_response_rules" - /services/haproxy/configuration/tcp_response_rules/{id}: + /services/haproxy/configuration/tcp_response_rules/{index}: $ref: "paths/configuration.yaml#/tcp_response_rules_one" /services/haproxy/configuration/backend_switching_rules: $ref: "paths/configuration.yaml#/backend_switching_rules" - /services/haproxy/configuration/backend_switching_rules/{id}: + /services/haproxy/configuration/backend_switching_rules/{index}: $ref: "paths/configuration.yaml#/backend_switching_rules_one" /services/haproxy/configuration/server_switching_rules: $ref: "paths/configuration.yaml#/server_switching_rules" - /services/haproxy/configuration/server_switching_rules/{id}: + /services/haproxy/configuration/server_switching_rules/{index}: $ref: "paths/configuration.yaml#/server_switching_rules_one" /services/haproxy/configuration/filters: $ref: "paths/configuration.yaml#/filters" - /services/haproxy/configuration/filters/{id}: + /services/haproxy/configuration/filters/{index}: $ref: "paths/configuration.yaml#/filters_one" /services/haproxy/configuration/stick_rules: $ref: "paths/configuration.yaml#/stick_rules" - /services/haproxy/configuration/stick_rules/{id}: + /services/haproxy/configuration/stick_rules/{index}: $ref: "paths/configuration.yaml#/stick_rules_one" /services/haproxy/configuration/log_targets: $ref: "paths/configuration.yaml#/log_targets" - /services/haproxy/configuration/log_targets/{id}: + /services/haproxy/configuration/log_targets/{index}: $ref: "paths/configuration.yaml#/log_targets_one" /services/haproxy/configuration/acls: $ref: "paths/configuration.yaml#/acls" - /services/haproxy/configuration/acls/{id}: + /services/haproxy/configuration/acls/{index}: $ref: "paths/configuration.yaml#/acls_one" /services/haproxy/configuration/resolvers: $ref: "paths/configuration.yaml#/resolvers" diff --git a/models/configuration.yaml b/models/configuration.yaml index 1e2ad93..12c8136 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -814,10 +814,10 @@ http_request_rule: description: HAProxy HTTP request rule configuration (corresponds to http-request directives) type: object required: - - id + - index - type properties: - id: + index: type: integer x-nullable: true type: @@ -1064,10 +1064,10 @@ http_response_rule: description: HAProxy HTTP response rule configuration (corresponds to http-response directives) type: object required: - - id + - index - type properties: - id: + index: type: integer x-nullable: true type: @@ -1242,10 +1242,10 @@ tcp_request_rule: description: HAProxy TCP Request Rule configuration (corresponds to tcp-request) type: object required: - - id + - index - type properties: - id: + index: type: integer x-nullable: true type: @@ -1298,10 +1298,10 @@ tcp_response_rule: description: HAProxy TCP Response Rule configuration (corresponds to tcp-response) type: object required: - - id + - index - type properties: - id: + index: type: integer x-nullable: true type: @@ -1353,10 +1353,10 @@ backend_switching_rule: description: HAProxy backend switching rule configuration (corresponds to use_backend directive) type: object required: - - id + - index - name properties: - id: + index: type: integer x-nullable: true name: @@ -1392,10 +1392,10 @@ server_switching_rule: description: HAProxy server switching rule configuration (corresponds to use-server directive) type: object required: - - id + - index - target_server properties: - id: + index: type: integer x-nullable: true target_server: @@ -1430,10 +1430,10 @@ filter: description: HAProxy filters type: object required: - - id + - index - type properties: - id: + index: type: integer x-nullable: true type: @@ -1494,11 +1494,11 @@ stick_rule: description: Define a pattern used to create an entry in a stickiness table or matching condition or associate a user to a server. type: object required: - - id + - index - type - pattern properties: - id: + index: type: integer x-nullable: true type: @@ -1536,9 +1536,9 @@ log_target: description: Per-instance logging of events and traffic. type: object required: - - id + - index properties: - id: + index: type: integer x-nullable: true global: @@ -1607,12 +1607,12 @@ acl: from the request, the response or any environmental status. type: object required: - - id + - index - acl_name - criterion - value properties: - id: + index: type: integer x-nullable: true acl_name: diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 1f71d4d..ae36385 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -1610,7 +1610,7 @@ tcp_response_rules: tcp_response_rules_one: get: summary: Return one TCP Response Rule - description: Returns one TCP Response Rule configuration by it's ID in the specified backend. + description: Returns one TCP Response Rule configuration by it's index in the specified backend. operationId: getTCPResponseRule tags: - HAProxy configuration management @@ -1618,9 +1618,9 @@ tcp_response_rules_one: - Frontend options - TCPResponseRule parameters: - - name: id + - name: index in: path - description: TCP Response Rule ID + description: TCP Response Rule Index required: true type: integer - name: backend @@ -1650,7 +1650,7 @@ tcp_response_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a TCP Response Rule - description: Replaces a TCP Response Rule configuration by it's ID in the specified backend. + description: Replaces a TCP Response Rule configuration by it's Index in the specified backend. operationId: replaceTCPResponseRule tags: - HAProxy configuration management @@ -1658,9 +1658,9 @@ tcp_response_rules_one: - Frontend options - TCPResponseRule parameters: - - name: id + - name: index in: path - description: TCP Response Rule ID + description: TCP Response Rule Index required: true type: integer - name: backend @@ -1697,7 +1697,7 @@ tcp_response_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a TCP Response Rule - description: Deletes a TCP Response Rule configuration by it's ID from the specified backend. + description: Deletes a TCP Response Rule configuration by it's index from the specified backend. operationId: deleteTCPResponseRule tags: - HAProxy configuration management @@ -1705,9 +1705,9 @@ tcp_response_rules_one: - Frontend options - TCPResponseRule parameters: - - name: id + - name: index in: path - description: TCP Response Rule ID + description: TCP Response Rule Index required: true type: integer - name: backend @@ -1824,7 +1824,7 @@ tcp_request_rules: tcp_request_rules_one: get: summary: Return one TCP Request Rule - description: Returns one TCP Request Rule configuration by it's ID in the specified parent. + description: Returns one TCP Request Rule configuration by it's index in the specified parent. operationId: getTCPRequestRule tags: - HAProxy configuration management @@ -1832,9 +1832,9 @@ tcp_request_rules_one: - Frontend options - TCPRequestRule parameters: - - name: id + - name: index in: path - description: TCP Request Rule ID + description: TCP Request Rule Index required: true type: integer - name: parent_name @@ -1870,7 +1870,7 @@ tcp_request_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a TCP Request Rule - description: Replaces a TCP Request Rule configuration by it's ID in the specified parent. + description: Replaces a TCP Request Rule configuration by it's index in the specified parent. operationId: replaceTCPRequestRule tags: - HAProxy configuration management @@ -1878,9 +1878,9 @@ tcp_request_rules_one: - Frontend options - TCPRequestRule parameters: - - name: id + - name: index in: path - description: TCP Request Rule ID + description: TCP Request Rule Index required: true type: integer - name: parent_name @@ -1923,7 +1923,7 @@ tcp_request_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a TCP Request Rule - description: Deletes a TCP Request Rule configuration by it's ID from the specified parent. + description: Deletes a TCP Request Rule configuration by it's index from the specified parent. operationId: deleteTCPRequestRule tags: - HAProxy configuration management @@ -1931,9 +1931,9 @@ tcp_request_rules_one: - Frontend options - TCPRequestRule parameters: - - name: id + - name: index in: path - description: TCP Request Rule ID + description: TCP Request Rule Index required: true type: integer - name: parent_name @@ -2056,7 +2056,7 @@ http_request_rules: http_request_rules_one: get: summary: Return one HTTP Request Rule - description: Returns one HTTP Request Rule configuration by it's ID in the specified parent. + description: Returns one HTTP Request Rule configuration by it's index in the specified parent. operationId: getHTTPRequestRule tags: - HAProxy configuration management @@ -2064,9 +2064,9 @@ http_request_rules_one: - Frontend options - HTTPRequestRule parameters: - - name: id + - name: index in: path - description: HTTP Request Rule ID + description: HTTP Request Rule Index required: true type: integer - name: parent_name @@ -2102,7 +2102,7 @@ http_request_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a HTTP Request Rule - description: Replaces a HTTP Request Rule configuration by it's ID in the specified parent. + description: Replaces a HTTP Request Rule configuration by it's index in the specified parent. operationId: replaceHTTPRequestRule tags: - HAProxy configuration management @@ -2110,9 +2110,9 @@ http_request_rules_one: - Frontend options - HTTPRequestRule parameters: - - name: id + - name: index in: path - description: HTTP Request Rule ID + description: HTTP Request Rule Index required: true type: integer - name: parent_name @@ -2155,7 +2155,7 @@ http_request_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a HTTP Request Rule - description: Deletes a HTTP Request Rule configuration by it's ID from the specified parent. + description: Deletes a HTTP Request Rule configuration by it's index from the specified parent. operationId: deleteHTTPRequestRule tags: - HAProxy configuration management @@ -2163,9 +2163,9 @@ http_request_rules_one: - Frontend options - HTTPRequestRule parameters: - - name: id + - name: index in: path - description: HTTP Request Rule ID + description: HTTP Request Rule Index required: true type: integer - name: parent_name @@ -2288,7 +2288,7 @@ http_response_rules: http_response_rules_one: get: summary: Return one HTTP Response Rule - description: Returns one HTTP Response Rule configuration by it's ID in the specified parent. + description: Returns one HTTP Response Rule configuration by it's index in the specified parent. operationId: getHTTPResponseRule tags: - HAProxy configuration management @@ -2296,9 +2296,9 @@ http_response_rules_one: - Frontend options - HTTPResponseRule parameters: - - name: id + - name: index in: path - description: HTTP Response Rule ID + description: HTTP Response Rule Index required: true type: integer - name: parent_name @@ -2334,7 +2334,7 @@ http_response_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a HTTP Response Rule - description: Replaces a HTTP Response Rule configuration by it's ID in the specified parent. + description: Replaces a HTTP Response Rule configuration by it's index in the specified parent. operationId: replaceHTTPResponseRule tags: - HAProxy configuration management @@ -2342,9 +2342,9 @@ http_response_rules_one: - Frontend options - HTTPResponseRule parameters: - - name: id + - name: index in: path - description: HTTP Response Rule ID + description: HTTP Response Rule Index required: true type: integer - name: parent_name @@ -2387,7 +2387,7 @@ http_response_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a HTTP Response Rule - description: Deletes a HTTP Response Rule configuration by it's ID from the specified parent. + description: Deletes a HTTP Response Rule configuration by it's index from the specified parent. operationId: deleteHTTPResponseRule tags: - HAProxy configuration management @@ -2395,9 +2395,9 @@ http_response_rules_one: - Frontend options - HTTPResponseRule parameters: - - name: id + - name: index in: path - description: HTTP Response Rule ID + description: HTTP Response Rule Index required: true type: integer - name: parent_name @@ -2506,16 +2506,16 @@ backend_switching_rules: backend_switching_rules_one: get: summary: Return one Backend Switching Rule - description: Returns one Backend Switching Rule configuration by it's ID in the specified frontend. + description: Returns one Backend Switching Rule configuration by it's index in the specified frontend. operationId: getBackendSwitchingRule tags: - HAProxy configuration management - Frontend options - BackendSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: frontend @@ -2545,16 +2545,16 @@ backend_switching_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a Backend Switching Rule - description: Replaces a Backend Switching Rule configuration by it's ID in the specified frontend. + description: Replaces a Backend Switching Rule configuration by it's index in the specified frontend. operationId: replaceBackendSwitchingRule tags: - HAProxy configuration management - Frontend options - BackendSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: frontend @@ -2591,16 +2591,16 @@ backend_switching_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a Backend Switching Rule - description: Deletes a Backend Switching Rule configuration by it's ID from the specified frontend. + description: Deletes a Backend Switching Rule configuration by it's index from the specified frontend. operationId: deleteBackendSwitchingRule tags: - HAProxy configuration management - Frontend options - BackendSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: frontend @@ -2703,16 +2703,16 @@ server_switching_rules: server_switching_rules_one: get: summary: Return one Server Switching Rule - description: Returns one Server Switching Rule configuration by it's ID in the specified backend. + description: Returns one Server Switching Rule configuration by it's index in the specified backend. operationId: getServerSwitchingRule tags: - HAProxy configuration management - Backend options - ServerSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: backend @@ -2742,16 +2742,16 @@ server_switching_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a Server Switching Rule - description: Replaces a Server Switching Rule configuration by it's ID in the specified backend. + description: Replaces a Server Switching Rule configuration by it's index in the specified backend. operationId: replaceServerSwitchingRule tags: - HAProxy configuration management - Backend options - ServerSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: backend @@ -2788,16 +2788,16 @@ server_switching_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a Server Switching Rule - description: Deletes a Server Switching Rule configuration by it's ID from the specified backend. + description: Deletes a Server Switching Rule configuration by it's index from the specified backend. operationId: deleteServerSwitchingRule tags: - HAProxy configuration management - Backend options - ServerSwitchingRule parameters: - - name: id + - name: index in: path - description: Switching Rule ID + description: Switching Rule Index required: true type: integer - name: backend @@ -2982,7 +2982,7 @@ filters: filters_one: get: summary: Return one Filter - description: Returns one Filter configuration by it's ID in the specified parent. + description: Returns one Filter configuration by it's index in the specified parent. operationId: getFilter tags: - HAProxy configuration management @@ -2990,9 +2990,9 @@ filters_one: - Frontend options - Filter parameters: - - name: id + - name: index in: path - description: Filter ID + description: Filter Index required: true type: integer - name: parent_name @@ -3028,7 +3028,7 @@ filters_one: $ref: '#/responses/DefaultError' put: summary: Replace a Filter - description: Replaces a Filter configuration by it's ID in the specified parent. + description: Replaces a Filter configuration by it's index in the specified parent. operationId: replaceFilter tags: - HAProxy configuration management @@ -3036,9 +3036,9 @@ filters_one: - Frontend options - Filter parameters: - - name: id + - name: index in: path - description: Filter ID + description: Filter Index required: true type: integer - name: parent_name @@ -3081,7 +3081,7 @@ filters_one: $ref: '#/responses/DefaultError' delete: summary: Delete a Filter - description: Deletes a Filter configuration by it's ID from the specified parent. + description: Deletes a Filter configuration by it's index from the specified parent. operationId: deleteFilter tags: - HAProxy configuration management @@ -3089,9 +3089,9 @@ filters_one: - Frontend options - Filter parameters: - - name: id + - name: index in: path - description: Filter ID + description: Filter Index required: true type: integer - name: parent_name @@ -3200,16 +3200,16 @@ stick_rules: stick_rules_one: get: summary: Return one Stick Rule - description: Returns one Stick Rule configuration by it's ID in the specified backend. + description: Returns one Stick Rule configuration by it's index in the specified backend. operationId: getStickRule tags: - HAProxy configuration management - Backend options - StickRule parameters: - - name: id + - name: index in: path - description: Stick Rule ID + description: Stick Rule Index required: true type: integer - name: backend @@ -3239,16 +3239,16 @@ stick_rules_one: $ref: '#/responses/DefaultError' put: summary: Replace a Stick Rule - description: Replaces a Stick Rule configuration by it's ID in the specified backend. + description: Replaces a Stick Rule configuration by it's index in the specified backend. operationId: replaceStickRule tags: - HAProxy configuration management - Backend options - StickRule parameters: - - name: id + - name: index in: path - description: Stick Rule ID + description: Stick Rule Index required: true type: integer - name: backend @@ -3285,16 +3285,16 @@ stick_rules_one: $ref: '#/responses/DefaultError' delete: summary: Delete a Stick Rule - description: Deletes a Stick Rule configuration by it's ID from the specified backend. + description: Deletes a Stick Rule configuration by it's index from the specified backend. operationId: deleteStickRule tags: - HAProxy configuration management - Backend options - StickRule parameters: - - name: id + - name: index in: path - description: Stick Rule ID + description: Stick Rule Index required: true type: integer - name: backend @@ -3411,7 +3411,7 @@ log_targets: log_targets_one: get: summary: Return one Log Target - description: Returns one Log Target configuration by it's ID in the specified parent. + description: Returns one Log Target configuration by it's index in the specified parent. operationId: getLogTarget tags: - HAProxy configuration management @@ -3419,9 +3419,9 @@ log_targets_one: - Frontend options - LogTarget parameters: - - name: id + - name: index in: path - description: Log Target ID + description: Log Target Index required: true type: integer - name: parent_name @@ -3457,7 +3457,7 @@ log_targets_one: $ref: '#/responses/DefaultError' put: summary: Replace a Log Target - description: Replaces a Log Target configuration by it's ID in the specified parent. + description: Replaces a Log Target configuration by it's index in the specified parent. operationId: replaceLogTarget tags: - HAProxy configuration management @@ -3465,9 +3465,9 @@ log_targets_one: - Frontend options - LogTarget parameters: - - name: id + - name: index in: path - description: Log Target ID + description: Log Target Index required: true type: integer - name: parent_name @@ -3510,7 +3510,7 @@ log_targets_one: $ref: '#/responses/DefaultError' delete: summary: Delete a Log Target - description: Deletes a Log Target configuration by it's ID from the specified parent. + description: Deletes a Log Target configuration by it's index from the specified parent. operationId: deleteLogTarget tags: - HAProxy configuration management @@ -3518,9 +3518,9 @@ log_targets_one: - Frontend options - LogTarget parameters: - - name: id + - name: index in: path - description: Log Target ID + description: Log Target Index required: true type: integer - name: parent_name @@ -3643,7 +3643,7 @@ acls: acls_one: get: summary: Return one ACL line - description: Returns one ACL line configuration by it's ID in the specified parent. + description: Returns one ACL line configuration by it's index in the specified parent. operationId: getAcl tags: - HAProxy configuration management @@ -3651,9 +3651,9 @@ acls_one: - Frontend options - ACL parameters: - - name: id + - name: index in: path - description: ACL line ID + description: ACL line Index required: true type: integer - name: parent_name @@ -3689,7 +3689,7 @@ acls_one: $ref: '#/responses/DefaultError' put: summary: Replace a ACL line - description: Replaces a ACL line configuration by it's ID in the specified parent. + description: Replaces a ACL line configuration by it's index in the specified parent. operationId: replaceAcl tags: - HAProxy configuration management @@ -3697,9 +3697,9 @@ acls_one: - Frontend options - ACL parameters: - - name: id + - name: index in: path - description: ACL line ID + description: ACL line Index required: true type: integer - name: parent_name @@ -3742,7 +3742,7 @@ acls_one: $ref: '#/responses/DefaultError' delete: summary: Delete a ACL line - description: Deletes a ACL line configuration by it's ID from the specified parent. + description: Deletes a ACL line configuration by it's index from the specified parent. operationId: deleteAcl tags: - HAProxy configuration management @@ -3750,9 +3750,9 @@ acls_one: - Frontend options - ACL parameters: - - name: id + - name: index in: path - description: ACL line ID + description: ACL line Index required: true type: integer - name: parent_name From 62f9b27367937214a79af216b39d0d52bfda58e0 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sat, 28 Mar 2020 14:30:00 +0100 Subject: [PATCH 029/121] MINOR: bind_process remove from definitions --- build/haproxy_spec.yaml | 12 ++++++------ haproxy-spec.yaml | 2 -- models/configuration.yaml | 14 +++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 03f568e..5121ce8 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -272,7 +272,8 @@ definitions: balance: $ref: '#/definitions/balance' bind_process: - $ref: '#/definitions/bind_process' + pattern: ^[^\s]+$ + type: string check_timeout: type: integer x-nullable: true @@ -428,7 +429,8 @@ definitions: name: test_frontend properties: bind_process: - $ref: '#/definitions/bind_process' + pattern: ^[^\s]+$ + type: string clflog: type: boolean x-dependency: @@ -590,7 +592,8 @@ definitions: balance: $ref: '#/definitions/balance' bind_process: - $ref: '#/definitions/bind_process' + pattern: ^[^\s]+$ + type: string check_timeout: type: integer x-nullable: true @@ -3409,9 +3412,6 @@ definitions: required: - type type: object - bind_process: - pattern: ^[^\s]+$ - type: string redispatch: properties: enabled: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 3a11293..3600bba 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -236,8 +236,6 @@ definitions: $ref: "models/configuration.yaml#/httpchk" http-check: $ref: "models/configuration.yaml#/http-check" - bind_process: - $ref: "models/configuration.yaml#/bind_process" redispatch: $ref: "models/configuration.yaml#/redispatch" errorfile: diff --git a/models/configuration.yaml b/models/configuration.yaml index 12c8136..7566388 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -120,7 +120,8 @@ defaults: http-check: $ref: "#/definitions/http-check" bind_process: - $ref: "#/definitions/bind_process" + type: string + pattern: '^[^\s]+$' http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] @@ -314,7 +315,8 @@ frontend: mode: value: http bind_process: - $ref: "#/definitions/bind_process" + type: string + pattern: '^[^\s]+$' clflog: type: boolean x-display-name: CLF Log @@ -440,7 +442,8 @@ backend: http-check: $ref: "#/definitions/http-check" bind_process: - $ref: "#/definitions/bind_process" + type: string + pattern: '^[^\s]+$' mode: type: string enum: [http, tcp] @@ -1860,7 +1863,4 @@ http-check: x-dependency: type: value: expect - required: true -bind_process: - type: string - pattern: '^[^\s]+$' + required: true \ No newline at end of file From eebfbad19128d96b11b1969e96d79a442ad2dcd5 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sat, 28 Mar 2020 19:23:29 +0100 Subject: [PATCH 030/121] MINOR: tags: add missing tags --- build/haproxy_spec.yaml | 3 +++ haproxy-spec.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 5121ce8..061769a 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3686,6 +3686,9 @@ tags: - name: ACL - name: Resolver - name: Nameserver + - name: Peer + - name: PeerEntry + - name: Cluster security: - basic_auth: [] paths: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 3600bba..26db297 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -384,6 +384,9 @@ tags: - name: ACL - name: Resolver - name: Nameserver + - name: Peer + - name: PeerEntry + - name: Cluster security: - basic_auth: [] paths: From 30c63e0b0385488eef6dbb4e1b40d36120882d80 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sat, 28 Mar 2020 19:56:09 +0100 Subject: [PATCH 031/121] BUG/MINOR: peers: fix peers tags and return schema --- build/haproxy_spec.yaml | 6 +++--- paths/configuration.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 061769a..e2c35ed 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4513,7 +4513,7 @@ paths: _version: type: integer data: - $ref: '#/definitions/peer_section' + $ref: '#/definitions/peer_sections' required: - data type: object @@ -4695,7 +4695,7 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new peer_entry tags: - - Peer_Entry + - PeerEntry - HAProxy configuration management /services/haproxy/configuration/peer_entries/{name}: delete: @@ -4731,7 +4731,7 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a peer_entry tags: - - Peer_Entry + - PeerEntry - HAProxy configuration management - Peers options get: diff --git a/paths/configuration.yaml b/paths/configuration.yaml index ae36385..afdaff5 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -477,7 +477,7 @@ peer_section: - data properties: data: - $ref: "#/definitions/peer_section" + $ref: "#/definitions/peer_sections" _version: type: integer 'default': @@ -620,7 +620,7 @@ peer_entries: description: Adds a new peer entry in the specified peer section in the configuration file. operationId: createPeerEntry tags: - - Peer_Entry + - PeerEntry - HAProxy configuration management parameters: - name: peer_section @@ -745,7 +745,7 @@ peer_entries_one: description: Deletes a peer entry configuration by it's name in the specified peer section. operationId: deletePeerEntry tags: - - Peer_Entry + - PeerEntry - HAProxy configuration management - Peers options parameters: From 37e3c0df608fb0b12c03a26f13f0bdef181f3715 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sun, 29 Mar 2020 11:48:52 +0200 Subject: [PATCH 032/121] MEDIUM: server: add resolvers options --- build/haproxy_spec.yaml | 36 ++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index e2c35ed..71efe8e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -991,6 +991,24 @@ definitions: proto: pattern: ^[^\s]+$ type: string + resolve-net: + pattern: ^[^\s]+$ + type: string + x-dependency: + resolvers: + required: true + resolve-prefer: + pattern: ^[^\s]+$ + type: string + x-dependency: + resolvers: + required: true + resolvers: + pattern: ^[^\s]+$ + type: string + x-dynamic-enum: + operation: getResolvers + property: name send-proxy: enum: - enabled @@ -3348,6 +3366,24 @@ definitions: minimum: 1 type: integer x-nullable: true + resolve-net: + pattern: ^[^\s]+$ + type: string + x-dependency: + resolvers: + required: true + resolve-prefer: + pattern: ^[^\s]+$ + type: string + x-dependency: + resolvers: + required: true + resolvers: + pattern: ^[^\s]+$ + type: string + x-dynamic-enum: + operation: getResolvers + property: name rise: type: integer x-nullable: true diff --git a/models/configuration.yaml b/models/configuration.yaml index 7566388..3f52926 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -804,6 +804,24 @@ server: x-dependency: ssl: value: enabled + resolvers: + type: string + pattern: '^[^\s]+$' + x-dynamic-enum: + operation: getResolvers + property: name + resolve-prefer: + type: string + pattern: '^[^\s]+$' + x-dependency: + resolvers: + required: true + resolve-net: + type: string + pattern: '^[^\s]+$' + x-dependency: + resolvers: + required: true additionalProperties: false example: name: www @@ -1665,6 +1683,24 @@ default_server: minimum: 1 maximum: 65535 x-nullable: true + resolvers: + type: string + pattern: '^[^\s]+$' + x-dynamic-enum: + operation: getResolvers + property: name + resolve-prefer: + type: string + pattern: '^[^\s]+$' + x-dependency: + resolvers: + required: true + resolve-net: + type: string + pattern: '^[^\s]+$' + x-dependency: + resolvers: + required: true forwardfor: type: object x-display-name: ForwardFor From 8fb8711ea942d16cadec57a9781ae9b9e7afc632 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Sun, 29 Mar 2020 20:52:55 +0200 Subject: [PATCH 033/121] MEDIUM: raw: add skip reloads in raw config --- build/haproxy_spec.yaml | 16 ++++++++++++++-- paths/configuration.yaml | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 71efe8e..a6d639b 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -8062,7 +8062,7 @@ paths: - $ref: '#/parameters/transaction_id' - $ref: '#/parameters/version' produces: - - text/plain + - application/json responses: "200": description: Operation successful @@ -8097,10 +8097,22 @@ paths: required: true schema: type: string + - default: false + description: If set, no reload will be initiated and runtime actions from X-Runtime-Actions + will be applied + in: query + name: skip_reload + required: false + type: boolean + - description: List of Runtime API commands with parameters separated by ';' + in: header + name: X-Runtime-Actions + required: false + type: string - $ref: '#/parameters/version' - $ref: '#/parameters/force_reload' produces: - - text/plain + - application/json responses: "201": description: New HAProxy configuration pushed diff --git a/paths/configuration.yaml b/paths/configuration.yaml index afdaff5..4da5457 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -2830,7 +2830,7 @@ configuration: - $ref: "#/parameters/transaction_id" - $ref: "#/parameters/version" produces: - - text/plain + - application/json tags: - Configuration - HAProxy configuration management @@ -2858,7 +2858,7 @@ configuration: description: Push a new haproxy configuration file in plain text operationId: postHAProxyConfiguration produces: - - text/plain + - application/json consumes: - text/plain parameters: @@ -2867,6 +2867,17 @@ configuration: required: true schema: type: string + - name: skip_reload + in: query + description: If set, no reload will be initiated and runtime actions from X-Runtime-Actions will be applied + type: boolean + required: false + default: false + - name: X-Runtime-Actions + in: header + description: List of Runtime API commands with parameters separated by ';' + type: string + required: false - $ref: "#/parameters/version" - $ref: "#/parameters/force_reload" tags: From be19c3dde1171e042701ca0cf53516a1021a711e Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Fri, 27 Mar 2020 10:12:21 +0100 Subject: [PATCH 034/121] MINOR: add options logasap and allbackends --- build/haproxy_spec.yaml | 24 ++++++++++++++++++++++++ models/configuration.yaml | 18 +++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index a6d639b..a2fb951 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -269,6 +269,12 @@ definitions: - redis-check type: string x-display-name: Advanced Check + allbackups: + enum: + - enabled + - disabled + type: string + x-display-name: All Backups balance: $ref: '#/definitions/balance' bind_process: @@ -384,6 +390,12 @@ definitions: log_tag: pattern: ^[^\s]+$ type: string + logasap: + enum: + - enabled + - disabled + type: string + x-display-name: Log ASAP maxconn: type: integer x-display-name: Max Connections @@ -520,6 +532,12 @@ definitions: log_tag: pattern: ^[A-Za-z0-9-_.:]+$ type: string + logasap: + enum: + - enabled + - disabled + type: string + x-display-name: Log ASAP maxconn: type: integer x-display-name: Max Connections @@ -589,6 +607,12 @@ definitions: - redis-check type: string x-display-name: Advanced Check + allbackups: + enum: + - enabled + - disabled + type: string + x-display-name: All Backups balance: $ref: '#/definitions/balance' bind_process: diff --git a/models/configuration.yaml b/models/configuration.yaml index 3f52926..b25134b 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -234,6 +234,14 @@ defaults: x-dependency: unique_id_format: required: true + logasap: + type: string + enum: [enabled, disabled] + x-display-name: Log ASAP + allbackups: + type: string + enum: [enabled, disabled] + x-display-name: All Backups additionalProperties: false resolver: title: Resolver @@ -314,6 +322,10 @@ frontend: x-dependency: mode: value: http + logasap: + type: string + enum: [enabled, disabled] + x-display-name: Log ASAP bind_process: type: string pattern: '^[^\s]+$' @@ -447,6 +459,10 @@ backend: mode: type: string enum: [http, tcp] + allbackups: + type: string + enum: [enabled, disabled] + x-display-name: All Backups log_tag: type: string pattern: '^[^\s]+$' @@ -1899,4 +1915,4 @@ http-check: x-dependency: type: value: expect - required: true \ No newline at end of file + required: true From c53096813c40213770e8a27a0b22682ff14362ea Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Mon, 30 Mar 2020 11:20:29 +0200 Subject: [PATCH 035/121] BUG/MINOR: set resolver attributes of type time non nullable --- build/haproxy_spec.yaml | 8 ++++++++ models/configuration.yaml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index a2fb951..4da15b0 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3557,16 +3557,22 @@ definitions: type: integer hold_nx: type: integer + x-nullable: false hold_obsolete: type: integer + x-nullable: false hold_other: type: integer + x-nullable: false hold_refused: type: integer + x-nullable: false hold_timeout: type: integer + x-nullable: false hold_valid: type: integer + x-nullable: false name: pattern: ^[A-Za-z0-9-_.:]+$ type: string @@ -3578,8 +3584,10 @@ definitions: type: integer timeout_resolve: type: integer + x-nullable: false timeout_retry: type: integer + x-nullable: false required: - name title: Resolver diff --git a/models/configuration.yaml b/models/configuration.yaml index b25134b..e0bd3f5 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -259,16 +259,22 @@ resolver: minimum: 1232 hold_nx: type: integer + x-nullable: false hold_obsolete: type: integer + x-nullable: false hold_other: type: integer + x-nullable: false hold_refused: type: integer + x-nullable: false hold_timeout: type: integer + x-nullable: false hold_valid: type: integer + x-nullable: false parse-resolv-conf: type: boolean resolve_retries: @@ -276,8 +282,10 @@ resolver: minimum: 1 timeout_resolve: type: integer + x-nullable: false timeout_retry: type: integer + x-nullable: false nameserver: title: Nameserver description: Nameserver used in Runtime DNS configuration From 9a40bbb27e1fc858e4c420d33765c9db895ad68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Mon, 30 Mar 2020 14:07:47 +0000 Subject: [PATCH 036/121] FEATURE/MEDIUM: stats: add full support --- build/haproxy_spec.yaml | 34 ++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 2 ++ models/configuration.yaml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4da15b0..d373550 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -416,6 +416,8 @@ definitions: server_timeout: type: integer x-nullable: true + stats_options: + $ref: '#/definitions/stats_options' tcplog: type: boolean x-display-name: TCP Log @@ -551,6 +553,8 @@ definitions: pattern: ^[A-Za-z0-9-_.:]+$ type: string x-nullable: false + stats_options: + $ref: '#/definitions/stats_options' tcplog: type: boolean x-dependency: @@ -675,6 +679,7 @@ definitions: enum: - enabled - disabled + pattern: ^[^\s]+$ type: string x-dependency: mode: @@ -746,6 +751,8 @@ definitions: server_timeout: type: integer x-nullable: true + stats_options: + $ref: '#/definitions/stats_options' stick_table: properties: expire: @@ -2669,6 +2676,33 @@ definitions: type: array title: Stats collection type: object + stats_options: + properties: + stats_enable: + type: boolean + x-display-name: Stats Enable + stats_hide_version: + type: boolean + x-display-name: Stats Hide Version + stats_maxconn: + minimum: 1 + type: integer + stats_refresh_delay: + type: integer + x-nullable: true + stats_show_desc: + pattern: ^[^\s]+$ + type: string + stats_show_legends: + type: boolean + x-display-name: Stats Show Legends + stats_show_node_name: + pattern: ^[^\s]+$ + type: string + stats_uri_prefix: + pattern: ^[^\s]+$ + type: string + type: object error: additionalProperties: type: string diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 26db297..f6c70f6 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -166,6 +166,8 @@ definitions: $ref: "models/stats.yaml#/native_stat_stats" native_stats_collection: $ref: "models/stats.yaml#/native_stats_collection" + stats_options: + $ref: "models/configuration.yaml#/stats_options" error: $ref: "models/errors.yaml#/error" endpoint: diff --git a/models/configuration.yaml b/models/configuration.yaml index e0bd3f5..ec847a6 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -242,6 +242,8 @@ defaults: type: string enum: [enabled, disabled] x-display-name: All Backups + stats_options: + $ref: "#/definitions/stats_options" additionalProperties: false resolver: title: Resolver @@ -427,6 +429,8 @@ frontend: x-dependency: unique_id_format: required: true + stats_options: + $ref: "#/definitions/stats_options" additionalProperties: false example: name: test_frontend @@ -588,6 +592,9 @@ backend: x-dependency: mode: value: http + pattern: '^[^\s]+$' + stats_options: + $ref: "#/definitions/stats_options" additionalProperties: false example: name: test_backend @@ -1924,3 +1931,30 @@ http-check: type: value: expect required: true +stats_options: + type: object + properties: + stats_enable: + type: boolean + x-display-name: Stats Enable + stats_hide_version: + type: boolean + x-display-name: Stats Hide Version + stats_maxconn: + type: integer + minimum: 1 + stats_refresh_delay: + type: integer + x-nullable: true + stats_show_desc: + type: string + pattern: '^[^\s]+$' + stats_show_legends: + type: boolean + x-display-name: Stats Show Legends + stats_show_node_name: + type: string + pattern: '^[^\s]+$' + stats_uri_prefix: + type: string + pattern: '^[^\s]+$' From bd1501e8db4b40692fa8d52d8104b8dbf5e2d3b3 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Tue, 25 Feb 2020 15:35:28 +0100 Subject: [PATCH 037/121] FEATURE/MAJOR: tcp-request: full implementation --- build/haproxy_spec.yaml | 228 ++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 159 +++++++++++++++++++++++++- 2 files changed, 386 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index d373550..ba65514 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1657,7 +1657,26 @@ definitions: action: enum: - accept + - capture + - do-resolve + - expect-netscaler-cip + - expect-proxy - reject + - sc-inc-gpc0 + - sc-inc-gpc1 + - sc-set-gpt0 + - send-spoe-group + - set-dst-port + - set-dst + - set-priority + - set-src + - set-var + - silent-drop + - track-sc0 + - track-sc1 + - track-sc2 + - unset-var + - use-service type: string x-dependency: type: @@ -1667,6 +1686,31 @@ definitions: - content - session x-nullable: false + capture_len: + type: integer + x-dependency: + action: + required: true + value: capture + type: + required: true + value: + - connection + - content + x-display-name: Capture Length + capture_sample: + pattern: ^[^\s]+$ + type: string + x-dependency: + action: + required: true + value: capture + type: + required: true + value: + - connection + - content + x-display-name: Capture Sample cond: enum: - if @@ -1695,9 +1739,135 @@ definitions: freeFormat: true operation: getACLs property: acl_name + expr: + type: string + x-dependency: + action: + required: true + value: + - do-resolve + - set-var + - set-src + - set-priority + - set-dst + - set-dst-port + type: + value: + - session + - connection + - content + x-display-name: Standard HAProxy expression + gpt_value: + type: string + x-dependency: + action: + required: true + value: sc-set-gpt0 + type: + required: true + value: + - connection + - content + - session + x-display-name: Sticky counter value index: type: integer x-nullable: true + priority_type: + enum: + - class + - offset + type: string + x-dependency: + action: + required: true + value: set-priority + type: + value: + - content + resolve_protocol: + enum: + - ipv4 + - ipv6 + type: string + x-dependency: + action: + required: false + value: do-resolve + type: + required: true + value: + - content + x-display-name: Protocol + resolve_resolvers: + type: string + x-dependency: + action: + required: true + value: do-resolve + type: + required: true + value: + - content + x-display-name: Resolvers + resolve_var: + type: string + x-dependency: + action: + required: true + value: do-resolve + type: + required: true + value: + - content + x-display-name: Variable name + sc_inc_id: + type: string + x-dependency: + action: + required: true + value: + - sc-inc-gpc0 + - sc-inc-gpc1 + - sc-set-gpt0 + type: + required: true + value: + - connection + - content + - session + x-display-name: Sticky counter ID + service_name: + type: string + x-dependency: + action: + required: true + value: use-service + type: + value: content + x-display-name: Service name + spoe_engine_name: + type: string + x-dependency: + action: + required: true + value: send-spoe-group + type: + required: true + value: + - content + x-display-name: Engine name + spoe_group_name: + type: string + x-dependency: + action: + required: true + value: send-spoe-group + type: + required: true + value: + - content + x-display-name: Group name timeout: type: integer x-dependency: @@ -1705,6 +1875,36 @@ definitions: required: true value: inspect-delay x-nullable: true + track_key: + type: string + x-dependency: + action: + required: true + value: + - track-sc0 + - track-sc1 + - track-sc2 + type: + value: + - session + - connection + - content + x-display-name: Sample expression rule + track_table: + type: string + x-dependency: + action: + required: false + value: + - track-sc0 + - track-sc1 + - track-sc2 + type: + value: + - session + - connection + - content + x-display-name: Optional table name type: enum: - connection @@ -1713,6 +1913,34 @@ definitions: - session type: string x-nullable: false + var_name: + pattern: ^[^\s]+$ + type: string + x-dependency: + action: + required: true + value: + - set-var + - unset-var + type: + value: + - session + - content + x-display-name: Variable name + var_scope: + pattern: ^[^\s]+$ + type: string + x-dependency: + action: + required: true + value: + - set-var + - unset-var + type: + value: + - session + - content + x-display-name: Variable scope required: - index - type diff --git a/models/configuration.yaml b/models/configuration.yaml index ec847a6..8482e56 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1306,12 +1306,160 @@ tcp_request_rule: x-nullable: false action: type: string - enum: [accept, reject] + enum: [accept, capture, do-resolve, expect-netscaler-cip, expect-proxy, reject, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, send-spoe-group, set-dst-port, set-dst, set-priority, set-src, set-var, silent-drop, track-sc0, track-sc1, track-sc2, unset-var, use-service] x-nullable: false x-dependency: type: value: [connection, content, session] required: true + capture_sample: + pattern: '^[^\s]+$' + x-display-name: Capture Sample + type: string + x-dependency: + action: + value: capture + required: true + type: + value: [connection, content] + required: true + capture_len: + type: integer + x-display-name: Capture Length + x-dependency: + action: + value: capture + required: true + type: + value: [connection, content] + required: true + resolve_var: + type: string + x-display-name: Variable name + x-dependency: + action: + value: do-resolve + required: true + type: + value: [content] + required: true + resolve_resolvers: + type: string + x-display-name: Resolvers + x-dependency: + action: + value: do-resolve + required: true + type: + value: [content] + required: true + resolve_protocol: + type: string + enum: [ipv4, ipv6] + x-display-name: Protocol + x-dependency: + action: + value: do-resolve + required: false + type: + value: [content] + required: true + sc_inc_id: + type: string + x-display-name: Sticky counter ID + x-dependency: + action: + value: [sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0] + required: true + type: + value: [connection, content, session] + required: true + gpt_value: + type: string + x-display-name: Sticky counter value + x-dependency: + action: + value: sc-set-gpt0 + required: true + type: + value: [connection, content, session] + required: true + spoe_engine_name: + type: string + x-display-name: Engine name + x-dependency: + action: + value: send-spoe-group + required: true + type: + value: [content] + required: true + spoe_group_name: + type: string + x-display-name: Group name + x-dependency: + action: + value: send-spoe-group + required: true + type: + value: [content] + required: true + priority_type: + type: string + enum: [class, offset] + x-dependency: + action: + value: set-priority + required: true + type: + value: [content] + var_name: + type: string + pattern: '^[^\s]+$' + x-display-name: Variable name + x-dependency: + action: + value: [set-var, unset-var] + required: true + type: + value: [session, content] + var_scope: + type: string + pattern: '^[^\s]+$' + x-display-name: Variable scope + x-dependency: + action: + value: [set-var, unset-var] + required: true + type: + value: [session, content] + track_key: + type: string + x-display-name: Sample expression rule + x-dependency: + action: + value: [track-sc0, track-sc1, track-sc2] + required: true + type: + value: [session, connection, content] + track_table: + type: string + x-display-name: Optional table name + x-dependency: + action: + value: [track-sc0, track-sc1, track-sc2] + required: false + type: + value: [session, connection, content] + service_name: + type: string + x-display-name: Service name + x-dependency: + action: + value: use-service + required: true + type: + value: content timeout: type: integer x-nullable: true @@ -1319,6 +1467,15 @@ tcp_request_rule: type: value: inspect-delay required: true + expr: + type: string + x-display-name: Standard HAProxy expression + x-dependency: + action: + value: [do-resolve, set-var, set-src, set-priority, set-dst, set-dst-port] + required: true + type: + value: [session, connection, content] cond: type: string x-display-name: Condition From 3d8325024bc636fd6cd3166a96437a9ee100b17c Mon Sep 17 00:00:00 2001 From: Moemen MHEDHBI Date: Tue, 31 Mar 2020 18:49:47 +0200 Subject: [PATCH 038/121] BUG/MINOR: set show_node_name stats attribute to non nullable --- build/haproxy_spec.yaml | 1 + models/configuration.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index ba65514..3d0fda0 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2927,6 +2927,7 @@ definitions: stats_show_node_name: pattern: ^[^\s]+$ type: string + x-nullable: true stats_uri_prefix: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index 8482e56..f73a89e 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -2112,6 +2112,7 @@ stats_options: stats_show_node_name: type: string pattern: '^[^\s]+$' + x-nullable: true stats_uri_prefix: type: string pattern: '^[^\s]+$' From 54445943b7ee602f19620e5d3889af054e916d2b Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Tue, 31 Mar 2020 19:00:24 +0200 Subject: [PATCH 039/121] MINOR: stats: add x-nullable to show-desc option --- build/haproxy_spec.yaml | 1 + models/configuration.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 3d0fda0..f759e9b 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2921,6 +2921,7 @@ definitions: stats_show_desc: pattern: ^[^\s]+$ type: string + x-nullable: true stats_show_legends: type: boolean x-display-name: Stats Show Legends diff --git a/models/configuration.yaml b/models/configuration.yaml index f73a89e..7ef30e7 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -2106,6 +2106,7 @@ stats_options: stats_show_desc: type: string pattern: '^[^\s]+$' + x-nullable: true stats_show_legends: type: boolean x-display-name: Stats Show Legends From f608a6ed2abce30f5772a4bfc188b1c1949aba3d Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Thu, 2 Apr 2020 14:22:57 +0200 Subject: [PATCH 040/121] BUG/MINOR: Add default header version --- build/haproxy_spec.yaml | 12 ++++++++---- haproxy-spec.yaml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f759e9b..6f2f5dc 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3899,7 +3899,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' NotFound: @@ -3908,7 +3909,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' AlreadyExists: @@ -3917,7 +3919,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' DefaultError: @@ -3926,7 +3929,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' parameters: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index f6c70f6..629d117 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -267,7 +267,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' NotFound: @@ -276,7 +277,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' AlreadyExists: @@ -285,7 +287,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' DefaultError: @@ -294,7 +297,8 @@ responses: Configuration-Version: description: Configuration file version type: integer - x-nullable: false + x-nullable: true + default: 0 schema: $ref: '#/definitions/error' parameters: From b9d65f827ada616deb96fa72a0bf1df423aa726d Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Thu, 2 Apr 2020 16:18:47 +0200 Subject: [PATCH 041/121] MINOR: raw: add skip version check qs parameter --- build/haproxy_spec.yaml | 7 +++++++ paths/configuration.yaml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 6f2f5dc..13ae492 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -8397,6 +8397,13 @@ paths: required: true schema: type: string + - default: false + description: If set, no version check will be done and the pushed config will + be enforced + in: query + name: skip_version + required: false + type: boolean - default: false description: If set, no reload will be initiated and runtime actions from X-Runtime-Actions will be applied diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 4da5457..a009acc 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -2867,6 +2867,12 @@ configuration: required: true schema: type: string + - name: skip_version + in: query + description: If set, no version check will be done and the pushed config will be enforced + type: boolean + required: false + default: false - name: skip_reload in: query description: If set, no reload will be initiated and runtime actions from X-Runtime-Actions will be applied From 80324e8484f257fde6402caa909543ae73ad7669 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Mon, 6 Apr 2020 13:52:51 +0200 Subject: [PATCH 042/121] BUG/MINOR: cluster settings are read only all settings are recieved through bootstrap key, so nothing can be set directly --- build/haproxy_spec.yaml | 5 +++++ models/cluster.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 13ae492..fa75cec 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3491,16 +3491,21 @@ definitions: properties: address: pattern: ^[^\s]+$ + readOnly: true type: string api_base_path: + readOnly: true type: string description: + readOnly: true type: string name: + readOnly: true type: string port: maximum: 65535 minimum: 1 + readOnly: true type: integer x-nullable: true title: Cluster controller information diff --git a/models/cluster.yaml b/models/cluster.yaml index 0aa0ffc..a9d5471 100644 --- a/models/cluster.yaml +++ b/models/cluster.yaml @@ -17,17 +17,22 @@ settings: properties: name: type: string + readOnly: true description: type: string + readOnly: true address: pattern: ^[^\s]+$ type: string + readOnly: true port: maximum: 65535 minimum: 1 type: integer x-nullable: true + readOnly: true api_base_path: type: string + readOnly: true title: Cluster controller information type: object From c2b688a5d7f2d6511c41ed1befe3746a91d1bcc5 Mon Sep 17 00:00:00 2001 From: Moemen MHEDHBI Date: Sat, 11 Apr 2020 01:34:45 +0200 Subject: [PATCH 043/121] MINOR: Add the http-request action: replace-path --- build/haproxy_spec.yaml | 15 ++++++++++++++- models/configuration.yaml | 12 ++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index fa75cec..044e404 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1241,11 +1241,23 @@ definitions: required: true value: set-log-level path_fmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: + - set-path + - replace-path + path_match: + pattern: ^[^\s]+$ type: string x-dependency: type: required: true - value: set-path + value: + - set-path + - replace-path query-fmt: type: string x-dependency: @@ -1363,6 +1375,7 @@ definitions: - set-header - set-log-level - set-path + - replace-path - set-query - set-uri - set-var diff --git a/models/configuration.yaml b/models/configuration.yaml index 7ef30e7..aa05e3e 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -874,7 +874,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1018,12 +1018,20 @@ http_request_rule: type: value: set-log-level required: true + path_match: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: [set-path, replace-path] + required: true path_fmt: type: string + pattern: '^[^\s]+$' x-dependency: type: + value: [set-path, replace-path] required: true - value: set-path var_name: type: string pattern: '^[^\s]+$' From 1db514bf841d949f0ca5753b178c7b4f7568608a Mon Sep 17 00:00:00 2001 From: Amel Husic Date: Mon, 23 Dec 2019 12:14:15 +0100 Subject: [PATCH 044/121] FEATURE/MEDIUM: runtime: add maps support --- build/haproxy_spec.yaml | 263 ++++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 26 ++++ models/runtime.yaml | 25 +++- paths/runtime.yaml | 226 ++++++++++++++++++++++++++++++++++ 4 files changed, 539 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 044e404..23b0413 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3537,6 +3537,41 @@ definitions: type: string title: Cluster Settings type: object + map: + description: Map File + properties: + description: + type: string + file: + type: string + id: + type: string + title: Map File + type: object + maps: + title: Map Files Array + description: Array of runtime map files + type: array + items: + $ref: "#/definitions/map" + map_entry: + description: One Map Entry + properties: + id: + readOnly: true + type: string + key: + type: string + value: + type: string + title: One Map Entry + type: object + map_entries: + title: Maps Entries + description: Entries of one runtime map + type: array + items: + $ref: "#/definitions/map_entry" balance: properties: algorithm: @@ -4036,6 +4071,7 @@ tags: - name: TCPResponseRule - name: Filter - name: StickRule + - name: StickTable - name: LogTarget - name: ACL - name: Resolver @@ -4043,6 +4079,7 @@ tags: - name: Peer - name: PeerEntry - name: Cluster + - name: Maps security: - basic_auth: [] paths: @@ -8666,4 +8703,230 @@ paths: summary: Return Stick Table Entries tags: - StickTable + /services/haproxy/runtime/maps: + get: + description: Returns all available map files. + operationId: getAllRuntimeMapFiles + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/maps' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return all available map files + tags: + - Maps + post: + consumes: + - multipart/form-data + description: Creates runtime map file with its entries. + operationId: createRuntimeMap + parameters: + - description: The map file to upload + in: formData + name: fileUpload + type: file + x-mimetype: text/plain + responses: + "201": + description: Map file created with its entries + schema: + $ref: '#/definitions/map_entries' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Creates runtime map file with its entries + tags: + - Maps + /services/haproxy/runtime/maps/{name}: + delete: + description: Remove all map entries from the map file. + operationId: clearRuntimeMap + parameters: + - description: Map file name + in: path + name: name + required: true + type: string + - description: If true, deletes file from disk + in: query + name: forceDelete + type: boolean + responses: + "204": + description: All map entries deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Remove all map entries from the map file + tags: + - Maps + get: + description: Returns one runtime map file. + operationId: getOneRuntimeMap + parameters: + - description: Map file name + in: path + name: name + required: true + type: string + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/map' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one runtime map file + tags: + - Maps + /services/haproxy/runtime/maps_entries: + get: + description: Returns an array of all entries in a given runtime map file. + operationId: showRuntimeMap + parameters: + - description: Map file name + in: query + name: map + required: true + type: string + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/map_entries' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one map runtime entries + tags: + - Maps + post: + description: Adds an entry into the map file. + operationId: addMapEntry + parameters: + - description: Map file name + in: query + name: map + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/map_entry' + responses: + "201": + description: Map entry created + schema: + $ref: '#/definitions/map_entry' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Adds an entry into the map file + tags: + - Maps + /services/haproxy/runtime/maps_entries/{id}: + delete: + description: Delete all the map entries from the map by its id. + operationId: deleteRuntimeMapEntry + parameters: + - description: Map id + in: path + name: id + required: true + type: string + - description: Map file name + in: query + name: map + required: true + type: string + responses: + "204": + description: Map key/value deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Deletes all the map entries from the map by its id + tags: + - Maps + get: + description: Returns one map runtime setting by it's id. + operationId: getRuntimeMapEntry + parameters: + - description: Map id + in: path + name: id + required: true + type: string + - description: Map file name + in: query + name: map + required: true + type: string + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/map_entry' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one map runtime setting + tags: + - Maps + put: + description: Replaces the value corresponding to each id in a map. + operationId: replaceRuntimeMapEntry + parameters: + - description: Map id + in: path + name: id + required: true + type: string + - description: Map file name + in: query + name: map + required: true + type: string + - in: body + name: data + required: true + schema: + properties: + value: + description: Map value + type: string + required: + - value + type: object + responses: + "200": + description: Map value replaced + schema: + $ref: '#/definitions/map_entry' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace the value corresponding to each id in a map + tags: + - Maps diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 629d117..a7c9781 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -228,6 +228,22 @@ definitions: $ref: "#/definitions/stick_table_entry" cluster_settings: $ref: "models/cluster.yaml#/settings" + map: + $ref: "models/runtime.yaml#/map" + maps: + title: Map Files Array + description: Array of runtime map files + type: array + items: + $ref: "#/definitions/map" + map_entry: + $ref: "models/runtime.yaml#/map_entry" + map_entries: + title: Maps Entries + description: Entries of one runtime map + type: array + items: + $ref: "#/definitions/map_entry" balance: $ref: "models/configuration.yaml#/balance" forwardfor: @@ -386,6 +402,7 @@ tags: - name: TCPResponseRule - name: Filter - name: StickRule + - name: StickTable - name: LogTarget - name: ACL - name: Resolver @@ -393,6 +410,7 @@ tags: - name: Peer - name: PeerEntry - name: Cluster + - name: Maps security: - basic_auth: [] paths: @@ -518,3 +536,11 @@ paths: $ref: "paths/runtime.yaml#/stick_tables_one" /services/haproxy/runtime/stick_table_entries: $ref: "paths/runtime.yaml#/stick_table_entries" + /services/haproxy/runtime/maps: + $ref: "paths/runtime.yaml#/maps" + /services/haproxy/runtime/maps/{name}: + $ref: "paths/runtime.yaml#/maps_one" + /services/haproxy/runtime/maps_entries: + $ref: "paths/runtime.yaml#/maps_entries" + /services/haproxy/runtime/maps_entries/{id}: + $ref: "paths/runtime.yaml#/maps_entries_one" diff --git a/models/runtime.yaml b/models/runtime.yaml index cf9a78a..25550dd 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -345,4 +345,27 @@ table_entry: type: integer x-nullable: true use: - type: boolean \ No newline at end of file + type: boolean +map: + title: Map File + description: Map File + type: object + properties: + id: + type: string + file: + type: string + description: + type: string +map_entry: + title: One Map Entry + description: One Map Entry + type: object + properties: + id: + type: string + readOnly: true + key: + type: string + value: + type: string \ No newline at end of file diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 815233c..00a2416 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -185,3 +185,229 @@ stick_table_entries: $ref: "#/definitions/stick_table_entries" 'default': $ref: '#/responses/DefaultError' +maps: + get: # show map + summary: Return all available map files + description: Returns all available map files. + operationId: getAllRuntimeMapFiles + tags: + - Maps + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/maps" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + post: # (raw) + summary: Creates runtime map file with its entries + description: Creates runtime map file with its entries. + operationId: createRuntimeMap + consumes: + - multipart/form-data + parameters: + - in: formData + name: fileUpload + type: file + description: The map file to upload + x-mimetype: text/plain + tags: + - Maps + responses: + '201': + description: Map file created with its entries + schema: + $ref: "#/definitions/map_entries" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +maps_one: + get: # one map file + summary: Return one runtime map file + description: Returns one runtime map file. + operationId: getOneRuntimeMap + tags: + - Maps + parameters: + - name: name + in: path + description: Map file name + required: true + type: string + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/map" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: # clear map [map] + summary: Remove all map entries from the map file + description: Remove all map entries from the map file. + operationId: clearRuntimeMap + parameters: + - name: name + in: path + description: Map file name + required: true + type: string + - name: forceDelete + in: query + description: If true, deletes file from disk + type: boolean + tags: + - Maps + responses: + '204': + description: All map entries deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +maps_entries: + get: # show map [map] + summary: Return one map runtime entries + description: Returns an array of all entries in a given runtime map file. + operationId: showRuntimeMap + tags: + - Maps + parameters: + - name: map + in: query + description: Map file name + required: true + type: string + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/map_entries" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + post: # add map [map] key value + summary: Adds an entry into the map file + description: Adds an entry into the map file. + operationId: addMapEntry + parameters: + - name: map + in: query + description: Map file name + required: true + type: string + - name: data + in: body + required: true + schema: + $ref: '#/definitions/map_entry' + tags: + - Maps + responses: + '201': + description: Map entry created + schema: + $ref: "#/definitions/map_entry" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +maps_entries_one: + get: # get map + summary: Return one map runtime setting + description: Returns one map runtime setting by it's id. + operationId: getRuntimeMapEntry + tags: + - Maps + parameters: + - name: id + in: path + description: Map id + required: true + type: string + - name: map + in: query + description: Map file name + required: true + type: string + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/map_entry" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: # set map [|#] + summary: Replace the value corresponding to each id in a map + description: Replaces the value corresponding to each id in a map. + operationId: replaceRuntimeMapEntry + tags: + - Maps + parameters: + - name: id + in: path + description: Map id + required: true + type: string + - name: map + in: query + description: Map file name + required: true + type: string + - name: data + in: body + required: true + schema: + type: object + required: + - value + properties: + value: + description: Map value + type: string + responses: + '200': + description: Map value replaced + schema: + $ref: "#/definitions/map_entry" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: # del map [|#] + summary: Deletes all the map entries from the map by its id + description: Delete all the map entries from the map by its id. + operationId: deleteRuntimeMapEntry + tags: + - Maps + parameters: + - name: id + in: path + description: Map id + required: true + type: string + - name: map + in: query + description: Map file name + required: true + type: string + responses: + '204': + description: Map key/value deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From 687e7854ddf1546b212d010332422516123bc698 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Mon, 27 Apr 2020 14:01:48 +0200 Subject: [PATCH 045/121] BUG/MINOR: Add possible statuses as enum to deny_status --- build/go.mod | 2 +- build/go.sum | 2 ++ build/haproxy_spec.yaml | 12 ++++++++++++ models/configuration.yaml | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/build/go.mod b/build/go.mod index 29e7275..e3af0b2 100644 --- a/build/go.mod +++ b/build/go.mod @@ -2,4 +2,4 @@ module github.com/haproxytech/dataplaneapi-specification/build go 1.12 -require gopkg.in/yaml.v2 v2.2.2 +require gopkg.in/yaml.v2 v2.2.8 diff --git a/build/go.sum b/build/go.sum index bd555a3..ba2a066 100644 --- a/build/go.sum +++ b/build/go.sum @@ -1,3 +1,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 23b0413..42af725 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1179,6 +1179,18 @@ definitions: operation: getACLs property: acl_name deny_status: + enum: + - 200 + - 400 + - 403 + - 405 + - 408 + - 425 + - 429 + - 500 + - 502 + - 503 + - 504 type: integer x-dependency: type: diff --git a/models/configuration.yaml b/models/configuration.yaml index aa05e3e..b527642 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -983,6 +983,7 @@ http_request_rule: required: true deny_status: type: integer + enum: [200, 400, 403, 405, 408, 425, 429, 500, 502, 503, 504] x-nullable: false x-dependency: type: From 7f23f8fc6a6369ef799e0d4ddb0f2d358d03af06 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Fri, 24 Apr 2020 15:49:16 +0200 Subject: [PATCH 046/121] MINOR: cluster: add path to start certificate refresh --- build/haproxy_spec.yaml | 14 ++++++++++++++ haproxy-spec.yaml | 2 ++ paths/cluster.yaml | 15 +++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 42af725..2ba61a1 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4181,6 +4181,20 @@ paths: summary: Post cluster settings tags: - Cluster + /cluster/certificate: + post: + description: Initiates a certificate refresh + operationId: initiateCertificateRefresh + responses: + "200": + description: refresh activated + "403": + description: refresh not possible + default: + $ref: '#/responses/DefaultError' + summary: Initiates a certificate refresh + tags: + - Cluster /services: get: description: Returns a list of API managed services endpoints. diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index a7c9781..74de857 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -422,6 +422,8 @@ paths: $ref: "paths/general.yaml#/info" /cluster: $ref: "paths/cluster.yaml#/cluster" + /cluster/certificate: + $ref: "paths/cluster.yaml#/certificate" /services: $ref: "paths/general.yaml#/services" /services/haproxy: diff --git a/paths/cluster.yaml b/paths/cluster.yaml index e10a1f0..398bd98 100644 --- a/paths/cluster.yaml +++ b/paths/cluster.yaml @@ -37,3 +37,18 @@ cluster: $ref: '#/responses/BadRequest' 'default': $ref: '#/responses/DefaultError' +certificate: + post: + tags: + - Cluster + summary: Initiates a certificate refresh + description: Initiates a certificate refresh + operationId: initiateCertificateRefresh + responses: + '200': + description: refresh activated + '403': + description: refresh not possible + 'default': + $ref: '#/responses/DefaultError' + \ No newline at end of file From cd6a450161ec92d7f76128b8ac9879d9cdbf59cf Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Wed, 29 Apr 2020 12:34:16 +0200 Subject: [PATCH 047/121] BUG/MINOR: stats_show_desc can be a string with spaces --- build/haproxy_spec.yaml | 1 - models/configuration.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 2ba61a1..ec84626 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2944,7 +2944,6 @@ definitions: type: integer x-nullable: true stats_show_desc: - pattern: ^[^\s]+$ type: string x-nullable: true stats_show_legends: diff --git a/models/configuration.yaml b/models/configuration.yaml index b527642..9e6c238 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -2114,7 +2114,6 @@ stats_options: x-nullable: true stats_show_desc: type: string - pattern: '^[^\s]+$' x-nullable: true stats_show_legends: type: boolean From d5b0be79d666c6e638e4fe4e25ba389d5d9de8f3 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Thu, 7 May 2020 13:29:43 +0200 Subject: [PATCH 048/121] BUG/MINOR: resolvers: fix field definitions --- build/haproxy_spec.yaml | 15 ++++++++------- models/configuration.yaml | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index ec84626..a48cf63 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -3881,26 +3881,27 @@ definitions: description: Runtime DNS configuration properties: accepted_payload_size: - minimum: 1232 + maximum: 8192 + minimum: 512 type: integer hold_nx: type: integer - x-nullable: false + x-nullable: true hold_obsolete: type: integer - x-nullable: false + x-nullable: true hold_other: type: integer - x-nullable: false + x-nullable: true hold_refused: type: integer - x-nullable: false + x-nullable: true hold_timeout: type: integer - x-nullable: false + x-nullable: true hold_valid: type: integer - x-nullable: false + x-nullable: true name: pattern: ^[A-Za-z0-9-_.:]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index 9e6c238..037e2d2 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -258,25 +258,26 @@ resolver: x-nullable: false accepted_payload_size: type: integer - minimum: 1232 + minimum: 512 + maximum: 8192 hold_nx: type: integer - x-nullable: false + x-nullable: true hold_obsolete: type: integer - x-nullable: false + x-nullable: true hold_other: type: integer - x-nullable: false + x-nullable: true hold_refused: type: integer - x-nullable: false + x-nullable: true hold_timeout: type: integer - x-nullable: false + x-nullable: true hold_valid: type: integer - x-nullable: false + x-nullable: true parse-resolv-conf: type: boolean resolve_retries: From 10503ffcd68a5ef27605b37cd60bd03dc38d5d12 Mon Sep 17 00:00:00 2001 From: Stefan Scheglmann Date: Thu, 30 Apr 2020 12:51:42 +0200 Subject: [PATCH 049/121] MINOR: server: adds slowstart parameter --- build/haproxy_spec.yaml | 3 +++ models/configuration.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index a48cf63..2186569 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1050,6 +1050,9 @@ definitions: - enabled - disabled type: string + slowstart: + pattern: ^[1-9][0-9]*(us|ms|s|m|h|d)$ + type: string sni: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index 037e2d2..5b8c41e 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -799,6 +799,9 @@ server: send-proxy-v2: type: string enum: [enabled, disabled] + slowstart: + type: string + pattern: '^[1-9][0-9]*(us|ms|s|m|h|d)$' sni: type: string pattern: '^[^\s]+$' From 5803f913893fdf0ab467e6219670bd58c1da1bb8 Mon Sep 17 00:00:00 2001 From: Stefan Scheglmann Date: Tue, 12 May 2020 09:02:16 +0200 Subject: [PATCH 050/121] Review comments --- build/haproxy_spec.yaml | 7 +++++-- models/configuration.yaml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 2186569..7c4725e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1051,8 +1051,8 @@ definitions: - disabled type: string slowstart: - pattern: ^[1-9][0-9]*(us|ms|s|m|h|d)$ - type: string + type: integer + x-nullable: true sni: pattern: ^[^\s]+$ type: string @@ -3742,6 +3742,9 @@ definitions: rise: type: integer x-nullable: true + slowstart: + type: integer + x-nullable: true sni: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index 5b8c41e..0f556f7 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -800,8 +800,8 @@ server: type: string enum: [enabled, disabled] slowstart: - type: string - pattern: '^[1-9][0-9]*(us|ms|s|m|h|d)$' + type: integer + x-nullable: true sni: type: string pattern: '^[^\s]+$' @@ -1873,6 +1873,9 @@ default_server: check-sni: type: string pattern: '^[^\s]+$' + slowstart: + type: integer + x-nullable: true sni: type: string pattern: '^[^\s]+$' From 5e9c04cdcc269ccfc9dd740ed00581e42787728b Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Tue, 19 May 2020 13:05:22 +0200 Subject: [PATCH 051/121] MINOR: add http-buffer-request added to frontend, backend and default --- build/haproxy_spec.yaml | 18 ++++++++++++++++++ models/configuration.yaml | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 7c4725e..0666870 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -340,6 +340,12 @@ definitions: x-display-name: External Check Path forwardfor: $ref: '#/definitions/forwardfor' + http-buffer-request: + enum: + - enabled + - disabled + type: string + x-display-name: HTTP bufferrequest http-check: $ref: '#/definitions/http-check' http-use-htx: @@ -485,6 +491,12 @@ definitions: x-dependency: mode: value: http + http-buffer-request: + enum: + - enabled + - disabled + type: string + x-display-name: HTTP bufferrequest http-use-htx: enum: - enabled @@ -673,6 +685,12 @@ definitions: - avalanche type: string type: object + http-buffer-request: + enum: + - enabled + - disabled + type: string + x-display-name: HTTP bufferrequest http-check: $ref: '#/definitions/http-check' http-use-htx: diff --git a/models/configuration.yaml b/models/configuration.yaml index 0f556f7..36f6072 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -139,6 +139,10 @@ defaults: type: string enum: [enabled, disabled] x-display-name: Don't Log Null + http-buffer-request: + type: string + enum: [enabled, disabled] + x-display-name: HTTP bufferrequest httplog: type: boolean x-display-name: HTTP Log @@ -367,6 +371,10 @@ frontend: type: string enum: [enabled, disabled] x-display-name: Don't Log Null + http-buffer-request: + type: string + enum: [enabled, disabled] + x-display-name: HTTP bufferrequest http_connection_mode: type: string enum: [httpclose, http-server-close, http-keep-alive] @@ -476,6 +484,10 @@ backend: type: string enum: [enabled, disabled] x-display-name: All Backups + http-buffer-request: + type: string + enum: [enabled, disabled] + x-display-name: HTTP bufferrequest log_tag: type: string pattern: '^[^\s]+$' From dc48cf3a2ba594749efbe568651a33488ffd4fe5 Mon Sep 17 00:00:00 2001 From: Moemen MHEDHBI Date: Fri, 29 May 2020 14:02:19 +0200 Subject: [PATCH 052/121] MINOR: server: add alpn param --- build/haproxy_spec.yaml | 4 ++++ models/configuration.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0666870..5fefb3c 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -966,6 +966,10 @@ definitions: type: string allow_0rtt: type: boolean + alpn: + pattern: ^[^\s]+$ + type: string + x-display-name: ALPN Protocols backup: enum: - enabled diff --git a/models/configuration.yaml b/models/configuration.yaml index 36f6072..f891381 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -820,6 +820,10 @@ server: ssl: type: string enum: [enabled, disabled] + alpn: + type: string + x-display-name: ALPN Protocols + pattern: '^[^\s]+$' check-sni: type: string pattern: '^[^\s]+$' From 9ae18037af79c68943d819d861749547ef7c9120 Mon Sep 17 00:00:00 2001 From: Geoff Simmons Date: Mon, 25 May 2020 20:41:45 +0200 Subject: [PATCH 053/121] MINOR: server: add proxy-v2-options --- build/haproxy_spec.yaml | 13 +++++++++++++ models/configuration.yaml | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 5fefb3c..cbfb247 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1044,6 +1044,19 @@ definitions: proto: pattern: ^[^\s]+$ type: string + proxy-v2-options: + items: + enum: + - ssl + - cert-cn + - ssl-cipher + - cert-sig + - cert-key + - authority + - crc32c + - unique-id + type: string + type: array resolve-net: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index f891381..dd33acc 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -811,6 +811,11 @@ server: send-proxy-v2: type: string enum: [enabled, disabled] + proxy-v2-options: + type: array + items: + type: string + enum: [ssl, cert-cn, ssl-cipher, cert-sig, cert-key, authority, crc32c, unique-id] slowstart: type: integer x-nullable: true From db6c9a1d402754c30721cc70352895dbc2d5c2f3 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Tue, 16 Jun 2020 08:51:13 +0200 Subject: [PATCH 054/121] MINOR: http_request_rule: add del-map and set-map --- build/haproxy_spec.yaml | 58 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 50 +++++++++++++++++++++++++++++++-- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index cbfb247..b25e85f 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1290,6 +1290,33 @@ definitions: type: required: true value: set-log-level + map_file: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: + - set-map + - del-map + map_keyfmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: + - set-map + - del-map + x-display-name: Map Key Format + map_valuefmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: set-map + x-display-name: Map Value Format path_fmt: pattern: ^[^\s]+$ type: string @@ -1436,6 +1463,8 @@ definitions: - track-sc0 - track-sc1 - track-sc2 + - set-map + - del-map type: string x-nullable: false uri-fmt: @@ -1593,6 +1622,33 @@ definitions: type: required: true value: set-log-level + map_file: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: + - set-map + - del-map + map_keyfmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: + - set-map + - del-map + x-display-name: Map Key Format + map_valuefmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: set-map + x-display-name: Map Value Format redir_code: enum: - 301 @@ -1674,6 +1730,8 @@ definitions: - add-acl - del-acl - capture + - set-map + - del-map type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index dd33acc..01d4552 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1123,6 +1123,29 @@ http_request_rule: type: value: [add-acl, del-acl] required: true + map_file: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: [set-map, del-map] + required: true + map_keyfmt: + type: string + x-display-name: Map Key Format + pattern: '^[^\s]+$' + x-dependency: + type: + value: [set-map, del-map] + required: true + map_valuefmt: + type: string + x-display-name: Map Value Format + pattern: '^[^\s]+$' + x-dependency: + type: + value: set-map + required: true cond: type: string x-display-name: Condition @@ -1158,7 +1181,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map] x-nullable: false capture_sample: type: string @@ -1301,6 +1324,29 @@ http_response_rule: type: value: [add-acl, del-acl] required: true + map_file: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: [set-map, del-map] + required: true + map_keyfmt: + type: string + x-display-name: Map Key Format + pattern: '^[^\s]+$' + x-dependency: + type: + value: [set-map, del-map] + required: true + map_valuefmt: + type: string + x-display-name: Map Value Format + pattern: '^[^\s]+$' + x-dependency: + type: + value: set-map + required: true cond: type: string x-display-name: Condition From 5091843dec568b41cdd3e3aa28819234ce051efc Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Thu, 18 Jun 2020 14:19:37 +0200 Subject: [PATCH 055/121] FEATURE/MINOR: http_request_rule: Aded cache-use, disable-l7-retry, early-hint --- build/haproxy_spec.yaml | 27 +++++++++++++++++++++++++++ models/configuration.yaml | 26 +++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index b25e85f..595b01f 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1177,6 +1177,14 @@ definitions: type: value: auth x-display-name: Authentication Realm + cache_name: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: cache-use + x-display-name: Cache Name capture_id: type: integer x-dependency: @@ -1271,6 +1279,22 @@ definitions: - set-header - replace-value x-display-name: Header Name + hint_format: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: early-hint + x-display-name: Hint Format + hint_name: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: early-hint + x-display-name: Hint Name index: type: integer x-nullable: true @@ -1465,6 +1489,9 @@ definitions: - track-sc2 - set-map - del-map + - cache-use + - disable-l7-retry + - early-hint type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index 01d4552..5a17e00 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1146,6 +1146,30 @@ http_request_rule: type: value: set-map required: true + cache_name: + type: string + x-display-name: Cache Name + pattern: '^[^\s]+$' + x-dependency: + type: + value: cache-use + required: true + hint_name: + type: string + x-display-name: Hint Name + pattern: '^[^\s]+$' + x-dependency: + type: + value: early-hint + required: true + hint_format: + type: string + x-display-name: Hint Format + pattern: '^[^\s]+$' + x-dependency: + type: + value: early-hint + required: true cond: type: string x-display-name: Condition From 8d625538fca4385bb249af3e9e8f5a621d3d43ae Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 19 Jun 2020 10:16:56 +0200 Subject: [PATCH 056/121] FEATURE/MINOR: http_request_rule: Added replace-uri --- build/haproxy_spec.yaml | 11 ++++++++++- models/configuration.yaml | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 595b01f..7a1caa9 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1492,6 +1492,7 @@ definitions: - cache-use - disable-l7-retry - early-hint + - replace-uri type: string x-nullable: false uri-fmt: @@ -1499,7 +1500,15 @@ definitions: x-dependency: type: required: true - value: set-uri + value: + - set-uri + - replace-uri + uri-match: + type: string + x-dependency: + type: + required: true + value: replace-uri var_expr: type: string x-dependency: diff --git a/models/configuration.yaml b/models/configuration.yaml index 5a17e00..84428a4 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1085,12 +1085,18 @@ http_request_rule: type: required: true value: set-query + uri-match: + type: string + x-dependency: + type: + required: true + value: replace-uri uri-fmt: type: string x-dependency: type: required: true - value: set-uri + value: [set-uri, replace-uri] spoe_engine: type: string x-display-name: SPOE Engine From f542bd88333017aacaa34fecc60b5451929cec59 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Mon, 22 Jun 2020 09:13:48 +0200 Subject: [PATCH 057/121] FEATURE/MINOR: Added sc-inc-gpc0 and sc-inc-gpc1 to http_request_rule and http_response_rule --- build/haproxy_spec.yaml | 20 ++++++++++++++++++++ models/configuration.yaml | 16 ++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 7a1caa9..13cb653 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1401,6 +1401,14 @@ definitions: required: true value: redirect x-display-name: Redirect Value + sc_id: + type: integer + x-dependency: + type: + required: true + value: + - sc-inc-gpc0 + - sc-inc-gpc1 spoe_engine: pattern: ^[^\s]+$ type: string @@ -1493,6 +1501,8 @@ definitions: - disable-l7-retry - early-hint - replace-uri + - sc-inc-gpc0 + - sc-inc-gpc1 type: string x-nullable: false uri-fmt: @@ -1721,6 +1731,14 @@ definitions: required: true value: redirect x-display-name: Redirect Value + sc_id: + type: integer + x-dependency: + type: + required: true + value: + - sc-inc-gpc0 + - sc-inc-gpc1 spoe_engine: pattern: ^[^\s]+$ type: string @@ -1768,6 +1786,8 @@ definitions: - capture - set-map - del-map + - sc-inc-gpc0 + - sc-inc-gpc1 type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index 84428a4..c05dbdb 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1176,6 +1176,12 @@ http_request_rule: type: value: early-hint required: true + sc_id: + type: integer + x-dependency: + type: + value: [sc-inc-gpc0, sc-inc-gpc1] + required: true cond: type: string x-display-name: Condition @@ -1211,7 +1217,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1] x-nullable: false capture_sample: type: string @@ -1377,6 +1383,12 @@ http_response_rule: type: value: set-map required: true + sc_id: + type: integer + x-dependency: + type: + value: [sc-inc-gpc0, sc-inc-gpc1] + required: true cond: type: string x-display-name: Condition From 0eaeeb60277f871ac7177bd672834c6e0107bc25 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Thu, 18 Jun 2020 08:41:46 +0200 Subject: [PATCH 058/121] FEATURE/MINOR: http-request: add do-resolve, set-dst, set-dst-port --- build/haproxy_spec.yaml | 35 +++++++++++++++++++++++++++++++++-- models/configuration.yaml | 25 +++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 13cb653..7fe89f3 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1244,6 +1244,16 @@ definitions: - deny - tarpit x-nullable: false + expr: + type: string + x-dependency: + type: + required: true + value: + - do-resolve + - set-dst + - set-dst-port + x-display-name: Standard HAProxy expression hdr_format: pattern: ^[^\s]+$ type: string @@ -1359,6 +1369,16 @@ definitions: value: - set-path - replace-path + protocol: + enum: + - ipv4 + - ipv6 + type: string + x-dependency: + type: + required: false + value: do-resolve + x-display-name: Protocol query-fmt: type: string x-dependency: @@ -1401,11 +1421,17 @@ definitions: required: true value: redirect x-display-name: Redirect Value + resolvers: + type: string + x-dependency: + type: + required: true + value: do-resolve + x-display-name: Resolvers sc_id: type: integer x-dependency: type: - required: true value: - sc-inc-gpc0 - sc-inc-gpc1 @@ -1503,6 +1529,9 @@ definitions: - replace-uri - sc-inc-gpc0 - sc-inc-gpc1 + - do-resolve + - set-dst + - set-dst-port type: string x-nullable: false uri-fmt: @@ -1532,7 +1561,9 @@ definitions: x-dependency: type: required: true - value: set-var + value: + - set-var + - do-resolve var_scope: pattern: ^[^\s]+$ type: string diff --git a/models/configuration.yaml b/models/configuration.yaml index c05dbdb..810d5e7 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1063,7 +1063,7 @@ http_request_rule: pattern: '^[^\s]+$' x-dependency: type: - value: set-var + value: [set-var, do-resolve] required: true var_scope: type: string @@ -1181,6 +1181,27 @@ http_request_rule: x-dependency: type: value: [sc-inc-gpc0, sc-inc-gpc1] + resolvers: + type: string + x-display-name: Resolvers + x-dependency: + type: + value: do-resolve + required: true + protocol: + type: string + enum: [ipv4, ipv6] + x-display-name: Protocol + x-dependency: + type: + value: do-resolve + required: false + expr: + type: string + x-display-name: Standard HAProxy expression + x-dependency: + type: + value: [do-resolve, set-dst, set-dst-port] required: true cond: type: string From f90936142246dd9e9dd3d2840e3f5376335eaa58 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Mon, 22 Jun 2020 16:20:55 +0200 Subject: [PATCH 059/121] FEATURE/MINOR: Added sc-set-gpt0, set-mark and set-nice to http_request_rule and http_response_rule --- build/haproxy_spec.yaml | 75 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 75 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 146 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 7fe89f3..967b5ae 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1351,6 +1351,24 @@ definitions: required: true value: set-map x-display-name: Map Value Format + mark_value: + pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ + type: string + x-dependency: + type: + required: true + value: set-mark + x-display-name: Mark Value + nice_value: + maximum: 1024 + minimum: -1024 + type: integer + x-dependency: + type: + required: true + value: set-nice + x-display-name: Nice Value + x-nullable: false path_fmt: pattern: ^[^\s]+$ type: string @@ -1428,13 +1446,30 @@ definitions: required: true value: do-resolve x-display-name: Resolvers + sc_expr: + type: string + x-dependency: + type: + required: true + value: sc-set-gpt0 + x-display-name: ScSet Expression Value sc_id: type: integer x-dependency: type: + required: true value: - sc-inc-gpc0 - sc-inc-gpc1 + - sc-set-gpt0 + sc_int: + type: integer + x-dependency: + type: + required: true + value: sc-set-gpt0 + x-display-name: ScSet Integer Value + x-nullable: true spoe_engine: pattern: ^[^\s]+$ type: string @@ -1532,6 +1567,9 @@ definitions: - do-resolve - set-dst - set-dst-port + - sc-set-gpt0 + - set-mark + - set-nice type: string x-nullable: false uri-fmt: @@ -1726,6 +1764,24 @@ definitions: required: true value: set-map x-display-name: Map Value Format + mark_value: + pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ + type: string + x-dependency: + type: + required: true + value: set-mark + x-display-name: Mark Value + nice_value: + maximum: 1024 + minimum: -1024 + type: integer + x-dependency: + type: + required: true + value: set-nice + x-display-name: Nice Value + x-nullable: false redir_code: enum: - 301 @@ -1762,6 +1818,13 @@ definitions: required: true value: redirect x-display-name: Redirect Value + sc_expr: + type: string + x-dependency: + type: + required: true + value: sc-set-gpt0 + x-display-name: ScSet Expression Value sc_id: type: integer x-dependency: @@ -1770,6 +1833,15 @@ definitions: value: - sc-inc-gpc0 - sc-inc-gpc1 + - sc-set-gpt0 + sc_int: + type: integer + x-dependency: + type: + required: true + value: sc-set-gpt0 + x-display-name: ScSet Integer Value + x-nullable: true spoe_engine: pattern: ^[^\s]+$ type: string @@ -1819,6 +1891,9 @@ definitions: - del-map - sc-inc-gpc0 - sc-inc-gpc1 + - sc-set-gpt0 + - set-mark + - set-nice type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index 810d5e7..7a223be 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1180,7 +1180,8 @@ http_request_rule: type: integer x-dependency: type: - value: [sc-inc-gpc0, sc-inc-gpc1] + value: [sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0] + required: true resolvers: type: string x-display-name: Resolvers @@ -1203,6 +1204,39 @@ http_request_rule: type: value: [do-resolve, set-dst, set-dst-port] required: true + sc_expr: + type: string + x-display-name: ScSet Expression Value + x-dependency: + type: + value: sc-set-gpt0 + required: true + sc_int: + type: integer + x-nullable: true + x-display-name: ScSet Integer Value + x-dependency: + type: + value: sc-set-gpt0 + required: true + mark_value: + type: string + pattern: '^(0x[0-9A-Fa-f]+|[0-9]+)$' + x-display-name: Mark Value + x-dependency: + type: + value: set-mark + required: true + nice_value: + type: integer + minimum: -1024 + maximum: 1024 + x-nullable: false + x-display-name: Nice Value + x-dependency: + type: + value: set-nice + required: true cond: type: string x-display-name: Condition @@ -1238,7 +1272,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice] x-nullable: false capture_sample: type: string @@ -1408,7 +1442,40 @@ http_response_rule: type: integer x-dependency: type: - value: [sc-inc-gpc0, sc-inc-gpc1] + value: [sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0] + required: true + sc_expr: + type: string + x-display-name: ScSet Expression Value + x-dependency: + type: + value: sc-set-gpt0 + required: true + sc_int: + type: integer + x-nullable: true + x-display-name: ScSet Integer Value + x-dependency: + type: + value: sc-set-gpt0 + required: true + mark_value: + type: string + pattern: '^(0x[0-9A-Fa-f]+|[0-9]+)$' + x-display-name: Mark Value + x-dependency: + type: + value: set-mark + required: true + nice_value: + type: integer + minimum: -1024 + maximum: 1024 + x-nullable: false + x-display-name: Nice Value + x-dependency: + type: + value: set-nice required: true cond: type: string From 91e7da8326228cba70cec50ead011516f7f04888 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Wed, 24 Jun 2020 16:10:59 +0200 Subject: [PATCH 060/121] FEATURE/MINOR: http_request_rule: Added set-method, set-priority-class and set-priority-offset --- build/haproxy_spec.yaml | 12 ++++++++++++ models/configuration.yaml | 11 +++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 967b5ae..530c165 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1253,6 +1253,8 @@ definitions: - do-resolve - set-dst - set-dst-port + - set-priority-class + - set-priority-offset x-display-name: Standard HAProxy expression hdr_format: pattern: ^[^\s]+$ @@ -1359,6 +1361,13 @@ definitions: required: true value: set-mark x-display-name: Mark Value + method_fmt: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: set-method nice_value: maximum: 1024 minimum: -1024 @@ -1570,6 +1579,9 @@ definitions: - sc-set-gpt0 - set-mark - set-nice + - set-method + - set-priority-class + - set-priority-offset type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index 7a223be..b6cdea3 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1202,7 +1202,7 @@ http_request_rule: x-display-name: Standard HAProxy expression x-dependency: type: - value: [do-resolve, set-dst, set-dst-port] + value: [do-resolve, set-dst, set-dst-port, set-priority-class, set-priority-offset] required: true sc_expr: type: string @@ -1237,6 +1237,13 @@ http_request_rule: type: value: set-nice required: true + method_fmt: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: set-method + required: true cond: type: string x-display-name: Condition From 4beb66a35ab456722659e06c420c1dfce79d358b Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Wed, 1 Jul 2020 14:15:06 +0200 Subject: [PATCH 061/121] FEATURE/MINOR: http_request_rule: added set-src, set-src-port and wait-for-handshake --- build/haproxy_spec.yaml | 5 +++++ models/configuration.yaml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 530c165..f6aadc2 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1255,6 +1255,8 @@ definitions: - set-dst-port - set-priority-class - set-priority-offset + - set-src + - set-src-port x-display-name: Standard HAProxy expression hdr_format: pattern: ^[^\s]+$ @@ -1582,6 +1584,9 @@ definitions: - set-method - set-priority-class - set-priority-offset + - set-src + - set-src-por + - wait-for-handshake type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index b6cdea3..4a8c032 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1202,7 +1202,7 @@ http_request_rule: x-display-name: Standard HAProxy expression x-dependency: type: - value: [do-resolve, set-dst, set-dst-port, set-priority-class, set-priority-offset] + value: [do-resolve, set-dst, set-dst-port, set-priority-class, set-priority-offset, set-src, set-src-port] required: true sc_expr: type: string From 1dda1e35b959ec726434b62404254574d7ee0843 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Mon, 6 Jul 2020 10:41:29 +0200 Subject: [PATCH 062/121] FEATURE/MINOR: cluster: option to clean configuration when moving from cluster mod to single mode add option to clean or keep configuration. --- build/haproxy_spec.yaml | 7 +++++++ paths/cluster.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f6aadc2..3499559 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4446,6 +4446,13 @@ paths: required: true schema: $ref: '#/definitions/cluster_settings' + - description: In case of moving to single mode do we keep or clean configuration + enum: + - keep + in: query + name: configuration + required: false + type: string - $ref: '#/parameters/version' responses: "200": diff --git a/paths/cluster.yaml b/paths/cluster.yaml index 398bd98..f1e0e3f 100644 --- a/paths/cluster.yaml +++ b/paths/cluster.yaml @@ -25,6 +25,13 @@ cluster: in: body schema: $ref: "#/definitions/cluster_settings" + - name: configuration + description: In case of moving to single mode do we keep or clean configuration + enum: + - keep + in: query + required: false + type: string - $ref: "#/parameters/version" tags: - Cluster From 2d5bb7a765ffd533a4cef28377d52268b0676cb4 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Thu, 2 Jul 2020 16:48:37 +0200 Subject: [PATCH 063/121] FEATURE/MINOR: http-request/response: added set-tos, silent-drop and unset-var --- build/haproxy_spec.yaml | 35 ++++++++++++++++++++++++++++++++--- models/configuration.yaml | 28 ++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 3499559..6ff9d09 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1497,6 +1497,14 @@ definitions: required: true value: send-spoe-group x-display-name: SPOE Group + tos_value: + pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ + type: string + x-dependency: + type: + required: true + value: set-tos + x-display-name: Tos Value track-sc0-key: pattern: ^[^\s]+$ type: string @@ -1587,6 +1595,9 @@ definitions: - set-src - set-src-por - wait-for-handshake + - set-tos + - silent-drop + - unset-var type: string x-nullable: false uri-fmt: @@ -1619,13 +1630,16 @@ definitions: value: - set-var - do-resolve + - unset-var var_scope: pattern: ^[^\s]+$ type: string x-dependency: type: required: true - value: set-var + value: + - set-var + - unset-var required: - index - type @@ -1887,6 +1901,14 @@ definitions: x-dependency: type: value: set-status + tos_value: + pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ + type: string + x-dependency: + type: + required: true + value: set-tos + x-display-name: Tos Value type: enum: - allow @@ -1911,6 +1933,9 @@ definitions: - sc-set-gpt0 - set-mark - set-nice + - set-tos + - silent-drop + - unset-var type: string x-nullable: false var_expr: @@ -1926,14 +1951,18 @@ definitions: x-dependency: type: required: true - value: set-var + value: + - set-var + - unset-var var_scope: pattern: ^[^\s]+$ type: string x-dependency: type: required: true - value: set-var + value: + - set-var + - unset-var required: - index - type diff --git a/models/configuration.yaml b/models/configuration.yaml index 4a8c032..94437d4 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1063,14 +1063,14 @@ http_request_rule: pattern: '^[^\s]+$' x-dependency: type: - value: [set-var, do-resolve] + value: [set-var, do-resolve, unset-var] required: true var_scope: type: string pattern: '^[^\s]+$' x-dependency: type: - value: set-var + value: [set-var, unset-var] required: true var_expr: type: string @@ -1244,6 +1244,14 @@ http_request_rule: type: value: set-method required: true + tos_value: + type: string + pattern: '^(0x[0-9A-Fa-f]+|[0-9]+)$' + x-display-name: Tos Value + x-dependency: + type: + value: set-tos + required: true cond: type: string x-display-name: Condition @@ -1279,7 +1287,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var] x-nullable: false capture_sample: type: string @@ -1363,14 +1371,14 @@ http_response_rule: pattern: '^[^\s]+$' x-dependency: type: - value: set-var + value: [set-var, unset-var] required: true var_scope: type: string pattern: '^[^\s]+$' x-dependency: type: - value: set-var + value: [set-var, unset-var] required: true var_expr: type: string @@ -1484,6 +1492,14 @@ http_response_rule: type: value: set-nice required: true + tos_value: + type: string + pattern: '^(0x[0-9A-Fa-f]+|[0-9]+)$' + x-display-name: Tos Value + x-dependency: + type: + value: set-tos + required: true cond: type: string x-display-name: Condition From e47101d2e81d837d94f04bd4ca5ab3b6b0630002 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 3 Jul 2020 15:57:11 +0200 Subject: [PATCH 064/121] FEATURE/MINOR: http_response_rule: Added track-sc[0-2] --- build/haproxy_spec.yaml | 48 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 47 +++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 6ff9d09..0967ad2 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1909,6 +1909,51 @@ definitions: required: true value: set-tos x-display-name: Tos Value + track-sc0-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc0 + x-display-name: track-sc0 Key + track-sc0-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc0 + x-display-name: track-sc0 Table + track-sc1-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc1 + x-display-name: track-sc1 Key + track-sc1-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc1 + x-display-name: track-sc1 Table + track-sc2-key: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: track-sc2 + x-display-name: track-sc2 Key + track-sc2-table: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + value: track-sc2 + x-display-name: track-sc2 Table type: enum: - allow @@ -1936,6 +1981,9 @@ definitions: - set-tos - silent-drop - unset-var + - track-sc0 + - track-sc1 + - track-sc2 type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index 94437d4..2da797a 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1287,7 +1287,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var, track-sc0, track-sc1, track-sc2] x-nullable: false capture_sample: type: string @@ -1500,6 +1500,51 @@ http_response_rule: type: value: set-tos required: true + track-sc0-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc0 Key + x-dependency: + type: + value: track-sc0 + required: true + track-sc0-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc0 Table + x-dependency: + type: + value: track-sc0 + track-sc1-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc1 Key + x-dependency: + type: + value: track-sc1 + required: true + track-sc1-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc1 Table + x-dependency: + type: + value: track-sc1 + track-sc2-key: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc2 Key + x-dependency: + type: + value: track-sc2 + required: true + track-sc2-table: + type: string + pattern: '^[^\s]+$' + x-display-name: track-sc2 Table + x-dependency: + type: + value: track-sc2 cond: type: string x-display-name: Condition From 035cebf8c52139809bb3a110078792a55091c35b Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Mon, 6 Jul 2020 15:41:55 +0200 Subject: [PATCH 065/121] FEATURE/MINOR: http-request/response: add strict-mode --- build/haproxy_spec.yaml | 20 ++++++++++++++++++++ models/configuration.yaml | 18 ++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0967ad2..07f1f2a 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1497,6 +1497,15 @@ definitions: required: true value: send-spoe-group x-display-name: SPOE Group + strict_mode: + enum: + - "on" + - "off" + type: string + x-dependency: + type: + required: true + value: strict-mode tos_value: pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ type: string @@ -1598,6 +1607,7 @@ definitions: - set-tos - silent-drop - unset-var + - strict-mode type: string x-nullable: false uri-fmt: @@ -1901,6 +1911,15 @@ definitions: x-dependency: type: value: set-status + strict_mode: + enum: + - "on" + - "off" + type: string + x-dependency: + type: + required: true + value: strict-mode tos_value: pattern: ^(0x[0-9A-Fa-f]+|[0-9]+)$ type: string @@ -1984,6 +2003,7 @@ definitions: - track-sc0 - track-sc1 - track-sc2 + - strict-mode type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index 2da797a..41334d9 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -899,7 +899,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1252,6 +1252,13 @@ http_request_rule: type: value: set-tos required: true + strict_mode: + type: string + enum: ['on', 'off'] + x-dependency: + type: + value: strict-mode + required: true cond: type: string x-display-name: Condition @@ -1287,7 +1294,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var, track-sc0, track-sc1, track-sc2] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var, track-sc0, track-sc1, track-sc2, strict-mode] x-nullable: false capture_sample: type: string @@ -1545,6 +1552,13 @@ http_response_rule: x-dependency: type: value: track-sc2 + strict_mode: + type: string + enum: ['on', 'off'] + x-dependency: + type: + value: strict-mode + required: true cond: type: string x-display-name: Condition From 0dfe6b8168f4cc2d489fa171444adf5052e21595 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Thu, 9 Jul 2020 15:26:08 +0200 Subject: [PATCH 066/121] FEATURE/MINOR: global: add lua-load --- build/haproxy_spec.yaml | 11 +++++++++++ models/configuration.yaml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 07f1f2a..6955619 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -182,6 +182,17 @@ definitions: pattern: ^[^\s]+$ type: string x-display-name: Group + lua_loads: + items: + properties: + file: + pattern: ^[^\s]+$ + type: string + required: + - file + type: object + x-go-name: LuaLoad + type: array master-worker: type: boolean x-display-name: Master Worker Mode diff --git a/models/configuration.yaml b/models/configuration.yaml index 41334d9..cdae9fd 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -96,6 +96,17 @@ global: stats_timeout: type: integer x-nullable: true + lua_loads: + type: array + items: + type: object + x-go-name: LuaLoad + required: + - file + properties: + file: + type: string + pattern: '^[^\s]+$' additionalProperties: false defaults: title: Defaults From 00d953e127065de15028ef0d9ee003077ca01b04 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 10 Jul 2020 08:49:05 +0200 Subject: [PATCH 067/121] FEATURE/MINOR: http-request/response: add lua action --- build/haproxy_spec.yaml | 26 ++++++++++++++++++++++++++ models/configuration.yaml | 28 ++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 6955619..39f4c49 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1339,6 +1339,18 @@ definitions: type: required: true value: set-log-level + lua_action: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: lua + lua_params: + type: string + x-dependency: + type: + value: lua map_file: pattern: ^[^\s]+$ type: string @@ -1619,6 +1631,7 @@ definitions: - silent-drop - unset-var - strict-mode + - lua type: string x-nullable: false uri-fmt: @@ -1789,6 +1802,18 @@ definitions: type: required: true value: set-log-level + lua_action: + pattern: ^[^\s]+$ + type: string + x-dependency: + type: + required: true + value: lua + lua_params: + type: string + x-dependency: + type: + value: lua map_file: pattern: ^[^\s]+$ type: string @@ -2015,6 +2040,7 @@ definitions: - track-sc1 - track-sc2 - strict-mode + - lua type: string x-nullable: false var_expr: diff --git a/models/configuration.yaml b/models/configuration.yaml index cdae9fd..55d8b82 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -910,7 +910,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode, lua] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1270,6 +1270,18 @@ http_request_rule: type: value: strict-mode required: true + lua_action: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: lua + required: true + lua_params: + type: string + x-dependency: + type: + value: lua cond: type: string x-display-name: Condition @@ -1305,7 +1317,7 @@ http_response_rule: x-nullable: true type: type: string - enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var, track-sc0, track-sc1, track-sc2, strict-mode] + enum: [allow, deny, redirect, add-header, set-header, del-header, set-log-level, set-var, set-status, send-spoe-group, replace-header, replace-value, add-acl, del-acl, capture, set-map, del-map, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, set-mark, set-nice, set-tos, silent-drop, unset-var, track-sc0, track-sc1, track-sc2, strict-mode, lua] x-nullable: false capture_sample: type: string @@ -1570,6 +1582,18 @@ http_response_rule: type: value: strict-mode required: true + lua_action: + type: string + pattern: '^[^\s]+$' + x-dependency: + type: + value: lua + required: true + lua_params: + type: string + x-dependency: + type: + value: lua cond: type: string x-display-name: Condition From 3a5092b751f545c5be2a984bde3c88941626f442 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 10 Jul 2020 13:57:12 +0200 Subject: [PATCH 068/121] FEATURE/MINOR: tcp-request/response: add lua action --- build/haproxy_spec.yaml | 42 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 40 +++++++++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 39f4c49..544cc0e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2111,6 +2111,7 @@ definitions: - track-sc2 - unset-var - use-service + - lua type: string x-dependency: type: @@ -2207,6 +2208,28 @@ definitions: index: type: integer x-nullable: true + lua_action: + pattern: ^[^\s]+$ + type: string + x-dependency: + action: + required: true + value: lua + type: + value: + - connection + - content + x-display-name: Lua action name + lua_params: + type: string + x-dependency: + action: + value: lua + type: + value: + - connection + - content + x-display-name: Lua action params priority_type: enum: - class @@ -2399,6 +2422,7 @@ definitions: enum: - accept - reject + - lua type: string x-dependency: type: @@ -2429,6 +2453,24 @@ definitions: index: type: integer x-nullable: true + lua_action: + pattern: ^[^\s]+$ + type: string + x-dependency: + action: + required: true + value: lua + type: + value: content + x-display-name: Lua action name + lua_params: + type: string + x-dependency: + action: + value: lua + type: + value: content + x-display-name: Lua action params timeout: type: integer x-dependency: diff --git a/models/configuration.yaml b/models/configuration.yaml index 55d8b82..ac312b8 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1633,7 +1633,7 @@ tcp_request_rule: x-nullable: false action: type: string - enum: [accept, capture, do-resolve, expect-netscaler-cip, expect-proxy, reject, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, send-spoe-group, set-dst-port, set-dst, set-priority, set-src, set-var, silent-drop, track-sc0, track-sc1, track-sc2, unset-var, use-service] + enum: [accept, capture, do-resolve, expect-netscaler-cip, expect-proxy, reject, sc-inc-gpc0, sc-inc-gpc1, sc-set-gpt0, send-spoe-group, set-dst-port, set-dst, set-priority, set-src, set-var, silent-drop, track-sc0, track-sc1, track-sc2, unset-var, use-service, lua] x-nullable: false x-dependency: type: @@ -1803,6 +1803,24 @@ tcp_request_rule: required: true type: value: [session, connection, content] + lua_action: + type: string + pattern: '^[^\s]+$' + x-display-name: Lua action name + x-dependency: + action: + value: lua + required: true + type: + value: [connection, content] + lua_params: + type: string + x-display-name: Lua action params + x-dependency: + action: + value: lua + type: + value: [connection, content] cond: type: string x-display-name: Condition @@ -1846,7 +1864,7 @@ tcp_response_rule: x-nullable: false action: type: string - enum: [accept, reject] + enum: [accept, reject, lua] x-nullable: false x-dependency: type: @@ -1859,6 +1877,24 @@ tcp_response_rule: type: value: inspect-delay required: true + lua_action: + type: string + pattern: '^[^\s]+$' + x-display-name: Lua action name + x-dependency: + action: + value: lua + required: true + type: + value: content + lua_params: + type: string + x-display-name: Lua action params + x-dependency: + action: + value: lua + type: + value: content cond: type: string x-display-name: Condition From 6e4c61fbcc49ed17f85a8c2c81da0799e668a3e9 Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Thu, 16 Jul 2020 09:16:49 +0200 Subject: [PATCH 069/121] MINOR: global: add default ciphersuites --- build/haproxy_spec.yaml | 6 ++++++ models/configuration.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 544cc0e..13788ae 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -239,12 +239,18 @@ definitions: ssl_default_bind_ciphers: type: string x-display-name: SSL Default Bind Ciphers + ssl_default_bind_ciphersuites: + type: string + x-display-name: SSL Default Bind Ciphersuites ssl_default_bind_options: type: string x-display-name: SSL Default Bind Options ssl_default_server_ciphers: type: string x-display-name: SSL Default Server Ciphers + ssl_default_server_ciphersuites: + type: string + x-display-name: SSL Default Server Ciphersuites ssl_default_server_options: type: string x-display-name: SSL Default Server Options diff --git a/models/configuration.yaml b/models/configuration.yaml index ac312b8..766055e 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -45,12 +45,18 @@ global: ssl_default_bind_ciphers: type: string x-display-name: SSL Default Bind Ciphers + ssl_default_bind_ciphersuites: + type: string + x-display-name: SSL Default Bind Ciphersuites ssl_default_server_options: type: string x-display-name: SSL Default Server Options ssl_default_server_ciphers: type: string x-display-name: SSL Default Server Ciphers + ssl_default_server_ciphersuites: + type: string + x-display-name: SSL Default Server Ciphersuites cpu_maps: x-go-name: CPUMaps type: array From 3e3de54e76b0c946d8f58120ba52027c4f51a1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Thu, 16 Jul 2020 11:57:49 +0000 Subject: [PATCH 070/121] FEATURE/MEDIUM: specification: add endpoint to serve OpenAPI v3 spec --- build/haproxy_spec.yaml | 17 +++++++++++++++++ haproxy-spec.yaml | 3 +++ paths/general.yaml | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 13788ae..33f2ae5 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4552,6 +4552,7 @@ tags: - name: PeerEntry - name: Cluster - name: Maps + - name: SpecificationOpenapiv3 security: - basic_auth: [] paths: @@ -4587,6 +4588,22 @@ paths: summary: Data Plane API Specification tags: - Specification + /specification_openapiv3: + get: + description: Return Data Plane API OpenAPI v3 specification + operationId: getOpenapiv3Specification + produces: + - application/json + responses: + "200": + description: Success + schema: + type: object + default: + $ref: '#/responses/DefaultError' + summary: Data Plane API v3 Specification + tags: + - SpecificationOpenapiv3 /info: get: description: Return API, hardware and OS information diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 74de857..c035352 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -411,6 +411,7 @@ tags: - name: PeerEntry - name: Cluster - name: Maps + - name: SpecificationOpenapiv3 security: - basic_auth: [] paths: @@ -418,6 +419,8 @@ paths: $ref: "paths/general.yaml#/root" /specification: $ref: "paths/general.yaml#/specification" + /specification_openapiv3: + $ref: "paths/general.yaml#/specification_openapiv3" /info: $ref: "paths/general.yaml#/info" /cluster: diff --git a/paths/general.yaml b/paths/general.yaml index d7cd071..256abab 100644 --- a/paths/general.yaml +++ b/paths/general.yaml @@ -244,6 +244,22 @@ specification: type: object 'default': $ref: '#/responses/DefaultError' +specification_openapiv3: + get: + tags: + - SpecificationOpenapiv3 + summary: Data Plane API v3 Specification + description: Return Data Plane API OpenAPI v3 specification + operationId: getOpenapiv3Specification + produces: + - application/json + responses: + '200': + description: Success + schema: + type: object + 'default': + $ref: '#/responses/DefaultError' reloads: get: tags: From a1e70390a93f945abf5ba2a5b058f359734ec6e3 Mon Sep 17 00:00:00 2001 From: ahusic Date: Mon, 27 Jul 2020 17:28:45 +0200 Subject: [PATCH 071/121] MINOR: yaml: use single tag instead of multiple tags Previously multiple tags were used. Since openapi-generator doesn't support it (generate duplicated Go structs), we have to use single tag. Added script to pipeline to ensure single tags are used. --- .github/workflows/compare_build.yml | 4 + .gitlab-ci.yml | 2 + build/haproxy_spec.yaml | 201 ---------------------------- haproxy-spec.yaml | 6 - paths/configuration.yaml | 194 --------------------------- paths/runtime.yaml | 3 - scripts/single-tag.sh | 35 +++++ 7 files changed, 41 insertions(+), 404 deletions(-) create mode 100644 scripts/single-tag.sh diff --git a/.github/workflows/compare_build.yml b/.github/workflows/compare_build.yml index 9f5f9b3..78f63e5 100644 --- a/.github/workflows/compare_build.yml +++ b/.github/workflows/compare_build.yml @@ -10,4 +10,8 @@ jobs: cd build ./build -file ../haproxy-spec.yaml > haproxy_spec_to_compare.yaml diff -u haproxy_spec.yaml haproxy_spec_to_compare.yaml + - name: Ensure single tags + run: | + chmod +x ./scripts/single-tag.sh + ./scripts/single-tag.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aad6784..bc1fc05 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,3 +21,5 @@ yamllint: script: # to test locally, run: docker run --rm -v $(pwd):/data cytopia/yamllint . - /bin/sh -c "yamllint -f colored ." + - chmod +x ./scripts/single-tag.sh + - /bin/sh -c ./scripts/single-tag.sh diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 33f2ae5..9eea218 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4527,14 +4527,8 @@ tags: description: Managing frontend bind configurations (advanced mode) - name: Server description: Managing backend server configurations (advanced mode) - - name: Frontend options - description: Various frontend options (advanced mode) - - name: Backend options - description: Various backend options (advanced mode) - name: Configuration description: Raw HAProxy configuration management (advanced mode) - - name: HAProxy configuration management - description: Managing advanced haproxy configuration (advanced mode) - name: TCPRequestRule - name: HTTPRequestRule - name: HTTPResponseRule @@ -5134,7 +5128,6 @@ paths: summary: Return a global part of configuration tags: - Global - - HAProxy configuration management put: description: Replace global part of config operationId: replaceGlobal @@ -5167,7 +5160,6 @@ paths: summary: Replace global tags: - Global - - HAProxy configuration management /services/haproxy/configuration/defaults: get: description: Returns defaults part of configuration. @@ -5194,7 +5186,6 @@ paths: summary: Return defaults part of configuration tags: - Defaults - - HAProxy configuration management put: description: Replace defaults part of config operationId: replaceDefaults @@ -5227,7 +5218,6 @@ paths: summary: Replace defaults tags: - Defaults - - HAProxy configuration management /services/haproxy/configuration/frontends: get: description: Returns an array of all configured frontends. @@ -5256,7 +5246,6 @@ paths: summary: Return an array of frontends tags: - Frontend - - HAProxy configuration management post: description: Adds a new frontend to the configuration file. operationId: createFrontend @@ -5291,7 +5280,6 @@ paths: summary: Add a frontend tags: - Frontend - - HAProxy configuration management /services/haproxy/configuration/frontends/{name}: delete: description: Deletes a frontend from the configuration by it's name. @@ -5321,7 +5309,6 @@ paths: summary: Delete a frontend tags: - Frontend - - HAProxy configuration management get: description: Returns one frontend configuration by it's name. operationId: getFrontend @@ -5354,7 +5341,6 @@ paths: summary: Return a frontend tags: - Frontend - - HAProxy configuration management put: description: Replaces a frontend configuration by it's name. operationId: replaceFrontend @@ -5394,7 +5380,6 @@ paths: summary: Replace a frontend tags: - Frontend - - HAProxy configuration management /services/haproxy/configuration/peer_section: get: description: Returns an array of all configured peer_section. @@ -5423,7 +5408,6 @@ paths: summary: Return an array of peer_section tags: - Peer - - HAProxy configuration management post: description: Adds a new peer to the configuration file. operationId: createPeer @@ -5458,7 +5442,6 @@ paths: summary: Add a peer tags: - Peer - - HAProxy configuration management /services/haproxy/configuration/peer_section/{name}: delete: description: Deletes a peer from the configuration by it's name. @@ -5488,7 +5471,6 @@ paths: summary: Delete a peer tags: - Peer - - HAProxy configuration management get: description: Returns one peer configuration by it's name. operationId: getPeerSection @@ -5521,7 +5503,6 @@ paths: summary: Return a peer tags: - Peer - - HAProxy configuration management /services/haproxy/configuration/peer_entries: get: description: Returns an array of all peer_entries that are configured in specified @@ -5556,7 +5537,6 @@ paths: summary: Return an array of peer_entries tags: - PeerEntry - - HAProxy configuration management post: description: Adds a new peer entry in the specified peer section in the configuration file. @@ -5597,7 +5577,6 @@ paths: summary: Add a new peer_entry tags: - PeerEntry - - HAProxy configuration management /services/haproxy/configuration/peer_entries/{name}: delete: description: Deletes a peer entry configuration by it's name in the specified peer @@ -5633,8 +5612,6 @@ paths: summary: Delete a peer_entry tags: - PeerEntry - - HAProxy configuration management - - Peers options get: description: Returns one peer_entry configuration by it's name in the specified peer section. @@ -5673,7 +5650,6 @@ paths: summary: Return one peer_entry tags: - PeerEntry - - HAProxy configuration management put: description: Replaces a peer entry configuration by it's name in the specified peer section. @@ -5719,8 +5695,6 @@ paths: summary: Replace a peer_entry tags: - PeerEntry - - HAProxy configuration management - - Peers options /services/haproxy/configuration/backends: get: description: Returns an array of all configured backends. @@ -5749,7 +5723,6 @@ paths: summary: Return an array of backends tags: - Backend - - HAProxy configuration management post: description: Adds a new backend to the configuration file. operationId: createBackend @@ -5784,7 +5757,6 @@ paths: summary: Add a backend tags: - Backend - - HAProxy configuration management /services/haproxy/configuration/backends/{name}: delete: description: Deletes a frontend from the configuration by it's name. @@ -5814,7 +5786,6 @@ paths: summary: Delete a backend tags: - Backend - - HAProxy configuration management get: description: Returns one backend configuration by it's name. operationId: getBackend @@ -5847,7 +5818,6 @@ paths: summary: Return a backend tags: - Backend - - HAProxy configuration management put: description: Replaces a backend configuration by it's name. operationId: replaceBackend @@ -5887,7 +5857,6 @@ paths: summary: Replace a backend tags: - Backend - - HAProxy configuration management /services/haproxy/configuration/binds: get: description: Returns an array of all binds that are configured in specified frontend. @@ -5921,8 +5890,6 @@ paths: summary: Return an array of binds tags: - Bind - - HAProxy configuration management - - Frontend options post: description: Adds a new bind in the specified frontend in the configuration file. operationId: createBind @@ -5962,8 +5929,6 @@ paths: summary: Add a new bind tags: - Bind - - HAProxy configuration management - - Frontend options /services/haproxy/configuration/binds/{name}: delete: description: Deletes a bind configuration by it's name in the specified frontend. @@ -5998,8 +5963,6 @@ paths: summary: Delete a bind tags: - Bind - - HAProxy configuration management - - Frontend options get: description: Returns one bind configuration by it's name in the specified frontend. operationId: getBind @@ -6037,8 +6000,6 @@ paths: summary: Return one bind tags: - Bind - - HAProxy configuration management - - Frontend options put: description: Replaces a bind configuration by it's name in the specified frontend. operationId: replaceBind @@ -6083,8 +6044,6 @@ paths: summary: Replace a bind tags: - Bind - - HAProxy configuration management - - Frontend options /services/haproxy/configuration/servers: get: description: Returns an array of all servers that are configured in specified backend. @@ -6118,8 +6077,6 @@ paths: summary: Return an array of servers tags: - Server - - HAProxy configuration management - - Backend options post: description: Adds a new server in the specified backend in the configuration file. operationId: createServer @@ -6159,8 +6116,6 @@ paths: summary: Add a new server tags: - Server - - HAProxy configuration management - - Backend options /services/haproxy/configuration/servers/{name}: delete: description: Deletes a server configuration by it's name in the specified backend. @@ -6195,8 +6150,6 @@ paths: summary: Delete a server tags: - Server - - HAProxy configuration management - - Backend options get: description: Returns one server configuration by it's name in the specified backend. operationId: getServer @@ -6234,8 +6187,6 @@ paths: summary: Return one server tags: - Server - - HAProxy configuration management - - Backend options put: description: Replaces a server configuration by it's name in the specified backend. operationId: replaceServer @@ -6280,8 +6231,6 @@ paths: summary: Replace a server tags: - Server - - HAProxy configuration management - - Backend options /services/haproxy/configuration/http_request_rules: get: description: Returns all HTTP Request Rules that are configured in specified parent. @@ -6322,9 +6271,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all HTTP Request Rules tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule post: description: Adds a new HTTP Request Rule of the specified type in the specified @@ -6373,9 +6319,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new HTTP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule /services/haproxy/configuration/http_request_rules/{index}: delete: @@ -6419,9 +6362,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a HTTP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule get: description: Returns one HTTP Request Rule configuration by it's index in the specified @@ -6468,9 +6408,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one HTTP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule put: description: Replaces a HTTP Request Rule configuration by it's index in the specified @@ -6524,9 +6461,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a HTTP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule /services/haproxy/configuration/http_response_rules: get: @@ -6568,9 +6502,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all HTTP Response Rules tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule post: description: Adds a new HTTP Response Rule of the specified type in the specified @@ -6619,9 +6550,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new HTTP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule /services/haproxy/configuration/http_response_rules/{index}: delete: @@ -6665,9 +6593,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a HTTP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule get: description: Returns one HTTP Response Rule configuration by it's index in the specified @@ -6714,9 +6639,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one HTTP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule put: description: Replaces a HTTP Response Rule configuration by it's index in the specified @@ -6770,9 +6692,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a HTTP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule /services/haproxy/configuration/tcp_request_rules: get: @@ -6815,9 +6734,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all TCP Request Rules tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule post: description: Adds a new TCP Request Rule of the specified type in the specified @@ -6866,9 +6782,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new TCP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule /services/haproxy/configuration/tcp_request_rules/{index}: delete: @@ -6912,9 +6825,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a TCP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule get: description: Returns one TCP Request Rule configuration by it's index in the specified @@ -6961,9 +6871,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one TCP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule put: description: Replaces a TCP Request Rule configuration by it's index in the specified @@ -7017,9 +6924,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a TCP Request Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule /services/haproxy/configuration/tcp_response_rules: get: @@ -7053,9 +6957,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all TCP Response Rules tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule post: description: Adds a new TCP Response Rule of the specified type in the specified @@ -7096,9 +6997,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new TCP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule /services/haproxy/configuration/tcp_response_rules/{index}: delete: @@ -7134,9 +7032,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a TCP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule get: description: Returns one TCP Response Rule configuration by it's index in the specified @@ -7175,9 +7070,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one TCP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule put: description: Replaces a TCP Response Rule configuration by it's Index in the specified @@ -7223,9 +7115,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a TCP Response Rule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule /services/haproxy/configuration/backend_switching_rules: get: @@ -7260,8 +7149,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all Backend Switching Rules tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule post: description: Adds a new Backend Switching Rule of the specified type in the specified @@ -7302,8 +7189,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new Backend Switching Rule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule /services/haproxy/configuration/backend_switching_rules/{index}: delete: @@ -7339,8 +7224,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a Backend Switching Rule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule get: description: Returns one Backend Switching Rule configuration by it's index in the @@ -7379,8 +7262,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one Backend Switching Rule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule put: description: Replaces a Backend Switching Rule configuration by it's index in the @@ -7426,8 +7307,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a Backend Switching Rule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule /services/haproxy/configuration/server_switching_rules: get: @@ -7462,8 +7341,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all Server Switching Rules tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule post: description: Adds a new Server Switching Rule of the specified type in the specified @@ -7504,8 +7381,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new Server Switching Rule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule /services/haproxy/configuration/server_switching_rules/{index}: delete: @@ -7541,8 +7416,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a Server Switching Rule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule get: description: Returns one Server Switching Rule configuration by it's index in the @@ -7581,8 +7454,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one Server Switching Rule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule put: description: Replaces a Server Switching Rule configuration by it's index in the @@ -7628,8 +7499,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a Server Switching Rule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule /services/haproxy/configuration/filters: get: @@ -7671,9 +7540,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all Filters tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter post: description: Adds a new Filter of the specified type in the specified parent. @@ -7721,9 +7587,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new Filter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter /services/haproxy/configuration/filters/{index}: delete: @@ -7766,9 +7629,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a Filter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter get: description: Returns one Filter configuration by it's index in the specified parent. @@ -7814,9 +7674,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one Filter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter put: description: Replaces a Filter configuration by it's index in the specified parent. @@ -7869,9 +7726,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a Filter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter /services/haproxy/configuration/stick_rules: get: @@ -7905,8 +7759,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all Stick Rules tags: - - HAProxy configuration management - - Backend options - StickRule post: description: Adds a new Stick Rule of the specified type in the specified backend. @@ -7946,8 +7798,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new Stick Rule tags: - - HAProxy configuration management - - Backend options - StickRule /services/haproxy/configuration/stick_rules/{index}: delete: @@ -7983,8 +7833,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a Stick Rule tags: - - HAProxy configuration management - - Backend options - StickRule get: description: Returns one Stick Rule configuration by it's index in the specified @@ -8023,8 +7871,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one Stick Rule tags: - - HAProxy configuration management - - Backend options - StickRule put: description: Replaces a Stick Rule configuration by it's index in the specified @@ -8070,8 +7916,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a Stick Rule tags: - - HAProxy configuration management - - Backend options - StickRule /services/haproxy/configuration/log_targets: get: @@ -8113,9 +7957,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all Log Targets tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget post: description: Adds a new Log Target of the specified type in the specified parent. @@ -8163,9 +8004,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new Log Target tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget /services/haproxy/configuration/log_targets/{index}: delete: @@ -8209,9 +8047,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a Log Target tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget get: description: Returns one Log Target configuration by it's index in the specified @@ -8258,9 +8093,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one Log Target tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget put: description: Replaces a Log Target configuration by it's index in the specified @@ -8314,9 +8146,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a Log Target tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget /services/haproxy/configuration/acls: get: @@ -8358,9 +8187,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return an array of all ACL lines tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL post: description: Adds a new ACL line of the specified type in the specified parent. @@ -8408,9 +8234,6 @@ paths: $ref: '#/responses/DefaultError' summary: Add a new ACL line tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL /services/haproxy/configuration/acls/{index}: delete: @@ -8453,9 +8276,6 @@ paths: $ref: '#/responses/DefaultError' summary: Delete a ACL line tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL get: description: Returns one ACL line configuration by it's index in the specified parent. @@ -8501,9 +8321,6 @@ paths: $ref: '#/responses/DefaultError' summary: Return one ACL line tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL put: description: Replaces a ACL line configuration by it's index in the specified parent. @@ -8556,9 +8373,6 @@ paths: $ref: '#/responses/DefaultError' summary: Replace a ACL line tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL /services/haproxy/configuration/resolvers: get: @@ -8588,7 +8402,6 @@ paths: summary: Return an array of resolvers tags: - Resolver - - HAProxy configuration management post: description: Adds a new resolver section to the configuration file. operationId: createResolver @@ -8623,7 +8436,6 @@ paths: summary: Add a resolver tags: - Resolver - - HAProxy configuration management /services/haproxy/configuration/resolvers/{name}: delete: description: Deletes a resolver from the configuration by it's name. @@ -8653,7 +8465,6 @@ paths: summary: Delete a resolver tags: - Resolver - - HAProxy configuration management get: description: Returns one resolver section configuration by it's name. operationId: getResolver @@ -8686,7 +8497,6 @@ paths: summary: Return a resolver tags: - Resolver - - HAProxy configuration management put: description: Replaces a resolver configuration by it's name. operationId: replaceResolver @@ -8726,7 +8536,6 @@ paths: summary: Replace a resolver tags: - Resolver - - HAProxy configuration management /services/haproxy/configuration/nameservers: get: description: Returns an array of all configured nameservers. @@ -8760,7 +8569,6 @@ paths: summary: Return an array of nameservers tags: - Nameserver - - HAProxy configuration management post: description: Adds a new nameserver to the resolvers section. operationId: createNameserver @@ -8800,7 +8608,6 @@ paths: summary: Add a nameserver tags: - Nameserver - - HAProxy configuration management /services/haproxy/configuration/nameservers/{name}: delete: description: Deletes a nameserver from the resolvers section by it's name. @@ -8835,7 +8642,6 @@ paths: summary: Delete a nameserver tags: - Nameserver - - HAProxy configuration management get: description: Returns one nameserver configuration by it's name. operationId: getNameserver @@ -8873,7 +8679,6 @@ paths: summary: Return a nameserver tags: - Nameserver - - HAProxy configuration management put: description: Replaces a nameserver configuration by it's name. operationId: replaceNameserver @@ -8918,7 +8723,6 @@ paths: summary: Replace a nameserver tags: - Nameserver - - HAProxy configuration management /services/haproxy/configuration/raw: get: description: Returns HAProxy configuration file in plain text @@ -8950,7 +8754,6 @@ paths: summary: Return HAProxy configuration tags: - Configuration - - HAProxy configuration management post: consumes: - text/plain @@ -9005,7 +8808,6 @@ paths: summary: Push new haproxy configuration tags: - Configuration - - HAProxy configuration management /services/haproxy/runtime: get: description: Returns a list of endpoints to be used for advanced runtime settings @@ -9059,7 +8861,6 @@ paths: summary: Return an array of runtime servers' setings tags: - Server - - Backend options /services/haproxy/runtime/servers/{name}: get: description: Returns one server runtime settings by it's name in the specified backend. @@ -9087,7 +8888,6 @@ paths: summary: Return one server runtime settings tags: - Server - - Backend options put: description: Replaces a server transient settings by it's name in the specified backend. @@ -9122,7 +8922,6 @@ paths: summary: Replace server transient settings tags: - Server - - Backend options /services/haproxy/runtime/stick_tables: get: description: Returns an array of all stick tables. diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index c035352..b525bb3 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -386,14 +386,8 @@ tags: description: Managing frontend bind configurations (advanced mode) - name: Server description: Managing backend server configurations (advanced mode) - - name: Frontend options - description: Various frontend options (advanced mode) - - name: Backend options - description: Various backend options (advanced mode) - name: Configuration description: Raw HAProxy configuration management (advanced mode) - - name: HAProxy configuration management - description: Managing advanced haproxy configuration (advanced mode) - name: TCPRequestRule - name: HTTPRequestRule - name: HTTPResponseRule diff --git a/paths/configuration.yaml b/paths/configuration.yaml index a009acc..754424c 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -8,7 +8,6 @@ global: - $ref: "#/parameters/transaction_id" tags: - Global - - HAProxy configuration management responses: '200': description: Successful operation @@ -41,7 +40,6 @@ global: - $ref: "#/parameters/force_reload" tags: - Global - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -68,7 +66,6 @@ defaults: - $ref: "#/parameters/transaction_id" tags: - Defaults - - HAProxy configuration management responses: '200': description: Successful operation @@ -101,7 +98,6 @@ defaults: - $ref: "#/parameters/force_reload" tags: - Defaults - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -128,7 +124,6 @@ frontends: - $ref: "#/parameters/transaction_id" tags: - Frontend - - HAProxy configuration management responses: '200': description: Successful operation @@ -163,7 +158,6 @@ frontends: - $ref: "#/parameters/force_reload" tags: - Frontend - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -190,7 +184,6 @@ frontends_one: operationId: getFrontend tags: - Frontend - - HAProxy configuration management parameters: - name: name in: path @@ -223,7 +216,6 @@ frontends_one: operationId: replaceFrontend tags: - Frontend - - HAProxy configuration management parameters: - name: name in: path @@ -263,7 +255,6 @@ frontends_one: operationId: deleteFrontend tags: - Frontend - - HAProxy configuration management parameters: - name: name in: path @@ -295,7 +286,6 @@ backends: - $ref: "#/parameters/transaction_id" tags: - Backend - - HAProxy configuration management responses: '200': description: Successful operation @@ -330,7 +320,6 @@ backends: - $ref: "#/parameters/force_reload" tags: - Backend - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -357,7 +346,6 @@ backends_one: operationId: getBackend tags: - Backend - - HAProxy configuration management parameters: - name: name in: path @@ -390,7 +378,6 @@ backends_one: operationId: replaceBackend tags: - Backend - - HAProxy configuration management parameters: - name: name in: path @@ -430,7 +417,6 @@ backends_one: operationId: deleteBackend tags: - Backend - - HAProxy configuration management parameters: - name: name in: path @@ -462,7 +448,6 @@ peer_section: - $ref: "#/parameters/transaction_id" tags: - Peer - - HAProxy configuration management responses: '200': description: Successful operation @@ -497,7 +482,6 @@ peer_section: - $ref: "#/parameters/force_reload" tags: - Peer - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -524,7 +508,6 @@ peer_section_one: operationId: getPeerSection tags: - Peer - - HAProxy configuration management parameters: - name: name in: path @@ -557,7 +540,6 @@ peer_section_one: operationId: deletePeer tags: - Peer - - HAProxy configuration management parameters: - name: name in: path @@ -580,7 +562,6 @@ peer_section_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - peer_entries: get: summary: Return an array of peer_entries @@ -588,7 +569,6 @@ peer_entries: operationId: getPeerEntries tags: - PeerEntry - - HAProxy configuration management parameters: - name: peer_section in: query @@ -621,7 +601,6 @@ peer_entries: operationId: createPeerEntry tags: - PeerEntry - - HAProxy configuration management parameters: - name: peer_section in: query @@ -662,7 +641,6 @@ peer_entries_one: operationId: getPeerEntry tags: - PeerEntry - - HAProxy configuration management parameters: - name: name in: path @@ -700,8 +678,6 @@ peer_entries_one: operationId: replacePeerEntry tags: - PeerEntry - - HAProxy configuration management - - Peers options parameters: - name: name in: path @@ -746,8 +722,6 @@ peer_entries_one: operationId: deletePeerEntry tags: - PeerEntry - - HAProxy configuration management - - Peers options parameters: - name: name in: path @@ -775,7 +749,6 @@ peer_entries_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - binds: get: summary: Return an array of binds @@ -783,8 +756,6 @@ binds: operationId: getBinds tags: - Bind - - HAProxy configuration management - - Frontend options parameters: - name: frontend in: query @@ -817,8 +788,6 @@ binds: operationId: createBind tags: - Bind - - HAProxy configuration management - - Frontend options parameters: - name: frontend in: query @@ -859,8 +828,6 @@ binds_one: operationId: getBind tags: - Bind - - HAProxy configuration management - - Frontend options parameters: - name: name in: path @@ -898,8 +865,6 @@ binds_one: operationId: replaceBind tags: - Bind - - HAProxy configuration management - - Frontend options parameters: - name: name in: path @@ -944,8 +909,6 @@ binds_one: operationId: deleteBind tags: - Bind - - HAProxy configuration management - - Frontend options parameters: - name: name in: path @@ -982,7 +945,6 @@ resolvers: - $ref: "#/parameters/transaction_id" tags: - Resolver - - HAProxy configuration management responses: '200': description: Successful operation @@ -1017,7 +979,6 @@ resolvers: - $ref: "#/parameters/force_reload" tags: - Resolver - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -1044,7 +1005,6 @@ resolvers_one: operationId: getResolver tags: - Resolver - - HAProxy configuration management parameters: - name: name in: path @@ -1077,7 +1037,6 @@ resolvers_one: operationId: replaceResolver tags: - Resolver - - HAProxy configuration management parameters: - name: name in: path @@ -1117,7 +1076,6 @@ resolvers_one: operationId: deleteResolver tags: - Resolver - - HAProxy configuration management parameters: - name: name in: path @@ -1154,7 +1112,6 @@ nameservers: - $ref: "#/parameters/transaction_id" tags: - Nameserver - - HAProxy configuration management responses: '200': description: Successful operation @@ -1194,7 +1151,6 @@ nameservers: - $ref: "#/parameters/force_reload" tags: - Nameserver - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -1221,7 +1177,6 @@ nameservers_one: operationId: getNameserver tags: - Nameserver - - HAProxy configuration management parameters: - name: name in: path @@ -1259,7 +1214,6 @@ nameservers_one: operationId: replaceNameserver tags: - Nameserver - - HAProxy configuration management parameters: - name: name in: path @@ -1304,7 +1258,6 @@ nameservers_one: operationId: deleteNameserver tags: - Nameserver - - HAProxy configuration management parameters: - name: name in: path @@ -1339,8 +1292,6 @@ servers: operationId: getServers tags: - Server - - HAProxy configuration management - - Backend options parameters: - name: backend in: query @@ -1373,8 +1324,6 @@ servers: operationId: createServer tags: - Server - - HAProxy configuration management - - Backend options parameters: - name: backend in: query @@ -1415,8 +1364,6 @@ servers_one: operationId: getServer tags: - Server - - HAProxy configuration management - - Backend options parameters: - name: name in: path @@ -1454,8 +1401,6 @@ servers_one: operationId: replaceServer tags: - Server - - HAProxy configuration management - - Backend options parameters: - name: name in: path @@ -1500,8 +1445,6 @@ servers_one: operationId: deleteServer tags: - Server - - HAProxy configuration management - - Backend options parameters: - name: name in: path @@ -1535,9 +1478,6 @@ tcp_response_rules: description: Returns all TCP Response Rules that are configured in specified backend. operationId: getTCPResponseRules tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule parameters: - name: backend @@ -1570,9 +1510,6 @@ tcp_response_rules: description: Adds a new TCP Response Rule of the specified type in the specified backend. operationId: createTCPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule parameters: - name: backend @@ -1613,9 +1550,6 @@ tcp_response_rules_one: description: Returns one TCP Response Rule configuration by it's index in the specified backend. operationId: getTCPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule parameters: - name: index @@ -1653,9 +1587,6 @@ tcp_response_rules_one: description: Replaces a TCP Response Rule configuration by it's Index in the specified backend. operationId: replaceTCPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule parameters: - name: index @@ -1700,9 +1631,6 @@ tcp_response_rules_one: description: Deletes a TCP Response Rule configuration by it's index from the specified backend. operationId: deleteTCPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPResponseRule parameters: - name: index @@ -1737,9 +1665,6 @@ tcp_request_rules: description: Returns all TCP Request Rules that are configured in specified parent and parent type. operationId: getTCPRequestRules tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule parameters: - name: parent_name @@ -1778,9 +1703,6 @@ tcp_request_rules: description: Adds a new TCP Request Rule of the specified type in the specified parent. operationId: createTCPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule parameters: - name: parent_name @@ -1827,9 +1749,6 @@ tcp_request_rules_one: description: Returns one TCP Request Rule configuration by it's index in the specified parent. operationId: getTCPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule parameters: - name: index @@ -1873,9 +1792,6 @@ tcp_request_rules_one: description: Replaces a TCP Request Rule configuration by it's index in the specified parent. operationId: replaceTCPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule parameters: - name: index @@ -1926,9 +1842,6 @@ tcp_request_rules_one: description: Deletes a TCP Request Rule configuration by it's index from the specified parent. operationId: deleteTCPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - TCPRequestRule parameters: - name: index @@ -1969,9 +1882,6 @@ http_request_rules: description: Returns all HTTP Request Rules that are configured in specified parent. operationId: getHTTPRequestRules tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule parameters: - name: parent_name @@ -2010,9 +1920,6 @@ http_request_rules: description: Adds a new HTTP Request Rule of the specified type in the specified parent. operationId: createHTTPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule parameters: - name: parent_name @@ -2059,9 +1966,6 @@ http_request_rules_one: description: Returns one HTTP Request Rule configuration by it's index in the specified parent. operationId: getHTTPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule parameters: - name: index @@ -2105,9 +2009,6 @@ http_request_rules_one: description: Replaces a HTTP Request Rule configuration by it's index in the specified parent. operationId: replaceHTTPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule parameters: - name: index @@ -2158,9 +2059,6 @@ http_request_rules_one: description: Deletes a HTTP Request Rule configuration by it's index from the specified parent. operationId: deleteHTTPRequestRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPRequestRule parameters: - name: index @@ -2201,9 +2099,6 @@ http_response_rules: description: Returns all HTTP Response Rules that are configured in specified parent. operationId: getHTTPResponseRules tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule parameters: - name: parent_name @@ -2242,9 +2137,6 @@ http_response_rules: description: Adds a new HTTP Response Rule of the specified type in the specified parent. operationId: createHTTPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule parameters: - name: parent_name @@ -2291,9 +2183,6 @@ http_response_rules_one: description: Returns one HTTP Response Rule configuration by it's index in the specified parent. operationId: getHTTPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule parameters: - name: index @@ -2337,9 +2226,6 @@ http_response_rules_one: description: Replaces a HTTP Response Rule configuration by it's index in the specified parent. operationId: replaceHTTPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule parameters: - name: index @@ -2390,9 +2276,6 @@ http_response_rules_one: description: Deletes a HTTP Response Rule configuration by it's index from the specified parent. operationId: deleteHTTPResponseRule tags: - - HAProxy configuration management - - Backend options - - Frontend options - HTTPResponseRule parameters: - name: index @@ -2433,8 +2316,6 @@ backend_switching_rules: description: Returns all Backend Switching Rules that are configured in specified frontend. operationId: getBackendSwitchingRules tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule parameters: - name: frontend @@ -2467,8 +2348,6 @@ backend_switching_rules: description: Adds a new Backend Switching Rule of the specified type in the specified frontend. operationId: createBackendSwitchingRule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule parameters: - name: frontend @@ -2509,8 +2388,6 @@ backend_switching_rules_one: description: Returns one Backend Switching Rule configuration by it's index in the specified frontend. operationId: getBackendSwitchingRule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule parameters: - name: index @@ -2548,8 +2425,6 @@ backend_switching_rules_one: description: Replaces a Backend Switching Rule configuration by it's index in the specified frontend. operationId: replaceBackendSwitchingRule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule parameters: - name: index @@ -2594,8 +2469,6 @@ backend_switching_rules_one: description: Deletes a Backend Switching Rule configuration by it's index from the specified frontend. operationId: deleteBackendSwitchingRule tags: - - HAProxy configuration management - - Frontend options - BackendSwitchingRule parameters: - name: index @@ -2630,8 +2503,6 @@ server_switching_rules: description: Returns all Backend Switching Rules that are configured in specified backend. operationId: getServerSwitchingRules tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule parameters: - name: backend @@ -2664,8 +2535,6 @@ server_switching_rules: description: Adds a new Server Switching Rule of the specified type in the specified backend. operationId: createServerSwitchingRule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule parameters: - name: backend @@ -2706,8 +2575,6 @@ server_switching_rules_one: description: Returns one Server Switching Rule configuration by it's index in the specified backend. operationId: getServerSwitchingRule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule parameters: - name: index @@ -2745,8 +2612,6 @@ server_switching_rules_one: description: Replaces a Server Switching Rule configuration by it's index in the specified backend. operationId: replaceServerSwitchingRule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule parameters: - name: index @@ -2791,8 +2656,6 @@ server_switching_rules_one: description: Deletes a Server Switching Rule configuration by it's index from the specified backend. operationId: deleteServerSwitchingRule tags: - - HAProxy configuration management - - Backend options - ServerSwitchingRule parameters: - name: index @@ -2833,7 +2696,6 @@ configuration: - application/json tags: - Configuration - - HAProxy configuration management responses: '200': description: Operation successful @@ -2888,7 +2750,6 @@ configuration: - $ref: "#/parameters/force_reload" tags: - Configuration - - HAProxy configuration management responses: '202': description: Configuration change accepted and reload requested @@ -2912,9 +2773,6 @@ filters: description: Returns all Filters that are configured in specified parent. operationId: getFilters tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter parameters: - name: parent_name @@ -2953,9 +2811,6 @@ filters: description: Adds a new Filter of the specified type in the specified parent. operationId: createFilter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter parameters: - name: parent_name @@ -3002,9 +2857,6 @@ filters_one: description: Returns one Filter configuration by it's index in the specified parent. operationId: getFilter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter parameters: - name: index @@ -3048,9 +2900,6 @@ filters_one: description: Replaces a Filter configuration by it's index in the specified parent. operationId: replaceFilter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter parameters: - name: index @@ -3101,9 +2950,6 @@ filters_one: description: Deletes a Filter configuration by it's index from the specified parent. operationId: deleteFilter tags: - - HAProxy configuration management - - Backend options - - Frontend options - Filter parameters: - name: index @@ -3144,8 +2990,6 @@ stick_rules: description: Returns all Stick Rules that are configured in specified backend. operationId: getStickRules tags: - - HAProxy configuration management - - Backend options - StickRule parameters: - name: backend @@ -3178,8 +3022,6 @@ stick_rules: description: Adds a new Stick Rule of the specified type in the specified backend. operationId: createStickRule tags: - - HAProxy configuration management - - Backend options - StickRule parameters: - name: backend @@ -3220,8 +3062,6 @@ stick_rules_one: description: Returns one Stick Rule configuration by it's index in the specified backend. operationId: getStickRule tags: - - HAProxy configuration management - - Backend options - StickRule parameters: - name: index @@ -3259,8 +3099,6 @@ stick_rules_one: description: Replaces a Stick Rule configuration by it's index in the specified backend. operationId: replaceStickRule tags: - - HAProxy configuration management - - Backend options - StickRule parameters: - name: index @@ -3305,8 +3143,6 @@ stick_rules_one: description: Deletes a Stick Rule configuration by it's index from the specified backend. operationId: deleteStickRule tags: - - HAProxy configuration management - - Backend options - StickRule parameters: - name: index @@ -3341,9 +3177,6 @@ log_targets: description: Returns all Log Targets that are configured in specified parent. operationId: getLogTargets tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget parameters: - name: parent_name @@ -3382,9 +3215,6 @@ log_targets: description: Adds a new Log Target of the specified type in the specified parent. operationId: createLogTarget tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget parameters: - name: parent_name @@ -3431,9 +3261,6 @@ log_targets_one: description: Returns one Log Target configuration by it's index in the specified parent. operationId: getLogTarget tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget parameters: - name: index @@ -3477,9 +3304,6 @@ log_targets_one: description: Replaces a Log Target configuration by it's index in the specified parent. operationId: replaceLogTarget tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget parameters: - name: index @@ -3530,9 +3354,6 @@ log_targets_one: description: Deletes a Log Target configuration by it's index from the specified parent. operationId: deleteLogTarget tags: - - HAProxy configuration management - - Backend options - - Frontend options - LogTarget parameters: - name: index @@ -3573,9 +3394,6 @@ acls: description: Returns all ACL lines that are configured in specified parent. operationId: getAcls tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL parameters: - name: parent_name @@ -3614,9 +3432,6 @@ acls: description: Adds a new ACL line of the specified type in the specified parent. operationId: createAcl tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL parameters: - name: parent_name @@ -3663,9 +3478,6 @@ acls_one: description: Returns one ACL line configuration by it's index in the specified parent. operationId: getAcl tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL parameters: - name: index @@ -3709,9 +3521,6 @@ acls_one: description: Replaces a ACL line configuration by it's index in the specified parent. operationId: replaceAcl tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL parameters: - name: index @@ -3762,9 +3571,6 @@ acls_one: description: Deletes a ACL line configuration by it's index from the specified parent. operationId: deleteAcl tags: - - HAProxy configuration management - - Backend options - - Frontend options - ACL parameters: - name: index diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 00a2416..8f13fa4 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -22,7 +22,6 @@ servers: operationId: getRuntimeServers tags: - Server - - Backend options parameters: - name: backend in: query @@ -43,7 +42,6 @@ servers_one: operationId: getRuntimeServer tags: - Server - - Backend options parameters: - name: name in: path @@ -70,7 +68,6 @@ servers_one: operationId: replaceRuntimeServer tags: - Server - - Backend options parameters: - name: name in: path diff --git a/scripts/single-tag.sh b/scripts/single-tag.sh new file mode 100644 index 0000000..8e9fdaf --- /dev/null +++ b/scripts/single-tag.sh @@ -0,0 +1,35 @@ +# Ensure single tags are used. +# This is necessary for opaneapi-generator +# which doesn't work well with multiple tags +haproxy_spec="./build/haproxy_spec.yaml" +found="false" +countTags=0 +lineNo=0 + +while IFS= read -r line +do + lineNo=$((lineNo+1)) + # skip root tags + if [ "$line" = "tags:" ]; then + continue + fi + + trimLine="${line#"${line%%[![:space:]]*}"}" + + if [ "$found" = "true" ] && [ "${trimLine:0:1}" = "-" ]; then + countTags=$((countTags+1)) + else + found="false" + countTags=0 + fi + + if [ "$countTags" -gt 1 ]; then + echo "Multiple tags are not supported. Additional tag: $line at line: $lineNo" + exit 1 + fi + + # handle only tags from path + if [ "$trimLine" = "tags:" ]; then + found="true" + fi +done < "$haproxy_spec" \ No newline at end of file From 9a5092b6a6afaca1b04b0127110206a20946c44f Mon Sep 17 00:00:00 2001 From: ahusic Date: Tue, 28 Jul 2020 19:03:22 +0200 Subject: [PATCH 072/121] CLEANUP: yaml: various yaml linting warnings fixed --- .github/workflows/compare_build.yml | 3 ++- .github/workflows/lint.yml | 4 +++- models/configuration.yaml | 1 + models/runtime.yaml | 4 ++-- paths/cluster.yaml | 1 - paths/runtime.yaml | 18 +++++++++--------- scripts/single-tag.sh | 6 +++--- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/compare_build.yml b/.github/workflows/compare_build.yml index 78f63e5..2f0502a 100644 --- a/.github/workflows/compare_build.yml +++ b/.github/workflows/compare_build.yml @@ -1,4 +1,6 @@ +--- name: Compare build +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: build: @@ -14,4 +16,3 @@ jobs: run: | chmod +x ./scripts/single-tag.sh ./scripts/single-tag.sh - diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 38d0733..1bc0d6c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,6 @@ +--- name: Yaml Lint +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: lint: @@ -9,4 +11,4 @@ jobs: uses: ibiqlik/action-yamllint@master with: file_or_dir: . - config_file: .yamllint.yml \ No newline at end of file + config_file: .yamllint.yml diff --git a/models/configuration.yaml b/models/configuration.yaml index 766055e..bfc4c82 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1,3 +1,4 @@ +--- global: title: Global description: HAProxy global configuration diff --git a/models/runtime.yaml b/models/runtime.yaml index 25550dd..65315fb 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -60,7 +60,7 @@ process_info_item: pool_failed: type: integer x-nullable: true - ulimit_n: + ulimit_n: type: integer x-nullable: true max_sock: @@ -368,4 +368,4 @@ map_entry: key: type: string value: - type: string \ No newline at end of file + type: string diff --git a/paths/cluster.yaml b/paths/cluster.yaml index f1e0e3f..50196b9 100644 --- a/paths/cluster.yaml +++ b/paths/cluster.yaml @@ -58,4 +58,3 @@ certificate: description: refresh not possible 'default': $ref: '#/responses/DefaultError' - \ No newline at end of file diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 8f13fa4..7837943 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -183,7 +183,7 @@ stick_table_entries: 'default': $ref: '#/responses/DefaultError' maps: - get: # show map + get: # show map summary: Return all available map files description: Returns all available map files. operationId: getAllRuntimeMapFiles @@ -198,7 +198,7 @@ maps: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - post: # (raw) + post: # (raw) summary: Creates runtime map file with its entries description: Creates runtime map file with its entries. operationId: createRuntimeMap @@ -224,7 +224,7 @@ maps: 'default': $ref: '#/responses/DefaultError' maps_one: - get: # one map file + get: # one map file summary: Return one runtime map file description: Returns one runtime map file. operationId: getOneRuntimeMap @@ -245,7 +245,7 @@ maps_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - delete: # clear map [map] + delete: # clear map [map] summary: Remove all map entries from the map file description: Remove all map entries from the map file. operationId: clearRuntimeMap @@ -269,7 +269,7 @@ maps_one: 'default': $ref: '#/responses/DefaultError' maps_entries: - get: # show map [map] + get: # show map [map] summary: Return one map runtime entries description: Returns an array of all entries in a given runtime map file. operationId: showRuntimeMap @@ -290,7 +290,7 @@ maps_entries: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - post: # add map [map] key value + post: # add map [map] key value summary: Adds an entry into the map file description: Adds an entry into the map file. operationId: addMapEntry @@ -319,7 +319,7 @@ maps_entries: 'default': $ref: '#/responses/DefaultError' maps_entries_one: - get: # get map + get: # get map summary: Return one map runtime setting description: Returns one map runtime setting by it's id. operationId: getRuntimeMapEntry @@ -345,7 +345,7 @@ maps_entries_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - put: # set map [|#] + put: # set map [|#] summary: Replace the value corresponding to each id in a map description: Replaces the value corresponding to each id in a map. operationId: replaceRuntimeMapEntry @@ -384,7 +384,7 @@ maps_entries_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - delete: # del map [|#] + delete: # del map [|#] summary: Deletes all the map entries from the map by its id description: Delete all the map entries from the map by its id. operationId: deleteRuntimeMapEntry diff --git a/scripts/single-tag.sh b/scripts/single-tag.sh index 8e9fdaf..d767cdc 100644 --- a/scripts/single-tag.sh +++ b/scripts/single-tag.sh @@ -13,7 +13,7 @@ do if [ "$line" = "tags:" ]; then continue fi - + trimLine="${line#"${line%%[![:space:]]*}"}" if [ "$found" = "true" ] && [ "${trimLine:0:1}" = "-" ]; then @@ -27,9 +27,9 @@ do echo "Multiple tags are not supported. Additional tag: $line at line: $lineNo" exit 1 fi - + # handle only tags from path if [ "$trimLine" = "tags:" ]; then found="true" fi -done < "$haproxy_spec" \ No newline at end of file +done < "$haproxy_spec" From 279a569d8e430930a9a6a5a9654e9df96980aa78 Mon Sep 17 00:00:00 2001 From: ahusic Date: Fri, 28 Aug 2020 17:31:36 +0200 Subject: [PATCH 073/121] FEATURE/MINOR: global: add log-send-hostname support --- build/haproxy_spec.yaml | 14 ++++++++++++++ models/configuration.yaml | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 9eea218..0ee1c23 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -182,6 +182,20 @@ definitions: pattern: ^[^\s]+$ type: string x-display-name: Group + log_send_hostname: + properties: + enabled: + enum: + - enabled + - disabled + type: string + param: + pattern: ^[^\s]+$ + type: string + required: + - enabled + type: object + x-display-name: Log Send Hostname lua_loads: items: properties: diff --git a/models/configuration.yaml b/models/configuration.yaml index bfc4c82..102b7ed 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -114,6 +114,18 @@ global: file: type: string pattern: '^[^\s]+$' + log_send_hostname: + type: object + x-display-name: Log Send Hostname + required: + - enabled + properties: + enabled: + type: string + enum: [enabled, disabled] + param: + type: string + pattern: '^[^\s]+$' additionalProperties: false defaults: title: Defaults From 8698d6e9b53386c48fe1f280e303ec76eaa842e3 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Wed, 12 Aug 2020 09:32:52 +0200 Subject: [PATCH 074/121] FEATURE/MEDIUM: Add service discovery endpoint and consul service deiscovery --- build/haproxy_spec.yaml | 183 ++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 13 +++ models/service-discovery.yaml | 55 ++++++++++ paths/service-discovery.yaml | 114 +++++++++++++++++++++ 4 files changed, 365 insertions(+) create mode 100644 models/service-discovery.yaml create mode 100644 paths/service-discovery.yaml diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0ee1c23..87ce8a0 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4431,6 +4431,74 @@ definitions: type: array items: $ref: '#/definitions/nameserver' + consul: + additionalProperties: false + description: Consul server configuration + example: + address: 127.0.0.1 + id: 0 + port: 90 + properties: + address: + pattern: ^[^\s]+$ + type: string + description: + type: string + enabled: + type: boolean + id: + description: Auto generated ID. + pattern: ^[^\s]+$ + type: string + x-nullable: true + name: + type: string + port: + maximum: 65535 + minimum: 1 + type: integer + retry_timeout: + description: Duration in seconds in-between data pulling requests to the consul + server + minimum: 1 + type: integer + server_slots_base: + default: 10 + type: integer + server_slots_growth_increment: + type: integer + server_slots_growth_type: + default: exponential + enum: + - linear + - exponential + type: string + service-blacklist: + items: + pattern: ^[^\s]+$ + type: string + type: array + service-whitelist: + items: + pattern: ^[^\s]+$ + type: string + type: array + token: + pattern: ^[^\s]+$ + type: string + required: + - address + - port + - enabled + - retry_timeout + title: Consul server + type: object + consuls: + title: Consuls + description: Consuls array + type: array + items: + $ref: '#/definitions/consul' responses: BadRequest: description: Bad request @@ -4561,6 +4629,7 @@ tags: - name: Cluster - name: Maps - name: SpecificationOpenapiv3 + - name: ServiceDiscovery security: - basic_auth: [] paths: @@ -4687,6 +4756,120 @@ paths: summary: Initiates a certificate refresh tags: - Cluster + /service_discovery/consul: + get: + description: Returns all configured Consul servers. + operationId: getConsuls + responses: + "200": + description: Successful operation + schema: + properties: + data: + $ref: '#/definitions/consuls' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of all configured Consul servers + tags: + - ServiceDiscovery + post: + description: Adds a new Consul server. + operationId: createConsul + parameters: + - in: body + name: data + required: true + schema: + $ref: '#/definitions/consul' + responses: + "201": + description: Consul created + schema: + $ref: '#/definitions/consul' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new Consul server + tags: + - ServiceDiscovery + /service_discovery/consul/{id}: + delete: + description: Deletes a Consul server configuration by it's id. + operationId: deleteConsul + parameters: + - description: Consul server Index + in: path + name: id + required: true + type: string + responses: + "204": + description: Consul server deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a Consul server + tags: + - ServiceDiscovery + get: + description: Returns one Consul server configuration by it's id. + operationId: getConsul + parameters: + - description: Consul server id + in: path + name: id + required: true + type: string + responses: + "200": + description: Successful operation + schema: + properties: + data: + $ref: '#/definitions/consul' + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one Consul server + tags: + - ServiceDiscovery + put: + description: Replaces a Consul server configuration by it's id. + operationId: replaceConsul + parameters: + - description: Consul Index + in: path + name: id + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/consul' + responses: + "200": + description: Consul server replaced + schema: + $ref: '#/definitions/consul' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a Consul server + tags: + - ServiceDiscovery /services: get: description: Returns a list of API managed services endpoints. diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index b525bb3..2351296 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -276,6 +276,14 @@ definitions: type: array items: $ref: '#/definitions/nameserver' + consul: + $ref: "models/service-discovery.yaml#/consul" + consuls: + title: Consuls + description: Consuls array + type: array + items: + $ref: '#/definitions/consul' responses: BadRequest: description: Bad request @@ -406,6 +414,7 @@ tags: - name: Cluster - name: Maps - name: SpecificationOpenapiv3 + - name: ServiceDiscovery security: - basic_auth: [] paths: @@ -421,6 +430,10 @@ paths: $ref: "paths/cluster.yaml#/cluster" /cluster/certificate: $ref: "paths/cluster.yaml#/certificate" + /service_discovery/consul: + $ref: "paths/service-discovery.yaml#/consul" + /service_discovery/consul/{id}: + $ref: "paths/service-discovery.yaml#/consul_one" /services: $ref: "paths/general.yaml#/services" /services/haproxy: diff --git a/models/service-discovery.yaml b/models/service-discovery.yaml new file mode 100644 index 0000000..d0fb3ec --- /dev/null +++ b/models/service-discovery.yaml @@ -0,0 +1,55 @@ +consul: + title: Consul server + description: Consul server configuration + type: object + required: [address, port, enabled, retry_timeout] + properties: + id: + type: string + x-nullable: true + pattern: '^[^\s]+$' + description: Auto generated ID. + address: + type: string + pattern: '^[^\s]+$' + port: + type: integer + minimum: 1 + maximum: 65535 + token: + type: string + pattern: '^[^\s]+$' + enabled: + type: boolean + retry_timeout: + type: integer + minimum: 1 + description: Duration in seconds in-between data pulling requests to the consul server + service-whitelist: + type: array + items: + type: string + pattern: '^[^\s]+$' + service-blacklist: + type: array + items: + type: string + pattern: '^[^\s]+$' + server_slots_base: + type: integer + default: 10 + server_slots_growth_type: + type: string + enum: [linear, exponential] + default: exponential + server_slots_growth_increment: + type: integer + description: + type: string + name: + type: string + additionalProperties: false + example: + id: 0 + address: 127.0.0.1 + port: 90 \ No newline at end of file diff --git a/paths/service-discovery.yaml b/paths/service-discovery.yaml new file mode 100644 index 0000000..14eb7c0 --- /dev/null +++ b/paths/service-discovery.yaml @@ -0,0 +1,114 @@ +consul: + get: + summary: Return an array of all configured Consul servers + description: Returns all configured Consul servers. + operationId: getConsuls + tags: + - ServiceDiscovery + responses: + '200': + description: Successful operation + schema: + type: object + required: + - data + properties: + data: + $ref: "#/definitions/consuls" + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new Consul server + description: Adds a new Consul server. + operationId: createConsul + tags: + - ServiceDiscovery + parameters: + - name: data + in: body + required: true + schema: + $ref: '#/definitions/consul' + responses: + '201': + description: Consul created + schema: + $ref: '#/definitions/consul' + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +consul_one: + get: + summary: Return one Consul server + description: Returns one Consul server configuration by it's id. + operationId: getConsul + tags: + - ServiceDiscovery + parameters: + - name: id + in: path + description: Consul server id + required: true + type: string + responses: + '200': + description: Successful operation + schema: + type: object + properties: + data: + $ref: "#/definitions/consul" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a Consul server + description: Replaces a Consul server configuration by it's id. + operationId: replaceConsul + tags: + - ServiceDiscovery + parameters: + - name: id + in: path + description: Consul Index + required: true + type: string + - name: data + in: body + required: true + schema: + $ref: '#/definitions/consul' + responses: + '200': + description: Consul server replaced + schema: + $ref: '#/definitions/consul' + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a Consul server + description: Deletes a Consul server configuration by it's id. + operationId: deleteConsul + tags: + - ServiceDiscovery + parameters: + - name: id + in: path + description: Consul server Index + required: true + type: string + responses: + '204': + description: Consul server deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' \ No newline at end of file From 288b126e93b2cbf3fd6867d07d08087933572d16 Mon Sep 17 00:00:00 2001 From: ahusic Date: Thu, 3 Sep 2020 14:19:01 +0200 Subject: [PATCH 075/121] MINOR: http-request: add missing redirect codes --- build/haproxy_spec.yaml | 2 ++ models/configuration.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 87ce8a0..43811f6 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1462,6 +1462,8 @@ definitions: - 301 - 302 - 303 + - 307 + - 308 type: integer x-dependency: type: diff --git a/models/configuration.yaml b/models/configuration.yaml index 102b7ed..3750093 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1025,7 +1025,7 @@ http_request_rule: redir_code: type: integer x-display-name: Redirect Code - enum: [301, 302, 303] + enum: [301, 302, 303, 307, 308] x-dependency: type: value: redirect From 70331571e8bc13fecb82f2e77404cf52a62b072a Mon Sep 17 00:00:00 2001 From: ahusic Date: Thu, 10 Sep 2020 13:55:07 +0200 Subject: [PATCH 076/121] BUG/MINOR: http-rules: make nullable enums --- build/haproxy_spec.yaml | 4 +++- models/configuration.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 43811f6..63ba540 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1274,7 +1274,7 @@ definitions: value: - deny - tarpit - x-nullable: false + x-nullable: true expr: type: string x-dependency: @@ -1469,6 +1469,7 @@ definitions: type: value: redirect x-display-name: Redirect Code + x-nullable: true redir_option: type: string x-dependency: @@ -1891,6 +1892,7 @@ definitions: type: value: redirect x-display-name: Redirect Code + x-nullable: true redir_option: type: string x-dependency: diff --git a/models/configuration.yaml b/models/configuration.yaml index 3750093..1e4b066 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1024,6 +1024,7 @@ http_request_rule: required: true redir_code: type: integer + x-nullable: true x-display-name: Redirect Code enum: [301, 302, 303, 307, 308] x-dependency: @@ -1039,7 +1040,7 @@ http_request_rule: deny_status: type: integer enum: [200, 400, 403, 405, 408, 425, 429, 500, 502, 503, 504] - x-nullable: false + x-nullable: true x-dependency: type: value: [deny, tarpit] @@ -1372,6 +1373,7 @@ http_response_rule: required: true redir_code: type: integer + x-nullable: true x-display-name: Redirect Code enum: [301, 302, 303] x-dependency: From 859d612e95d5fffb17ce550b5c22bf820821d740 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Mon, 6 Jul 2020 14:05:33 +0200 Subject: [PATCH 077/121] FEATURE/MINOR: server: add missing settings --- build/haproxy_spec.yaml | 210 ++++++++++++++++++++++++++++- models/configuration.yaml | 276 +++++++++++++++++++++++++++++--------- 2 files changed, 422 insertions(+), 64 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 63ba540..77a5f57 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1019,39 +1019,163 @@ definitions: - enabled - disabled type: string + check_alpn: + pattern: ^[^\s]+$ + type: string + x-display-name: Protocols + check_proto: + pattern: ^[^\s]+$ + type: string + x-display-name: Name + check_via_socks4: + enum: + - enabled + - disabled + type: string + ciphers: + type: string + x-dependency: + ssl: + value: enabled + ciphersuites: + type: string + x-dependency: + ssl: + value: enabled cookie: pattern: ^[^\s]+$ type: string + crl_file: + type: string + x-dependency: + ssl: + value: enabled downinter: type: integer x-nullable: true + error_limit: + type: integer + x-display-name: Error count + fall: + type: integer + x-display-name: Nr. of consecutive failed checks + x-nullable: true fastinter: type: integer x-nullable: true + force_sslv3: + enum: + - enabled + - disabled + type: string + force_tlsv10: + enum: + - enabled + - disabled + type: string + force_tlsv11: + enum: + - enabled + - disabled + type: string + force_tlsv12: + enum: + - enabled + - disabled + type: string + force_tlsv13: + enum: + - enabled + - disabled + type: string health_check_port: maximum: 65535 minimum: 1 type: integer x-nullable: true + id: + type: integer + x-nullable: true init-addr: pattern: ^[^\s]+$ type: string + x-nullable: true inter: type: integer x-nullable: true + log_proto: + enum: + - legacy + - octet-count + type: string maintenance: enum: - enabled - disabled type: string + max_reuse: + type: integer + x-nullable: true maxconn: type: integer - x-display-name: Max Connections + x-display-name: Max Concurrent Connections + x-nullable: true + maxqueue: + type: integer + x-display-name: Max Number of Connections + x-nullable: true + minconn: + type: integer x-nullable: true name: pattern: ^[^\s]+$ type: string x-nullable: false + namespace: + type: string + no_sslv3: + enum: + - enabled + - disabled + type: string + no_tlsv10: + enum: + - enabled + - disabled + type: string + no_tlsv11: + enum: + - enabled + - disabled + type: string + no_tlsv12: + enum: + - enabled + - disabled + type: string + no_tlsv13: + enum: + - enabled + - disabled + type: string + no_verifyhost: + enum: + - enabled + - disabled + type: string + npn: + type: string + x-dependency: + ssl: + value: enabled + observe: + enum: + - layer4 + - layer7 + type: string + x-dependency: + ssl: + value: enabled on-error: enum: - fastinter @@ -1067,6 +1191,15 @@ definitions: enum: - shutdown-backup-sessions type: string + pool_low_conn: + type: integer + x-nullable: true + pool_max_conn: + type: integer + x-nullable: true + pool_purge_delay: + type: integer + x-nullable: true port: maximum: 65535 minimum: 1 @@ -1088,24 +1221,35 @@ definitions: - unique-id type: string type: array + redir: + type: string + x-display-name: Prefix resolve-net: - pattern: ^[^\s]+$ + pattern: ^[^,\s][^\,]*[^,\s]*$ type: string x-dependency: resolvers: required: true resolve-prefer: - pattern: ^[^\s]+$ + enum: + - ipv4 + - ipv6 type: string x-dependency: resolvers: required: true + resolve_opts: + pattern: ^[^,\s][^\,]*[^,\s]*$ + type: string resolvers: pattern: ^[^\s]+$ type: string x-dynamic-enum: operation: getResolvers property: name + rise: + type: integer + x-nullable: true send-proxy: enum: - enabled @@ -1116,12 +1260,30 @@ definitions: - enabled - disabled type: string + send_proxy_v2_ssl: + enum: + - enabled + - disabled + type: string + send_proxy_v2_ssl_cn: + enum: + - enabled + - disabled + type: string slowstart: type: integer x-nullable: true sni: pattern: ^[^\s]+$ type: string + socks4: + pattern: ^[^\s]+$ + type: string + x-dependency: + check-via-socks4: + required: true + source: + type: string ssl: enum: - enabled @@ -1140,6 +1302,39 @@ definitions: x-dependency: ssl: value: enabled + ssl_max_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + ssl_min_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + ssl_reuse: + enum: + - enabled + - disabled + type: string + stick: + enum: + - enabled + - disabled + type: string + tcp_ut: + type: integer + tfo: + enum: + - enabled + - disabled + type: string tls_tickets: enum: - enabled @@ -1148,6 +1343,8 @@ definitions: x-dependency: ssl: value: enabled + track: + type: string verify: enum: - none @@ -1156,6 +1353,13 @@ definitions: x-dependency: ssl: value: enabled + verifyhost: + type: string + x-dependency: + ssl: + value: enabled + verify: + value: required weight: type: integer x-nullable: true diff --git a/models/configuration.yaml b/models/configuration.yaml index 1e4b066..8c76341 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -761,28 +761,122 @@ server: type: string pattern: '^[^\s]+$' x-nullable: false - allow_0rtt: - type: boolean - port: + health_check_port: type: integer x-nullable: true minimum: 1 maximum: 65535 - health_check_port: + ssl_certificate: + type: string + pattern: '^[^\s]+$' + x-dependency: + ssl: + value: enabled + maintenance: # I don't see this option in the specification + type: string + enum: [enabled, disabled] + agent-check: + type: string + enum: [enabled, disabled] + x-dependency: + agent-port: + required: true + agent-send: + type: string + agent-inter: + type: integer + x-nullable: true + agent-addr: + type: string + pattern: '^[^\s]+$' + agent-port: type: integer x-nullable: true minimum: 1 maximum: 65535 - maxconn: + allow_0rtt: + type: boolean + alpn: + type: string + x-display-name: ALPN Protocols + pattern: '^[^\s]+$' + backup: + type: string + enum: [enabled, disabled] + ssl_cafile: # ca-file? + type: string + x-display-name: SSL CA File + pattern: '^[^\s]+$' + x-dependency: + ssl: + value: enabled + check: + type: string + enum: [enabled, disabled] + check_alpn: + type: string + x-display-name: Protocols + pattern: '^[^\s]+$' + check_proto: + type: string + x-display-name: Name + pattern: '^[^\s]+$' + check-sni: + type: string + pattern: '^[^\s]+$' + check-ssl: + type: string + enum: [enabled, disabled] + check_via_socks4: + type: string + enum: [enabled, disabled] + ciphers: + type: string + x-dependency: + ssl: + value: enabled + ciphersuites: + type: string + x-dependency: + ssl: + value: enabled + cookie: + type: string + pattern: '^[^\s]+$' + crl_file: + type: string + x-dependency: + ssl: + value: enabled + error_limit: type: integer - x-display-name: Max Connections + x-display-name: Error count + fall: + type: integer + x-display-name: Nr. of consecutive failed checks x-nullable: true - weight: + force_sslv3: + type: string + enum: [enabled, disabled] + force_tlsv10: + type: string + enum: [enabled, disabled] + force_tlsv11: + type: string + enum: [enabled, disabled] + force_tlsv12: + type: string + enum: [enabled, disabled] + force_tlsv13: + type: string + enum: [enabled, disabled] + id: type: integer x-nullable: true init-addr: pattern: ^[^\s]+$ type: string + x-nullable: true inter: type: integer x-nullable: true @@ -792,40 +886,54 @@ server: downinter: type: integer x-nullable: true - cookie: + log_proto: type: string - pattern: '^[^\s]+$' - backup: + enum: [legacy, octet-count] + maxconn: + type: integer + x-display-name: Max Concurrent Connections + x-nullable: true + maxqueue: + type: integer + x-display-name: Max Number of Connections + x-nullable: true + max_reuse: + type: integer + x-nullable: true + minconn: + type: integer + x-nullable: true + namespace: type: string - enum: [enabled, disabled] - check: + no_sslv3: type: string enum: [enabled, disabled] - agent-check: + no_tlsv10: type: string enum: [enabled, disabled] - x-dependency: - agent-port: - required: true - agent-addr: + no_tlsv11: type: string - pattern: '^[^\s]+$' - agent-port: - type: integer - x-nullable: true - minimum: 1 - maximum: 65535 - agent-inter: - type: integer - x-nullable: true - agent-send: + enum: [enabled, disabled] + no_tlsv12: type: string - proto: + enum: [enabled, disabled] + no_tlsv13: type: string - pattern: '^[^\s]+$' - maintenance: + enum: [enabled, disabled] + no_verifyhost: type: string enum: [enabled, disabled] + npn: + type: string + x-dependency: + ssl: + value: enabled + observe: + type: string + enum: [layer4, layer7] + x-dependency: + ssl: + value: enabled on-error: type: string enum: [fastinter, fail-check, sudden-death, mark-down] @@ -835,6 +943,50 @@ server: on-marked-up: type: string enum: [shutdown-backup-sessions] + pool_low_conn: + type: integer + x-nullable: true + pool_max_conn: + type: integer + x-nullable: true + pool_purge_delay: + type: integer + x-nullable: true + port: + type: integer + x-nullable: true + minimum: 1 + maximum: 65535 + proto: + type: string + pattern: '^[^\s]+$' + redir: + type: string + x-display-name: Prefix + rise: + type: integer + x-nullable: true + resolve_opts: + type: string + pattern: '^[^,\s][^\,]*[^,\s]*$' + resolve-prefer: + type: string + enum: [ipv4, ipv6] + x-dependency: + resolvers: + required: true + resolve-net: + type: string + pattern: '^[^,\s][^\,]*[^,\s]*$' + x-dependency: + resolvers: + required: true + resolvers: + type: string + pattern: '^[^\s]+$' + x-dynamic-enum: + operation: getResolvers + property: name send-proxy: type: string enum: [enabled, disabled] @@ -846,38 +998,48 @@ server: items: type: string enum: [ssl, cert-cn, ssl-cipher, cert-sig, cert-key, authority, crc32c, unique-id] + send_proxy_v2_ssl: + type: string + enum: [enabled, disabled] + send_proxy_v2_ssl_cn: + type: string + enum: [enabled, disabled] slowstart: type: integer x-nullable: true sni: type: string pattern: '^[^\s]+$' + source: + type: string ssl: type: string enum: [enabled, disabled] - alpn: + ssl_max_ver: type: string - x-display-name: ALPN Protocols - pattern: '^[^\s]+$' - check-sni: + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + ssl_min_ver: type: string - pattern: '^[^\s]+$' - check-ssl: + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + ssl_reuse: type: string enum: [enabled, disabled] - ssl_certificate: + stick: type: string - pattern: '^[^\s]+$' - x-dependency: - ssl: - value: enabled - ssl_cafile: + enum: [enabled, disabled] + socks4: type: string - x-display-name: SSL CA File pattern: '^[^\s]+$' x-dependency: - ssl: - value: enabled + check-via-socks4: + required: true + tcp_ut: + type: integer + tfo: + type: string + enum: [enabled, disabled] + track: + type: string tls_tickets: type: string enum: [enabled, disabled] @@ -890,24 +1052,16 @@ server: x-dependency: ssl: value: enabled - resolvers: - type: string - pattern: '^[^\s]+$' - x-dynamic-enum: - operation: getResolvers - property: name - resolve-prefer: - type: string - pattern: '^[^\s]+$' - x-dependency: - resolvers: - required: true - resolve-net: + verifyhost: type: string - pattern: '^[^\s]+$' x-dependency: - resolvers: - required: true + ssl: + value: enabled + verify: + value: required + weight: + type: integer + x-nullable: true additionalProperties: false example: name: www From 543ba60ccef59a41a8cf713dc3b6728bbfb2c964 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Mon, 6 Jul 2020 15:22:35 +0200 Subject: [PATCH 078/121] FEATURE/MINOR: bind: add missing settings --- build/haproxy_spec.yaml | 186 ++++++++++++++++++++++++++++++++++ models/configuration.yaml | 208 +++++++++++++++++++++++++++++++++++--- 2 files changed, 380 insertions(+), 14 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 77a5f57..81ce688 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -895,6 +895,8 @@ definitions: name: http port: 80 properties: + accept_netscaler_cip: + type: integer accept_proxy: type: boolean address: @@ -906,18 +908,171 @@ definitions: pattern: ^[^\s]+$ type: string x-display-name: ALPN Protocols + backlog: + type: string + ca_ignore_err: + type: string + x-dependency: + ssl: + value: true + ca_sign_file: + type: string + x-dependency: + ssl: + value: true + ca_sign_pass: + type: string + x-dependency: + ssl: + value: true + x-display-name: Passphrase + ca_verify_file: + type: string + x-dependency: + ca_file: + value: true + ciphers: + type: string + x-dependency: + ssl: + value: true + ciphersuites: + type: string + x-dependency: + ssl: + value: true + crl_file: + type: string + x-dependency: + ssl: + value: true + crt_ignore_err: + type: string + x-dependency: + ssl: + value: true + crt_list: + type: string + x-dependency: + ssl: + value: true + curves: + type: string + x-dependency: + ssl: + value: true + defer_accept: + type: boolean + ecdhe: + type: string + x-dependency: + ssl: + value: true + expose_fd_listeners: + type: boolean + force_sslv3: + type: boolean + force_tlsv10: + type: boolean + force_tlsv11: + type: boolean + force_tlsv12: + type: boolean + force_tlsv13: + type: boolean + generate_certificates: + type: boolean + x-dependency: + ssl: + value: true + gid: + type: integer + x-display-name: Group ID + group: + type: string + x-display-name: Group name + id: + type: string + x-display-name: Socket ID + interface: + type: string + level: + enum: + - user + - operator + - admin + type: string + maxconn: + type: integer + mode: + type: string + mss: + type: string name: pattern: ^[^\s]+$ type: string x-nullable: false + namespace: + type: string + nice: + type: integer + no_ca_names: + type: boolean + x-dependency: + ssl: + value: true + no_sslv3: + type: boolean + x-dependency: + ssl: + value: true + no_tls_tickets: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv10: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv11: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv12: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv13: + type: boolean + x-dependency: + ssl: + value: true + npn: + type: string port: maximum: 65535 minimum: 1 type: integer x-nullable: true + prefer_client_ciphers: + type: boolean process: pattern: ^[^\s]+$ type: string + proto: + type: string + x-display-name: Protocol name + severity_output: + enum: + - none + - number + - string + type: string + x-display-name: Format ssl: type: boolean ssl_cafile: @@ -933,13 +1088,44 @@ definitions: x-dependency: ssl: value: true + ssl_max_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + ssl_min_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + strict_sni: + type: boolean + x-dependency: + ssl: + value: true tcp_user_timeout: type: integer x-nullable: true + tfo: + type: boolean + tls_ticket_keys: + type: string transparent: type: boolean + uid: + type: string + user: + type: string v4v6: type: boolean + v6only: + type: boolean verify: enum: - none diff --git a/models/configuration.yaml b/models/configuration.yaml index 8c76341..d0cf24b 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -690,14 +690,177 @@ bind: required: - name properties: + accept_netscaler_cip: + type: integer + accept_proxy: + type: boolean + allow_0rtt: + type: boolean + alpn: + type: string + x-display-name: ALPN Protocols + pattern: '^[^\s]+$' + backlog: + type: string + curves: + type: string + x-dependency: + ssl: + value: true + ecdhe: + type: string + x-dependency: + ssl: + value: true + #ca_file: + # type: string + # x-dependency: + # ssl: + # value: true + ca_ignore_err: + type: string + x-dependency: + ssl: + value: true + ca_sign_file: + type: string + x-dependency: + ssl: + value: true + ca_sign_pass: + type: string + x-display-name: Passphrase + x-dependency: + ssl: + value: true + ca_verify_file: + type: string + x-dependency: + ca_file: + value: true + ciphers: + type: string + x-dependency: + ssl: + value: true + ciphersuites: + type: string + x-dependency: + ssl: + value: true + crl_file: + type: string + x-dependency: + ssl: + value: true + #crt: + # type: string + # x-dependency: + # ssl: + # value: true + crt_ignore_err: + type: string + x-dependency: + ssl: + value: true + crt_list: + type: string + x-dependency: + ssl: + value: true + defer_accept: + type: boolean + expose_fd_listeners: + type: boolean + force_sslv3: + type: boolean + force_tlsv10: + type: boolean + force_tlsv11: + type: boolean + force_tlsv12: + type: boolean + force_tlsv13: + type: boolean + generate_certificates: + type: boolean + x-dependency: + ssl: + value: true + gid: + type: integer + x-display-name: Group ID + group: + type: string + x-display-name: Group name + id: + type: string + x-display-name: Socket ID + interface: + type: string + level: + type: string + enum: [user, operator, admin] + severity_output: + type: string + x-display-name: Format + enum: [none, number, string] + maxconn: + type: integer + mode: + type: string + mss: + type: string name: type: string pattern: '^[^\s]+$' x-nullable: false - accept_proxy: + namespace: + type: string + nice: + type: integer + no_ca_names: type: boolean - allow_0rtt: + x-dependency: + ssl: + value: true + no_sslv3: + type: boolean + x-dependency: + ssl: + value: true + no_tls_tickets: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv10: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv11: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv12: + type: boolean + x-dependency: + ssl: + value: true + no_tlsv13: + type: boolean + x-dependency: + ssl: + value: true + npn: + type: string + prefer_client_ciphers: type: boolean + process: + type: string + pattern: '^[^\s]+$' address: type: string pattern: '^[^\s]+$' @@ -706,11 +869,9 @@ bind: x-nullable: true minimum: 1 maximum: 65535 - process: + proto: type: string - pattern: '^[^\s]+$' - v4v6: - type: boolean + x-display-name: Protocol name ssl: type: boolean ssl_certificate: @@ -726,21 +887,40 @@ bind: x-dependency: ssl: value: true - alpn: + ssl_max_ver: type: string - x-display-name: ALPN Protocols - pattern: '^[^\s]+$' - verify: + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + ssl_min_ver: type: string - enum: [none, optional, required] + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + strict_sni: + type: boolean x-dependency: ssl: - value: enabled - transparent: - type: boolean + value: true tcp_user_timeout: type: integer x-nullable: true + tfo: + type: boolean + tls_ticket_keys: + type: string + transparent: + type: boolean + v4v6: + type: boolean + v6only: + type: boolean + uid: + type: string + user: + type: string + verify: + type: string + enum: [none, optional, required] + x-dependency: + ssl: + value: enabled additionalProperties: false example: name: http From d1e3232f6140b9ca13e589048d9ff821679eba17 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Mon, 5 Oct 2020 15:11:40 +0200 Subject: [PATCH 079/121] FEATURE/MINOR: http_request_rule: Added use-service --- build/haproxy_spec.yaml | 7 +++++++ models/configuration.yaml | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 81ce688..0480817 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1917,6 +1917,12 @@ definitions: value: sc-set-gpt0 x-display-name: ScSet Integer Value x-nullable: true + service_name: + type: string + x-dependency: + type: + required: true + value: use-service spoe_engine: pattern: ^[^\s]+$ type: string @@ -2045,6 +2051,7 @@ definitions: - unset-var - strict-mode - lua + - use-service type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index d0cf24b..c3e20ea 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1263,7 +1263,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode, lua] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode, lua, use-service] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1636,6 +1636,12 @@ http_request_rule: x-dependency: type: value: lua + service_name: + type: string + x-dependency: + type: + value: use-service + required: true cond: type: string x-display-name: Condition From e516132e766b64c05eb82654c26e8ca58e52bfa9 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Fri, 25 Sep 2020 18:28:21 +0200 Subject: [PATCH 080/121] FEATURE/MINOR: default-server: missing commands --- build/haproxy_spec.yaml | 324 ++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 244 ++++++++++++++++++++++++++++ 2 files changed, 568 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0480817..81dbe93 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4562,6 +4562,47 @@ definitions: x-display-name: ForwardFor default_server: properties: + address: + pattern: ^[^\s]+$ + type: string + x-nullable: false + agent-addr: + pattern: ^[^\s]+$ + type: string + agent-check: + enum: + - enabled + - disabled + type: string + x-dependency: + agent-port: + required: true + agent-inter: + type: integer + x-nullable: true + agent-port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true + agent-send: + type: string + allow_0rtt: + type: boolean + alpn: + pattern: ^[^\s]+$ + type: string + x-display-name: ALPN Protocols + backup: + enum: + - enabled + - disabled + type: string + check: + enum: + - enabled + - disabled + type: string check-sni: pattern: ^[^\s]+$ type: string @@ -4570,26 +4611,202 @@ definitions: - enabled - disabled type: string + check_alpn: + pattern: ^[^\s]+$ + type: string + x-display-name: Protocols + check_proto: + pattern: ^[^\s]+$ + type: string + x-display-name: Name + check_via_socks4: + enum: + - enabled + - disabled + type: string + ciphers: + type: string + x-dependency: + ssl: + value: enabled + ciphersuites: + type: string + x-dependency: + ssl: + value: enabled + cookie: + pattern: ^[^\s]+$ + type: string + crl_file: + type: string + x-dependency: + ssl: + value: enabled downinter: type: integer x-nullable: true + error_limit: + type: integer + x-display-name: Error count fall: type: integer + x-display-name: Nr. of consecutive failed checks x-nullable: true fastinter: type: integer x-nullable: true + force_sslv3: + enum: + - enabled + - disabled + type: string + force_tlsv10: + enum: + - enabled + - disabled + type: string + force_tlsv11: + enum: + - enabled + - disabled + type: string + force_tlsv12: + enum: + - enabled + - disabled + type: string + force_tlsv13: + enum: + - enabled + - disabled + type: string + health_check_port: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true init-addr: pattern: ^[^\s]+$ type: string inter: type: integer x-nullable: true + log_proto: + enum: + - legacy + - octet-count + type: string + max_reuse: + type: integer + x-nullable: true + maxconn: + type: integer + x-display-name: Max Concurrent Connections + x-nullable: true + maxqueue: + type: integer + x-display-name: Max Number of Connections + x-nullable: true + minconn: + type: integer + x-nullable: true + name: + pattern: ^[^\s]+$ + type: string + x-nullable: false + namespace: + type: string + no_sslv3: + enum: + - enabled + - disabled + type: string + no_tlsv10: + enum: + - enabled + - disabled + type: string + no_tlsv11: + enum: + - enabled + - disabled + type: string + no_tlsv12: + enum: + - enabled + - disabled + type: string + no_tlsv13: + enum: + - enabled + - disabled + type: string + no_verifyhost: + enum: + - enabled + - disabled + type: string + npn: + type: string + x-dependency: + ssl: + value: enabled + observe: + enum: + - layer4 + - layer7 + type: string + x-dependency: + ssl: + value: enabled + on-error: + enum: + - fastinter + - fail-check + - sudden-death + - mark-down + type: string + on-marked-down: + enum: + - shutdown-sessions + type: string + on-marked-up: + enum: + - shutdown-backup-sessions + type: string + pool_low_conn: + type: integer + x-nullable: true + pool_max_conn: + type: integer + x-nullable: true + pool_purge_delay: + type: integer + x-nullable: true port: maximum: 65535 minimum: 1 type: integer x-nullable: true + proto: + pattern: ^[^\s]+$ + type: string + proxy-v2-options: + items: + enum: + - ssl + - cert-cn + - ssl-cipher + - cert-sig + - cert-key + - authority + - crc32c + - unique-id + type: string + type: array + redir: + type: string + x-display-name: Prefix resolve-net: pattern: ^[^\s]+$ type: string @@ -4597,11 +4814,17 @@ definitions: resolvers: required: true resolve-prefer: + enum: + - ipv4 + - ipv6 pattern: ^[^\s]+$ type: string x-dependency: resolvers: required: true + resolve_opts: + pattern: ^[^,\s][^\,]*[^,\s]*$ + type: string resolvers: pattern: ^[^\s]+$ type: string @@ -4611,12 +4834,113 @@ definitions: rise: type: integer x-nullable: true + send-proxy: + enum: + - enabled + - disabled + type: string + send-proxy-v2: + enum: + - enabled + - disabled + type: string + send_proxy_v2_ssl: + enum: + - enabled + - disabled + type: string + send_proxy_v2_ssl_cn: + enum: + - enabled + - disabled + type: string slowstart: type: integer x-nullable: true sni: pattern: ^[^\s]+$ type: string + socks4: + pattern: ^[^\s]+$ + type: string + x-dependency: + check-via-socks4: + required: true + source: + type: string + ssl: + enum: + - enabled + - disabled + type: string + ssl_certificate: + pattern: ^[^\s]+$ + type: string + x-dependency: + ssl: + value: enabled + ssl_max_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + ssl_min_ver: + enum: + - SSLv3 + - TLSv1.0 + - TLSv1.1 + - TLSv1.2 + - TLSv1.3 + type: string + ssl_reuse: + enum: + - enabled + - disabled + type: string + stick: + enum: + - enabled + - disabled + type: string + tcp_ut: + type: integer + tfo: + enum: + - enabled + - disabled + type: string + tls_tickets: + enum: + - enabled + - disabled + type: string + x-dependency: + ssl: + value: enabled + track: + type: string + verify: + enum: + - none + - required + type: string + x-dependency: + ssl: + value: enabled + verifyhost: + type: string + x-dependency: + ssl: + value: enabled + verify: + value: required + weight: + type: integer + x-nullable: true + title: Default Server type: object httpchk: properties: diff --git a/models/configuration.yaml b/models/configuration.yaml index c3e20ea..44b99c7 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -2561,6 +2561,7 @@ acl: x-nullable: false additionalProperties: false default_server: + title: Default Server type: object properties: init-addr: @@ -2580,6 +2581,7 @@ default_server: x-nullable: true fall: type: integer + x-display-name: Nr. of consecutive failed checks x-nullable: true check-sni: type: string @@ -2606,6 +2608,7 @@ default_server: property: name resolve-prefer: type: string + enum: [ipv4, ipv6] pattern: '^[^\s]+$' x-dependency: resolvers: @@ -2616,6 +2619,247 @@ default_server: x-dependency: resolvers: required: true + name: + type: string + pattern: '^[^\s]+$' + x-nullable: false + address: + type: string + pattern: '^[^\s]+$' + x-nullable: false + health_check_port: + type: integer + x-nullable: true + minimum: 1 + maximum: 65535 + ssl_certificate: + type: string + pattern: '^[^\s]+$' + x-dependency: + ssl: + value: enabled + agent-check: + type: string + enum: [enabled, disabled] + x-dependency: + agent-port: + required: true + agent-send: + type: string + agent-inter: + type: integer + x-nullable: true + agent-addr: + type: string + pattern: '^[^\s]+$' + agent-port: + type: integer + x-nullable: true + minimum: 1 + maximum: 65535 + allow_0rtt: + type: boolean + alpn: + type: string + x-display-name: ALPN Protocols + pattern: '^[^\s]+$' + backup: + type: string + enum: [enabled, disabled] + check: + type: string + enum: [enabled, disabled] + check_alpn: + type: string + x-display-name: Protocols + pattern: '^[^\s]+$' + check_proto: + type: string + x-display-name: Name + pattern: '^[^\s]+$' + check_via_socks4: + type: string + enum: [enabled, disabled] + ciphers: + type: string + x-dependency: + ssl: + value: enabled + ciphersuites: + type: string + x-dependency: + ssl: + value: enabled + cookie: + type: string + pattern: '^[^\s]+$' + crl_file: + type: string + x-dependency: + ssl: + value: enabled + error_limit: + type: integer + x-display-name: Error count + force_sslv3: + type: string + enum: [enabled, disabled] + force_tlsv10: + type: string + enum: [enabled, disabled] + force_tlsv11: + type: string + enum: [enabled, disabled] + force_tlsv12: + type: string + enum: [enabled, disabled] + force_tlsv13: + type: string + enum: [enabled, disabled] + log_proto: + type: string + enum: [legacy, octet-count] + maxconn: + type: integer + x-display-name: Max Concurrent Connections + x-nullable: true + maxqueue: + type: integer + x-display-name: Max Number of Connections + x-nullable: true + max_reuse: + type: integer + x-nullable: true + minconn: + type: integer + x-nullable: true + namespace: + type: string + no_sslv3: + type: string + enum: [enabled, disabled] + no_tlsv10: + type: string + enum: [enabled, disabled] + no_tlsv11: + type: string + enum: [enabled, disabled] + no_tlsv12: + type: string + enum: [enabled, disabled] + no_tlsv13: + type: string + enum: [enabled, disabled] + no_verifyhost: + type: string + enum: [enabled, disabled] + npn: + type: string + x-dependency: + ssl: + value: enabled + observe: + type: string + enum: [layer4, layer7] + x-dependency: + ssl: + value: enabled + on-error: + type: string + enum: [fastinter, fail-check, sudden-death, mark-down] + on-marked-down: + type: string + enum: [shutdown-sessions] + on-marked-up: + type: string + enum: [shutdown-backup-sessions] + pool_low_conn: + type: integer + x-nullable: true + pool_max_conn: + type: integer + x-nullable: true + pool_purge_delay: + type: integer + x-nullable: true + proto: + type: string + pattern: '^[^\s]+$' + redir: + type: string + x-display-name: Prefix + resolve_opts: + type: string + pattern: '^[^,\s][^\,]*[^,\s]*$' + send-proxy: + type: string + enum: [enabled, disabled] + send-proxy-v2: + type: string + enum: [enabled, disabled] + proxy-v2-options: + type: array + items: + type: string + enum: [ssl, cert-cn, ssl-cipher, cert-sig, cert-key, authority, crc32c, unique-id] + send_proxy_v2_ssl: + type: string + enum: [enabled, disabled] + send_proxy_v2_ssl_cn: + type: string + enum: [enabled, disabled] + source: + type: string + ssl: + type: string + enum: [enabled, disabled] + ssl_max_ver: + type: string + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + ssl_min_ver: + type: string + enum: [SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3] + ssl_reuse: + type: string + enum: [enabled, disabled] + stick: + type: string + enum: [enabled, disabled] + socks4: + type: string + pattern: '^[^\s]+$' + x-dependency: + check-via-socks4: + required: true + tcp_ut: + type: integer + tfo: + type: string + enum: [enabled, disabled] + track: + type: string + tls_tickets: + type: string + enum: [enabled, disabled] + x-dependency: + ssl: + value: enabled + verify: + type: string + enum: [none, required] + x-dependency: + ssl: + value: enabled + verifyhost: + type: string + x-dependency: + ssl: + value: enabled + verify: + value: required + weight: + type: integer + x-nullable: true forwardfor: type: object x-display-name: ForwardFor From 99f1024c88f520e3b4e53d4d0c8001a0d4d69672 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Mon, 5 Oct 2020 13:36:46 +0200 Subject: [PATCH 081/121] MEDIUM: enable port range for bind --- build/haproxy_spec.yaml | 5 +++++ models/configuration.yaml | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 81dbe93..ddb9c64 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1058,6 +1058,11 @@ definitions: minimum: 1 type: integer x-nullable: true + port-range-end: + maximum: 65535 + minimum: 1 + type: integer + x-nullable: true prefer_client_ciphers: type: boolean process: diff --git a/models/configuration.yaml b/models/configuration.yaml index 44b99c7..ab610e8 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -865,10 +865,15 @@ bind: type: string pattern: '^[^\s]+$' port: + maximum: 65535 + minimum: 1 type: integer x-nullable: true - minimum: 1 + port-range-end: maximum: 65535 + minimum: 1 + type: integer + x-nullable: true proto: type: string x-display-name: Protocol name From 1f71c9ea59aa8ea432397a6fe842d1c7542474c1 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Fri, 9 Oct 2020 11:28:25 +0200 Subject: [PATCH 082/121] MINOR: implementing monitor-uri and monitor fail --- build/haproxy_spec.yaml | 26 ++++++++++++++++++++++++++ haproxy-spec.yaml | 4 ++++ models/configuration.yaml | 6 ++++++ models/monitor.yaml | 19 +++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 models/monitor.yaml diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index ddb9c64..583dbac 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -442,6 +442,8 @@ definitions: - tcp - http type: string + monitor_uri: + $ref: '#/definitions/monitor_uri' queue_timeout: type: integer x-nullable: true @@ -592,6 +594,10 @@ definitions: - http - tcp type: string + monitor_fail: + $ref: '#/definitions/monitor_fail' + monitor_uri: + $ref: '#/definitions/monitor_uri' name: pattern: ^[A-Za-z0-9-_.:]+$ type: string @@ -5229,6 +5235,26 @@ definitions: type: array items: $ref: '#/definitions/consul' + monitor_uri: + type: string + monitor_fail: + properties: + cond: + enum: + - if + - unless + type: string + x-display-name: Condition + cond_test: + type: string + x-dependency: + cond: + required: true + x-display-name: Condition Test + required: + - cond + - cond_test + type: object responses: BadRequest: description: Bad request diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 2351296..2e4ad5a 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -284,6 +284,10 @@ definitions: type: array items: $ref: '#/definitions/consul' + monitor_uri: + $ref: "models/monitor.yaml#/monitor_uri" + monitor_fail: + $ref: "models/monitor.yaml#/monitor_fail" responses: BadRequest: description: Bad request diff --git a/models/configuration.yaml b/models/configuration.yaml index ab610e8..58d85b6 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -202,6 +202,8 @@ defaults: check_timeout: type: integer x-nullable: true + monitor_uri: + $ref: '#/definitions/monitor_uri' connect_timeout: type: integer x-nullable: true @@ -470,6 +472,10 @@ frontend: required: true stats_options: $ref: "#/definitions/stats_options" + monitor_uri: + $ref: '#/definitions/monitor_uri' + monitor_fail: + $ref: '#/definitions/monitor_fail' additionalProperties: false example: name: test_frontend diff --git a/models/monitor.yaml b/models/monitor.yaml new file mode 100644 index 0000000..609cf01 --- /dev/null +++ b/models/monitor.yaml @@ -0,0 +1,19 @@ +--- +monitor_uri: + type: string +monitor_fail: + required: + - cond + - cond_test + type: object + properties: + cond: + type: string + x-display-name: Condition + enum: [if, unless] + cond_test: + type: string + x-display-name: Condition Test + x-dependency: + cond: + required: true From 93629aaa2fc078a68d2ec2da44c8f6718993c27c Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Tue, 13 Oct 2020 09:29:06 +0200 Subject: [PATCH 083/121] BUG/MINOR: server: minimum port number --- build/haproxy_spec.yaml | 2 +- models/runtime.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 583dbac..881ad6d 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4235,7 +4235,7 @@ definitions: type: string port: maximum: 65535 - minimum: 0 + minimum: 1 readOnly: true type: integer x-nullable: true diff --git a/models/runtime.yaml b/models/runtime.yaml index 65315fb..c613cbb 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -225,7 +225,7 @@ server: port: type: integer x-nullable: true - minimum: 0 + minimum: 1 maximum: 65535 readOnly: true operational_state: From 5d0b7ffcb38214efeb6c7ba03c310223083c7138 Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Mon, 12 Oct 2020 09:42:05 +0200 Subject: [PATCH 084/121] DOC/MINOR: fixing schema warnings --- build/haproxy_spec.yaml | 31 ++++++++++++++++--------------- models/configuration.yaml | 25 ++++++++++++------------- models/runtime.yaml | 2 +- models/service-discovery.yaml | 6 ++++-- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 881ad6d..4ca37fb 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -638,7 +638,7 @@ definitions: forwardfor: enabled: enabled httpchk: - method: OPTIONS + method: GET uri: /check version: HTTP/1.1 mode: http @@ -1162,7 +1162,6 @@ definitions: example: address: 10.1.1.1 check: enabled - max-connections: 500 name: www port: 8080 weight: 80 @@ -1579,7 +1578,7 @@ definitions: cond_test: '{ src 192.168.0.0/16 }' hdr_format: '%T' hdr_name: X-Haproxy-Current-Date - id: 0 + index: 0 type: add-header properties: acl_file: @@ -2125,7 +2124,7 @@ definitions: cond_test: '{ src 192.168.0.0/16 }' hdr_format: '%T' hdr_name: X-Haproxy-Current-Date - id: 0 + index: 0 type: add-header properties: acl_file: @@ -2517,8 +2516,8 @@ definitions: example: cond: if cond_test: '{ src 192.168.0.0/16 }' - id: 0 - type: accept + index: 0 + type: connection properties: action: enum: @@ -2847,8 +2846,8 @@ definitions: example: cond: if cond_test: '{ src 192.168.0.0/16 }' - id: 0 - type: accept + index: 0 + type: content properties: action: enum: @@ -2934,7 +2933,7 @@ definitions: example: cond: if cond_test: '{ req_ssl_sni -i www.example.com }' - id: 0 + index: 0 name: test_backend properties: cond: @@ -2982,7 +2981,7 @@ definitions: example: cond: if cond_test: '{ req_ssl_sni -i www.example.com }' - id: 0 + index: 0 target_server: www properties: cond: @@ -3026,7 +3025,7 @@ definitions: additionalProperties: false description: HAProxy filters example: - id: 0 + index: 0 trace_name: name trace_rnd_parsing: true type: trace @@ -3101,9 +3100,9 @@ definitions: description: Define a pattern used to create an entry in a stickiness table or matching condition or associate a user to a server. example: - id: 0 + index: 0 pattern: src - type: storeonly + type: match properties: cond: enum: @@ -4204,7 +4203,7 @@ definitions: description: Runtime transient server properties example: address: 127.0.0.5 - admin_state: up + admin_state: ready operational_state: up port: 80 server_id: 1 @@ -5172,8 +5171,10 @@ definitions: description: Consul server configuration example: address: 127.0.0.1 - id: 0 + enabled: true + id: "0" port: 90 + retry_timeout: 10 properties: address: pattern: ^[^\s]+$ diff --git a/models/configuration.yaml b/models/configuration.yaml index 58d85b6..a12845f 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -654,7 +654,7 @@ backend: enabled: enabled httpchk: uri: "/check" - method: OPTIONS + method: GET version: HTTP/1.1 peer_section: title: Peer Section @@ -1260,7 +1260,6 @@ server: port: 8080 check: enabled weight: 80 - max-connections: 500 http_request_rule: title: HTTP Request Rule description: HAProxy HTTP request rule configuration (corresponds to http-request directives) @@ -1669,7 +1668,7 @@ http_request_rule: required: true additionalProperties: false example: - id: 0 + index: 0 type: add-header hdr_name: X-Haproxy-Current-Date hdr_format: "%T" @@ -1982,7 +1981,7 @@ http_response_rule: required: true additionalProperties: false example: - id: 0 + index: 0 type: add-header hdr_name: X-Haproxy-Current-Date hdr_format: "%T" @@ -2215,8 +2214,8 @@ tcp_request_rule: required: true additionalProperties: false example: - id: 0 - type: accept + index: 0 + type: connection cond: if cond_test: "{ src 192.168.0.0/16 }" tcp_response_rule: @@ -2288,8 +2287,8 @@ tcp_response_rule: value: content additionalProperties: false example: - id: 0 - type: accept + index: 0 + type: content cond: if cond_test: "{ src 192.168.0.0/16 }" backend_switching_rule: @@ -2327,7 +2326,7 @@ backend_switching_rule: required: true additionalProperties: false example: - id: 0 + index: 0 name: test_backend cond: if cond_test: "{ req_ssl_sni -i www.example.com }" @@ -2365,7 +2364,7 @@ server_switching_rule: required: true additionalProperties: false example: - id: 0 + index: 0 target_server: www cond: if cond_test: "{ req_ssl_sni -i www.example.com }" @@ -2429,7 +2428,7 @@ filter: required: true additionalProperties: false example: - id: 0 + index: 0 type: trace trace_name: name trace_rnd_parsing: true @@ -2472,8 +2471,8 @@ stick_rule: required: true additionalProperties: false example: - id: 0 - type: storeonly + index: 0 + type: match pattern: src log_target: title: Log Target diff --git a/models/runtime.yaml b/models/runtime.yaml index c613cbb..dd62872 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -240,7 +240,7 @@ server: address: 127.0.0.5 port: 80 operational_state: up - admin_state: up + admin_state: ready table: title: Stick Table description: Stick Table Information diff --git a/models/service-discovery.yaml b/models/service-discovery.yaml index d0fb3ec..86d5ba8 100644 --- a/models/service-discovery.yaml +++ b/models/service-discovery.yaml @@ -50,6 +50,8 @@ consul: type: string additionalProperties: false example: - id: 0 + id: "0" + enabled: true address: 127.0.0.1 - port: 90 \ No newline at end of file + port: 90 + retry_timeout: 10 \ No newline at end of file From 09b3b9be51964c12ab40d3cadf596bafba09c50a Mon Sep 17 00:00:00 2001 From: ahusic Date: Fri, 11 Sep 2020 13:57:21 +0200 Subject: [PATCH 085/121] MINOR: runtime-maps: add force reload parameter for file upload --- build/haproxy_spec.yaml | 9 +++++++++ paths/runtime.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4ca37fb..883ef62 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -9993,11 +9993,20 @@ paths: name: fileUpload type: file x-mimetype: text/plain + - $ref: '#/parameters/force_reload' responses: "201": description: Map file created with its entries schema: $ref: '#/definitions/map_entries' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/map_entries' "400": $ref: '#/responses/BadRequest' "409": diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 7837943..5337a20 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -210,6 +210,7 @@ maps: type: file description: The map file to upload x-mimetype: text/plain + - $ref: "#/parameters/force_reload" tags: - Maps responses: @@ -217,6 +218,14 @@ maps: description: Map file created with its entries schema: $ref: "#/definitions/map_entries" + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/map_entries' '409': $ref: '#/responses/AlreadyExists' '400': From 640e34f700528b13af3f3c02df63044bd5935216 Mon Sep 17 00:00:00 2001 From: ahusic Date: Thu, 20 Aug 2020 17:05:39 +0200 Subject: [PATCH 086/121] BUG/MINOR: runtime-maps: enable immediate syncing This change enables immediate syncing maps from memory to disk for POST, PUT, DELETE methods. --- build/haproxy_spec.yaml | 20 ++++++++++++++++++++ paths/runtime.yaml | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 883ef62..8265cfa 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10030,6 +10030,11 @@ paths: in: query name: forceDelete type: boolean + - default: false + description: If true, immediately syncs changes to disk + in: query + name: forceSync + type: boolean responses: "204": description: All map entries deleted @@ -10092,6 +10097,11 @@ paths: name: map required: true type: string + - default: false + description: If true, immediately syncs changes to disk + in: query + name: forceSync + type: boolean - in: body name: data required: true @@ -10126,6 +10136,11 @@ paths: name: map required: true type: string + - default: false + description: If true, immediately syncs changes to disk + in: query + name: forceSync + type: boolean responses: "204": description: Map key/value deleted @@ -10176,6 +10191,11 @@ paths: name: map required: true type: string + - default: false + description: If true, immediately syncs changes to disk + in: query + name: forceSync + type: boolean - in: body name: data required: true diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 5337a20..9310936 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -268,6 +268,11 @@ maps_one: in: query description: If true, deletes file from disk type: boolean + - name: forceSync + in: query + description: If true, immediately syncs changes to disk + type: boolean + default: false tags: - Maps responses: @@ -309,6 +314,11 @@ maps_entries: description: Map file name required: true type: string + - name: forceSync + in: query + description: If true, immediately syncs changes to disk + type: boolean + default: false - name: data in: body required: true @@ -371,6 +381,11 @@ maps_entries_one: description: Map file name required: true type: string + - name: forceSync + in: query + description: If true, immediately syncs changes to disk + type: boolean + default: false - name: data in: body required: true @@ -410,6 +425,11 @@ maps_entries_one: description: Map file name required: true type: string + - name: forceSync + in: query + description: If true, immediately syncs changes to disk + type: boolean + default: false responses: '204': description: Map key/value deleted From cb73616e0a6babc20bd94df930046de3a6684824 Mon Sep 17 00:00:00 2001 From: ahusic Date: Wed, 28 Oct 2020 13:51:11 +0100 Subject: [PATCH 087/121] BUILD/MINOR: CI: replace runner tag docker with tag go --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc1fc05..4a190c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ compare build: name: alpine:3.10.3 entrypoint: [""] tags: - - docker + - go script: # try building it and compare if resulting file is equal to what is commited. - cd build @@ -17,7 +17,7 @@ yamllint: name: cytopia/yamllint:latest entrypoint: [""] tags: - - docker + - go script: # to test locally, run: docker run --rm -v $(pwd):/data cytopia/yamllint . - /bin/sh -c "yamllint -f colored ." From 1219c815a75bd658ce0898a86db7b7b4b828d60d Mon Sep 17 00:00:00 2001 From: ahusic Date: Mon, 2 Nov 2020 10:40:14 +0100 Subject: [PATCH 088/121] FEATURE/MEDIUM: config: add configuration version endpoint --- build/haproxy_spec.yaml | 18 ++++++++++++++++++ haproxy-spec.yaml | 2 ++ paths/configuration.yaml | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 8265cfa..4605ee5 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10221,4 +10221,22 @@ paths: summary: Replace the value corresponding to each id in a map tags: - Maps + /services/haproxy/configuration/version: + get: + description: Returns configuration version. + operationId: getConfigurationVersion + parameters: + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Configuration version + schema: + type: integer + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a configuration version + tags: + - Configuration diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 2e4ad5a..891b745 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -560,3 +560,5 @@ paths: $ref: "paths/runtime.yaml#/maps_entries" /services/haproxy/runtime/maps_entries/{id}: $ref: "paths/runtime.yaml#/maps_entries_one" + /services/haproxy/configuration/version: + $ref: "paths/configuration.yaml#/version" diff --git a/paths/configuration.yaml b/paths/configuration.yaml index 754424c..dc7c856 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -3605,3 +3605,21 @@ acls_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' +version: + get: + summary: Return a configuration version + description: Returns configuration version. + operationId: getConfigurationVersion + tags: + - Configuration + parameters: + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Configuration version + schema: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From 91726d611b660da0417bb15497e1a53e05c9a4b4 Mon Sep 17 00:00:00 2001 From: ahusic Date: Fri, 6 Nov 2020 15:36:16 +0100 Subject: [PATCH 089/121] FEATURE/MINOR: configuration: validate configuration without applying Optional parameter `only_validate` gives possibility to check whether configuration file is valid or not. When used, configuration is only validated, but not actually applied. --- build/haproxy_spec.yaml | 6 ++++++ paths/configuration.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4605ee5..5eec2d3 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -9733,6 +9733,12 @@ paths: name: skip_reload required: false type: boolean + - default: false + description: If set, only validates configuration, without applying it + in: query + name: only_validate + required: false + type: boolean - description: List of Runtime API commands with parameters separated by ';' in: header name: X-Runtime-Actions diff --git a/paths/configuration.yaml b/paths/configuration.yaml index dc7c856..ea85080 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -2741,6 +2741,12 @@ configuration: type: boolean required: false default: false + - name: only_validate + in: query + description: If set, only validates configuration, without applying it + type: boolean + required: false + default: false - name: X-Runtime-Actions in: header description: List of Runtime API commands with parameters separated by ';' From 3e0c88187368741648e6f5d1f04bf61fbddac8d6 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Tue, 10 Nov 2020 12:59:31 +0100 Subject: [PATCH 090/121] BUG/MINOR: fix description of backend endpoint --- build/haproxy_spec.yaml | 2 +- paths/configuration.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 5eec2d3..bdde754 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -6713,7 +6713,7 @@ paths: - Backend /services/haproxy/configuration/backends/{name}: delete: - description: Deletes a frontend from the configuration by it's name. + description: Deletes a backend from the configuration by it's name. operationId: deleteBackend parameters: - description: Backend name diff --git a/paths/configuration.yaml b/paths/configuration.yaml index ea85080..c5457cc 100644 --- a/paths/configuration.yaml +++ b/paths/configuration.yaml @@ -413,7 +413,7 @@ backends_one: $ref: '#/responses/DefaultError' delete: summary: Delete a backend - description: Deletes a frontend from the configuration by it's name. + description: Deletes a backend from the configuration by it's name. operationId: deleteBackend tags: - Backend From 5a96f5abdfc5eae9a8599272a18a606901ef7637 Mon Sep 17 00:00:00 2001 From: ahusic Date: Mon, 16 Nov 2020 11:25:27 +0100 Subject: [PATCH 091/121] MAJOR: runtime-maps: return map object on file upload --- build/haproxy_spec.yaml | 4 ++-- paths/runtime.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index bdde754..fbcf42f 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10004,7 +10004,7 @@ paths: "201": description: Map file created with its entries schema: - $ref: '#/definitions/map_entries' + $ref: '#/definitions/map' "202": description: Configuration change accepted and reload requested headers: @@ -10012,7 +10012,7 @@ paths: description: ID of the requested reload type: string schema: - $ref: '#/definitions/map_entries' + $ref: '#/definitions/map' "400": $ref: '#/responses/BadRequest' "409": diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 9310936..3ebd717 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -217,7 +217,7 @@ maps: '201': description: Map file created with its entries schema: - $ref: "#/definitions/map_entries" + $ref: "#/definitions/map" '202': description: Configuration change accepted and reload requested headers: @@ -225,7 +225,7 @@ maps: description: ID of the requested reload type: string schema: - $ref: '#/definitions/map_entries' + $ref: '#/definitions/map' '409': $ref: '#/responses/AlreadyExists' '400': From b4365e5de7c49306392a9f9b36d7871af379dd9d Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 27 Nov 2020 12:03:00 +0100 Subject: [PATCH 092/121] MINOR: Configuration: added tunnel timeout to defaults and backend --- build/haproxy_spec.yaml | 6 ++++++ models/configuration.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index fbcf42f..42b10cd 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -460,6 +460,9 @@ definitions: tcplog: type: boolean x-display-name: TCP Log + tunnel_timeout: + type: integer + x-nullable: true unique_id_format: type: string x-display-name: Unique ID format @@ -838,6 +841,9 @@ definitions: - binary type: string type: object + tunnel_timeout: + type: integer + x-nullable: true required: - name title: Backend diff --git a/models/configuration.yaml b/models/configuration.yaml index a12845f..50abd5a 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -231,6 +231,9 @@ defaults: queue_timeout: type: integer x-nullable: true + tunnel_timeout: + type: integer + x-nullable: true external_check: type: string enum: [enabled, disabled] @@ -599,6 +602,9 @@ backend: server_timeout: type: integer x-nullable: true + tunnel_timeout: + type: integer + x-nullable: true httpchk: $ref: "#/definitions/httpchk" x-dependency: From d8f54ab3d36fc8e3babf685f5079b9a55d88de15 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Thu, 26 Nov 2020 18:04:43 +0100 Subject: [PATCH 093/121] BUG/MINOR: typo on runtime servers' settings endpoint summary --- build/haproxy_spec.yaml | 2 +- paths/runtime.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 42b10cd..7b98347 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -9824,7 +9824,7 @@ paths: $ref: '#/definitions/runtime_servers' default: $ref: '#/responses/DefaultError' - summary: Return an array of runtime servers' setings + summary: Return an array of runtime servers' settings tags: - Server /services/haproxy/runtime/servers/{name}: diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 3ebd717..e635700 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -17,7 +17,7 @@ process_info: $ref: '#/responses/DefaultError' servers: get: - summary: Return an array of runtime servers' setings + summary: Return an array of runtime servers' settings description: Returns an array of all servers' runtime settings. operationId: getRuntimeServers tags: From c2261192d585e49a4e73d85d7218bd010f2f6ec3 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Mon, 30 Nov 2020 18:38:42 +0100 Subject: [PATCH 094/121] MINOR: ssl: adding async support --- build/haproxy_spec.yaml | 3 +++ models/configuration.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 7b98347..439e6dc 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -268,6 +268,9 @@ definitions: ssl_default_server_options: type: string x-display-name: SSL Default Server Options + ssl_mode_async: + type: boolean + x-display-name: Asynchronous TLS I/O operations stats_timeout: type: integer x-nullable: true diff --git a/models/configuration.yaml b/models/configuration.yaml index 50abd5a..2bcdfad 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -58,6 +58,9 @@ global: ssl_default_server_ciphersuites: type: string x-display-name: SSL Default Server Ciphersuites + ssl_mode_async: + type: boolean + x-display-name: Asynchronous TLS I/O operations cpu_maps: x-go-name: CPUMaps type: array From 8de3fcce1366b0f91a8d1a67eae317cd8110bc82 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Tue, 1 Dec 2020 15:50:25 +0100 Subject: [PATCH 095/121] REORG/MINOR: ssl: using enum for SSL mode async --- build/haproxy_spec.yaml | 5 ++++- models/configuration.yaml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 439e6dc..71c4789 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -269,7 +269,10 @@ definitions: type: string x-display-name: SSL Default Server Options ssl_mode_async: - type: boolean + enum: + - enabled + - disabled + type: string x-display-name: Asynchronous TLS I/O operations stats_timeout: type: integer diff --git a/models/configuration.yaml b/models/configuration.yaml index 2bcdfad..550048d 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -59,7 +59,8 @@ global: type: string x-display-name: SSL Default Server Ciphersuites ssl_mode_async: - type: boolean + type: string + enum: [enabled, disabled] x-display-name: Asynchronous TLS I/O operations cpu_maps: x-go-name: CPUMaps From 62d8befd50bbf4c8346f9343f2aa144c2227fd73 Mon Sep 17 00:00:00 2001 From: Antonio Paunovic Date: Thu, 30 Jul 2020 23:16:20 +0200 Subject: [PATCH 096/121] BUG/MEDIUM: add support for spaces within the hrd_format --- build/haproxy_spec.yaml | 7 ------- models/configuration.yaml | 7 ------- 2 files changed, 14 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 71c4789..e73da92 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1702,7 +1702,6 @@ definitions: - set-src-port x-display-name: Standard HAProxy expression hdr_format: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -1714,7 +1713,6 @@ definitions: - add-header x-display-name: Header Format hdr_match: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -1724,7 +1722,6 @@ definitions: - replace-value x-display-name: Header Match hdr_name: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -2191,7 +2188,6 @@ definitions: operation: getACLs property: acl_name hdr_format: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -2203,7 +2199,6 @@ definitions: - add-header x-display-name: Header Format hdr_match: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -2213,7 +2208,6 @@ definitions: - replace-value x-display-name: Header Match hdr_name: - pattern: ^[^\s]+$ type: string x-dependency: type: @@ -4493,7 +4487,6 @@ definitions: - rdp-cookie type: string hdr_name: - pattern: ^[^\s]+$ type: string x-dependency: algorithm: diff --git a/models/configuration.yaml b/models/configuration.yaml index 550048d..884a8af 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1401,7 +1401,6 @@ http_request_rule: hdr_name: type: string x-display-name: Header Name - pattern: '^[^\s]+$' x-dependency: type: value: [add-header, replace-header, del-header, set-header, replace-value] @@ -1409,7 +1408,6 @@ http_request_rule: hdr_match: type: string x-display-name: Header Match - pattern: '^[^\s]+$' x-dependency: type: value: [replace-header, replace-value] @@ -1417,7 +1415,6 @@ http_request_rule: hdr_format: type: string x-display-name: Header Format - pattern: '^[^\s]+$' x-dependency: type: value: [replace-header, replace-value, set-header, add-header] @@ -1749,7 +1746,6 @@ http_response_rule: hdr_name: type: string x-display-name: Header Name - pattern: '^[^\s]+$' x-dependency: type: value: [add-header, replace-header, del-header, set-header, replace-value] @@ -1757,7 +1753,6 @@ http_response_rule: hdr_match: type: string x-display-name: Header Match - pattern: '^[^\s]+$' x-dependency: type: value: [replace-header, replace-value] @@ -1765,7 +1760,6 @@ http_response_rule: hdr_format: type: string x-display-name: Header Format - pattern: '^[^\s]+$' x-dependency: type: value: [replace-header, replace-value, set-header, add-header] @@ -2949,7 +2943,6 @@ balance: hdr_name: type: string x-display-name: Header Name - pattern: '^[^\s]+$' x-dependency: algorithm: value: hdr From 8d48a6a2c0a80ca6e05ac00c08e2db9a0fbb1d87 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 4 Dec 2020 16:30:40 +0100 Subject: [PATCH 097/121] MINOR: AdvCheck: added params for mysql-check, pgsql-check, and smtpchk --- build/haproxy_spec.yaml | 34 ++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 6 ++++++ models/configuration.yaml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index e73da92..63c4c4e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -450,6 +450,10 @@ definitions: type: string monitor_uri: $ref: '#/definitions/monitor_uri' + mysql_check_params: + $ref: '#/definitions/mysql_check_params' + pgsql_check_params: + $ref: '#/definitions/pgsql_check_params' queue_timeout: type: integer x-nullable: true @@ -461,6 +465,8 @@ definitions: server_timeout: type: integer x-nullable: true + smtpchk_params: + $ref: '#/definitions/smtpchk_params' stats_options: $ref: '#/definitions/stats_options' tcplog: @@ -800,10 +806,14 @@ definitions: - http - tcp type: string + mysql_check_params: + $ref: '#/definitions/mysql_check_params' name: pattern: ^[A-Za-z0-9-_.:]+$ type: string x-nullable: false + pgsql_check_params: + $ref: '#/definitions/pgsql_check_params' queue_timeout: type: integer x-nullable: true @@ -815,6 +825,8 @@ definitions: server_timeout: type: integer x-nullable: true + smtpchk_params: + $ref: '#/definitions/smtpchk_params' stats_options: $ref: '#/definitions/stats_options' stick_table: @@ -5261,6 +5273,28 @@ definitions: - cond - cond_test type: object + smtpchk_params: + properties: + domain: + type: string + hello: + type: string + type: object + mysql_check_params: + properties: + client_version: + enum: + - pre-41 + - post-41 + type: string + username: + type: string + type: object + pgsql_check_params: + properties: + username: + type: string + type: object responses: BadRequest: description: Bad request diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 891b745..10ea612 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -288,6 +288,12 @@ definitions: $ref: "models/monitor.yaml#/monitor_uri" monitor_fail: $ref: "models/monitor.yaml#/monitor_fail" + smtpchk_params: + $ref: "models/configuration.yaml#/smtpchk_params" + mysql_check_params: + $ref: "models/configuration.yaml#/mysql_check_params" + pgsql_check_params: + $ref: "models/configuration.yaml#/pgsql_check_params" responses: BadRequest: description: Bad request diff --git a/models/configuration.yaml b/models/configuration.yaml index 884a8af..31bebe2 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -149,6 +149,12 @@ defaults: type: string x-display-name: Advanced Check enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check] + smtpchk_params: + $ref: "#/definitions/smtpchk_params" + mysql_check_params: + $ref: "#/definitions/mysql_check_params" + pgsql_check_params: + $ref: "#/definitions/pgsql_check_params" httpchk: $ref: "#/definitions/httpchk" http-check: @@ -568,6 +574,12 @@ backend: type: string x-display-name: Advanced Check enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check] + smtpchk_params: + $ref: "#/definitions/smtpchk_params" + mysql_check_params: + $ref: "#/definitions/mysql_check_params" + pgsql_check_params: + $ref: "#/definitions/pgsql_check_params" external_check: type: string enum: [enabled, disabled] @@ -3100,3 +3112,23 @@ stats_options: stats_uri_prefix: type: string pattern: '^[^\s]+$' +smtpchk_params: + type: object + properties: + hello: + type: string + domain: + type: string +mysql_check_params: + type: object + properties: + username: + type: string + client_version: + type: string + enum: [pre-41, post-41] +pgsql_check_params: + type: object + properties: + username: + type: string From 92e578861e9f4fd0bbbca32412d9e94c85c2a0a4 Mon Sep 17 00:00:00 2001 From: Robert Maticevic Date: Fri, 4 Dec 2020 16:58:35 +0100 Subject: [PATCH 098/121] BUG/MINOR: AdvCheck: move httpchk under adv_check to remove double check options --- build/haproxy_spec.yaml | 15 +++++++++------ haproxy-spec.yaml | 4 ++-- models/configuration.yaml | 17 +++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 63c4c4e..7a51138 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -304,6 +304,7 @@ definitions: - pgsql-check - tcp-check - redis-check + - httpchk type: string x-display-name: Advanced Check allbackups: @@ -415,8 +416,8 @@ definitions: - never - safe type: string - httpchk: - $ref: '#/definitions/httpchk' + httpchk_params: + $ref: '#/definitions/httpchk_params' httplog: type: boolean x-display-name: HTTP Log @@ -648,11 +649,12 @@ definitions: additionalProperties: false description: HAProxy backend configuration example: + adv_check: httpchk balance: algorithm: roundrobin forwardfor: enabled: enabled - httpchk: + httpchk_params: method: GET uri: /check version: HTTP/1.1 @@ -673,6 +675,7 @@ definitions: - pgsql-check - tcp-check - redis-check + - httpchk type: string x-display-name: Advanced Check allbackups: @@ -793,8 +796,8 @@ definitions: x-dependency: mode: value: http - httpchk: - $ref: '#/definitions/httpchk' + httpchk_params: + $ref: '#/definitions/httpchk_params' x-dependency: mode: value: http @@ -4969,7 +4972,7 @@ definitions: x-nullable: true title: Default Server type: object - httpchk: + httpchk_params: properties: method: enum: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 10ea612..69599f1 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -250,8 +250,8 @@ definitions: $ref: "models/configuration.yaml#/forwardfor" default_server: $ref: "models/configuration.yaml#/default_server" - httpchk: - $ref: "models/configuration.yaml#/httpchk" + httpchk_params: + $ref: "models/configuration.yaml#/httpchk_params" http-check: $ref: "models/configuration.yaml#/http-check" redispatch: diff --git a/models/configuration.yaml b/models/configuration.yaml index 31bebe2..6e3d48a 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -148,15 +148,15 @@ defaults: adv_check: type: string x-display-name: Advanced Check - enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check] + enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check, httpchk] smtpchk_params: $ref: "#/definitions/smtpchk_params" mysql_check_params: $ref: "#/definitions/mysql_check_params" pgsql_check_params: $ref: "#/definitions/pgsql_check_params" - httpchk: - $ref: "#/definitions/httpchk" + httpchk_params: + $ref: "#/definitions/httpchk_params" http-check: $ref: "#/definitions/http-check" bind_process: @@ -573,7 +573,7 @@ backend: adv_check: type: string x-display-name: Advanced Check - enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check] + enum: [ssl-hello-chk, smtpchk, ldap-check, mysql-check, pgsql-check, tcp-check, redis-check, httpchk] smtpchk_params: $ref: "#/definitions/smtpchk_params" mysql_check_params: @@ -621,8 +621,8 @@ backend: tunnel_timeout: type: integer x-nullable: true - httpchk: - $ref: "#/definitions/httpchk" + httpchk_params: + $ref: "#/definitions/httpchk_params" x-dependency: mode: value: http @@ -674,7 +674,8 @@ backend: algorithm: roundrobin forwardfor: enabled: enabled - httpchk: + adv_check: httpchk + httpchk_params: uri: "/check" method: GET version: HTTP/1.1 @@ -2979,7 +2980,7 @@ balance: x-dependency: algorithm: value: rdp-cookie -httpchk: +httpchk_params: type: object x-display-name: HTTP Check properties: From ffad4b8517917ba4263eef874476305bc94d5bd3 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Mon, 14 Dec 2020 12:05:44 +0100 Subject: [PATCH 099/121] MINOR: transaction: rate limiting HAProxy transaction operations --- build/haproxy_spec.yaml | 14 ++++++++++++++ paths/general.yaml | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 7a51138..76090ba 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -5963,6 +5963,20 @@ paths: description: Transaction started schema: $ref: '#/definitions/transaction' + "429": + description: Too many open transactions + schema: + example: + code: 429 + message: cannot start a new transaction, reached the maximum amount of 20 + active transactions available + properties: + code: + type: integer + message: + type: string + type: object + title: Transaction rate limiting default: $ref: '#/responses/DefaultError' summary: Start a new transaction diff --git a/paths/general.yaml b/paths/general.yaml index 256abab..249128e 100644 --- a/paths/general.yaml +++ b/paths/general.yaml @@ -153,6 +153,19 @@ transactions: description: Transaction started schema: $ref: "#/definitions/transaction" + '429': + title: Transaction rate limiting + description: Too many open transactions + schema: + type: object + properties: + code: + type: integer + message: + type: string + example: + code: 429 + message: cannot start a new transaction, reached the maximum amount of 20 active transactions available 'default': $ref: '#/responses/DefaultError' transactions_one: From 77861cc0328f685b4f23d3a751218babc90d9155 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Mon, 14 Dec 2020 15:04:04 +0100 Subject: [PATCH 100/121] BUG/MINOR: hotfix for ffad4b8, title in body is a forbidden property --- build/haproxy_spec.yaml | 1 - paths/general.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 76090ba..032eea6 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -5976,7 +5976,6 @@ paths: message: type: string type: object - title: Transaction rate limiting default: $ref: '#/responses/DefaultError' summary: Start a new transaction diff --git a/paths/general.yaml b/paths/general.yaml index 249128e..16fd64e 100644 --- a/paths/general.yaml +++ b/paths/general.yaml @@ -154,7 +154,6 @@ transactions: schema: $ref: "#/definitions/transaction" '429': - title: Transaction rate limiting description: Too many open transactions schema: type: object From cdb42f0061a34e3583c6ce90fd6b017d041a3c6c Mon Sep 17 00:00:00 2001 From: Will <11353590+june07@users.noreply.github.com> Date: Mon, 21 Dec 2020 07:20:19 -0800 Subject: [PATCH 101/121] BUG/MINOR: redir_code: add 307, 308 as possible return codes --- build/haproxy_spec.yaml | 2 ++ models/configuration.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 032eea6..8901f32 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -2315,6 +2315,8 @@ definitions: - 301 - 302 - 303 + - 307 + - 308 type: integer x-dependency: type: diff --git a/models/configuration.yaml b/models/configuration.yaml index 6e3d48a..da35b28 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1745,7 +1745,7 @@ http_response_rule: type: integer x-nullable: true x-display-name: Redirect Code - enum: [301, 302, 303] + enum: [301, 302, 303, 307, 308] x-dependency: type: value: redirect From 4df5859623d3802bf1b91c7f6cd5d2ece79dc1e1 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Mon, 21 Dec 2020 16:41:22 +0100 Subject: [PATCH 102/121] TEST/MINOR: adding linter for commit messages commit messages are now checked if they are aligned with our CONTRIBUTING guide (https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING) --- .gitlab-ci.yml | 14 +++++++++++++- models/configuration.yaml | 4 ++-- models/service-discovery.yaml | 5 +++-- paths/service-discovery.yaml | 3 ++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a190c5..1cf698a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,8 @@ --- +stages: + - lint compare build: + stage: lint image: # I just like pinning things, this version is latest, not special in any way name: alpine:3.10.3 @@ -11,8 +14,8 @@ compare build: - cd build - ./build -file ../haproxy-spec.yaml > haproxy_spec_to_compare.yaml - diff -u haproxy_spec_to_compare.yaml haproxy_spec.yaml - yamllint: + stage: lint image: name: cytopia/yamllint:latest entrypoint: [""] @@ -23,3 +26,12 @@ yamllint: - /bin/sh -c "yamllint -f colored ." - chmod +x ./scripts/single-tag.sh - /bin/sh -c ./scripts/single-tag.sh +lint-commit-msg: + stage: lint + image: + name: haproxytech/check-commit:latest + entrypoint: [""] + tags: + - go + script: + - go run /check.go diff --git a/models/configuration.yaml b/models/configuration.yaml index da35b28..e799964 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -741,7 +741,7 @@ bind: x-dependency: ssl: value: true - #ca_file: + # ca_file: # type: string # x-dependency: # ssl: @@ -782,7 +782,7 @@ bind: x-dependency: ssl: value: true - #crt: + # crt: # type: string # x-dependency: # ssl: diff --git a/models/service-discovery.yaml b/models/service-discovery.yaml index 86d5ba8..7ef8902 100644 --- a/models/service-discovery.yaml +++ b/models/service-discovery.yaml @@ -1,3 +1,4 @@ +--- consul: title: Consul server description: Consul server configuration @@ -43,7 +44,7 @@ consul: enum: [linear, exponential] default: exponential server_slots_growth_increment: - type: integer + type: integer description: type: string name: @@ -54,4 +55,4 @@ consul: enabled: true address: 127.0.0.1 port: 90 - retry_timeout: 10 \ No newline at end of file + retry_timeout: 10 diff --git a/paths/service-discovery.yaml b/paths/service-discovery.yaml index 14eb7c0..ea4a7ce 100644 --- a/paths/service-discovery.yaml +++ b/paths/service-discovery.yaml @@ -1,3 +1,4 @@ +--- consul: get: summary: Return an array of all configured Consul servers @@ -111,4 +112,4 @@ consul_one: '404': $ref: '#/responses/NotFound' 'default': - $ref: '#/responses/DefaultError' \ No newline at end of file + $ref: '#/responses/DefaultError' From 4dc154c6c62c36d0872af52d3ffaae75245f0151 Mon Sep 17 00:00:00 2001 From: ahusic Date: Mon, 16 Nov 2020 15:37:45 +0100 Subject: [PATCH 103/121] MEDIUM: maps: added endpoints to manipulate maps on disk Storage operations on maps added: - GET, DELETE, PUT one map on disk - GET - list all available maps on disk --- build/haproxy_spec.yaml | 91 ++++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 4 ++ paths/storage.yaml | 92 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 187 insertions(+) create mode 100644 paths/storage.yaml diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 8901f32..4b80844 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10302,4 +10302,95 @@ paths: summary: Return a configuration version tags: - Configuration + /services/haproxy/storage/maps: + get: + description: Returns all available map files on disk. + operationId: getAllStorageMapFiles + responses: + "200": + description: Successful operation + schema: + items: + type: string + type: array + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return all available map files on disk + tags: + - Storage + /services/haproxy/storage/maps/{name}: + delete: + description: Deletes map file from disk. + operationId: deleteStorageMap + parameters: + - description: Map file name + in: path + name: name + required: true + type: string + responses: + "204": + description: Map file deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Deletes map file from disk + tags: + - Storage + get: + description: Returns one map file from disk. + operationId: getOneStorageMap + parameters: + - description: Map file name + in: path + name: name + required: true + type: string + responses: + "200": + description: Successful operation + schema: + type: string + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one map file from disk + tags: + - Storage + put: + consumes: + - text/plain + description: Replaces a Map file on disk. + operationId: replaceStorageMapFile + parameters: + - description: Map file name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + type: string + produces: + - application/json + responses: + "200": + description: Map file replaced + schema: + type: string + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a Map file on disk + tags: + - Storage diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 69599f1..178eeea 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -568,3 +568,7 @@ paths: $ref: "paths/runtime.yaml#/maps_entries_one" /services/haproxy/configuration/version: $ref: "paths/configuration.yaml#/version" + /services/haproxy/storage/maps: + $ref: "paths/storage.yaml#/maps" + /services/haproxy/storage/maps/{name}: + $ref: "paths/storage.yaml#/maps_one" diff --git a/paths/storage.yaml b/paths/storage.yaml new file mode 100644 index 0000000..e2112e4 --- /dev/null +++ b/paths/storage.yaml @@ -0,0 +1,92 @@ +--- +maps: + get: + summary: Return all available map files on disk + description: Returns all available map files on disk. + operationId: getAllStorageMapFiles + tags: + - Storage + responses: + '200': + description: Successful operation + schema: + type: array + items: + type: string + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +maps_one: + get: + summary: Return one map file from disk + description: Returns one map file from disk. + operationId: getOneStorageMap + tags: + - Storage + parameters: + - name: name + in: path + description: Map file name + required: true + type: string + responses: + '200': + description: Successful operation + schema: + type: string + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Deletes map file from disk + description: Deletes map file from disk. + operationId: deleteStorageMap + tags: + - Storage + parameters: + - name: name + in: path + description: Map file name + required: true + type: string + responses: + '204': + description: Map file deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a Map file on disk + description: Replaces a Map file on disk. + operationId: replaceStorageMapFile + produces: + - application/json + consumes: + - text/plain + tags: + - Storage + parameters: + - name: name + in: path + description: Map file name + required: true + type: string + - name: data + in: body + required: true + schema: + type: string + responses: + '200': + description: Map file replaced + schema: + type: string + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From 9e6fe9174f1bc19b49fb2c18b919353937e9fb76 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Thu, 17 Dec 2020 17:15:15 +0100 Subject: [PATCH 104/121] REORG/MEDIUM: maps: move map file upload path from runtime to map storage endpoint Storage container (get all) returns a list of Map models for files that are managed. Also added filter for displaying unmanaged maps on the runtime endpoint and tweaked some descriptions to reference storage_name --- build/haproxy_spec.yaml | 115 +++++++++++++++++++++------------------- paths/runtime.yaml | 55 +++++-------------- paths/storage.yaml | 60 ++++++++++++++++----- 3 files changed, 120 insertions(+), 110 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4b80844..5b6f5bf 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10031,8 +10031,15 @@ paths: - StickTable /services/haproxy/runtime/maps: get: - description: Returns all available map files. + description: Returns runtime map files. operationId: getAllRuntimeMapFiles + parameters: + - default: false + description: If true, also show unmanaged map files loaded in haproxy + in: query + name: includeUnmanaged + required: false + type: boolean responses: "200": description: Successful operation @@ -10042,41 +10049,7 @@ paths: $ref: '#/responses/NotFound' default: $ref: '#/responses/DefaultError' - summary: Return all available map files - tags: - - Maps - post: - consumes: - - multipart/form-data - description: Creates runtime map file with its entries. - operationId: createRuntimeMap - parameters: - - description: The map file to upload - in: formData - name: fileUpload - type: file - x-mimetype: text/plain - - $ref: '#/parameters/force_reload' - responses: - "201": - description: Map file created with its entries - schema: - $ref: '#/definitions/map' - "202": - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: '#/definitions/map' - "400": - $ref: '#/responses/BadRequest' - "409": - $ref: '#/responses/AlreadyExists' - default: - $ref: '#/responses/DefaultError' - summary: Creates runtime map file with its entries + summary: Return runtime map files tags: - Maps /services/haproxy/runtime/maps/{name}: @@ -10134,7 +10107,7 @@ paths: description: Returns an array of all entries in a given runtime map file. operationId: showRuntimeMap parameters: - - description: Map file name + - description: Map storage_name in: query name: map required: true @@ -10155,7 +10128,7 @@ paths: description: Adds an entry into the map file. operationId: addMapEntry parameters: - - description: Map file name + - description: Map storage_name in: query name: map required: true @@ -10194,7 +10167,7 @@ paths: name: id required: true type: string - - description: Map file name + - description: Map storage_name in: query name: map required: true @@ -10223,7 +10196,7 @@ paths: name: id required: true type: string - - description: Map file name + - description: Map storage_name in: query name: map required: true @@ -10249,7 +10222,7 @@ paths: name: id required: true type: string - - description: Map file name + - description: Map storage_name in: query name: map required: true @@ -10304,28 +10277,59 @@ paths: - Configuration /services/haproxy/storage/maps: get: - description: Returns all available map files on disk. + description: Returns a list of all managed map files operationId: getAllStorageMapFiles responses: "200": description: Successful operation schema: - items: - type: string - type: array + $ref: '#/definitions/maps' "404": $ref: '#/responses/NotFound' default: $ref: '#/responses/DefaultError' - summary: Return all available map files on disk + summary: Return a list of all managed map files + tags: + - Storage + post: + consumes: + - multipart/form-data + description: Creates a managed runtime map file with its entries. + operationId: createRuntimeMap + parameters: + - description: The map file contents + in: formData + name: fileUpload + type: file + x-mimetype: text/plain + responses: + "201": + description: Map file created with its entries + schema: + $ref: '#/definitions/map' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/map' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Creates a managed runtime map file with its entries tags: - Storage /services/haproxy/storage/maps/{name}: delete: - description: Deletes map file from disk. + description: Deletes a managed map file from disk. operationId: deleteStorageMap parameters: - - description: Map file name + - description: Map file storage_name in: path name: name required: true @@ -10337,14 +10341,14 @@ paths: $ref: '#/responses/NotFound' default: $ref: '#/responses/DefaultError' - summary: Deletes map file from disk + summary: Deletes a managed map file from disk tags: - Storage get: - description: Returns one map file from disk. + description: Returns the contents of one managed map file from disk operationId: getOneStorageMap parameters: - - description: Map file name + - description: Map file storage_name in: path name: name required: true @@ -10358,16 +10362,16 @@ paths: $ref: '#/responses/NotFound' default: $ref: '#/responses/DefaultError' - summary: Return one map file from disk + summary: Return the contents of one managed map file from disk tags: - Storage put: consumes: - text/plain - description: Replaces a Map file on disk. + description: Replaces the contents of a managed map file on disk operationId: replaceStorageMapFile parameters: - - description: Map file name + - description: Map file storage_name in: path name: name required: true @@ -10377,6 +10381,7 @@ paths: required: true schema: type: string + - $ref: '#/parameters/force_reload' produces: - application/json responses: @@ -10390,7 +10395,7 @@ paths: $ref: '#/responses/NotFound' default: $ref: '#/responses/DefaultError' - summary: Replace a Map file on disk + summary: Replace contents of a managed map file on disk tags: - Storage diff --git a/paths/runtime.yaml b/paths/runtime.yaml index e635700..f9acfcb 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -184,11 +184,18 @@ stick_table_entries: $ref: '#/responses/DefaultError' maps: get: # show map - summary: Return all available map files - description: Returns all available map files. + summary: Return runtime map files + description: Returns runtime map files. operationId: getAllRuntimeMapFiles tags: - Maps + parameters: + - name: includeUnmanaged + in: query + description: If true, also show unmanaged map files loaded in haproxy + required: false + type: boolean + default: false responses: '200': description: Successful operation @@ -198,40 +205,6 @@ maps: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' - post: # (raw) - summary: Creates runtime map file with its entries - description: Creates runtime map file with its entries. - operationId: createRuntimeMap - consumes: - - multipart/form-data - parameters: - - in: formData - name: fileUpload - type: file - description: The map file to upload - x-mimetype: text/plain - - $ref: "#/parameters/force_reload" - tags: - - Maps - responses: - '201': - description: Map file created with its entries - schema: - $ref: "#/definitions/map" - '202': - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: '#/definitions/map' - '409': - $ref: '#/responses/AlreadyExists' - '400': - $ref: '#/responses/BadRequest' - 'default': - $ref: '#/responses/DefaultError' maps_one: get: # one map file summary: Return one runtime map file @@ -292,7 +265,7 @@ maps_entries: parameters: - name: map in: query - description: Map file name + description: Map storage_name required: true type: string responses: @@ -311,7 +284,7 @@ maps_entries: parameters: - name: map in: query - description: Map file name + description: Map storage_name required: true type: string - name: forceSync @@ -352,7 +325,7 @@ maps_entries_one: type: string - name: map in: query - description: Map file name + description: Map storage_name required: true type: string responses: @@ -378,7 +351,7 @@ maps_entries_one: type: string - name: map in: query - description: Map file name + description: Map storage_name required: true type: string - name: forceSync @@ -422,7 +395,7 @@ maps_entries_one: type: string - name: map in: query - description: Map file name + description: Map storage_name required: true type: string - name: forceSync diff --git a/paths/storage.yaml b/paths/storage.yaml index e2112e4..134b614 100644 --- a/paths/storage.yaml +++ b/paths/storage.yaml @@ -1,8 +1,8 @@ --- maps: get: - summary: Return all available map files on disk - description: Returns all available map files on disk. + summary: Return a list of all managed map files + description: Returns a list of all managed map files operationId: getAllStorageMapFiles tags: - Storage @@ -10,24 +10,55 @@ maps: '200': description: Successful operation schema: - type: array - items: - type: string + $ref: "#/definitions/maps" '404': $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' + post: # (raw) + summary: Creates a managed runtime map file with its entries + description: Creates a managed runtime map file with its entries. + operationId: createRuntimeMap + consumes: + - multipart/form-data + parameters: + - in: formData + name: fileUpload + type: file + description: The map file contents + x-mimetype: text/plain + tags: + - Storage + responses: + '201': + description: Map file created with its entries + schema: + $ref: "#/definitions/map" + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/map' + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' maps_one: get: - summary: Return one map file from disk - description: Returns one map file from disk. + summary: Return the contents of one managed map file from disk + description: Returns the contents of one managed map file from disk operationId: getOneStorageMap tags: - Storage parameters: - name: name in: path - description: Map file name + description: Map file storage_name required: true type: string responses: @@ -40,15 +71,15 @@ maps_one: 'default': $ref: '#/responses/DefaultError' delete: - summary: Deletes map file from disk - description: Deletes map file from disk. + summary: Deletes a managed map file from disk + description: Deletes a managed map file from disk. operationId: deleteStorageMap tags: - Storage parameters: - name: name in: path - description: Map file name + description: Map file storage_name required: true type: string responses: @@ -59,8 +90,8 @@ maps_one: 'default': $ref: '#/responses/DefaultError' put: - summary: Replace a Map file on disk - description: Replaces a Map file on disk. + summary: Replace contents of a managed map file on disk + description: Replaces the contents of a managed map file on disk operationId: replaceStorageMapFile produces: - application/json @@ -71,7 +102,7 @@ maps_one: parameters: - name: name in: path - description: Map file name + description: Map file storage_name required: true type: string - name: data @@ -79,6 +110,7 @@ maps_one: required: true schema: type: string + - $ref: "#/parameters/force_reload" responses: '200': description: Map file replaced From 5f58448f611d5e3ce1343c17f98322bdffee7892 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Wed, 16 Dec 2020 12:37:57 +0100 Subject: [PATCH 105/121] MINOR: add storage_name attribute to map model The attribute value, if present, will indicate the name for the resource on the storage and runtime endpoints. If the attribute doesn't have a value, this means the corresponding mapfile is loaded into haproxy but resides on the filesystem outside of the directory the datplane manages files in. As a consequence this map file will not be able to be manipulated through the dataplane's map storage and runtime endpoints. --- build/haproxy_spec.yaml | 2 ++ models/runtime.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 5b6f5bf..fb0ff8e 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4462,6 +4462,8 @@ definitions: type: string id: type: string + storage_name: + type: string title: Map File type: object maps: diff --git a/models/runtime.yaml b/models/runtime.yaml index dd62872..b8b613e 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -355,6 +355,8 @@ map: type: string file: type: string + storage_name: + type: string description: type: string map_entry: From 44e3169d1171c50c5d0bcae8a9383970cc093e86 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Fri, 18 Dec 2020 00:13:31 +0100 Subject: [PATCH 106/121] MEDIUM: get storage map file returns file contents, no response on PUT --- build/haproxy_spec.yaml | 6 +++--- paths/storage.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index fb0ff8e..26fc5fc 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10355,11 +10355,13 @@ paths: name: name required: true type: string + produces: + - application/octet-stream responses: "200": description: Successful operation schema: - type: string + type: file "404": $ref: '#/responses/NotFound' default: @@ -10389,8 +10391,6 @@ paths: responses: "200": description: Map file replaced - schema: - type: string "400": $ref: '#/responses/BadRequest' "404": diff --git a/paths/storage.yaml b/paths/storage.yaml index 134b614..badaf1e 100644 --- a/paths/storage.yaml +++ b/paths/storage.yaml @@ -61,11 +61,13 @@ maps_one: description: Map file storage_name required: true type: string + produces: + - application/octet-stream responses: '200': description: Successful operation schema: - type: string + type: file '404': $ref: '#/responses/NotFound' 'default': @@ -114,8 +116,6 @@ maps_one: responses: '200': description: Map file replaced - schema: - type: string '400': $ref: '#/responses/BadRequest' '404': From 03601818f49a32dbc2e0be85c218746db006caa4 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Fri, 18 Dec 2020 01:14:44 +0100 Subject: [PATCH 107/121] BUG/MINOR: add force-reload parameter to storage map replace (PUT) Also remove force-reload parameter from map create (POST), tweak HTTP return codes. Fix querystring parameters to use underscores and clarify descriptions. --- build/haproxy_spec.yaml | 30 ++++++++++++++---------------- paths/runtime.yaml | 12 ++++++------ paths/storage.yaml | 18 ++++++++---------- 3 files changed, 28 insertions(+), 32 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 26fc5fc..4b54474 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10039,7 +10039,7 @@ paths: - default: false description: If true, also show unmanaged map files loaded in haproxy in: query - name: includeUnmanaged + name: include_unmanaged required: false type: boolean responses: @@ -10109,7 +10109,7 @@ paths: description: Returns an array of all entries in a given runtime map file. operationId: showRuntimeMap parameters: - - description: Map storage_name + - description: Mapfile attribute storage_name in: query name: map required: true @@ -10130,7 +10130,7 @@ paths: description: Adds an entry into the map file. operationId: addMapEntry parameters: - - description: Map storage_name + - description: Mapfile attribute storage_name in: query name: map required: true @@ -10169,7 +10169,7 @@ paths: name: id required: true type: string - - description: Map storage_name + - description: Mapfile attribute storage_name in: query name: map required: true @@ -10198,7 +10198,7 @@ paths: name: id required: true type: string - - description: Map storage_name + - description: Mapfile attribute storage_name in: query name: map required: true @@ -10224,7 +10224,7 @@ paths: name: id required: true type: string - - description: Map storage_name + - description: Mapfile attribute storage_name in: query name: map required: true @@ -10301,7 +10301,7 @@ paths: parameters: - description: The map file contents in: formData - name: fileUpload + name: file_upload type: file x-mimetype: text/plain responses: @@ -10309,14 +10309,6 @@ paths: description: Map file created with its entries schema: $ref: '#/definitions/map' - "202": - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: '#/definitions/map' "400": $ref: '#/responses/BadRequest' "409": @@ -10389,7 +10381,13 @@ paths: produces: - application/json responses: - "200": + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + "204": description: Map file replaced "400": $ref: '#/responses/BadRequest' diff --git a/paths/runtime.yaml b/paths/runtime.yaml index f9acfcb..891885d 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -190,7 +190,7 @@ maps: tags: - Maps parameters: - - name: includeUnmanaged + - name: include_unmanaged in: query description: If true, also show unmanaged map files loaded in haproxy required: false @@ -265,7 +265,7 @@ maps_entries: parameters: - name: map in: query - description: Map storage_name + description: Mapfile attribute storage_name required: true type: string responses: @@ -284,7 +284,7 @@ maps_entries: parameters: - name: map in: query - description: Map storage_name + description: Mapfile attribute storage_name required: true type: string - name: forceSync @@ -325,7 +325,7 @@ maps_entries_one: type: string - name: map in: query - description: Map storage_name + description: Mapfile attribute storage_name required: true type: string responses: @@ -351,7 +351,7 @@ maps_entries_one: type: string - name: map in: query - description: Map storage_name + description: Mapfile attribute storage_name required: true type: string - name: forceSync @@ -395,7 +395,7 @@ maps_entries_one: type: string - name: map in: query - description: Map storage_name + description: Mapfile attribute storage_name required: true type: string - name: forceSync diff --git a/paths/storage.yaml b/paths/storage.yaml index badaf1e..38a1446 100644 --- a/paths/storage.yaml +++ b/paths/storage.yaml @@ -23,7 +23,7 @@ maps: - multipart/form-data parameters: - in: formData - name: fileUpload + name: file_upload type: file description: The map file contents x-mimetype: text/plain @@ -34,14 +34,6 @@ maps: description: Map file created with its entries schema: $ref: "#/definitions/map" - '202': - description: Configuration change accepted and reload requested - headers: - Reload-ID: - description: ID of the requested reload - type: string - schema: - $ref: '#/definitions/map' '409': $ref: '#/responses/AlreadyExists' '400': @@ -114,7 +106,13 @@ maps_one: type: string - $ref: "#/parameters/force_reload" responses: - '200': + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + '204': description: Map file replaced '400': $ref: '#/responses/BadRequest' From 0930c9b7c01148d78a4653f660d5f6b9cc0a8bc8 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Mon, 21 Dec 2020 13:24:16 +0100 Subject: [PATCH 108/121] MINOR: sticktable: supporting general purpose tag for Stick Tables --- build/haproxy_spec.yaml | 4 ++++ models/runtime.yaml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4b54474..f9254bc 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4282,6 +4282,7 @@ definitions: - gpc0_rate - gpc1 - gpc1_rate + - gpt0 - conn_cnt - conn_cur - conn_rate @@ -4376,6 +4377,9 @@ definitions: gpc1_rate: type: integer x-nullable: true + gpt0: + type: integer + x-nullable: true http_err_cnt: type: integer x-nullable: true diff --git a/models/runtime.yaml b/models/runtime.yaml index b8b613e..e3fb4c6 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -269,7 +269,7 @@ table: properties: field: type: string - enum: [server_id, gpc0, gpc0_rate, gpc1, gpc1_rate, conn_cnt, conn_cur, conn_rate, sess_cnt, sess_rate, http_req_cnt, http_req_rate, http_err_cnt, http_err_rate, bytes_in_cnt, bytes_in_rate, bytes_out_cnt, bytes_out_rate] + enum: [server_id, gpc0, gpc0_rate, gpc1, gpc1_rate, gpt0, conn_cnt, conn_cur, conn_rate, sess_cnt, sess_rate, http_req_cnt, http_req_rate, http_err_cnt, http_err_rate, bytes_in_cnt, bytes_in_rate, bytes_out_cnt, bytes_out_rate] type: type: string enum: [rate, counter] @@ -302,6 +302,9 @@ table_entry: gpc1_rate: type: integer x-nullable: true + gpt0: + type: integer + x-nullable: true conn_cnt: type: integer x-nullable: true From 623fa2e551ab608246fb1eba3a0719dcdea4427e Mon Sep 17 00:00:00 2001 From: Goran Galinec Date: Mon, 28 Dec 2020 16:15:08 +0100 Subject: [PATCH 109/121] CLEANUP/MINOR: server: removed comment --- models/configuration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/configuration.yaml b/models/configuration.yaml index e799964..0bbe18c 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -986,7 +986,7 @@ server: x-dependency: ssl: value: enabled - maintenance: # I don't see this option in the specification + maintenance: type: string enum: [enabled, disabled] agent-check: From ba1d2d6ad461ff3e21d99aed1357eb69080bd577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Wed, 30 Dec 2020 14:09:53 +0000 Subject: [PATCH 110/121] MEDIUM: ssl-certs: add models and use them Unify naming of ssl models and resource urls --- build/haproxy_spec.yaml | 129 ++++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 12 ++++ models/runtime.yaml | 9 +++ paths/storage.yaml | 114 +++++++++++++++++++++++++++++++++++ 4 files changed, 264 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index f9254bc..716d1d7 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4494,6 +4494,21 @@ definitions: type: array items: $ref: "#/definitions/map_entry" + ssl_certificate: + description: A file containing one or more SSL/TLS certificates and keys + properties: + description: + type: string + storage_name: + type: string + title: SSL File + type: object + ssl_certificates: + title: SSL Files Array + description: Array of ssl certificate files + type: array + items: + $ref: "#/definitions/ssl_certificate" balance: properties: algorithm: @@ -10402,4 +10417,118 @@ paths: summary: Replace contents of a managed map file on disk tags: - Storage + /services/haproxy/storage/ssl_certificates: + get: + description: Returns all available SSL certificates on disk. + operationId: getAllStorageSSLCertificates + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/ssl_certificates' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return all available SSL certificates on disk + tags: + - Storage + post: + consumes: + - multipart/form-data + description: Creates SSL certificate. + operationId: createStorageSSLCertificate + parameters: + - description: The SSL certificate to upload + in: formData + name: file_upload + type: file + x-mimetype: text/plain + responses: + "201": + description: SSL certificate created + schema: + $ref: '#/definitions/ssl_certificate' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Create SSL certificate + tags: + - Storage + /services/haproxy/storage/ssl_certificates/{name}: + delete: + description: Deletes SSL certificate from disk. + operationId: deleteStorageSSLCertificate + parameters: + - description: SSL certificate name + in: path + name: name + required: true + type: string + responses: + "204": + description: SSL certificate deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete SSL certificate from disk + tags: + - Storage + get: + description: Returns one SSL certificate from disk. + operationId: getOneStorageSSLCertificate + parameters: + - description: SSL certificate name + in: path + name: name + required: true + type: string + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/ssl_certificate' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one SSL certificate from disk + tags: + - Storage + put: + consumes: + - text/plain + description: Replaces SSL certificate on disk. + operationId: replaceStorageSSLCertificate + parameters: + - description: SSL certificate name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + type: string + produces: + - application/json + responses: + "202": + description: SSL certificate replaced + schema: + $ref: '#/definitions/ssl_certificate' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace SSL certificates on disk + tags: + - Storage diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 178eeea..02fea56 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -244,6 +244,14 @@ definitions: type: array items: $ref: "#/definitions/map_entry" + ssl_certificate: + $ref: "models/runtime.yaml#/ssl_certificate" + ssl_certificates: + title: SSL Files Array + description: Array of ssl certificate files + type: array + items: + $ref: "#/definitions/ssl_certificate" balance: $ref: "models/configuration.yaml#/balance" forwardfor: @@ -572,3 +580,7 @@ paths: $ref: "paths/storage.yaml#/maps" /services/haproxy/storage/maps/{name}: $ref: "paths/storage.yaml#/maps_one" + /services/haproxy/storage/ssl_certificates: + $ref: "paths/storage.yaml#/ssl_certificates" + /services/haproxy/storage/ssl_certificates/{name}: + $ref: "paths/storage.yaml#/ssl_certificates_one" diff --git a/models/runtime.yaml b/models/runtime.yaml index e3fb4c6..8f30f27 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -374,3 +374,12 @@ map_entry: type: string value: type: string +ssl_certificate: + title: SSL File + description: A file containing one or more SSL/TLS certificates and keys + type: object + properties: + storage_name: + type: string + description: + type: string diff --git a/paths/storage.yaml b/paths/storage.yaml index 38a1446..1e1d1fa 100644 --- a/paths/storage.yaml +++ b/paths/storage.yaml @@ -120,3 +120,117 @@ maps_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' +ssl_certificates: + get: + summary: Return all available SSL certificates on disk + description: Returns all available SSL certificates on disk. + operationId: getAllStorageSSLCertificates + tags: + - Storage + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/ssl_certificates" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Create SSL certificate + description: Creates SSL certificate. + operationId: createStorageSSLCertificate + consumes: + - multipart/form-data + parameters: + - in: formData + name: file_upload + type: file + description: The SSL certificate to upload + x-mimetype: text/plain + tags: + - Storage + responses: + '201': + description: SSL certificate created + schema: + $ref: "#/definitions/ssl_certificate" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +ssl_certificates_one: + get: + summary: Return one SSL certificate from disk + description: Returns one SSL certificate from disk. + operationId: getOneStorageSSLCertificate + tags: + - Storage + parameters: + - name: name + in: path + description: SSL certificate name + required: true + type: string + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/ssl_certificate" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete SSL certificate from disk + description: Deletes SSL certificate from disk. + operationId: deleteStorageSSLCertificate + tags: + - Storage + parameters: + - name: name + in: path + description: SSL certificate name + required: true + type: string + responses: + '204': + description: SSL certificate deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace SSL certificates on disk + description: Replaces SSL certificate on disk. + operationId: replaceStorageSSLCertificate + produces: + - application/json + consumes: + - text/plain + tags: + - Storage + parameters: + - name: name + in: path + description: SSL certificate name + required: true + type: string + - name: data + in: body + required: true + schema: + type: string + responses: + '202': + description: SSL certificate replaced + schema: + $ref: "#/definitions/ssl_certificate" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From c826ec95047ecdafc42e6a97aabc1a8c12f7a302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amel=20Husi=C4=87?= Date: Thu, 31 Dec 2020 12:53:13 +0000 Subject: [PATCH 111/121] MEDIUM: spoe: add spoe with transaction support - added SPOE CRUD functions - added SPOE transaction support --- build/haproxy_spec.yaml | 1136 +++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 68 ++ models/spoe-transactions.yaml | 18 + models/spoe.yaml | 118 ++++ paths/spoe-transactions.yaml | 155 +++++ paths/spoe.yaml | 788 +++++++++++++++++++++++ 6 files changed, 2283 insertions(+) create mode 100644 models/spoe-transactions.yaml create mode 100644 models/spoe.yaml create mode 100644 paths/spoe-transactions.yaml create mode 100644 paths/spoe.yaml diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 716d1d7..c09ec2b 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4131,6 +4131,32 @@ definitions: type: array items: $ref: "#/definitions/transaction" + spoe_transaction: + description: SPOE configuration transaction + example: + _version: 2 + id: 273e3385-2d0c-4fb1-aa27-93cbb31ff203 + status: in_progress + properties: + _version: + type: integer + id: + pattern: ^[^\s]+$ + type: string + status: + enum: + - failed + - in_progress + - success + type: string + title: SPOE configuration transaction + type: object + spoe_transactions: + title: SPOE Transactions array + description: SPOE Configuration transactions array + type: array + items: + $ref: "#/definitions/spoe_transaction" info: description: General API, OS and hardware information example: @@ -5321,6 +5347,167 @@ definitions: username: type: string type: object + spoe_files: + description: SPOE files + items: + type: string + title: SPOE files + type: array + spoe_scope: + description: SPOE scope name + title: SPOE scope + type: string + spoe_scopes: + title: SPOE Scopes + description: All SPOE Scopes + type: array + items: + $ref: "#/definitions/spoe_scope" + spoe_agent: + description: SPOE agent configuration + properties: + async: + enum: + - enabled + - disabled + type: string + continue-on-error: + enum: + - enabled + type: string + dontlog-normal: + enum: + - enabled + - disabled + type: string + engine-name: + type: string + force-set-var: + enum: + - enabled + type: string + groups: + type: string + hello_timeout: + type: integer + idle_timeout: + type: integer + log: + $ref: '#/definitions/log_targets' + max-frame-size: + type: integer + max-waiting-frames: + type: integer + maxconnrate: + type: integer + maxerrrate: + type: integer + messages: + type: string + name: + type: string + option_set-on-error: + pattern: ^[A-Za-z0-9-_.]+$ + type: string + option_set-process-time: + pattern: ^[A-Za-z0-9-_.]+$ + type: string + option_set-total-time: + pattern: ^[A-Za-z0-9-_.]+$ + type: string + option_var-prefix: + pattern: ^[A-Za-z0-9-_.]+$ + type: string + pipelining: + enum: + - enabled + - disabled + type: string + processing_timeout: + type: integer + register-var-names: + type: string + send-frag-payload: + enum: + - enabled + - disabled + type: string + use-backend: + type: string + required: + - name + title: SPOE agent + type: object + spoe_agents: + title: SPOE Agents + description: SPOE Agents of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_agent" + spoe_message: + description: SPOE message section configuration + properties: + acl: + $ref: '#/definitions/acls' + args: + type: string + event: + properties: + cond: + enum: + - if + - unless + type: string + x-display-name: Condition + cond_test: + type: string + x-dependency: + cond: + required: true + x-display-name: Condition Test + name: + enum: + - on-client-session + - on-server-session + - on-frontend-tcp-request + - on-backend-tcp-request + - on-tcp-response + - on-frontend-http-request + - on-backend-http-request + - on-http-response + type: string + required: + - name + type: object + name: + type: string + required: + - name + title: SPOE message + type: object + spoe_messages: + title: SPOE Messages + description: SPOE Messages of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_message" + spoe_group: + description: SPOE group section configuration + properties: + messages: + type: string + name: + type: string + required: + - name + title: SPOE group + type: object + spoe_groups: + title: SPOE Groups + description: SPOE Groups of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_group" responses: BadRequest: description: Bad request @@ -5452,6 +5639,8 @@ tags: - name: Maps - name: SpecificationOpenapiv3 - name: ServiceDiscovery + - name: Spoe + - name: SpoeTransactions security: - basic_auth: [] paths: @@ -6078,6 +6267,165 @@ paths: summary: Commit transaction tags: - Transactions + /services/haproxy/spoe_transactions: + get: + description: Returns a list of SPOE configuration transactions. Transactions can + be filtered by their status. + operationId: getSpoeTransactions + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Filter by transaction status + enum: + - failed + - in_progress + in: query + name: status + required: false + type: string + produces: + - application/json + responses: + "200": + description: Success + schema: + $ref: '#/definitions/spoe_transactions' + default: + $ref: '#/responses/DefaultError' + summary: Return list of SPOE configuration transactions. + tags: + - SpoeTransactions + post: + description: Starts a new transaction and returns it's id + operationId: startSpoeTransaction + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Configuration version on which to work on + in: query + name: version + required: true + type: integer + produces: + - application/json + responses: + "201": + description: Transaction started + schema: + $ref: '#/definitions/spoe_transaction' + "429": + description: Too many open transactions + schema: + example: + code: 429 + message: cannot start a new transaction, reached the maximum amount of 20 + active transactions available + properties: + code: + type: integer + message: + type: string + type: object + default: + $ref: '#/responses/DefaultError' + summary: Start a new transaction + tags: + - SpoeTransactions + /services/haproxy/spoe_transactions/{id}: + delete: + description: Deletes a transaction. + operationId: deleteSpoeTransaction + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Transaction id + in: path + name: id + required: true + type: string + responses: + "204": + description: Transaction deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a transaction + tags: + - SpoeTransactions + get: + description: Returns one SPOE configuration transactions. + operationId: getSpoeTransaction + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Transaction id + in: path + name: id + required: true + type: string + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/spoe_transaction' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one SPOE configuration transactions + tags: + - SpoeTransactions + put: + description: Commit transaction, execute all operations in transaction and return + msg + operationId: commitSpoeTransaction + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Transaction id + in: path + name: id + required: true + type: string + - $ref: '#/parameters/force_reload' + responses: + "200": + description: Transaction succesfully commited + schema: + $ref: '#/definitions/spoe_transaction' + "202": + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: '#/definitions/spoe_transaction' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Commit transaction + tags: + - SpoeTransactions /services/haproxy/reloads: get: description: Returns a list of HAProxy reloads. @@ -10531,4 +10879,792 @@ paths: summary: Replace SSL certificates on disk tags: - Storage + /services/haproxy/spoe/spoe_files: + get: + description: Returns all available SPOE files. + operationId: getAllSpoeFiles + responses: + "200": + description: Successful operation + schema: + $ref: '#/definitions/spoe_files' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return all available SPOE files + tags: + - Spoe + post: + consumes: + - multipart/form-data + description: Creates SPOE file with its entries. + operationId: createSpoe + parameters: + - description: The spoe file to upload + in: formData + name: file_upload + type: file + x-mimetype: text/plain + responses: + "201": + description: SPOE file created with its entries + schema: + type: string + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Creates SPOE file with its entries + tags: + - Spoe + /services/haproxy/spoe/spoe_files/{name}: + delete: + description: Deletes SPOE file. + operationId: deleteSpoeFile + parameters: + - description: SPOE file name + in: path + name: name + required: true + type: string + responses: + "204": + description: SPOE file deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete SPOE file + tags: + - Spoe + get: + description: Returns one SPOE file. + operationId: getOneSpoeFile + parameters: + - description: SPOE file name + in: path + name: name + required: true + type: string + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + type: string + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one SPOE file + tags: + - Spoe + /services/haproxy/spoe/spoe_scopes: + get: + description: Returns an array of all configured spoe scopes. + operationId: getSpoeScopes + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_scopes' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of spoe scopes + tags: + - Spoe + post: + description: Adds a new spoe scope. + operationId: createSpoeScope + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_scope' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "201": + description: Spoe scope created + schema: + $ref: '#/definitions/spoe_scope' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new spoe scope + tags: + - Spoe + /services/haproxy/spoe/spoe_scopes/{name}: + delete: + description: Deletes a SPOE scope from the configuration file. + operationId: deleteSpoeScope + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "204": + description: Spoe scope deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a SPOE scope + tags: + - Spoe + get: + description: Returns one SPOE scope in one SPOE file. + operationId: getSpoeScope + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_scope' + required: + - data + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return one SPOE scope + tags: + - Spoe + /services/haproxy/spoe/spoe_agents: + get: + description: Returns an array of all configured spoe agents in one scope. + operationId: getSpoeAgents + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_agents' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of spoe agents in one scope + tags: + - Spoe + post: + description: Adds a new spoe agent to the spoe scope. + operationId: createSpoeAgent + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_agent' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "201": + description: Spoe agent created + schema: + $ref: '#/definitions/spoe_agent' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new spoe agent to scope + tags: + - Spoe + /services/haproxy/spoe/spoe_agents/{name}: + delete: + description: Deletes a SPOE agent from the configuration in one SPOE scope. + operationId: deleteSpoeAgent + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe agent name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "204": + description: Spoe agent deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a SPOE agent + tags: + - Spoe + get: + description: Returns one spoe agent configuration in one SPOE scope. + operationId: getSpoeAgent + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe agent name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_agent' + required: + - data + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a spoe agent + tags: + - Spoe + put: + description: Replaces a SPOE agent configuration in one SPOE scope. + operationId: replaceSpoeAgent + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe agent name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_agent' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "200": + description: Spoe agent replaced + schema: + $ref: '#/definitions/spoe_agent' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a SPOE agent + tags: + - Spoe + /services/haproxy/spoe/spoe_messages: + get: + description: Returns an array of all configured spoe messages in one scope. + operationId: getSpoeMessages + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_messages' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of spoe messages in one scope + tags: + - Spoe + post: + description: Adds a new spoe message to the spoe scope. + operationId: createSpoeMessage + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_message' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "201": + description: Spoe message created + schema: + $ref: '#/definitions/spoe_message' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new spoe message to scope + tags: + - Spoe + /services/haproxy/spoe/spoe_messages/{name}: + delete: + description: Deletes a spoe message from the SPOE scope. + operationId: deleteSpoeMessage + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe message name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "204": + description: Spoe message deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a spoe message + tags: + - Spoe + get: + description: Returns one spoe message configuration in SPOE scope. + operationId: getSpoeMessage + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe message name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_message' + required: + - data + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a spoe message + tags: + - Spoe + put: + description: Replaces a spoe message configuration in one SPOE scope. + operationId: replaceSpoeMessage + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe message name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_message' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "200": + description: Spoe message replaced + schema: + $ref: '#/definitions/spoe_message' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a spoe message + tags: + - Spoe + /services/haproxy/spoe/spoe_groups: + get: + description: Returns an array of all configured SPOE groups in one SPOE scope. + operationId: getSpoeGroups + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_groups' + required: + - data + type: object + default: + $ref: '#/responses/DefaultError' + summary: Return an array of SPOE groups + tags: + - Spoe + post: + description: Adds a new SPOE groups to the SPOE scope. + operationId: createSpoeGroup + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_group' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "201": + description: Spoe groups created + schema: + $ref: '#/definitions/spoe_group' + "400": + $ref: '#/responses/BadRequest' + "409": + $ref: '#/responses/AlreadyExists' + default: + $ref: '#/responses/DefaultError' + summary: Add a new SPOE groups + tags: + - Spoe + /services/haproxy/spoe/spoe_groups/{name}: + delete: + description: Deletes a SPOE groups from the one SPOE scope. + operationId: deleteSpoeGroup + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe group name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "204": + description: Spoe group deleted + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Delete a SPOE groups + tags: + - Spoe + get: + description: Returns one SPOE groups configuration in one SPOE scope. + operationId: getSpoeGroup + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe group name + in: path + name: name + required: true + type: string + - $ref: '#/parameters/transaction_id' + responses: + "200": + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + properties: + _version: + type: integer + data: + $ref: '#/definitions/spoe_group' + required: + - data + type: object + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a SPOE groups + tags: + - Spoe + put: + description: Replaces a SPOE groups configuration in one SPOE scope. + operationId: replaceSpoeGroup + parameters: + - description: Spoe file name + in: query + name: spoe + required: true + type: string + - description: Spoe scope + in: query + name: scope + required: true + type: string + - description: Spoe group name + in: path + name: name + required: true + type: string + - in: body + name: data + required: true + schema: + $ref: '#/definitions/spoe_group' + - $ref: '#/parameters/transaction_id' + - $ref: '#/parameters/version' + responses: + "200": + description: Spoe groups replaced + schema: + $ref: '#/definitions/spoe_group' + "400": + $ref: '#/responses/BadRequest' + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Replace a SPOE groups + tags: + - Spoe diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 02fea56..324da55 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -192,6 +192,14 @@ definitions: type: array items: $ref: "#/definitions/transaction" + spoe_transaction: + $ref: "models/spoe-transactions.yaml#/spoe_transaction" + spoe_transactions: + title: SPOE Transactions array + description: SPOE Configuration transactions array + type: array + items: + $ref: "#/definitions/spoe_transaction" info: $ref: "models/general.yaml#/info" reload: @@ -302,6 +310,40 @@ definitions: $ref: "models/configuration.yaml#/mysql_check_params" pgsql_check_params: $ref: "models/configuration.yaml#/pgsql_check_params" + spoe_files: + $ref: "models/spoe.yaml#/spoe_files" + spoe_scope: + $ref: "models/spoe.yaml#/spoe_scope" + spoe_scopes: + title: SPOE Scopes + description: All SPOE Scopes + type: array + items: + $ref: "#/definitions/spoe_scope" + spoe_agent: + $ref: "models/spoe.yaml#/spoe_agent" + spoe_agents: + title: SPOE Agents + description: SPOE Agents of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_agent" + spoe_message: + $ref: "models/spoe.yaml#/spoe_message" + spoe_messages: + title: SPOE Messages + description: SPOE Messages of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_message" + spoe_group: + $ref: "models/spoe.yaml#/spoe_group" + spoe_groups: + title: SPOE Groups + description: SPOE Groups of one scope in SPOE file + type: array + items: + $ref: "#/definitions/spoe_group" responses: BadRequest: description: Bad request @@ -433,6 +475,8 @@ tags: - name: Maps - name: SpecificationOpenapiv3 - name: ServiceDiscovery + - name: Spoe + - name: SpoeTransactions security: - basic_auth: [] paths: @@ -468,6 +512,10 @@ paths: $ref: "paths/general.yaml#/transactions" /services/haproxy/transactions/{id}: $ref: "paths/general.yaml#/transactions_one" + /services/haproxy/spoe_transactions: + $ref: "paths/spoe-transactions.yaml#/transactions" + /services/haproxy/spoe_transactions/{id}: + $ref: "paths/spoe-transactions.yaml#/transactions_one" /services/haproxy/reloads: $ref: "paths/general.yaml#/reloads" /services/haproxy/reloads/{id}: @@ -584,3 +632,23 @@ paths: $ref: "paths/storage.yaml#/ssl_certificates" /services/haproxy/storage/ssl_certificates/{name}: $ref: "paths/storage.yaml#/ssl_certificates_one" + /services/haproxy/spoe/spoe_files: + $ref: "paths/spoe.yaml#/spoe_files" + /services/haproxy/spoe/spoe_files/{name}: + $ref: "paths/spoe.yaml#/spoes_one" + /services/haproxy/spoe/spoe_scopes: + $ref: "paths/spoe.yaml#/spoe_scopes" + /services/haproxy/spoe/spoe_scopes/{name}: + $ref: "paths/spoe.yaml#/spoe_scopes_one" + /services/haproxy/spoe/spoe_agents: + $ref: "paths/spoe.yaml#/spoe_agents" + /services/haproxy/spoe/spoe_agents/{name}: + $ref: "paths/spoe.yaml#/spoe_agents_one" + /services/haproxy/spoe/spoe_messages: + $ref: "paths/spoe.yaml#/spoe_messages" + /services/haproxy/spoe/spoe_messages/{name}: + $ref: "paths/spoe.yaml#/spoe_messages_one" + /services/haproxy/spoe/spoe_groups: + $ref: "paths/spoe.yaml#/spoe_groups" + /services/haproxy/spoe/spoe_groups/{name}: + $ref: "paths/spoe.yaml#/spoe_groups_one" diff --git a/models/spoe-transactions.yaml b/models/spoe-transactions.yaml new file mode 100644 index 0000000..5162d05 --- /dev/null +++ b/models/spoe-transactions.yaml @@ -0,0 +1,18 @@ +--- +spoe_transaction: + title: SPOE configuration transaction + description: SPOE configuration transaction + type: object + properties: + id: + type: string + pattern: '^[^\s]+$' + status: + type: string + enum: [failed, in_progress, success] + _version: + type: integer + example: + id: 273e3385-2d0c-4fb1-aa27-93cbb31ff203 + status: in_progress + _version: 2 diff --git a/models/spoe.yaml b/models/spoe.yaml new file mode 100644 index 0000000..d7770fd --- /dev/null +++ b/models/spoe.yaml @@ -0,0 +1,118 @@ +--- +spoe_files: + title: SPOE files + description: SPOE files + type: array + items: + type: string +spoe_scope: + title: SPOE scope + description: SPOE scope name + type: string +spoe_agent: + title: SPOE agent + description: SPOE agent configuration + type: object + required: + - name + properties: + engine-name: + type: string + name: + type: string + groups: + type: string + log: + $ref: "#/definitions/log_targets" + maxconnrate: + type: integer + maxerrrate: + type: integer + max-frame-size: + type: integer + max-waiting-frames: + type: integer + messages: + type: string + async: + type: string + enum: [enabled, disabled] + continue-on-error: + type: string + enum: [enabled] + dontlog-normal: + type: string + enum: [enabled, disabled] + force-set-var: + type: string + enum: [enabled] + pipelining: + type: string + enum: [enabled, disabled] + send-frag-payload: + type: string + enum: [enabled, disabled] + option_set-on-error: + type: string + pattern: '^[A-Za-z0-9-_.]+$' + option_set-process-time: + type: string + pattern: '^[A-Za-z0-9-_.]+$' + option_set-total-time: + type: string + pattern: '^[A-Za-z0-9-_.]+$' + option_var-prefix: + type: string + pattern: '^[A-Za-z0-9-_.]+$' + register-var-names: + type: string + hello_timeout: + type: integer + idle_timeout: + type: integer + processing_timeout: + type: integer + use-backend: + type: string +spoe_message: + title: SPOE message + description: SPOE message section configuration + type: object + required: + - name + properties: + name: + type: string + acl: + $ref: "#/definitions/acls" + args: + type: string + event: + type: object + required: + - name + properties: + name: + type: string + enum: [on-client-session, on-server-session, on-frontend-tcp-request, on-backend-tcp-request, on-tcp-response, on-frontend-http-request, on-backend-http-request, on-http-response] + cond: + type: string + x-display-name: Condition + enum: [if, unless] + cond_test: + type: string + x-display-name: Condition Test + x-dependency: + cond: + required: true +spoe_group: + title: SPOE group + description: SPOE group section configuration + type: object + required: + - name + properties: + name: + type: string + messages: + type: string diff --git a/paths/spoe-transactions.yaml b/paths/spoe-transactions.yaml new file mode 100644 index 0000000..657fed9 --- /dev/null +++ b/paths/spoe-transactions.yaml @@ -0,0 +1,155 @@ +--- +transactions: + get: + tags: + - SpoeTransactions + summary: Return list of SPOE configuration transactions. + description: Returns a list of SPOE configuration transactions. Transactions can be filtered by their status. + operationId: getSpoeTransactions + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: status + in: query + description: Filter by transaction status + required: false + type: string + enum: [failed, in_progress] + produces: + - application/json + responses: + '200': + description: Success + schema: + $ref: '#/definitions/spoe_transactions' + 'default': + $ref: '#/responses/DefaultError' + post: + tags: + - SpoeTransactions + summary: Start a new transaction + description: Starts a new transaction and returns it's id + operationId: startSpoeTransaction + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: version + in: query + description: Configuration version on which to work on + required: true + type: integer + produces: + - application/json + responses: + '201': + description: Transaction started + schema: + $ref: "#/definitions/spoe_transaction" + '429': + description: Too many open transactions + schema: + type: object + properties: + code: + type: integer + message: + type: string + example: + code: 429 + message: cannot start a new transaction, reached the maximum amount of 20 active transactions available + 'default': + $ref: '#/responses/DefaultError' +transactions_one: + get: + tags: + - SpoeTransactions + summary: Return one SPOE configuration transactions + description: Returns one SPOE configuration transactions. + operationId: getSpoeTransaction + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: id + in: path + description: Transaction id + required: true + type: string + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/spoe_transaction" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + tags: + - SpoeTransactions + summary: Commit transaction + description: Commit transaction, execute all operations in transaction and return msg + operationId: commitSpoeTransaction + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: id + in: path + description: Transaction id + required: true + type: string + - $ref: "#/parameters/force_reload" + responses: + '202': + description: Configuration change accepted and reload requested + headers: + Reload-ID: + description: ID of the requested reload + type: string + schema: + $ref: "#/definitions/spoe_transaction" + '200': + description: Transaction succesfully commited + schema: + $ref: "#/definitions/spoe_transaction" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a transaction + description: Deletes a transaction. + operationId: deleteSpoeTransaction + tags: + - SpoeTransactions + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: id + in: path + description: Transaction id + required: true + type: string + responses: + '204': + description: Transaction deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' diff --git a/paths/spoe.yaml b/paths/spoe.yaml new file mode 100644 index 0000000..3b9c2ed --- /dev/null +++ b/paths/spoe.yaml @@ -0,0 +1,788 @@ +spoe_files: + get: + summary: Return all available SPOE files + description: Returns all available SPOE files. + operationId: getAllSpoeFiles + tags: + - Spoe + responses: + '200': + description: Successful operation + schema: + $ref: "#/definitions/spoe_files" + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Creates SPOE file with its entries + description: Creates SPOE file with its entries. + operationId: createSpoe + consumes: + - multipart/form-data + parameters: + - in: formData + name: file_upload + type: file + description: The spoe file to upload + x-mimetype: text/plain + tags: + - Spoe + responses: + '201': + description: SPOE file created with its entries + schema: + type: string + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +spoes_one: + get: + summary: Return one SPOE file + description: Returns one SPOE file. + operationId: getOneSpoeFile + tags: + - Spoe + parameters: + - name: name + in: path + description: SPOE file name + required: true + type: string + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + type: string + _version: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete SPOE file + description: Deletes SPOE file. + operationId: deleteSpoeFile + parameters: + - name: name + in: path + description: SPOE file name + required: true + type: string + tags: + - Spoe + responses: + '204': + description: SPOE file deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +spoe_scopes: + get: + summary: Return an array of spoe scopes + description: Returns an array of all configured spoe scopes. + operationId: getSpoeScopes + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - $ref: "#/parameters/transaction_id" + tags: + - Spoe + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_scopes" + _version: + type: integer + required: + - data + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new spoe scope + description: Adds a new spoe scope. + operationId: createSpoeScope + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_scope" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + tags: + - Spoe + responses: + '201': + description: Spoe scope created + schema: + $ref: "#/definitions/spoe_scope" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +spoe_scopes_one: + get: + summary: Return one SPOE scope + description: Returns one SPOE scope in one SPOE file. + operationId: getSpoeScope + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: name + in: path + description: Spoe scope + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_scope" + _version: + type: integer + required: + - data + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a SPOE scope + description: Deletes a SPOE scope from the configuration file. + operationId: deleteSpoeScope + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: name + in: path + description: Spoe scope name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '204': + description: Spoe scope deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +spoe_agents: + get: + summary: Return an array of spoe agents in one scope + description: Returns an array of all configured spoe agents in one scope. + operationId: getSpoeAgents + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - $ref: "#/parameters/transaction_id" + tags: + - Spoe + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_agents" + _version: + type: integer + required: + - data + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new spoe agent to scope + description: Adds a new spoe agent to the spoe scope. + operationId: createSpoeAgent + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_agent" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + tags: + - Spoe + responses: + '201': + description: Spoe agent created + schema: + $ref: "#/definitions/spoe_agent" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +spoe_agents_one: + get: + summary: Return a spoe agent + description: Returns one spoe agent configuration in one SPOE scope. + operationId: getSpoeAgent + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe agent name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_agent" + _version: + type: integer + required: + - data + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a SPOE agent + description: Replaces a SPOE agent configuration in one SPOE scope. + operationId: replaceSpoeAgent + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe agent name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_agent" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '200': + description: Spoe agent replaced + schema: + $ref: "#/definitions/spoe_agent" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a SPOE agent + description: Deletes a SPOE agent from the configuration in one SPOE scope. + operationId: deleteSpoeAgent + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe agent name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '204': + description: Spoe agent deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +spoe_messages: + get: + summary: Return an array of spoe messages in one scope + description: Returns an array of all configured spoe messages in one scope. + operationId: getSpoeMessages + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - $ref: "#/parameters/transaction_id" + tags: + - Spoe + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_messages" + _version: + type: integer + required: + - data + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new spoe message to scope + description: Adds a new spoe message to the spoe scope. + operationId: createSpoeMessage + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_message" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + tags: + - Spoe + responses: + '201': + description: Spoe message created + schema: + $ref: "#/definitions/spoe_message" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +spoe_messages_one: + get: + summary: Return a spoe message + description: Returns one spoe message configuration in SPOE scope. + operationId: getSpoeMessage + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe message name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_message" + _version: + type: integer + required: + - data + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a spoe message + description: Replaces a spoe message configuration in one SPOE scope. + operationId: replaceSpoeMessage + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe message name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_message" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '200': + description: Spoe message replaced + schema: + $ref: "#/definitions/spoe_message" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a spoe message + description: Deletes a spoe message from the SPOE scope. + operationId: deleteSpoeMessage + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe message name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '204': + description: Spoe message deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' +spoe_groups: + get: + summary: Return an array of SPOE groups + description: Returns an array of all configured SPOE groups in one SPOE scope. + operationId: getSpoeGroups + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - $ref: "#/parameters/transaction_id" + tags: + - Spoe + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_groups" + _version: + type: integer + required: + - data + 'default': + $ref: '#/responses/DefaultError' + post: + summary: Add a new SPOE groups + description: Adds a new SPOE groups to the SPOE scope. + operationId: createSpoeGroup + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_group" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + tags: + - Spoe + responses: + '201': + description: Spoe groups created + schema: + $ref: "#/definitions/spoe_group" + '409': + $ref: '#/responses/AlreadyExists' + '400': + $ref: '#/responses/BadRequest' + 'default': + $ref: '#/responses/DefaultError' +spoe_groups_one: + get: + summary: Return a SPOE groups + description: Returns one SPOE groups configuration in one SPOE scope. + operationId: getSpoeGroup + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe group name + required: true + type: string + - $ref: "#/parameters/transaction_id" + responses: + '200': + description: Successful operation + headers: + Configuration-Version: + description: Spoe configuration file version + type: integer + x-nullable: false + schema: + type: object + properties: + data: + $ref: "#/definitions/spoe_group" + _version: + type: integer + required: + - data + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + put: + summary: Replace a SPOE groups + description: Replaces a SPOE groups configuration in one SPOE scope. + operationId: replaceSpoeGroup + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe group name + required: true + type: string + - name: data + required: true + in: body + schema: + $ref: "#/definitions/spoe_group" + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '200': + description: Spoe groups replaced + schema: + $ref: "#/definitions/spoe_group" + '400': + $ref: '#/responses/BadRequest' + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' + delete: + summary: Delete a SPOE groups + description: Deletes a SPOE groups from the one SPOE scope. + operationId: deleteSpoeGroup + tags: + - Spoe + parameters: + - name: spoe + in: query + description: Spoe file name + required: true + type: string + - name: scope + in: query + description: Spoe scope + required: true + type: string + - name: name + in: path + description: Spoe group name + required: true + type: string + - $ref: "#/parameters/transaction_id" + - $ref: "#/parameters/version" + responses: + '204': + description: Spoe group deleted + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From d9529c4c69fef2bf49d2e2774091b6ae59733002 Mon Sep 17 00:00:00 2001 From: ahusic Date: Wed, 23 Dec 2020 23:06:43 +0100 Subject: [PATCH 112/121] MINOR: CI: added func to check if name is Pascal case --- .github/workflows/compare_build.yml | 6 +-- .gitlab-ci.yml | 4 +- scripts/lint-yaml.sh | 66 +++++++++++++++++++++++++++++ scripts/single-tag.sh | 35 --------------- 4 files changed, 71 insertions(+), 40 deletions(-) create mode 100755 scripts/lint-yaml.sh delete mode 100644 scripts/single-tag.sh diff --git a/.github/workflows/compare_build.yml b/.github/workflows/compare_build.yml index 2f0502a..8d775ef 100644 --- a/.github/workflows/compare_build.yml +++ b/.github/workflows/compare_build.yml @@ -12,7 +12,7 @@ jobs: cd build ./build -file ../haproxy-spec.yaml > haproxy_spec_to_compare.yaml diff -u haproxy_spec.yaml haproxy_spec_to_compare.yaml - - name: Ensure single tags + - name: YAML script validation run: | - chmod +x ./scripts/single-tag.sh - ./scripts/single-tag.sh + chmod +x ./scripts/lint-yaml.sh + ./scripts/lint-yaml.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1cf698a..202721a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,8 +24,8 @@ yamllint: script: # to test locally, run: docker run --rm -v $(pwd):/data cytopia/yamllint . - /bin/sh -c "yamllint -f colored ." - - chmod +x ./scripts/single-tag.sh - - /bin/sh -c ./scripts/single-tag.sh + - chmod +x ./scripts/lint-yaml.sh + - /bin/sh -c ./scripts/lint-yaml.sh lint-commit-msg: stage: lint image: diff --git a/scripts/lint-yaml.sh b/scripts/lint-yaml.sh new file mode 100755 index 0000000..a91be7f --- /dev/null +++ b/scripts/lint-yaml.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +# - Ensure single `tags` are used(openapi-generator doesn't work well with multiple tags) +# - Ensure Pascal case is used for `name` field + +set -e pipefail + +haproxy_spec="./build/haproxy_spec.yaml" +found="false" +countTags=0 +lineNo=0 + +# checkCamelCaseInNameField checks if usage of camel case name is supported +# and if not, it exit with error code 1 +checkCamelCaseInNameField() +{ + local name="$(echo $@ | grep '^name: ')" + if [ -n "$name" ]; then + local upperCased="$(echo "$name" | cut -d ":" -f 2 | grep -e '[[:upper:]]')" + + if [ -n "$upperCased" ]; then + # Add camel case names we want to support + local allowedCamelCaseNameFields=" HAProxy Support X-Runtime-Actions forceDelete forceSync" + + local allowed="$(echo "$allowedCamelCaseNameFields" | grep "$upperCased")" + if [ -z "$allowed" ] ; then + echo "Camel case \"$trimLine\" used at line no: $lineNo. Use Pascal case instead." + exit 1 + fi + fi + fi +} + +while IFS= read -r line +do + lineNo=$((lineNo+1)) + # skip root tags + if [ "$line" = "tags:" ]; then + continue + fi + + trimLine="${line#"${line%%[![:space:]]*}"}" + + # ensure camel case is not used in name fields + checkCamelCaseInNameField $trimLine + + if [ "$found" = "true" ] && [ -n "$trimLine" ] && [ -z "$(echo "$trimLine" | cut -d "-" -f 1)" ]; then + countTags=$((countTags+1)) + else + found="false" + countTags=0 + fi + + if [ "$countTags" -gt 1 ]; then + echo "Multiple tags are not supported. Additional tag: $line at line no: $lineNo" + exit 1 + fi + + # handle only tags from path + if [ "$trimLine" = "tags:" ]; then + found="true" + fi +done < "$haproxy_spec" + +echo "Linting YAML PASSED" +exit 0 diff --git a/scripts/single-tag.sh b/scripts/single-tag.sh deleted file mode 100644 index d767cdc..0000000 --- a/scripts/single-tag.sh +++ /dev/null @@ -1,35 +0,0 @@ -# Ensure single tags are used. -# This is necessary for opaneapi-generator -# which doesn't work well with multiple tags -haproxy_spec="./build/haproxy_spec.yaml" -found="false" -countTags=0 -lineNo=0 - -while IFS= read -r line -do - lineNo=$((lineNo+1)) - # skip root tags - if [ "$line" = "tags:" ]; then - continue - fi - - trimLine="${line#"${line%%[![:space:]]*}"}" - - if [ "$found" = "true" ] && [ "${trimLine:0:1}" = "-" ]; then - countTags=$((countTags+1)) - else - found="false" - countTags=0 - fi - - if [ "$countTags" -gt 1 ]; then - echo "Multiple tags are not supported. Additional tag: $line at line: $lineNo" - exit 1 - fi - - # handle only tags from path - if [ "$trimLine" = "tags:" ]; then - found="true" - fi -done < "$haproxy_spec" From 2e80dac239edc35a6dc4c9020f989cfa169f0f6b Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Fri, 8 Jan 2021 11:15:43 +0100 Subject: [PATCH 113/121] MINOR: add file (full path) attribute to SSL certificate model --- build/haproxy_spec.yaml | 2 ++ models/runtime.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index c09ec2b..0f6e780 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4525,6 +4525,8 @@ definitions: properties: description: type: string + file: + type: string storage_name: type: string title: SSL File diff --git a/models/runtime.yaml b/models/runtime.yaml index 8f30f27..a8e868c 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -379,6 +379,8 @@ ssl_certificate: description: A file containing one or more SSL/TLS certificates and keys type: object properties: + file: + type: string storage_name: type: string description: From 5c5ec1e633afc8025e730d654f50c10699e9fcbb Mon Sep 17 00:00:00 2001 From: Thomas Kaltenbach Date: Fri, 8 Jan 2021 11:30:19 +0000 Subject: [PATCH 114/121] MINOR: runtime: add acl file support --- build/haproxy_spec.yaml | 21 +++++++++++++++++++++ haproxy-spec.yaml | 4 ++++ models/runtime.yaml | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0f6e780..62cefb8 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4537,6 +4537,27 @@ definitions: type: array items: $ref: "#/definitions/ssl_certificate" + acl_file: + description: ACL File + properties: + description: + type: string + id: + type: string + storage_name: + type: string + title: ACL File + type: object + acl_file_entry: + description: One ACL File Entry + properties: + id: + readOnly: true + type: string + value: + type: string + title: One ACL File Entry + type: object balance: properties: algorithm: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 324da55..5db19c8 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -260,6 +260,10 @@ definitions: type: array items: $ref: "#/definitions/ssl_certificate" + acl_file: + $ref: "models/runtime.yaml#/acl_file" + acl_file_entry: + $ref: "models/runtime.yaml#/acl_file_entry" balance: $ref: "models/configuration.yaml#/balance" forwardfor: diff --git a/models/runtime.yaml b/models/runtime.yaml index a8e868c..d9f48f1 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -385,3 +385,24 @@ ssl_certificate: type: string description: type: string +acl_file: + title: ACL File + description: ACL File + type: object + properties: + id: + type: string + storage_name: + type: string + description: + type: string +acl_file_entry: + title: One ACL File Entry + description: One ACL File Entry + type: object + properties: + id: + type: string + readOnly: true + value: + type: string From 725f7ab2409b53d29a5b6224d49d50e15abe4b7f Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Tue, 12 Jan 2021 09:06:38 +0100 Subject: [PATCH 115/121] MINOR: runtime: add acl_files and acl_files_entries --- build/haproxy_spec.yaml | 12 ++++++++++++ haproxy-spec.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 62cefb8..ae438e1 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4548,6 +4548,12 @@ definitions: type: string title: ACL File type: object + acl_files: + title: ACL Files Array + description: Array of runtime acl files + type: array + items: + $ref: "#/definitions/acl_file" acl_file_entry: description: One ACL File Entry properties: @@ -4558,6 +4564,12 @@ definitions: type: string title: One ACL File Entry type: object + acl_files_entries: + title: ACL Files Entries + description: Array of entries of one runtime acl file + type: array + items: + $ref: "#/definitions/acl_file_entry" balance: properties: algorithm: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index 5db19c8..ec911a7 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -262,8 +262,20 @@ definitions: $ref: "#/definitions/ssl_certificate" acl_file: $ref: "models/runtime.yaml#/acl_file" + acl_files: + title: ACL Files Array + description: Array of runtime acl files + type: array + items: + $ref: "#/definitions/acl_file" acl_file_entry: $ref: "models/runtime.yaml#/acl_file_entry" + acl_files_entries: + title: ACL Files Entries + description: Array of entries of one runtime acl file + type: array + items: + $ref: "#/definitions/acl_file_entry" balance: $ref: "models/configuration.yaml#/balance" forwardfor: From 59d959841d3ede8cf140bbeb716557e6d2801f4a Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Tue, 12 Jan 2021 16:46:56 +0100 Subject: [PATCH 116/121] MINOR: use force_sync query parameter instead of forceSync --- build/haproxy_spec.yaml | 8 ++++---- paths/runtime.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index ae438e1..4a00bab 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10473,7 +10473,7 @@ paths: - default: false description: If true, immediately syncs changes to disk in: query - name: forceSync + name: force_sync type: boolean responses: "204": @@ -10540,7 +10540,7 @@ paths: - default: false description: If true, immediately syncs changes to disk in: query - name: forceSync + name: force_sync type: boolean - in: body name: data @@ -10579,7 +10579,7 @@ paths: - default: false description: If true, immediately syncs changes to disk in: query - name: forceSync + name: force_sync type: boolean responses: "204": @@ -10634,7 +10634,7 @@ paths: - default: false description: If true, immediately syncs changes to disk in: query - name: forceSync + name: force_sync type: boolean - in: body name: data diff --git a/paths/runtime.yaml b/paths/runtime.yaml index 891885d..f639e01 100644 --- a/paths/runtime.yaml +++ b/paths/runtime.yaml @@ -241,7 +241,7 @@ maps_one: in: query description: If true, deletes file from disk type: boolean - - name: forceSync + - name: force_sync in: query description: If true, immediately syncs changes to disk type: boolean @@ -287,7 +287,7 @@ maps_entries: description: Mapfile attribute storage_name required: true type: string - - name: forceSync + - name: force_sync in: query description: If true, immediately syncs changes to disk type: boolean @@ -354,7 +354,7 @@ maps_entries_one: description: Mapfile attribute storage_name required: true type: string - - name: forceSync + - name: force_sync in: query description: If true, immediately syncs changes to disk type: boolean @@ -398,7 +398,7 @@ maps_entries_one: description: Mapfile attribute storage_name required: true type: string - - name: forceSync + - name: force_sync in: query description: If true, immediately syncs changes to disk type: boolean From 95dd58ff16c6d18a0310f3150ab6d9a70243d131 Mon Sep 17 00:00:00 2001 From: Andjelko Iharos Date: Tue, 12 Jan 2021 16:55:34 +0100 Subject: [PATCH 117/121] MINOR: add force_reload query parameter to SSL certificate resource paths --- build/haproxy_spec.yaml | 2 ++ paths/storage.yaml | 2 ++ scripts/lint-yaml.sh | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 4a00bab..56dd313 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -10827,6 +10827,7 @@ paths: name: file_upload type: file x-mimetype: text/plain + - $ref: '#/parameters/force_reload' responses: "201": description: SSL certificate created @@ -10898,6 +10899,7 @@ paths: required: true schema: type: string + - $ref: '#/parameters/force_reload' produces: - application/json responses: diff --git a/paths/storage.yaml b/paths/storage.yaml index 1e1d1fa..339c84f 100644 --- a/paths/storage.yaml +++ b/paths/storage.yaml @@ -148,6 +148,7 @@ ssl_certificates: type: file description: The SSL certificate to upload x-mimetype: text/plain + - $ref: "#/parameters/force_reload" tags: - Storage responses: @@ -223,6 +224,7 @@ ssl_certificates_one: required: true schema: type: string + - $ref: "#/parameters/force_reload" responses: '202': description: SSL certificate replaced diff --git a/scripts/lint-yaml.sh b/scripts/lint-yaml.sh index a91be7f..c6acc96 100755 --- a/scripts/lint-yaml.sh +++ b/scripts/lint-yaml.sh @@ -20,7 +20,7 @@ checkCamelCaseInNameField() if [ -n "$upperCased" ]; then # Add camel case names we want to support - local allowedCamelCaseNameFields=" HAProxy Support X-Runtime-Actions forceDelete forceSync" + local allowedCamelCaseNameFields=" HAProxy Support X-Runtime-Actions forceDelete" local allowed="$(echo "$allowedCamelCaseNameFields" | grep "$upperCased")" if [ -z "$allowed" ] ; then From c9d4b7445f5e6fc04fabc91016387de8e70aa109 Mon Sep 17 00:00:00 2001 From: Stefan Scheglmann Date: Thu, 14 Jan 2021 19:11:36 +0100 Subject: [PATCH 118/121] MINOR: Added http-request return properties * Adds new type 'return' to http_request_rule * Adds properties required for 'return' to http_request_rule --- build/haproxy_spec.yaml | 62 +++++++++++++++++++++++++++++++++++++++ models/configuration.yaml | 46 ++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 56dd313..2038fc3 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -1927,6 +1927,67 @@ definitions: required: true value: do-resolve x-display-name: Resolvers + return_content: + type: string + x-dependency: + return_content_format: + required: true + value: + - errofile + - errorfiles + - file + - lf-file + - string + - lf-string + return_content_format: + enum: + - default-errorfile + - errorfile + - errorfiles + - file + - lf-file + - string + - lf-string + type: string + x-dependency: + type: + value: return + return_content_type: + type: string + x-dependency: + type: + value: return + x-display-name: Return content type + x-nullable: true + return_hdrs: + items: + properties: + fmt: + type: string + name: + type: string + required: + - name + - fmt + type: object + type: array + x-dependency: + return_content_format: + value: + - file + - lf-file + - string + - lf-string + x-go-name: ReturnHeaders + return_status_code: + maximum: 599 + minimum: 200 + type: integer + x-dependency: + type: + value: return + x-display-name: Return Error Code + x-nullable: true sc_expr: type: string x-dependency: @@ -2086,6 +2147,7 @@ definitions: - strict-mode - lua - use-service + - return type: string x-nullable: false uri-fmt: diff --git a/models/configuration.yaml b/models/configuration.yaml index 0bbe18c..c2f0e13 100644 --- a/models/configuration.yaml +++ b/models/configuration.yaml @@ -1296,7 +1296,7 @@ http_request_rule: x-nullable: true type: type: string - enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode, lua, use-service] + enum: [allow, deny, auth, redirect, tarpit, add-header, replace-header, replace-value, del-header, set-header, set-log-level, set-path, replace-path, set-query, set-uri, set-var, send-spoe-group, add-acl, del-acl, capture, track-sc0, track-sc1, track-sc2, set-map, del-map, cache-use, disable-l7-retry, early-hint, replace-uri, sc-inc-gpc0, sc-inc-gpc1, do-resolve, set-dst, set-dst-port, sc-set-gpt0, set-mark, set-nice, set-method, set-priority-class, set-priority-offset, set-src, set-src-por, wait-for-handshake, set-tos, silent-drop, unset-var, strict-mode, lua, use-service, return] x-nullable: false capture_sample: pattern: '^[^\s]+$' @@ -1686,6 +1686,50 @@ http_request_rule: x-dependency: cond: required: true + return_status_code: + type: integer + minimum: 200 + maximum: 599 + x-dependency: + type: + value: return + x-display-name: Return Error Code + x-nullable: true + return_content_type: + type: string + x-dependency: + type: + value: return + x-display-name: Return content type + x-nullable: true + return_content_format: + type: string + enum: [default-errorfile, errorfile, errorfiles, file, lf-file, string, lf-string] + x-dependency: + type: + value: return + return_content: + type: string + x-dependency: + return_content_format: + value: [errofile, errorfiles, file, lf-file, string, lf-string] + required: true + return_hdrs: + type: array + x-go-name: ReturnHeaders + x-dependency: + return_content_format: + value: [file, lf-file, string, lf-string] + items: + type: object + required: + - name + - fmt + properties: + name: + type: string + fmt: + type: string additionalProperties: false example: index: 0 From 79be346e8e1f866f31d5e6505e06f01ec86da880 Mon Sep 17 00:00:00 2001 From: Amel Husic Date: Thu, 4 Feb 2021 17:12:08 +0100 Subject: [PATCH 119/121] MEDIUM: SPOE: add configuration version endpoint --- build/haproxy_spec.yaml | 23 +++++++++++++++++++++++ haproxy-spec.yaml | 2 ++ paths/spoe.yaml | 23 +++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 2038fc3..0a0dc65 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -11766,4 +11766,27 @@ paths: summary: Replace a SPOE groups tags: - Spoe + /services/haproxy/spoe/version: + get: + description: Returns SPOE configuration version. + operationId: getSpoeConfigurationVersion + parameters: + - $ref: '#/parameters/transaction_id' + - description: Spoe file name + in: query + name: spoe + required: true + type: string + responses: + "200": + description: SPOE configuration version + schema: + type: integer + "404": + $ref: '#/responses/NotFound' + default: + $ref: '#/responses/DefaultError' + summary: Return a SPOE configuration version + tags: + - Spoe diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index ec911a7..c9b52f5 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -668,3 +668,5 @@ paths: $ref: "paths/spoe.yaml#/spoe_groups" /services/haproxy/spoe/spoe_groups/{name}: $ref: "paths/spoe.yaml#/spoe_groups_one" + /services/haproxy/spoe/version: + $ref: "paths/spoe.yaml#/version" diff --git a/paths/spoe.yaml b/paths/spoe.yaml index 3b9c2ed..732b5a7 100644 --- a/paths/spoe.yaml +++ b/paths/spoe.yaml @@ -786,3 +786,26 @@ spoe_groups_one: $ref: '#/responses/NotFound' 'default': $ref: '#/responses/DefaultError' +version: + get: + summary: Return a SPOE configuration version + description: Returns SPOE configuration version. + operationId: getSpoeConfigurationVersion + tags: + - Spoe + parameters: + - $ref: "#/parameters/transaction_id" + - name: spoe + in: query + description: Spoe file name + required: true + type: string + responses: + '200': + description: SPOE configuration version + schema: + type: integer + '404': + $ref: '#/responses/NotFound' + 'default': + $ref: '#/responses/DefaultError' From f5612208df37a2b2ec93487677e5ec196ba46952 Mon Sep 17 00:00:00 2001 From: Thomas Kaltenbach Date: Mon, 15 Feb 2021 09:05:45 +0100 Subject: [PATCH 120/121] MINOR: runtime: add ssl crt-list/cert support --- build/haproxy_spec.yaml | 73 +++++++++++++++++++++++++++++++++++++++++ haproxy-spec.yaml | 24 ++++++++++++++ models/runtime.yaml | 55 +++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+) diff --git a/build/haproxy_spec.yaml b/build/haproxy_spec.yaml index 0a0dc65..9f64df1 100644 --- a/build/haproxy_spec.yaml +++ b/build/haproxy_spec.yaml @@ -4599,6 +4599,79 @@ definitions: type: array items: $ref: "#/definitions/ssl_certificate" + ssl_cert_entry: + description: One SSL/TLS certificate + properties: + algorithm: + type: string + chain_issuer: + type: string + chain_subject: + type: string + issuer: + type: string + not_after: + format: date + type: string + not_before: + format: date + type: string + serial: + type: string + sha1_finger_print: + type: string + status: + type: string + storage_name: + type: string + subject: + type: string + subject_alternative_names: + items: + type: string + type: array + title: One SSL Certificate Entry + type: object + ssl_cert_entries: + title: SSL Certificate Entries + description: Array of entries of runtime SSL Certificate Entry + type: array + items: + $ref: "#/definitions/ssl_cert_entry" + ssl_crt_list: + description: One SSL/TLS certificate + properties: + file: + type: string + title: crt-list + type: object + ssl_crt_lists: + title: SSL crt-list + description: Array of entries of runtime crt-list + type: array + items: + $ref: "#/definitions/ssl_crt_list" + ssl_crt_list_entry: + description: One SSL/TLS certificate + properties: + file: + type: string + line_number: + type: string + sni_filters: + items: + type: string + type: array + ssl_bind_config: + type: string + title: One crt-list Entry + type: object + ssl_crt_list_entries: + title: SSL Certificate Entries + description: Array of entries of runtime SSL Certificate Entry + type: array + items: + $ref: "#/definitions/ssl_crt_list_entry" acl_file: description: ACL File properties: diff --git a/haproxy-spec.yaml b/haproxy-spec.yaml index c9b52f5..fbb334c 100644 --- a/haproxy-spec.yaml +++ b/haproxy-spec.yaml @@ -260,6 +260,30 @@ definitions: type: array items: $ref: "#/definitions/ssl_certificate" + ssl_cert_entry: + $ref: "models/runtime.yaml#/ssl_cert_entry" + ssl_cert_entries: + title: SSL Certificate Entries + description: Array of entries of runtime SSL Certificate Entry + type: array + items: + $ref: "#/definitions/ssl_cert_entry" + ssl_crt_list: + $ref: "models/runtime.yaml#/ssl_crt_list" + ssl_crt_lists: + title: SSL crt-list + description: Array of entries of runtime crt-list + type: array + items: + $ref: "#/definitions/ssl_crt_list" + ssl_crt_list_entry: + $ref: "models/runtime.yaml#/ssl_crt_list_entry" + ssl_crt_list_entries: + title: SSL Certificate Entries + description: Array of entries of runtime SSL Certificate Entry + type: array + items: + $ref: "#/definitions/ssl_crt_list_entry" acl_file: $ref: "models/runtime.yaml#/acl_file" acl_files: diff --git a/models/runtime.yaml b/models/runtime.yaml index d9f48f1..6679d51 100644 --- a/models/runtime.yaml +++ b/models/runtime.yaml @@ -385,6 +385,61 @@ ssl_certificate: type: string description: type: string +ssl_cert_entry: + title: One SSL Certificate Entry + description: One SSL/TLS certificate + type: object + properties: + storage_name: + type: string + status: + type: string + serial: + type: string + not_before: + type: string + format: date + not_after: + type: string + format: date + subject_alternative_names: + type: array + items: + type: string + algorithm: + type: string + sha1_finger_print: + type: string + subject: + type: string + issuer: + type: string + chain_subject: + type: string + chain_issuer: + type: string +ssl_crt_list: + title: crt-list + description: One SSL/TLS certificate + type: object + properties: + file: + type: string +ssl_crt_list_entry: + title: One crt-list Entry + description: One SSL/TLS certificate + type: object + properties: + line_number: + type: string + file: + type: string + ssl_bind_config: + type: string + sni_filters: + type: array + items: + type: string acl_file: title: ACL File description: ACL File From 07a938fabc0afb627291083669dd408c105639e7 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Tue, 23 Mar 2021 09:47:15 +0100 Subject: [PATCH 121/121] MAJOR: merging project with client-native project has been merged into https://github.com/haproxytech/client-native. Main reason for this change is to simplify contribution process. Now, PR is only needed in one project instead of three of them --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 4d54802..d4a734f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,23 @@ # ![HAProxy](assets/images/haproxy-weblogo-210x49.png "HAProxy") +
+
+ +:warning: This project has been merged with [client-native](https://github.com/haproxytech/client-native) project. + +
+
+
+
+
+
+
+
+
+
+
+
+ ## HAProxy Data Plane API Specification This is the [OpenAPI 2.0 (fka Swagger)](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) specification for the [HAProxy Data Plane API project](https://github.com/haproxytech/dataplaneapi)