From bc5201a5a657c75c369f4b7756912bf623a4c219 Mon Sep 17 00:00:00 2001 From: Aksenov Anton <82324812+Dangerio@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:36:57 +0300 Subject: [PATCH] feat all: support kill switches in API schema (#54) * Add lists with kill switches in response of `/configs/values` * Add lists with kill switches in response of `/configs/values` * Add lists with kill switches in request of `/admin/v1/configs` --- docs/api/api.yaml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/api/api.yaml b/docs/api/api.yaml index 85adb39..1883278 100644 --- a/docs/api/api.yaml +++ b/docs/api/api.yaml @@ -13,6 +13,10 @@ paths: post: description: | A handle for getting config values. + Returns configs changed since updated_since and last update time. + If any changed configs are Kill Switches, + returns additional lists of enabled and disabled Kill Switches. + A config with a changed Kill Switch flag is considered changed. requestBody: description: | Parameters for config values @@ -50,6 +54,18 @@ paths: type: object additionalProperties: true description: Map of received configs + kill_switches_enabled: + type: array + description: Enabled Kill Switches + items: + type: string + description: Config id + kill_switches_disabled: + type: array + description: Disabled Kill Switches + items: + type: string + description: Config id updated_at: type: string description: Time of last update @@ -63,7 +79,11 @@ paths: /admin/v1/configs: post: description: | - Handle for adding (editing) configs + Handle for adding (editing) configs. + Changes (sets) config values and optionally their Kill Switch flags. + The configs specified in kill_switches_disabled and kill_switches_enabled + become disabled and enabled kill switches, respectively. + The rest become regular dynamic configs. requestBody: description: | Config parameters (you can add bulk) @@ -81,6 +101,22 @@ paths: description: | Map key-values, config name and its value, you can have multiple configs at the same time + kill_switches_enabled: + type: array + description: | + Enabled Kill Switches, + must consist of ids from configs + items: + type: string + description: Config id + kill_switches_disabled: + type: array + description: | + Disabled Kill Switches, + must consist of ids from configs + items: + type: string + description: Config id service: type: string description: The name of the service to create/update for configs for