diff --git a/backend/.sqlx/query-00ce4ed3ca0eac7cb6283b047353a64b9e78c4beb423f04baef9a53fbf87e9f9.json b/backend/.sqlx/query-00ce4ed3ca0eac7cb6283b047353a64b9e78c4beb423f04baef9a53fbf87e9f9.json deleted file mode 100644 index e4909fc4da..0000000000 --- a/backend/.sqlx/query-00ce4ed3ca0eac7cb6283b047353a64b9e78c4beb423f04baef9a53fbf87e9f9.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO alerts (alert_type, message) VALUES ('recovered_critical_error', $1)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [] - }, - "hash": "00ce4ed3ca0eac7cb6283b047353a64b9e78c4beb423f04baef9a53fbf87e9f9" -} diff --git a/backend/.sqlx/query-0b955f2cff82a2d4ba3840588143e08952f029480d4a42503ecc3c5e70437995.json b/backend/.sqlx/query-0b955f2cff82a2d4ba3840588143e08952f029480d4a42503ecc3c5e70437995.json new file mode 100644 index 0000000000..820e4f45ab --- /dev/null +++ b/backend/.sqlx/query-0b955f2cff82a2d4ba3840588143e08952f029480d4a42503ecc3c5e70437995.json @@ -0,0 +1,48 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, alert_type, message, created_at, acknowledged \n FROM alerts \n WHERE acknowledged = $1\n ORDER BY created_at DESC \n LIMIT $2 OFFSET $3", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "alert_type", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "message", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "acknowledged", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Bool", + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + true + ] + }, + "hash": "0b955f2cff82a2d4ba3840588143e08952f029480d4a42503ecc3c5e70437995" +} diff --git a/backend/.sqlx/query-33cfb00f61dbae09467bd3732ce8e83c9835ccd30c90cb24788cdb54d1ceb575.json b/backend/.sqlx/query-33cfb00f61dbae09467bd3732ce8e83c9835ccd30c90cb24788cdb54d1ceb575.json new file mode 100644 index 0000000000..26e7a58854 --- /dev/null +++ b/backend/.sqlx/query-33cfb00f61dbae09467bd3732ce8e83c9835ccd30c90cb24788cdb54d1ceb575.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT value::BOOLEAN as value FROM global_settings WHERE name = 'critical_alert_mute_ui'", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "value", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "33cfb00f61dbae09467bd3732ce8e83c9835ccd30c90cb24788cdb54d1ceb575" +} diff --git a/backend/.sqlx/query-3a94ad52c6b7cde844fa868167248cd9ff63e5fdfa1d93d8fbec32a257b6b05e.json b/backend/.sqlx/query-3a94ad52c6b7cde844fa868167248cd9ff63e5fdfa1d93d8fbec32a257b6b05e.json new file mode 100644 index 0000000000..5a79a3d793 --- /dev/null +++ b/backend/.sqlx/query-3a94ad52c6b7cde844fa868167248cd9ff63e5fdfa1d93d8fbec32a257b6b05e.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO alerts (alert_type, message, acknowledged) VALUES ('recovered_critical_error', $1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "3a94ad52c6b7cde844fa868167248cd9ff63e5fdfa1d93d8fbec32a257b6b05e" +} diff --git a/backend/.sqlx/query-4c0067c2135a259aea5cc2db60f7375a9a33671be8ef406427d90f67a98c9c9f.json b/backend/.sqlx/query-4c0067c2135a259aea5cc2db60f7375a9a33671be8ef406427d90f67a98c9c9f.json deleted file mode 100644 index 32295ea1e1..0000000000 --- a/backend/.sqlx/query-4c0067c2135a259aea5cc2db60f7375a9a33671be8ef406427d90f67a98c9c9f.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO alerts (alert_type, message) VALUES ('critical_error', $1)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [] - }, - "hash": "4c0067c2135a259aea5cc2db60f7375a9a33671be8ef406427d90f67a98c9c9f" -} diff --git a/backend/.sqlx/query-4d22084a5d9860832f30e8f08cbfa1848ed3c1336fa4790f45b8189c4ac97d91.json b/backend/.sqlx/query-4d22084a5d9860832f30e8f08cbfa1848ed3c1336fa4790f45b8189c4ac97d91.json new file mode 100644 index 0000000000..b57d834f87 --- /dev/null +++ b/backend/.sqlx/query-4d22084a5d9860832f30e8f08cbfa1848ed3c1336fa4790f45b8189c4ac97d91.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO alerts (alert_type, message, acknowledged) VALUES ('critical_error', $1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "4d22084a5d9860832f30e8f08cbfa1848ed3c1336fa4790f45b8189c4ac97d91" +} diff --git a/backend/.sqlx/query-661f472ff3860983322162420457f5033b9c9afc344d9c3e385ba20a3ad2197a.json b/backend/.sqlx/query-661f472ff3860983322162420457f5033b9c9afc344d9c3e385ba20a3ad2197a.json index 1fa370e682..75b8108281 100644 --- a/backend/.sqlx/query-661f472ff3860983322162420457f5033b9c9afc344d9c3e385ba20a3ad2197a.json +++ b/backend/.sqlx/query-661f472ff3860983322162420457f5033b9c9afc344d9c3e385ba20a3ad2197a.json @@ -5,7 +5,7 @@ "columns": [ { "ordinal": 0, - "name": "bool", + "name": "?column?", "type_info": "Bool" } ], diff --git a/backend/.sqlx/query-a7c5008aa7ea43d0afac7d9f19846976ed7af2e90270902f001115e023cb947d.json b/backend/.sqlx/query-a7c5008aa7ea43d0afac7d9f19846976ed7af2e90270902f001115e023cb947d.json new file mode 100644 index 0000000000..53ef15ffa5 --- /dev/null +++ b/backend/.sqlx/query-a7c5008aa7ea43d0afac7d9f19846976ed7af2e90270902f001115e023cb947d.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE alerts SET acknowledged = true WHERE acknowledged = false", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "a7c5008aa7ea43d0afac7d9f19846976ed7af2e90270902f001115e023cb947d" +} diff --git a/backend/.sqlx/query-be3ae231557e794172336bc27d725f862dcf039bbb3d75ced9d54c86f53d2580.json b/backend/.sqlx/query-be3ae231557e794172336bc27d725f862dcf039bbb3d75ced9d54c86f53d2580.json new file mode 100644 index 0000000000..e726f11fe2 --- /dev/null +++ b/backend/.sqlx/query-be3ae231557e794172336bc27d725f862dcf039bbb3d75ced9d54c86f53d2580.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE alerts SET acknowledged = true WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "be3ae231557e794172336bc27d725f862dcf039bbb3d75ced9d54c86f53d2580" +} diff --git a/backend/.sqlx/query-cc5ab80241b88c5befea279f16c4ec68cec17b31dcd277b321f652917346496b.json b/backend/.sqlx/query-cc5ab80241b88c5befea279f16c4ec68cec17b31dcd277b321f652917346496b.json new file mode 100644 index 0000000000..18bc159e6c --- /dev/null +++ b/backend/.sqlx/query-cc5ab80241b88c5befea279f16c4ec68cec17b31dcd277b321f652917346496b.json @@ -0,0 +1,47 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, alert_type, message, created_at, acknowledged \n FROM alerts \n ORDER BY created_at DESC \n LIMIT $1 OFFSET $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "alert_type", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "message", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "acknowledged", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + true + ] + }, + "hash": "cc5ab80241b88c5befea279f16c4ec68cec17b31dcd277b321f652917346496b" +} diff --git a/backend/migrations/20241105225151_alert_add_acknowledged.down.sql b/backend/migrations/20241105225151_alert_add_acknowledged.down.sql new file mode 100644 index 0000000000..ed9a1323d6 --- /dev/null +++ b/backend/migrations/20241105225151_alert_add_acknowledged.down.sql @@ -0,0 +1 @@ +ALTER TABLE alerts DROP COLUMN acknowledged; \ No newline at end of file diff --git a/backend/migrations/20241105225151_alert_add_acknowledged.up.sql b/backend/migrations/20241105225151_alert_add_acknowledged.up.sql new file mode 100644 index 0000000000..5174aec6e0 --- /dev/null +++ b/backend/migrations/20241105225151_alert_add_acknowledged.up.sql @@ -0,0 +1,9 @@ +-- Step 1: Add the new column 'acknowledged' to the 'alerts' table +ALTER TABLE alerts +ADD COLUMN acknowledged BOOLEAN DEFAULT NULL; + +-- Step 2: Update all existing rows to set 'acknowledged' to true +-- we don't want to pop up notifications to all users after migrations +-- but only show new alerts from the point of the upgrade +UPDATE alerts +SET acknowledged = TRUE; \ No newline at end of file diff --git a/backend/src/main.rs b/backend/src/main.rs index 61ee657d2c..6869a24647 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -36,7 +36,7 @@ use windmill_common::{ ENV_SETTINGS, EXPOSE_DEBUG_METRICS_SETTING, EXPOSE_METRICS_SETTING, EXTRA_PIP_INDEX_URL_SETTING, HUB_BASE_URL_SETTING, JOB_DEFAULT_TIMEOUT_SECS_SETTING, JWT_SECRET_SETTING, KEEP_JOB_DIR_SETTING, LICENSE_KEY_SETTING, NPM_CONFIG_REGISTRY_SETTING, - OAUTH_SETTING, PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, + OAUTH_SETTING, PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, CRITICAL_ALERT_MUTE_UI_SETTING, REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING, RETENTION_PERIOD_SECS_SETTING, SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, SMTP_SETTING, TIMEOUT_WAIT_RESULT_SETTING, }, @@ -78,7 +78,7 @@ use crate::monitor::{ reload_hub_base_url_setting, reload_job_default_timeout_setting, reload_jwt_secret_setting, reload_license_key, reload_npm_config_registry_setting, reload_pip_index_url_setting, reload_retention_period_setting, reload_scim_token_setting, reload_smtp_config, - reload_worker_config, + reload_worker_config, reload_critical_alert_mute_ui_setting, }; #[cfg(feature = "parquet")] @@ -817,6 +817,12 @@ Windmill Community Edition {GIT_VERSION} tracing::error!(error = %e, "Could not reload jwt secret setting"); } }, + CRITICAL_ALERT_MUTE_UI_SETTING => { + tracing::info!("Critical alert UI setting changed"); + if let Err(e) = reload_critical_alert_mute_ui_setting(&db).await { + tracing::error!(error = %e, "Could not reload critical alert UI setting"); + } + }, a @_ => { tracing::info!("Unrecognized Global Setting Change Payload: {:?}", a); } diff --git a/backend/src/monitor.rs b/backend/src/monitor.rs index b6cbd55330..da811bb6ff 100644 --- a/backend/src/monitor.rs +++ b/backend/src/monitor.rs @@ -39,7 +39,7 @@ use windmill_common::{ EXPOSE_DEBUG_METRICS_SETTING, EXPOSE_METRICS_SETTING, EXTRA_PIP_INDEX_URL_SETTING, HUB_BASE_URL_SETTING, JOB_DEFAULT_TIMEOUT_SECS_SETTING, JWT_SECRET_SETTING, KEEP_JOB_DIR_SETTING, LICENSE_KEY_SETTING, NPM_CONFIG_REGISTRY_SETTING, OAUTH_SETTING, - PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, + PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, CRITICAL_ALERT_MUTE_UI_SETTING, REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING, RETENTION_PERIOD_SECS_SETTING, SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, TIMEOUT_WAIT_RESULT_SETTING, }, @@ -55,7 +55,7 @@ use windmill_common::{ WORKER_GROUP, }, BASE_URL, CRITICAL_ERROR_CHANNELS, DB, DEFAULT_HUB_BASE_URL, HUB_BASE_URL, JOB_RETENTION_SECS, - METRICS_DEBUG_ENABLED, METRICS_ENABLED, + METRICS_DEBUG_ENABLED, METRICS_ENABLED, CRITICAL_ALERT_MUTE_UI_ENABLED }; use windmill_queue::cancel_job; use windmill_worker::{ @@ -131,6 +131,10 @@ pub async fn initial_load( tracing::error!("Error loading expose debug metrics: {e:#}"); } + if let Err(e) = reload_critical_alert_mute_ui_setting(db).await { + tracing::error!("Error loading critical alert mute ui setting: {e:#}"); + } + if let Err(e) = load_tag_per_workspace_enabled(db).await { tracing::error!("Error loading default tag per workpsace: {e:#}"); } @@ -226,6 +230,17 @@ pub async fn load_tag_per_workspace_workspaces(db: &DB) -> error::Result<()> { Ok(()) } +pub async fn reload_critical_alert_mute_ui_setting(db: &DB) -> error::Result<()> { + let mute = load_value_from_global_settings(db, CRITICAL_ALERT_MUTE_UI_SETTING).await; + match mute { + Ok(Some(serde_json::Value::Bool(t))) => { + CRITICAL_ALERT_MUTE_UI_ENABLED.store(t, Ordering::Relaxed); + } + _ => (), + }; + Ok(()) +} + pub async fn load_metrics_debug_enabled(db: &DB) -> error::Result<()> { let metrics_enabled = load_value_from_global_settings(db, EXPOSE_DEBUG_METRICS_SETTING).await; match metrics_enabled { diff --git a/backend/windmill-api/openapi-deref.json b/backend/windmill-api/openapi-deref.json index db789c2163..a6e225259a 100644 --- a/backend/windmill-api/openapi-deref.json +++ b/backend/windmill-api/openapi-deref.json @@ -1,7 +1,7 @@ { "openapi": "3.0.3", "info": { - "version": "1.409.0", + "version": "1.418.0", "title": "Windmill API", "contact": { "name": "Windmill Team", @@ -1182,6 +1182,115 @@ } } }, + "/settings/critical_alerts": { + "get": { + "summary": "Get all critical alerts", + "operationId": "getCriticalAlerts", + "tags": [ + "setting" + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1, + "description": "The page number to retrieve (minimum value is 1)" + } + }, + { + "in": "query", + "name": "page_size", + "schema": { + "type": "integer", + "default": 10, + "maximum": 100, + "description": "Number of alerts per page (maximum is 100)" + } + }, + { + "in": "query", + "name": "acknowledged", + "schema": { + "type": "boolean", + "nullable": true, + "description": "Filter by acknowledgment status; true for acknowledged, false for unacknowledged, and omit for all alerts" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all critical alerts", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CriticalAlert" + } + } + } + } + } + } + } + }, + "/settings/critical_alerts/{id}/acknowledge": { + "post": { + "summary": "Acknowledge a critical alert", + "operationId": "acknowledgeCriticalAlert", + "tags": [ + "setting" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + }, + "description": "The ID of the critical alert to acknowledge" + } + ], + "responses": { + "200": { + "description": "Successfully acknowledged the critical alert", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Critical alert acknowledged" + } + } + } + } + } + } + }, + "/settings/critical_alerts/acknowledge_all": { + "post": { + "summary": "Acknowledge all unacknowledged critical alerts", + "operationId": "acknowledgeAllCriticalAlerts", + "tags": [ + "setting" + ], + "responses": { + "200": { + "description": "Successfully acknowledged all unacknowledged critical alerts.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "All unacknowledged critical alerts acknowledged" + } + } + } + } + } + } + }, "/settings/test_license_key": { "post": { "summary": "test license key", @@ -2239,6 +2348,14 @@ }, { "$ref": "#/components/parameters/PerPage" + }, + { + "name": "active_only", + "in": "query", + "description": "filter only active users", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -3328,6 +3445,44 @@ } } }, + "/w/{workspace}/workspaces/used_triggers": { + "get": { + "summary": "get used triggers", + "operationId": "getUsedTriggers", + "tags": [ + "workspace" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + } + ], + "responses": { + "200": { + "description": "status", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "http_routes_used": { + "type": "boolean" + }, + "websocket_used": { + "type": "boolean" + } + }, + "required": [ + "http_routes_used", + "websocket_used" + ] + } + } + } + } + } + } + }, "/w/{workspace}/users/list": { "get": { "summary": "list users", @@ -6362,6 +6517,36 @@ } } }, + "/w/{workspace}/scripts/get_latest_version/{path}": { + "get": { + "summary": "get scripts's latest version (hash)", + "operationId": "getScriptLatestVersion", + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/ScriptPath" + } + ], + "tags": [ + "script" + ], + "responses": { + "200": { + "description": "Script version/hash", + "content": { + "application/json": { + "required": false, + "schema": { + "$ref": "#/components/schemas/ScriptHistory" + } + } + } + } + } + } + }, "/w/{workspace}/scripts/history_update/h/{hash}/p/{path}": { "post": { "summary": "update history of a script", @@ -7178,6 +7363,36 @@ } } }, + "/w/{workspace}/flows/get_latest_version/{path}": { + "get": { + "summary": "get flow's latest version", + "operationId": "getFlowLatestVersion", + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/ScriptPath" + } + ], + "tags": [ + "flow" + ], + "responses": { + "200": { + "description": "Flow version", + "content": { + "application/json": { + "required": false, + "schema": { + "$ref": "#/components/schemas/FlowVersion" + } + } + } + } + } + } + }, "/w/{workspace}/flows/get/v/{version}/p/{path}": { "get": { "summary": "get flow version", @@ -8096,6 +8311,36 @@ } } }, + "/w/{workspace}/apps/get_latest_version/{path}": { + "get": { + "summary": "get apps's latest version", + "operationId": "getAppLatestVersion", + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/ScriptPath" + } + ], + "tags": [ + "app" + ], + "responses": { + "200": { + "description": "App version", + "content": { + "application/json": { + "required": false, + "schema": { + "$ref": "#/components/schemas/AppHistory" + } + } + } + } + } + } + }, "/w/{workspace}/apps/history_update/a/{id}/v/{version}": { "post": { "summary": "update app history", @@ -11495,21 +11740,217 @@ } } }, - "/w/{workspace}/http_triggers/used": { - "get": { - "summary": "whether http triggers are used", - "operationId": "used", + "/w/{workspace}/websocket_triggers/create": { + "post": { + "summary": "create websocket trigger", + "operationId": "createWebsocketTrigger", "tags": [ - "http_trigger" + "websocket_trigger" ], "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], + "requestBody": { + "description": "new websocket trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewWebsocketTrigger" + } + } + } + }, + "responses": { + "201": { + "description": "websocket trigger created", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/websocket_triggers/update/{path}": { + "post": { + "summary": "update websocket trigger", + "operationId": "updateWebsocketTrigger", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated trigger", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditWebsocketTrigger" + } + } + } + }, "responses": { "200": { - "description": "whether http triggers are used", + "description": "websocket trigger updated", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/websocket_triggers/delete/{path}": { + "delete": { + "summary": "delete websocket trigger", + "operationId": "deleteWebsocketTrigger", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "websocket trigger deleted", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/w/{workspace}/websocket_triggers/get/{path}": { + "get": { + "summary": "get websocket trigger", + "operationId": "getWebsocketTrigger", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "websocket trigger deleted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebsocketTrigger" + } + } + } + } + } + } + }, + "/w/{workspace}/websocket_triggers/list": { + "get": { + "summary": "list websocket triggers", + "operationId": "listWebsocketTriggers", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId", + "required": true + }, + { + "$ref": "#/components/parameters/Page" + }, + { + "$ref": "#/components/parameters/PerPage" + }, + { + "name": "path", + "description": "filter by path", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "is_flow", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "path_start", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "websocket trigger list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebsocketTrigger" + } + } + } + } + } + } + } + }, + "/w/{workspace}/websocket_triggers/exists/{path}": { + "get": { + "summary": "does websocket trigger exists", + "operationId": "existsWebsocketTrigger", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "responses": { + "200": { + "description": "websocket trigger exists", "content": { "application/json": { "schema": { @@ -11521,6 +11962,54 @@ } } }, + "/w/{workspace}/websocket_triggers/setenabled/{path}": { + "post": { + "summary": "set enabled websocket trigger", + "operationId": "setWebsocketTriggerEnabled", + "tags": [ + "websocket_trigger" + ], + "parameters": [ + { + "$ref": "#/components/parameters/WorkspaceId" + }, + { + "$ref": "#/components/parameters/Path" + } + ], + "requestBody": { + "description": "updated websocket trigger enable", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": [ + "enabled" + ] + } + } + } + }, + "responses": { + "200": { + "description": "websocket trigger enabled set", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/groups/list": { "get": { "summary": "list instance groups", @@ -12812,6 +13301,40 @@ } } }, + "/configs/list_autoscaling_events/{worker_group}": { + "get": { + "summary": "List autoscaling events", + "operationId": "listAutoscalingEvents", + "tags": [ + "config" + ], + "parameters": [ + { + "name": "worker_group", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of autoscaling events", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AutoscalingEvent" + } + } + } + } + } + } + } + }, "/w/{workspace}/acls/get/{kind}/{path}": { "get": { "summary": "get granular acls", @@ -12842,7 +13365,8 @@ "folder", "app", "raw_app", - "http_trigger" + "http_trigger", + "websocket_trigger" ] } } @@ -12894,7 +13418,8 @@ "folder", "app", "raw_app", - "http_trigger" + "http_trigger", + "websocket_trigger" ] } } @@ -12965,7 +13490,8 @@ "folder", "app", "raw_app", - "http_trigger" + "http_trigger", + "websocket_trigger" ] } } @@ -14959,6 +15485,165 @@ } } } + }, + "/srch/index/search/service_logs": { + "get": { + "summary": "Search through service logs with a string query", + "operationId": "searchLogsIndex", + "tags": [ + "indexSearch" + ], + "parameters": [ + { + "name": "search_query", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "mode", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "worker_group", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "hostname", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "min_ts", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "max_ts", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "search results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query_parse_errors": { + "description": "a list of the terms that couldn't be parsed (and thus ignored)", + "type": "array", + "items": { + "type": "string" + } + }, + "hits": { + "description": "log files that matched the query", + "type": "array", + "items": { + "$ref": "#/components/schemas/LogSearchHit" + } + } + } + } + } + } + } + } + } + }, + "/srch/index/search/count_service_logs": { + "get": { + "summary": "Search and count the log line hits on every provided host", + "operationId": "countSearchLogsIndex", + "tags": [ + "indexSearch" + ], + "parameters": [ + { + "name": "search_query", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "hosts", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "min_ts", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "max_ts", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "search results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query_parse_errors": { + "description": "a list of the terms that couldn't be parsed (and thus ignored)", + "type": "array", + "items": { + "type": "string" + } + }, + "count_per_host": { + "description": "count of log lines that matched the query per hostname", + "type": "object" + } + } + } + } + } + } + } + } } }, "components": { @@ -16560,6 +17245,7 @@ "users.delete", "users.update", "users.login", + "users.login_failure", "users.logout", "users.accept_invite", "users.decline_invite", @@ -16571,6 +17257,7 @@ "users.impersonate", "users.leave_workspace", "oauth.login", + "oauth.login_failure", "oauth.signup", "variables.create", "variables.delete", @@ -17533,9 +18220,248 @@ }, "email_count": { "type": "number" + }, + "websocket_count": { + "type": "number" } } }, + "WebsocketTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "edited_by": { + "type": "string" + }, + "edited_at": { + "type": "string", + "format": "date-time" + }, + "script_path": { + "type": "string" + }, + "url": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "extra_perms": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "email": { + "type": "string" + }, + "workspace_id": { + "type": "string" + }, + "server_id": { + "type": "string" + }, + "last_server_ping": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ] + } + }, + "initial_messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebsocketTriggerInitialMessage" + } + }, + "url_runnable_args": { + "$ref": "#/components/schemas/ScriptArgs" + } + }, + "required": [ + "path", + "edited_by", + "edited_at", + "script_path", + "url", + "extra_perms", + "is_flow", + "email", + "workspace_id", + "enabled", + "filters", + "initial_messages", + "url_runnable_args" + ] + }, + "NewWebsocketTrigger": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ] + } + }, + "initial_messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebsocketTriggerInitialMessage" + } + }, + "url_runnable_args": { + "$ref": "#/components/schemas/ScriptArgs" + } + }, + "required": [ + "path", + "script_path", + "url", + "is_flow", + "filters", + "initial_messages", + "url_runnable_args" + ] + }, + "EditWebsocketTrigger": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "path": { + "type": "string" + }, + "script_path": { + "type": "string" + }, + "is_flow": { + "type": "boolean" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {} + }, + "required": [ + "key", + "value" + ] + } + }, + "initial_messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebsocketTriggerInitialMessage" + } + }, + "url_runnable_args": { + "$ref": "#/components/schemas/ScriptArgs" + } + }, + "required": [ + "path", + "script_path", + "url", + "is_flow", + "filters", + "initial_messages", + "url_runnable_args" + ] + }, + "WebsocketTriggerInitialMessage": { + "anyOf": [ + { + "type": "object", + "properties": { + "raw_message": { + "type": "string" + } + }, + "required": [ + "raw_message" + ] + }, + { + "type": "object", + "properties": { + "runnable_result": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "args": { + "$ref": "#/components/schemas/ScriptArgs" + }, + "is_flow": { + "type": "boolean" + } + }, + "required": [ + "path", + "args", + "is_flow" + ] + } + }, + "required": [ + "runnable_result" + ] + } + ] + }, "Group": { "type": "object", "properties": { @@ -17817,6 +18743,9 @@ }, "username": { "type": "string" + }, + "operator_only": { + "type": "boolean" } }, "required": [ @@ -18796,6 +19725,66 @@ } } }, + "LogSearchHit": { + "type": "object", + "properties": { + "dancer": { + "type": "string" + } + } + }, + "AutoscalingEvent": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "worker_group": { + "type": "string" + }, + "event_type": { + "type": "string" + }, + "desired_workers": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "applied_at": { + "type": "string", + "format": "date-time" + } + } + }, + "CriticalAlert": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier for the alert" + }, + "alert_type": { + "type": "string", + "description": "Type of alert (e.g., critical_error)" + }, + "message": { + "type": "string", + "description": "The message content of the alert" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Time when the alert was created" + }, + "acknowledged": { + "type": "boolean", + "nullable": true, + "description": "Acknowledgment status of the alert, can be true, false, or null if not set" + } + } + }, "StaticTransform": { "type": "object", "properties": { @@ -18901,6 +19890,9 @@ }, "custom_concurrency_key": { "type": "string" + }, + "is_trigger": { + "type": "boolean" } }, "required": [ @@ -18933,6 +19925,9 @@ }, "tag_override": { "type": "string" + }, + "is_trigger": { + "type": "boolean" } }, "required": [ diff --git a/backend/windmill-api/openapi-deref.yaml b/backend/windmill-api/openapi-deref.yaml index e2a0b00a85..94206795c2 100644 --- a/backend/windmill-api/openapi-deref.yaml +++ b/backend/windmill-api/openapi-deref.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.409.0 + version: 1.418.0 title: Windmill API contact: name: Windmill Team @@ -142,6 +142,7 @@ paths: - users.delete - users.update - users.login + - users.login_failure - users.logout - users.accept_invite - users.decline_invite @@ -153,6 +154,7 @@ paths: - users.impersonate - users.leave_workspace - oauth.login + - oauth.login_failure - oauth.signup - variables.create - variables.delete @@ -231,24 +233,24 @@ paths: - name: before description: filter on started before (inclusive) timestamp in: query - schema: &ref_109 + schema: &ref_118 type: string format: date-time - name: after description: filter on created after (exclusive) timestamp in: query - schema: &ref_110 + schema: &ref_119 type: string format: date-time - name: username description: filter on exact username of user in: query - schema: &ref_119 + schema: &ref_128 type: string - name: operation description: filter on exact or prefix name of operation in: query - schema: &ref_120 + schema: &ref_129 type: string - name: operations in: query @@ -263,12 +265,12 @@ paths: - name: resource description: filter on exact or prefix name of resource in: query - schema: &ref_121 + schema: &ref_130 type: string - name: action_kind description: filter on type of operation in: query - schema: &ref_122 + schema: &ref_131 type: string enum: - Create @@ -300,12 +302,12 @@ paths: application/json: schema: type: object - properties: &ref_136 + properties: &ref_143 email: type: string password: type: string - required: &ref_137 + required: &ref_144 - email - password responses: @@ -428,7 +430,7 @@ paths: application/json: schema: type: object - properties: &ref_138 + properties: &ref_145 is_admin: type: boolean operator: @@ -782,7 +784,7 @@ paths: application/json: schema: type: object - properties: &ref_172 + properties: &ref_183 email: type: string workspaces: @@ -800,7 +802,7 @@ paths: - id - name - username - required: &ref_173 + required: &ref_184 - email - workspaces /workspaces/list_as_superadmin: @@ -842,14 +844,14 @@ paths: application/json: schema: type: object - properties: &ref_174 + properties: &ref_185 id: type: string name: type: string username: type: string - required: &ref_175 + required: &ref_186 - id - name responses: @@ -1042,6 +1044,98 @@ paths: text/plain: schema: type: string + /settings/critical_alerts: + get: + summary: Get all critical alerts + operationId: getCriticalAlerts + tags: + - setting + parameters: + - in: query + name: page + schema: + type: integer + default: 1 + description: The page number to retrieve (minimum value is 1) + - in: query + name: page_size + schema: + type: integer + default: 10 + maximum: 100 + description: Number of alerts per page (maximum is 100) + - in: query + name: acknowledged + schema: + type: boolean + nullable: true + description: >- + Filter by acknowledgment status; true for acknowledged, false for + unacknowledged, and omit for all alerts + responses: + '200': + description: Successfully retrieved all critical alerts + content: + application/json: + schema: + type: array + items: + type: object + properties: &ref_228 + id: + type: integer + description: Unique identifier for the alert + alert_type: + type: string + description: Type of alert (e.g., critical_error) + message: + type: string + description: The message content of the alert + created_at: + type: string + format: date-time + description: Time when the alert was created + acknowledged: + type: boolean + nullable: true + description: >- + Acknowledgment status of the alert, can be true, false, + or null if not set + /settings/critical_alerts/{id}/acknowledge: + post: + summary: Acknowledge a critical alert + operationId: acknowledgeCriticalAlert + tags: + - setting + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The ID of the critical alert to acknowledge + responses: + '200': + description: Successfully acknowledged the critical alert + content: + application/json: + schema: + type: string + example: Critical alert acknowledged + /settings/critical_alerts/acknowledge_all: + post: + summary: Acknowledge all unacknowledged critical alerts + operationId: acknowledgeAllCriticalAlerts + tags: + - setting + responses: + '200': + description: Successfully acknowledged all unacknowledged critical alerts. + content: + application/json: + schema: + type: string + example: All unacknowledged critical alerts acknowledged /settings/test_license_key: post: summary: test license key @@ -1197,12 +1291,12 @@ paths: type: array items: type: object - properties: &ref_214 + properties: &ref_221 name: type: string value: type: object - required: &ref_215 + required: &ref_222 - name - value /users/email: @@ -1361,6 +1455,8 @@ paths: type: string username: type: string + operator_only: + type: boolean required: &ref_13 - email - login_type @@ -1784,6 +1880,11 @@ paths: description: number of items to return for a given page (default 30, max 100) in: query schema: *ref_6 + - name: active_only + in: query + description: filter only active users + schema: + type: boolean responses: '200': description: user @@ -1932,7 +2033,7 @@ paths: type: array items: type: object - properties: &ref_198 + properties: &ref_205 script_path: type: string git_repo_resource_path: @@ -1957,7 +2058,7 @@ paths: - schedule - user - group - required: &ref_199 + required: &ref_206 - script_path - git_repo_resource_path deploy_ui: @@ -2639,6 +2740,32 @@ paths: text/plain: schema: type: number + /w/{workspace}/workspaces/used_triggers: + get: + summary: get used triggers + operationId: getUsedTriggers + tags: + - workspace + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + responses: + '200': + description: status + content: + application/json: + schema: + type: object + properties: + http_routes_used: + type: boolean + websocket_used: + type: boolean + required: + - http_routes_used + - websocket_used /w/{workspace}/users/list: get: summary: list users @@ -2681,7 +2808,7 @@ paths: type: array items: type: object - properties: &ref_135 + properties: &ref_142 email: type: string executions: @@ -2742,7 +2869,7 @@ paths: application/json: schema: type: object - properties: &ref_139 + properties: &ref_146 label: type: string expiration: @@ -2774,7 +2901,7 @@ paths: application/json: schema: type: object - properties: &ref_140 + properties: &ref_147 label: type: string expiration: @@ -2784,7 +2911,7 @@ paths: type: string workspace_id: type: string - required: &ref_141 + required: &ref_148 - impersonate_email responses: '201': @@ -2909,7 +3036,7 @@ paths: application/json: schema: type: object - properties: &ref_144 + properties: &ref_151 path: type: string value: @@ -2925,7 +3052,7 @@ paths: expires_at: type: string format: date-time - required: &ref_145 + required: &ref_152 - path - value - is_secret @@ -3010,7 +3137,7 @@ paths: application/json: schema: type: object - properties: &ref_146 + properties: &ref_153 path: type: string value: @@ -3195,7 +3322,7 @@ paths: type: array items: type: object - properties: &ref_142 + properties: &ref_149 name: type: string value: @@ -3204,7 +3331,7 @@ paths: type: string is_custom: type: boolean - required: &ref_143 + required: &ref_150 - name - value - description @@ -3344,7 +3471,7 @@ paths: application/json: schema: type: object - properties: &ref_191 + properties: &ref_198 access_token: type: string expires_in: @@ -3355,7 +3482,7 @@ paths: type: array items: type: string - required: &ref_192 + required: &ref_199 - access_token /w/{workspace}/oauth/create_account: post: @@ -3560,7 +3687,7 @@ paths: application/json: schema: type: object - properties: &ref_153 + properties: &ref_160 path: type: string value: {} @@ -3568,7 +3695,7 @@ paths: type: string resource_type: type: string - required: &ref_154 + required: &ref_161 - path - value - resource_type @@ -3623,7 +3750,7 @@ paths: application/json: schema: type: object - properties: &ref_155 + properties: &ref_162 path: type: string description: @@ -3689,7 +3816,7 @@ paths: application/json: schema: type: object - properties: &ref_156 + properties: &ref_163 workspace_id: type: string path: @@ -3710,7 +3837,7 @@ paths: edited_at: type: string format: date-time - required: &ref_157 + required: &ref_164 - path - resource_type - is_oauth @@ -3826,7 +3953,7 @@ paths: type: array items: type: object - properties: &ref_158 + properties: &ref_165 workspace_id: type: string path: @@ -3857,7 +3984,7 @@ paths: edited_at: type: string format: date-time - required: &ref_159 + required: &ref_166 - path - resource_type - is_oauth @@ -3904,7 +4031,7 @@ paths: - name: name in: path required: true - schema: &ref_92 + schema: &ref_101 type: string responses: '200': @@ -4026,7 +4153,7 @@ paths: application/json: schema: type: object - properties: &ref_160 + properties: &ref_167 schema: {} description: type: string @@ -4254,14 +4381,14 @@ paths: properties: flow: type: object - properties: &ref_50 + properties: &ref_52 summary: type: string description: type: string value: type: object - properties: &ref_58 + properties: &ref_64 modules: type: array items: @@ -4270,32 +4397,32 @@ paths: id: type: string value: - oneOf: &ref_239 + oneOf: &ref_249 - type: object - properties: &ref_223 + properties: &ref_233 input_transforms: type: object additionalProperties: oneOf: &ref_29 - type: object - properties: &ref_219 + properties: &ref_229 value: {} type: type: string enum: - javascript - required: &ref_220 + required: &ref_230 - expr - type - type: object - properties: &ref_221 + properties: &ref_231 expr: type: string type: type: string enum: - javascript - required: &ref_222 + required: &ref_232 - expr - type discriminator: &ref_30 @@ -4338,13 +4465,15 @@ paths: type: number custom_concurrency_key: type: string - required: &ref_224 + is_trigger: + type: boolean + required: &ref_234 - type - content - language - input_transforms - type: object - properties: &ref_225 + properties: &ref_235 input_transforms: type: object additionalProperties: @@ -4360,12 +4489,14 @@ paths: - script tag_override: type: string - required: &ref_226 + is_trigger: + type: boolean + required: &ref_236 - type - path - input_transforms - type: object - properties: &ref_227 + properties: &ref_237 input_transforms: type: object additionalProperties: @@ -4377,12 +4508,12 @@ paths: type: string enum: - flow - required: &ref_228 + required: &ref_238 - type - path - input_transforms - type: object - properties: &ref_229 + properties: &ref_239 modules: type: array items: @@ -4404,13 +4535,13 @@ paths: type: boolean parallelism: type: integer - required: &ref_230 + required: &ref_240 - modules - iterator - skip_failures - type - type: object - properties: &ref_231 + properties: &ref_241 modules: type: array items: @@ -4427,12 +4558,12 @@ paths: type: boolean parallelism: type: integer - required: &ref_232 + required: &ref_242 - modules - skip_failures - type - type: object - properties: &ref_233 + properties: &ref_243 branches: type: array items: @@ -4463,12 +4594,12 @@ paths: type: string enum: - branchone - required: &ref_234 + required: &ref_244 - branches - default - type - type: object - properties: &ref_235 + properties: &ref_245 branches: type: array items: @@ -4493,20 +4624,20 @@ paths: - branchall parallel: type: boolean - required: &ref_236 + required: &ref_246 - branches - type - type: object - properties: &ref_237 + properties: &ref_247 type: type: string enum: - identity flow: type: boolean - required: &ref_238 + required: &ref_248 - type - discriminator: &ref_240 + discriminator: &ref_250 propertyName: type mapping: rawscript: '#/components/schemas/RawScript' @@ -4588,7 +4719,7 @@ paths: type: boolean retry: type: object - properties: &ref_87 + properties: &ref_93 constant: type: object properties: @@ -4634,11 +4765,11 @@ paths: type: number early_return: type: string - required: &ref_59 + required: &ref_65 - modules schema: type: object - required: &ref_51 + required: &ref_53 - summary - value /apps/hub/list: @@ -4945,12 +5076,12 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: &ref_48 + schema: &ref_50 type: boolean - name: created_by description: mask to filter exact matching user creator in: query - schema: &ref_49 + schema: &ref_51 type: string - name: path_start description: mask to filter matching starting path @@ -5611,7 +5742,7 @@ paths: application/json: schema: type: object - properties: &ref_53 + properties: &ref_57 primary_schedule: type: object properties: @@ -5625,6 +5756,8 @@ paths: type: number email_count: type: number + websocket_count: + type: number /w/{workspace}/scripts/list_tokens/{path}: get: summary: get tokens with script scope @@ -5672,7 +5805,7 @@ paths: content: application/json: schema: - allOf: &ref_126 + allOf: &ref_135 - type: object properties: *ref_40 required: *ref_41 @@ -5710,13 +5843,38 @@ paths: type: array items: type: object - properties: &ref_127 + properties: &ref_42 script_hash: type: string deployment_msg: type: string - required: &ref_128 + required: &ref_43 - script_hash + /w/{workspace}/scripts/get_latest_version/{path}: + get: + summary: get scripts's latest version (hash) + operationId: getScriptLatestVersion + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_33 + tags: + - script + responses: + '200': + description: Script version/hash + content: + application/json: + required: false + schema: + type: object + properties: *ref_42 + required: *ref_43 /w/{workspace}/scripts/history_update/h/{hash}/p/{path}: post: summary: update history of a script @@ -5791,7 +5949,7 @@ paths: - name: token in: path required: true - schema: &ref_115 + schema: &ref_124 type: string - name: path in: path @@ -5939,20 +6097,20 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: &ref_42 + schema: &ref_44 type: string format: uuid - name: tag description: Override the tag to use in: query - schema: &ref_44 + schema: &ref_46 type: string - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: &ref_45 + schema: &ref_47 type: string - name: job_id description: >- @@ -5961,7 +6119,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: &ref_43 + schema: &ref_45 type: string format: uuid - name: invisible_to_owner @@ -6005,7 +6163,7 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6013,7 +6171,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6022,14 +6180,14 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: &ref_46 + schema: &ref_48 type: string - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: &ref_47 + schema: &ref_49 type: string requestBody: description: script args @@ -6065,17 +6223,17 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_45 + schema: *ref_47 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6083,7 +6241,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6092,13 +6250,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_47 + schema: *ref_49 requestBody: description: script args required: true @@ -6132,17 +6290,17 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_45 + schema: *ref_47 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6150,7 +6308,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6159,13 +6317,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_47 + schema: *ref_49 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -6173,7 +6331,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: &ref_86 + schema: &ref_92 type: string responses: '200': @@ -6204,13 +6362,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_47 + schema: *ref_49 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6218,7 +6376,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 requestBody: description: script args required: true @@ -6256,13 +6414,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_47 + schema: *ref_49 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6270,7 +6428,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 requestBody: description: script args required: true @@ -6381,11 +6539,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: path_start description: mask to filter matching starting path in: query @@ -6439,12 +6597,12 @@ paths: type: array items: allOf: - - allOf: &ref_52 + - allOf: &ref_56 - type: object - properties: *ref_50 - required: *ref_51 + properties: *ref_52 + required: *ref_53 - type: object - properties: &ref_177 + properties: &ref_188 workspace_id: type: string path: @@ -6458,7 +6616,7 @@ paths: type: boolean extra_perms: type: object - additionalProperties: &ref_176 + additionalProperties: &ref_187 type: boolean starred: type: boolean @@ -6476,7 +6634,7 @@ paths: type: number visible_to_runner_only: type: boolean - required: &ref_178 + required: &ref_189 - path - edited_by - edited_at @@ -6512,7 +6670,7 @@ paths: type: array items: type: object - properties: &ref_189 + properties: &ref_54 id: type: integer created_at: @@ -6520,9 +6678,34 @@ paths: format: date-time deployment_msg: type: string - required: &ref_190 + required: &ref_55 - id - created_at + /w/{workspace}/flows/get_latest_version/{path}: + get: + summary: get flow's latest version + operationId: getFlowLatestVersion + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_33 + tags: + - flow + responses: + '200': + description: Flow version + content: + application/json: + required: false + schema: + type: object + properties: *ref_54 + required: *ref_55 /w/{workspace}/flows/get/v/{version}/p/{path}: get: summary: get flow version @@ -6550,7 +6733,7 @@ paths: content: application/json: schema: - allOf: *ref_52 + allOf: *ref_56 /w/{workspace}/flows/history_update/v/{version}/p/{path}: post: summary: update flow history @@ -6616,7 +6799,7 @@ paths: content: application/json: schema: - allOf: *ref_52 + allOf: *ref_56 /w/{workspace}/flows/get_triggers_count/{path}: get: summary: get triggers count of flow @@ -6639,7 +6822,7 @@ paths: application/json: schema: type: object - properties: *ref_53 + properties: *ref_57 /w/{workspace}/flows/list_tokens/{path}: get: summary: get tokens with flow scope @@ -6720,11 +6903,11 @@ paths: application/json: schema: allOf: - - allOf: *ref_52 + - allOf: *ref_56 - type: object properties: draft: - allOf: *ref_52 + allOf: *ref_56 /w/{workspace}/flows/exists/{path}: get: summary: exists flow by path @@ -6765,10 +6948,10 @@ paths: application/json: schema: allOf: - - allOf: &ref_54 + - allOf: &ref_58 - type: object - properties: *ref_50 - required: *ref_51 + properties: *ref_52 + required: *ref_53 - type: object properties: path: @@ -6822,7 +7005,7 @@ paths: application/json: schema: allOf: - - allOf: *ref_54 + - allOf: *ref_58 - type: object properties: deployment_message: @@ -6910,11 +7093,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: path_start description: mask to filter matching starting path in: query @@ -6941,7 +7124,7 @@ paths: type: array items: type: object - properties: &ref_184 + properties: &ref_195 workspace_id: type: string path: @@ -6959,7 +7142,7 @@ paths: edited_at: type: string format: date-time - required: &ref_185 + required: &ref_196 - workspace_id - path - summary @@ -7002,7 +7185,7 @@ paths: - name: version in: path required: true - schema: &ref_114 + schema: &ref_123 type: number - name: path in: path @@ -7064,11 +7247,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: path_start description: mask to filter matching starting path in: query @@ -7109,7 +7292,7 @@ paths: type: array items: type: object - properties: &ref_182 + properties: &ref_193 id: type: integer workspace_id: @@ -7135,7 +7318,7 @@ paths: - viewer - publisher - anonymous - required: &ref_183 + required: &ref_194 - id - workspace_id - path @@ -7170,7 +7353,7 @@ paths: type: string policy: type: object - properties: &ref_55 + properties: &ref_59 triggerables: type: object additionalProperties: @@ -7253,7 +7436,7 @@ paths: application/json: schema: type: object - properties: &ref_56 + properties: &ref_60 id: type: integer workspace_id: @@ -7275,7 +7458,7 @@ paths: type: object policy: type: object - properties: *ref_55 + properties: *ref_59 execution_mode: type: string enum: @@ -7286,7 +7469,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_57 + required: &ref_61 - id - workspace_id - path @@ -7319,10 +7502,10 @@ paths: content: application/json: schema: - allOf: &ref_186 + allOf: &ref_197 - type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_60 + required: *ref_61 - type: object properties: draft_only: @@ -7352,13 +7535,38 @@ paths: type: array items: type: object - properties: &ref_187 + properties: &ref_62 version: type: integer deployment_msg: type: string - required: &ref_188 + required: &ref_63 - version + /w/{workspace}/apps/get_latest_version/{path}: + get: + summary: get apps's latest version + operationId: getAppLatestVersion + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_33 + tags: + - app + responses: + '200': + description: App version + content: + application/json: + required: false + schema: + type: object + properties: *ref_62 + required: *ref_63 /w/{workspace}/apps/history_update/a/{id}/v/{version}: post: summary: update app history @@ -7377,7 +7585,7 @@ paths: - name: version in: path required: true - schema: &ref_116 + schema: &ref_125 type: integer requestBody: description: App deployment message @@ -7418,8 +7626,8 @@ paths: application/json: schema: type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_60 + required: *ref_61 /w/{workspace}/apps_u/public_resource/{path}: get: summary: get public resource @@ -7485,8 +7693,8 @@ paths: application/json: schema: type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_60 + required: *ref_61 /w/{workspace}/raw_apps/create: post: summary: create raw app @@ -7633,7 +7841,7 @@ paths: value: {} policy: type: object - properties: *ref_55 + properties: *ref_59 deployment_message: type: string responses: @@ -7741,11 +7949,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -7753,7 +7961,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -7762,7 +7970,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -7798,7 +8006,7 @@ paths: - name: id in: path required: true - schema: &ref_83 + schema: &ref_89 type: string format: uuid - name: step_id @@ -7831,11 +8039,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -7843,7 +8051,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -7852,7 +8060,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -7910,17 +8118,17 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 - name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_45 + schema: *ref_47 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -7928,7 +8136,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -7937,7 +8145,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -7977,7 +8185,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -7990,7 +8198,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 requestBody: description: preview required: true @@ -7998,7 +8206,7 @@ paths: application/json: schema: type: object - properties: &ref_147 + properties: &ref_154 content: type: string path: @@ -8037,7 +8245,7 @@ paths: type: boolean lock: type: string - required: &ref_148 + required: &ref_155 - args responses: '201': @@ -8075,11 +8283,11 @@ paths: application/json: schema: type: object - properties: &ref_149 + properties: &ref_156 args: type: object additionalProperties: *ref_16 - required: &ref_150 + required: &ref_157 - args responses: '201': @@ -8112,7 +8320,7 @@ paths: type: array items: type: object - properties: &ref_208 + properties: &ref_215 raw_code: type: string path: @@ -8136,7 +8344,7 @@ paths: - php - rust - ansible - required: &ref_209 + required: &ref_216 - raw_code - path - language @@ -8176,7 +8384,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -8189,7 +8397,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 requestBody: description: preview required: true @@ -8197,11 +8405,11 @@ paths: application/json: schema: type: object - properties: &ref_179 + properties: &ref_190 value: type: object - properties: *ref_58 - required: *ref_59 + properties: *ref_64 + required: *ref_65 path: type: string args: @@ -8211,7 +8419,7 @@ paths: type: string restarted_from: type: object - properties: &ref_181 + properties: &ref_192 flow_job_id: type: string format: uuid @@ -8219,7 +8427,7 @@ paths: type: string branch_or_iteration_n: type: integer - required: &ref_180 + required: &ref_191 - value - content - args @@ -8245,94 +8453,94 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: script_path_exact description: mask to filter exact matching path in: query - schema: &ref_62 + schema: &ref_68 type: string - name: script_path_start description: mask to filter matching starting path in: query - schema: &ref_63 + schema: &ref_69 type: string - name: schedule_path description: mask to filter by schedule path in: query - schema: &ref_64 + schema: &ref_70 type: string - name: script_hash description: mask to filter exact matching path in: query - schema: &ref_65 + schema: &ref_71 type: string - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: &ref_66 + schema: &ref_72 type: string format: date-time - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: &ref_67 + schema: &ref_73 type: string format: date-time - name: success description: filter on successful jobs in: query - schema: &ref_68 + schema: &ref_74 type: boolean - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: &ref_69 + schema: &ref_75 type: boolean - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: &ref_70 + schema: &ref_76 type: string - name: suspended description: filter on suspended jobs in: query - schema: &ref_71 + schema: &ref_77 type: boolean - name: running description: filter on running jobs in: query - schema: &ref_72 + schema: &ref_78 type: boolean - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: &ref_73 + schema: &ref_79 type: string - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: &ref_74 + schema: &ref_80 type: string - name: tag description: filter on jobs with a given tag/worker group in: query - schema: &ref_75 + schema: &ref_81 type: string - name: page description: which page to return (start at 1, default 1) @@ -8363,7 +8571,7 @@ paths: type: array items: type: object - properties: &ref_81 + properties: &ref_87 workspace_id: type: string id: @@ -8430,14 +8638,14 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: &ref_76 + properties: &ref_82 step: type: integer modules: type: array items: type: object - properties: &ref_60 + properties: &ref_66 type: type: string enum: @@ -8514,20 +8722,20 @@ paths: format: uuid skipped: type: boolean - required: &ref_61 + required: &ref_67 - type user_states: additionalProperties: true preprocessor_module: allOf: - type: object - properties: *ref_60 - required: *ref_61 + properties: *ref_66 + required: *ref_67 failure_module: allOf: - type: object - properties: *ref_60 - required: *ref_61 + properties: *ref_66 + required: *ref_67 - type: object properties: parent_module: @@ -8542,14 +8750,14 @@ paths: items: type: string format: uuid - required: &ref_77 + required: &ref_83 - step - modules - failure_module raw_flow: type: object - properties: *ref_58 - required: *ref_59 + properties: *ref_64 + required: *ref_65 is_flow_step: type: boolean language: @@ -8587,7 +8795,7 @@ paths: type: number suspend: type: number - required: &ref_82 + required: &ref_88 - id - running - canceled @@ -8666,79 +8874,79 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_62 + schema: *ref_68 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_63 + schema: *ref_69 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_64 + schema: *ref_70 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_65 + schema: *ref_71 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_66 + schema: *ref_72 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_67 + schema: *ref_73 - name: success description: filter on successful jobs in: query - schema: *ref_68 + schema: *ref_74 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_75 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_70 + schema: *ref_76 - name: suspended description: filter on suspended jobs in: query - schema: *ref_71 + schema: *ref_77 - name: running description: filter on running jobs in: query - schema: *ref_72 + schema: *ref_78 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_74 + schema: *ref_80 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_75 + schema: *ref_81 - name: page description: which page to return (start at 1, default 1) in: query @@ -8816,75 +9024,75 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: &ref_78 + schema: &ref_84 type: string - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_62 + schema: *ref_68 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_63 + schema: *ref_69 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_64 + schema: *ref_70 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_65 + schema: *ref_71 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_66 + schema: *ref_72 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_67 + schema: *ref_73 - name: success description: filter on successful jobs in: query - schema: *ref_68 + schema: *ref_74 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_70 + schema: *ref_76 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_74 + schema: *ref_80 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_75 + schema: *ref_81 - name: page description: which page to return (start at 1, default 1) in: query @@ -8922,7 +9130,7 @@ paths: type: array items: type: object - properties: &ref_79 + properties: &ref_85 workspace_id: type: string id: @@ -8988,12 +9196,12 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: *ref_76 - required: *ref_77 + properties: *ref_82 + required: *ref_83 raw_flow: type: object - properties: *ref_58 - required: *ref_59 + properties: *ref_64 + required: *ref_65 is_flow_step: type: boolean language: @@ -9035,7 +9243,7 @@ paths: type: number aggregate_wait_time_ms: type: number - required: &ref_80 + required: &ref_86 - id - created_by - duration_ms @@ -9064,54 +9272,54 @@ paths: - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_78 + schema: *ref_84 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_62 + schema: *ref_68 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_63 + schema: *ref_69 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_64 + schema: *ref_70 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_65 + schema: *ref_71 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_66 + schema: *ref_72 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_67 + schema: *ref_73 - name: created_before description: filter on created before (inclusive) timestamp in: query - schema: &ref_117 + schema: &ref_126 type: string format: date-time - name: created_after description: filter on created after (exclusive) timestamp in: query - schema: &ref_118 + schema: &ref_127 type: string format: date-time - name: created_or_started_before @@ -9119,23 +9327,23 @@ paths: filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: &ref_111 + schema: &ref_120 type: string format: date-time - name: running description: filter on running jobs in: query - schema: *ref_72 + schema: *ref_78 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_75 - name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: &ref_112 + schema: &ref_121 type: string format: date-time - name: created_or_started_after_completed_jobs @@ -9144,7 +9352,7 @@ paths: otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: &ref_113 + schema: &ref_122 type: string format: date-time - name: job_kinds @@ -9152,27 +9360,27 @@ paths: filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_70 + schema: *ref_76 - name: suspended description: filter on suspended jobs in: query - schema: *ref_71 + schema: *ref_77 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_75 + schema: *ref_81 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_74 + schema: *ref_80 - name: page description: which page to return (start at 1, default 1) in: query @@ -9221,11 +9429,11 @@ paths: schema: type: array items: - oneOf: &ref_84 + oneOf: &ref_90 - allOf: - type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_85 + required: *ref_86 - type: object properties: type: @@ -9234,15 +9442,15 @@ paths: - CompletedJob - allOf: - type: object - properties: *ref_81 - required: *ref_82 + properties: *ref_87 + required: *ref_88 - type: object properties: type: type: string enum: - QueuedJob - discriminator: &ref_85 + discriminator: &ref_91 propertyName: type /jobs/db_clock: get: @@ -9309,7 +9517,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: no_logs in: query schema: @@ -9320,8 +9528,8 @@ paths: content: application/json: schema: - oneOf: *ref_84 - discriminator: *ref_85 + oneOf: *ref_90 + discriminator: *ref_91 /w/{workspace}/jobs_u/get_root_job_id/{id}: get: summary: get root job id @@ -9336,7 +9544,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: get root job id @@ -9358,7 +9566,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: job details @@ -9380,7 +9588,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: job args @@ -9401,7 +9609,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: running in: query schema: @@ -9436,9 +9644,9 @@ paths: type: integer flow_status: type: object - additionalProperties: &ref_151 + additionalProperties: &ref_158 type: object - properties: &ref_152 + properties: &ref_159 scheduled_for: type: string format: date-time @@ -9485,7 +9693,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: flow debug info details @@ -9506,7 +9714,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: job details @@ -9514,8 +9722,8 @@ paths: application/json: schema: type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_85 + required: *ref_86 /w/{workspace}/jobs_u/completed/get_result/{id}: get: summary: get completed job result @@ -9530,7 +9738,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: suspended_job in: query schema: @@ -9567,10 +9775,10 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: get_started in: query - schema: &ref_124 + schema: &ref_133 type: boolean responses: '200': @@ -9604,7 +9812,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: job details @@ -9612,8 +9820,8 @@ paths: application/json: schema: type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_85 + required: *ref_86 /w/{workspace}/jobs_u/queue/cancel/{id}: post: summary: cancel queued or running job @@ -9628,7 +9836,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 requestBody: description: reason required: true @@ -9692,7 +9900,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 requestBody: description: reason required: true @@ -9724,7 +9932,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -9755,7 +9963,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -9797,7 +10005,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -9805,7 +10013,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_86 + schema: *ref_92 - name: resume_id in: path required: true @@ -9840,7 +10048,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -9882,7 +10090,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: key in: path required: true @@ -9914,7 +10122,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: key in: path required: true @@ -9940,7 +10148,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 requestBody: required: true content: @@ -9968,7 +10176,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -10003,7 +10211,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -10045,7 +10253,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 - name: resume_id in: path required: true @@ -10069,8 +10277,8 @@ paths: type: object properties: job: - oneOf: *ref_84 - discriminator: *ref_85 + oneOf: *ref_90 + discriminator: *ref_91 approvers: type: array items: @@ -10135,7 +10343,7 @@ paths: application/json: schema: type: object - properties: &ref_162 + properties: &ref_169 path: type: string schedule: @@ -10176,7 +10384,7 @@ paths: type: boolean retry: type: object - properties: *ref_87 + properties: *ref_93 no_flow_overlap: type: boolean summary: @@ -10186,7 +10394,7 @@ paths: paused_until: type: string format: date-time - required: &ref_163 + required: &ref_170 - path - schedule - timezone @@ -10222,7 +10430,7 @@ paths: application/json: schema: type: object - properties: &ref_164 + properties: &ref_171 schedule: type: string timezone: @@ -10255,7 +10463,7 @@ paths: type: boolean retry: type: object - properties: *ref_87 + properties: *ref_93 no_flow_overlap: type: boolean summary: @@ -10265,7 +10473,7 @@ paths: paused_until: type: string format: date-time - required: &ref_165 + required: &ref_172 - schedule - timezone - script_path @@ -10356,7 +10564,7 @@ paths: application/json: schema: type: object - properties: &ref_88 + properties: &ref_94 path: type: string edited_by: @@ -10410,7 +10618,7 @@ paths: type: boolean retry: type: object - properties: *ref_87 + properties: *ref_93 summary: type: string no_flow_overlap: @@ -10420,7 +10628,7 @@ paths: paused_until: type: string format: date-time - required: &ref_89 + required: &ref_95 - path - edited_by - edited_at @@ -10477,7 +10685,7 @@ paths: filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 - name: path description: filter by path in: query @@ -10500,8 +10708,8 @@ paths: type: array items: type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_94 + required: *ref_95 /w/{workspace}/schedules/list_with_jobs: get: summary: list schedules with last 20 jobs @@ -10529,10 +10737,10 @@ paths: schema: type: array items: - allOf: &ref_161 + allOf: &ref_168 - type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_94 + required: *ref_95 - type: object properties: jobs: @@ -10611,7 +10819,7 @@ paths: application/json: schema: type: object - properties: &ref_166 + properties: &ref_173 path: type: string script_path: @@ -10632,7 +10840,7 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_167 + required: &ref_174 - path - script_path - route_path @@ -10669,7 +10877,7 @@ paths: application/json: schema: type: object - properties: &ref_168 + properties: &ref_175 path: type: string script_path: @@ -10690,7 +10898,7 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_169 + required: &ref_176 - path - script_path - is_flow @@ -10749,7 +10957,7 @@ paths: application/json: schema: type: object - properties: &ref_90 + properties: &ref_96 path: type: string edited_by: @@ -10783,7 +10991,7 @@ paths: type: boolean requires_auth: type: boolean - required: &ref_91 + required: &ref_97 - path - edited_by - edited_at @@ -10837,8 +11045,8 @@ paths: type: array items: type: object - properties: *ref_90 - required: *ref_91 + properties: *ref_96 + required: *ref_97 /w/{workspace}/http_triggers/exists/{path}: get: summary: does http trigger exists @@ -10901,24 +11109,362 @@ paths: application/json: schema: type: boolean - /w/{workspace}/http_triggers/used: - get: - summary: whether http triggers are used - operationId: used + /w/{workspace}/websocket_triggers/create: + post: + summary: create websocket trigger + operationId: createWebsocketTrigger tags: - - http_trigger + - websocket_trigger parameters: - name: workspace in: path required: true schema: *ref_0 + requestBody: + description: new websocket trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_177 + path: + type: string + script_path: + type: string + is_flow: + type: boolean + url: + type: string + enabled: + type: boolean + filters: + type: array + items: + type: object + properties: + key: + type: string + value: {} + required: + - key + - value + initial_messages: + type: array + items: + anyOf: &ref_98 + - type: object + properties: + raw_message: + type: string + required: + - raw_message + - type: object + properties: + runnable_result: + type: object + properties: + path: + type: string + args: + type: object + additionalProperties: *ref_16 + is_flow: + type: boolean + required: + - path + - args + - is_flow + required: + - runnable_result + url_runnable_args: + type: object + additionalProperties: *ref_16 + required: &ref_178 + - path + - script_path + - url + - is_flow + - filters + - initial_messages + - url_runnable_args + responses: + '201': + description: websocket trigger created + content: + text/plain: + schema: + type: string + /w/{workspace}/websocket_triggers/update/{path}: + post: + summary: update websocket trigger + operationId: updateWebsocketTrigger + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_21 + requestBody: + description: updated trigger + required: true + content: + application/json: + schema: + type: object + properties: &ref_179 + url: + type: string + path: + type: string + script_path: + type: string + is_flow: + type: boolean + filters: + type: array + items: + type: object + properties: + key: + type: string + value: {} + required: + - key + - value + initial_messages: + type: array + items: + anyOf: *ref_98 + url_runnable_args: + type: object + additionalProperties: *ref_16 + required: &ref_180 + - path + - script_path + - url + - is_flow + - filters + - initial_messages + - url_runnable_args responses: '200': - description: whether http triggers are used + description: websocket trigger updated + content: + text/plain: + schema: + type: string + /w/{workspace}/websocket_triggers/delete/{path}: + delete: + summary: delete websocket trigger + operationId: deleteWebsocketTrigger + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_21 + responses: + '200': + description: websocket trigger deleted + content: + text/plain: + schema: + type: string + /w/{workspace}/websocket_triggers/get/{path}: + get: + summary: get websocket trigger + operationId: getWebsocketTrigger + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_21 + responses: + '200': + description: websocket trigger deleted + content: + application/json: + schema: + type: object + properties: &ref_99 + path: + type: string + edited_by: + type: string + edited_at: + type: string + format: date-time + script_path: + type: string + url: + type: string + is_flow: + type: boolean + extra_perms: + type: object + additionalProperties: + type: boolean + email: + type: string + workspace_id: + type: string + server_id: + type: string + last_server_ping: + type: string + format: date-time + error: + type: string + enabled: + type: boolean + filters: + type: array + items: + type: object + properties: + key: + type: string + value: {} + required: + - key + - value + initial_messages: + type: array + items: + anyOf: *ref_98 + url_runnable_args: + type: object + additionalProperties: *ref_16 + required: &ref_100 + - path + - edited_by + - edited_at + - script_path + - url + - extra_perms + - is_flow + - email + - workspace_id + - enabled + - filters + - initial_messages + - url_runnable_args + /w/{workspace}/websocket_triggers/list: + get: + summary: list websocket triggers + operationId: listWebsocketTriggers + tags: + - websocket_trigger + parameters: + - required: true + name: workspace + in: path + schema: *ref_0 + - name: page + description: which page to return (start at 1, default 1) + in: query + schema: *ref_5 + - name: per_page + description: number of items to return for a given page (default 30, max 100) + in: query + schema: *ref_6 + - name: path + description: filter by path + in: query + schema: + type: string + - name: is_flow + in: query + schema: + type: boolean + - name: path_start + in: query + schema: + type: string + responses: + '200': + description: websocket trigger list + content: + application/json: + schema: + type: array + items: + type: object + properties: *ref_99 + required: *ref_100 + /w/{workspace}/websocket_triggers/exists/{path}: + get: + summary: does websocket trigger exists + operationId: existsWebsocketTrigger + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_21 + responses: + '200': + description: websocket trigger exists content: application/json: schema: type: boolean + /w/{workspace}/websocket_triggers/setenabled/{path}: + post: + summary: set enabled websocket trigger + operationId: setWebsocketTriggerEnabled + tags: + - websocket_trigger + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: path + in: path + required: true + schema: *ref_21 + requestBody: + description: updated websocket trigger enable + required: true + content: + application/json: + schema: + type: object + properties: + enabled: + type: boolean + required: + - enabled + responses: + '200': + description: websocket trigger enabled set + content: + text/plain: + schema: + type: string /groups/list: get: summary: list instance groups @@ -10934,7 +11480,7 @@ paths: type: array items: type: object - properties: &ref_93 + properties: &ref_102 name: type: string summary: @@ -10943,7 +11489,7 @@ paths: type: array items: type: string - required: &ref_94 + required: &ref_103 - name /groups/get/{name}: get: @@ -10955,7 +11501,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: instance group @@ -10963,8 +11509,8 @@ paths: application/json: schema: type: object - properties: *ref_93 - required: *ref_94 + properties: *ref_102 + required: *ref_103 /groups/create: post: summary: create instance group @@ -11002,7 +11548,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: update instance group required: true @@ -11032,7 +11578,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: instance group deleted @@ -11050,7 +11596,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: user to add to instance group required: true @@ -11080,7 +11626,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: user to remove from instance group required: true @@ -11115,7 +11661,7 @@ paths: type: array items: type: object - properties: &ref_95 + properties: &ref_104 name: type: string summary: @@ -11130,7 +11676,7 @@ paths: type: string external_id: type: string - required: &ref_96 + required: &ref_105 - name /groups/overwrite: post: @@ -11147,8 +11693,8 @@ paths: type: array items: type: object - properties: *ref_95 - required: *ref_96 + properties: *ref_104 + required: *ref_105 responses: '200': description: success message @@ -11184,7 +11730,7 @@ paths: type: array items: type: object - properties: &ref_97 + properties: &ref_106 name: type: string summary: @@ -11197,7 +11743,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_98 + required: &ref_107 - name /w/{workspace}/groups/listnames: get: @@ -11270,7 +11816,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: updated group required: true @@ -11302,7 +11848,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: group deleted @@ -11324,7 +11870,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: group @@ -11332,8 +11878,8 @@ paths: application/json: schema: type: object - properties: *ref_97 - required: *ref_98 + properties: *ref_106 + required: *ref_107 /w/{workspace}/groups/adduser/{name}: post: summary: add user to group @@ -11348,7 +11894,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: added user to group required: true @@ -11380,7 +11926,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: added user to group required: true @@ -11426,7 +11972,7 @@ paths: type: array items: type: object - properties: &ref_99 + properties: &ref_108 name: type: string owners: @@ -11444,7 +11990,7 @@ paths: edited_at: type: string format: date-time - required: &ref_100 + required: &ref_109 - name - owners - extra_perms @@ -11526,7 +12072,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: update folder required: true @@ -11565,7 +12111,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: folder deleted @@ -11587,7 +12133,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: folder @@ -11595,8 +12141,8 @@ paths: application/json: schema: type: object - properties: *ref_99 - required: *ref_100 + properties: *ref_108 + required: *ref_109 /w/{workspace}/folders/getusage/{name}: get: summary: get folder usage @@ -11611,7 +12157,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: folder @@ -11653,7 +12199,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: owner user to folder required: true @@ -11687,7 +12233,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: added owner to folder required: true @@ -11741,7 +12287,7 @@ paths: type: array items: type: object - properties: &ref_170 + properties: &ref_181 worker: type: string worker_instance: @@ -11783,7 +12329,7 @@ paths: type: number wm_memory_usage: type: number - required: &ref_171 + required: &ref_182 - worker - worker_instance - ping_at @@ -11876,7 +12422,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: a config @@ -11893,7 +12439,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 requestBody: description: worker group required: true @@ -11916,7 +12462,7 @@ paths: - name: name in: path required: true - schema: *ref_92 + schema: *ref_101 responses: '200': description: Delete config @@ -11939,13 +12485,49 @@ paths: type: array items: type: object - properties: &ref_216 + properties: &ref_223 name: type: string config: type: object - required: &ref_217 + required: &ref_224 - name + /configs/list_autoscaling_events/{worker_group}: + get: + summary: List autoscaling events + operationId: listAutoscalingEvents + tags: + - config + parameters: + - name: worker_group + in: path + required: true + schema: + type: string + responses: + '200': + description: List of autoscaling events + content: + application/json: + schema: + type: array + items: + type: object + properties: &ref_227 + id: + type: integer + format: int64 + worker_group: + type: string + event_type: + type: string + desired_workers: + type: integer + reason: + type: string + applied_at: + type: string + format: date-time /w/{workspace}/acls/get/{kind}/{path}: get: summary: get granular acls @@ -11977,6 +12559,7 @@ paths: - app - raw_app - http_trigger + - websocket_trigger responses: '200': description: acls @@ -12017,6 +12600,7 @@ paths: - app - raw_app - http_trigger + - websocket_trigger requestBody: description: acl to add required: true @@ -12069,6 +12653,7 @@ paths: - app - raw_app - http_trigger + - websocket_trigger requestBody: description: acl to add required: true @@ -12217,13 +12802,13 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: &ref_101 + schema: &ref_110 type: string - name: runnable_type in: query - schema: &ref_102 + schema: &ref_111 type: string - enum: &ref_133 + enum: &ref_140 - ScriptHash - ScriptPath - FlowPath @@ -12244,7 +12829,7 @@ paths: type: array items: type: object - properties: &ref_103 + properties: &ref_112 id: type: string name: @@ -12258,7 +12843,7 @@ paths: type: boolean success: type: boolean - required: &ref_104 + required: &ref_113 - id - name - args @@ -12308,10 +12893,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_101 + schema: *ref_110 - name: runnable_type in: query - schema: *ref_102 + schema: *ref_111 - name: page description: which page to return (start at 1, default 1) in: query @@ -12329,8 +12914,8 @@ paths: type: array items: type: object - properties: *ref_103 - required: *ref_104 + properties: *ref_112 + required: *ref_113 /w/{workspace}/inputs/create: post: summary: Create an Input for future use in a script or flow @@ -12344,10 +12929,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_101 + schema: *ref_110 - name: runnable_type in: query - schema: *ref_102 + schema: *ref_111 requestBody: description: Input required: true @@ -12355,12 +12940,12 @@ paths: application/json: schema: type: object - properties: &ref_129 + properties: &ref_136 name: type: string args: type: object - required: &ref_130 + required: &ref_137 - name - args - created_by @@ -12390,14 +12975,14 @@ paths: application/json: schema: type: object - properties: &ref_131 + properties: &ref_138 id: type: string name: type: string is_public: type: boolean - required: &ref_132 + required: &ref_139 - id - name - is_public @@ -12423,7 +13008,7 @@ paths: - name: input in: path required: true - schema: &ref_123 + schema: &ref_132 type: string responses: '200': @@ -12456,7 +13041,7 @@ paths: properties: s3_resource: type: object - properties: &ref_105 + properties: &ref_114 bucket: type: string region: @@ -12471,7 +13056,7 @@ paths: type: string pathStyle: type: boolean - required: &ref_106 + required: &ref_115 - bucket - region - endPoint @@ -12547,8 +13132,8 @@ paths: properties: s3_resource: type: object - properties: *ref_105 - required: *ref_106 + properties: *ref_114 + required: *ref_115 responses: '200': description: Connection settings @@ -12569,10 +13154,10 @@ paths: type: boolean client_kwargs: type: object - properties: &ref_107 + properties: &ref_116 region_name: type: string - required: &ref_108 + required: &ref_117 - region_name required: - endpoint_url @@ -12627,8 +13212,8 @@ paths: type: boolean client_kwargs: type: object - properties: *ref_107 - required: *ref_108 + properties: *ref_116 + required: *ref_117 required: - endpoint_url - use_ssl @@ -12686,8 +13271,8 @@ paths: application/json: schema: type: object - properties: *ref_105 - required: *ref_106 + properties: *ref_114 + required: *ref_115 /w/{workspace}/job_helpers/test_connection: get: summary: Test connection to the workspace object storage @@ -12751,10 +13336,10 @@ paths: type: array items: type: object - properties: &ref_193 + properties: &ref_200 s3: type: string - required: &ref_194 + required: &ref_201 - s3 restricted_access: type: boolean @@ -12787,7 +13372,7 @@ paths: application/json: schema: type: object - properties: &ref_195 + properties: &ref_202 mime_type: type: string size_in_bytes: @@ -12851,7 +13436,7 @@ paths: application/json: schema: type: object - properties: &ref_196 + properties: &ref_203 msg: type: string content: @@ -12863,7 +13448,7 @@ paths: - Csv - Parquet - Unknown - required: &ref_197 + required: &ref_204 - content_type /w/{workspace}/job_helpers/load_parquet_preview/{path}: get: @@ -13201,7 +13786,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 requestBody: description: parameters for statistics retrieval required: true @@ -13230,46 +13815,46 @@ paths: type: array items: type: object - properties: &ref_200 + properties: &ref_207 id: type: string name: type: string - required: &ref_201 + required: &ref_208 - id scalar_metrics: type: array items: type: object - properties: &ref_202 + properties: &ref_209 metric_id: type: string value: type: number - required: &ref_203 + required: &ref_210 - id - value timeseries_metrics: type: array items: type: object - properties: &ref_204 + properties: &ref_211 metric_id: type: string values: type: array items: type: object - properties: &ref_206 + properties: &ref_213 timestamp: type: string format: date-time value: type: number - required: &ref_207 + required: &ref_214 - timestamp - value - required: &ref_205 + required: &ref_212 - id - values /w/{workspace}/job_metrics/set_progress/{id}: @@ -13286,7 +13871,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 requestBody: description: parameters for statistics retrieval required: true @@ -13320,7 +13905,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: job progress between 0 and 99 @@ -13338,11 +13923,11 @@ paths: - name: before description: filter on started before (inclusive) timestamp in: query - schema: *ref_109 + schema: *ref_118 - name: after description: filter on created after (exclusive) timestamp in: query - schema: *ref_110 + schema: *ref_119 - name: with_error in: query required: false @@ -13414,12 +13999,12 @@ paths: type: array items: type: object - properties: &ref_210 + properties: &ref_217 concurrency_key: type: string total_running: type: number - required: &ref_211 + required: &ref_218 - concurrency_key - total_running /concurrency_groups/prune/{concurrency_id}: @@ -13432,7 +14017,7 @@ paths: - name: concurrency_id in: path required: true - schema: &ref_125 + schema: &ref_134 type: string responses: '200': @@ -13452,7 +14037,7 @@ paths: - name: id in: path required: true - schema: *ref_83 + schema: *ref_89 responses: '200': description: concurrency key for given job @@ -13485,93 +14070,93 @@ paths: - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 - name: label description: >- mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_78 + schema: *ref_84 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_62 + schema: *ref_68 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_63 + schema: *ref_69 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_64 + schema: *ref_70 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_65 + schema: *ref_71 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_66 + schema: *ref_72 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_67 + schema: *ref_73 - name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: *ref_111 + schema: *ref_120 - name: running description: filter on running jobs in: query - schema: *ref_72 + schema: *ref_78 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_75 - name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: *ref_112 + schema: *ref_121 - name: created_or_started_after_completed_jobs description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: *ref_113 + schema: *ref_122 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_70 + schema: *ref_76 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_75 + schema: *ref_81 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_74 + schema: *ref_80 - name: page description: which page to return (start at 1, default 1) in: query @@ -13619,17 +14204,17 @@ paths: application/json: schema: type: object - properties: &ref_212 + properties: &ref_219 jobs: type: array items: - oneOf: *ref_84 - discriminator: *ref_85 + oneOf: *ref_90 + discriminator: *ref_91 obscured_jobs: type: array items: type: object - properties: &ref_134 + properties: &ref_141 typ: type: string started_at: @@ -13642,7 +14227,7 @@ paths: Obscured jobs omitted for security because of too specific filtering type: boolean - required: &ref_213 + required: &ref_220 - jobs - obscured_jobs /srch/w/{workspace}/index/search/job: @@ -13684,9 +14269,118 @@ paths: type: array items: type: object - properties: &ref_218 + properties: &ref_225 dancer: type: string + /srch/index/search/service_logs: + get: + summary: Search through service logs with a string query + operationId: searchLogsIndex + tags: + - indexSearch + parameters: + - name: search_query + in: query + required: true + schema: + type: string + - name: mode + in: query + required: true + schema: + type: string + - name: worker_group + in: query + required: false + schema: + type: string + - name: hostname + in: query + required: true + schema: + type: string + - name: min_ts + in: query + required: false + schema: + type: string + format: date-time + - name: max_ts + in: query + required: false + schema: + type: string + format: date-time + responses: + '200': + description: search results + content: + application/json: + schema: + type: object + properties: + query_parse_errors: + description: >- + a list of the terms that couldn't be parsed (and thus + ignored) + type: array + items: + type: string + hits: + description: log files that matched the query + type: array + items: + type: object + properties: &ref_226 + dancer: + type: string + /srch/index/search/count_service_logs: + get: + summary: Search and count the log line hits on every provided host + operationId: countSearchLogsIndex + tags: + - indexSearch + parameters: + - name: search_query + in: query + required: true + schema: + type: string + - name: hosts + in: query + required: true + schema: + type: string + - name: min_ts + in: query + required: false + schema: + type: string + format: date-time + - name: max_ts + in: query + required: false + schema: + type: string + format: date-time + responses: + '200': + description: search results + content: + application/json: + schema: + type: object + properties: + query_parse_errors: + description: >- + a list of the terms that couldn't be parsed (and thus + ignored) + type: array + items: + type: string + count_per_host: + description: count of log lines that matched the query per hostname + type: object components: securitySchemes: bearerAuth: @@ -13711,12 +14405,12 @@ components: name: version in: path required: true - schema: *ref_114 + schema: *ref_123 Token: name: token in: path required: true - schema: *ref_115 + schema: *ref_124 AccountId: name: id in: path @@ -13741,7 +14435,7 @@ components: name: id in: path required: true - schema: *ref_83 + schema: *ref_89 Path: name: path in: path @@ -13756,12 +14450,12 @@ components: name: version in: path required: true - schema: *ref_116 + schema: *ref_125 Name: name: name in: path required: true - schema: *ref_92 + schema: *ref_101 Page: name: page description: which page to return (start at 1, default 1) @@ -13776,12 +14470,12 @@ components: name: order_desc description: order by desc order (default true) in: query - schema: *ref_48 + schema: *ref_50 CreatedBy: name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_49 + schema: *ref_51 Label: name: label description: >- @@ -13789,26 +14483,26 @@ components: with as a result an object containing a string in the array at key 'wm_labels') in: query - schema: *ref_78 + schema: *ref_84 ParentJob: name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_42 + schema: *ref_44 WorkerTag: name: tag description: Override the tag to use in: query - schema: *ref_44 + schema: *ref_46 CacheTtl: name: cache_ttl description: >- Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl in: query - schema: *ref_45 + schema: *ref_47 NewJobId: name: job_id description: >- @@ -13816,7 +14510,7 @@ components: randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_43 + schema: *ref_45 IncludeHeader: name: include_header description: > @@ -13826,14 +14520,14 @@ components: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_46 + schema: *ref_48 QueueLimit: name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_47 + schema: *ref_49 Payload: name: payload description: > @@ -13842,162 +14536,162 @@ components: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_86 + schema: *ref_92 ScriptStartPath: name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_63 + schema: *ref_69 SchedulePath: name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_64 + schema: *ref_70 ScriptExactPath: name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_62 + schema: *ref_68 ScriptExactHash: name: script_hash description: mask to filter exact matching path in: query - schema: *ref_65 + schema: *ref_71 CreatedBefore: name: created_before description: filter on created before (inclusive) timestamp in: query - schema: *ref_117 + schema: *ref_126 CreatedAfter: name: created_after description: filter on created after (exclusive) timestamp in: query - schema: *ref_118 + schema: *ref_127 StartedBefore: name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_66 + schema: *ref_72 StartedAfter: name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_67 + schema: *ref_73 Before: name: before description: filter on started before (inclusive) timestamp in: query - schema: *ref_109 + schema: *ref_118 CreatedOrStartedAfter: name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: *ref_112 + schema: *ref_121 CreatedOrStartedAfterCompletedJob: name: created_or_started_after_completed_jobs description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs in: query - schema: *ref_113 + schema: *ref_122 CreatedOrStartedBefore: name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: *ref_111 + schema: *ref_120 Success: name: success description: filter on successful jobs in: query - schema: *ref_68 + schema: *ref_74 ScheduledForBeforeNow: name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_75 Suspended: name: suspended description: filter on suspended jobs in: query - schema: *ref_71 + schema: *ref_77 Running: name: running description: filter on running jobs in: query - schema: *ref_72 + schema: *ref_78 ArgsFilter: name: args description: filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_73 + schema: *ref_79 Tag: name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_75 + schema: *ref_81 ResultFilter: name: result description: filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_74 + schema: *ref_80 After: name: after description: filter on created after (exclusive) timestamp in: query - schema: *ref_110 + schema: *ref_119 Username: name: username description: filter on exact username of user in: query - schema: *ref_119 + schema: *ref_128 Operation: name: operation description: filter on exact or prefix name of operation in: query - schema: *ref_120 + schema: *ref_129 ResourceName: name: resource description: filter on exact or prefix name of resource in: query - schema: *ref_121 + schema: *ref_130 ActionKind: name: action_kind description: filter on type of operation in: query - schema: *ref_122 + schema: *ref_131 JobKinds: name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_70 + schema: *ref_76 RunnableId: name: runnable_id in: query - schema: *ref_101 + schema: *ref_110 RunnableTypeQuery: name: runnable_type in: query - schema: *ref_102 + schema: *ref_111 InputId: name: input in: path required: true - schema: *ref_123 + schema: *ref_132 GetStarted: name: get_started in: query - schema: *ref_124 + schema: *ref_133 ConcurrencyId: name: concurrency_id in: path required: true - schema: *ref_125 + schema: *ref_134 schemas: Script: type: object @@ -14008,83 +14702,83 @@ components: properties: *ref_40 required: *ref_41 NewScriptWithDraft: - allOf: *ref_126 + allOf: *ref_135 ScriptHistory: type: object - properties: *ref_127 - required: *ref_128 + properties: *ref_42 + required: *ref_43 ScriptArgs: type: object additionalProperties: *ref_16 Input: type: object - properties: *ref_103 - required: *ref_104 + properties: *ref_112 + required: *ref_113 CreateInput: type: object - properties: *ref_129 - required: *ref_130 + properties: *ref_136 + required: *ref_137 UpdateInput: type: object - properties: *ref_131 - required: *ref_132 + properties: *ref_138 + required: *ref_139 RunnableType: type: string - enum: *ref_133 + enum: *ref_140 QueuedJob: type: object - properties: *ref_81 - required: *ref_82 + properties: *ref_87 + required: *ref_88 CompletedJob: type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_85 + required: *ref_86 ObscuredJob: type: object - properties: *ref_134 + properties: *ref_141 Job: - oneOf: *ref_84 - discriminator: *ref_85 + oneOf: *ref_90 + discriminator: *ref_91 User: type: object properties: *ref_10 required: *ref_11 UserUsage: type: object - properties: *ref_135 + properties: *ref_142 Login: type: object - properties: *ref_136 - required: *ref_137 + properties: *ref_143 + required: *ref_144 EditWorkspaceUser: type: object - properties: *ref_138 + properties: *ref_145 TruncatedToken: type: object properties: *ref_38 required: *ref_39 NewToken: type: object - properties: *ref_139 + properties: *ref_146 NewTokenImpersonate: type: object - properties: *ref_140 - required: *ref_141 + properties: *ref_147 + required: *ref_148 ListableVariable: type: object properties: *ref_22 required: *ref_23 ContextualVariable: type: object - properties: *ref_142 - required: *ref_143 + properties: *ref_149 + required: *ref_150 CreateVariable: type: object - properties: *ref_144 - required: *ref_145 + properties: *ref_151 + required: *ref_152 EditVariable: type: object - properties: *ref_146 + properties: *ref_153 AuditLog: type: object properties: *ref_1 @@ -14216,93 +14910,107 @@ components: - has_preprocessor Preview: type: object - properties: *ref_147 - required: *ref_148 + properties: *ref_154 + required: *ref_155 WorkflowTask: - type: object - properties: *ref_149 - required: *ref_150 - WorkflowStatusRecord: - type: object - additionalProperties: *ref_151 - WorkflowStatus: - type: object - properties: *ref_152 - CreateResource: - type: object - properties: *ref_153 - required: *ref_154 - EditResource: - type: object - properties: *ref_155 - Resource: type: object properties: *ref_156 required: *ref_157 + WorkflowStatusRecord: + type: object + additionalProperties: *ref_158 + WorkflowStatus: + type: object + properties: *ref_159 + CreateResource: + type: object + properties: *ref_160 + required: *ref_161 + EditResource: + type: object + properties: *ref_162 + Resource: + type: object + properties: *ref_163 + required: *ref_164 ListableResource: type: object - properties: *ref_158 - required: *ref_159 + properties: *ref_165 + required: *ref_166 ResourceType: type: object properties: *ref_26 required: *ref_27 EditResourceType: type: object - properties: *ref_160 + properties: *ref_167 Schedule: type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_94 + required: *ref_95 ScheduleWJobs: - allOf: *ref_161 + allOf: *ref_168 NewSchedule: type: object - properties: *ref_162 - required: *ref_163 + properties: *ref_169 + required: *ref_170 EditSchedule: type: object - properties: *ref_164 - required: *ref_165 + properties: *ref_171 + required: *ref_172 HttpTrigger: type: object - properties: *ref_90 - required: *ref_91 + properties: *ref_96 + required: *ref_97 NewHttpTrigger: type: object - properties: *ref_166 - required: *ref_167 + properties: *ref_173 + required: *ref_174 EditHttpTrigger: type: object - properties: *ref_168 - required: *ref_169 + properties: *ref_175 + required: *ref_176 TriggersCount: type: object - properties: *ref_53 - Group: - type: object - properties: *ref_97 - required: *ref_98 - InstanceGroup: - type: object - properties: *ref_93 - required: *ref_94 - Folder: + properties: *ref_57 + WebsocketTrigger: type: object properties: *ref_99 required: *ref_100 + NewWebsocketTrigger: + type: object + properties: *ref_177 + required: *ref_178 + EditWebsocketTrigger: + type: object + properties: *ref_179 + required: *ref_180 + WebsocketTriggerInitialMessage: + anyOf: *ref_98 + Group: + type: object + properties: *ref_106 + required: *ref_107 + InstanceGroup: + type: object + properties: *ref_102 + required: *ref_103 + Folder: + type: object + properties: *ref_108 + required: *ref_109 WorkerPing: type: object - properties: *ref_170 - required: *ref_171 + properties: *ref_181 + required: *ref_182 UserWorkspaceList: type: object - properties: *ref_172 - required: *ref_173 + properties: *ref_183 + required: *ref_184 CreateWorkspace: type: object - properties: *ref_174 - required: *ref_175 + properties: *ref_185 + required: *ref_186 Workspace: type: object properties: *ref_7 @@ -14316,48 +15024,48 @@ components: properties: *ref_12 required: *ref_13 Flow: - allOf: *ref_52 + allOf: *ref_56 ExtraPerms: type: object - additionalProperties: *ref_176 + additionalProperties: *ref_187 FlowMetadata: type: object - properties: *ref_177 - required: *ref_178 + properties: *ref_188 + required: *ref_189 OpenFlowWPath: - allOf: *ref_54 + allOf: *ref_58 FlowPreview: type: object - properties: *ref_179 - required: *ref_180 + properties: *ref_190 + required: *ref_191 RestartedFrom: type: object - properties: *ref_181 + properties: *ref_192 Policy: type: object - properties: *ref_55 + properties: *ref_59 ListableApp: type: object - properties: *ref_182 - required: *ref_183 + properties: *ref_193 + required: *ref_194 ListableRawApp: type: object - properties: *ref_184 - required: *ref_185 + properties: *ref_195 + required: *ref_196 AppWithLastVersion: type: object - properties: *ref_56 - required: *ref_57 + properties: *ref_60 + required: *ref_61 AppWithLastVersionWDraft: - allOf: *ref_186 + allOf: *ref_197 AppHistory: type: object - properties: *ref_187 - required: *ref_188 + properties: *ref_62 + required: *ref_63 FlowVersion: type: object - properties: *ref_189 - required: *ref_190 + properties: *ref_54 + required: *ref_55 SlackToken: type: object properties: @@ -14379,33 +15087,33 @@ components: - bot TokenResponse: type: object - properties: *ref_191 - required: *ref_192 + properties: *ref_198 + required: *ref_199 HubScriptKind: name: kind schema: *ref_34 PolarsClientKwargs: type: object - properties: *ref_107 - required: *ref_108 + properties: *ref_116 + required: *ref_117 LargeFileStorage: type: object properties: *ref_17 WindmillLargeFile: type: object - properties: *ref_193 - required: *ref_194 + properties: *ref_200 + required: *ref_201 WindmillFileMetadata: type: object - properties: *ref_195 + properties: *ref_202 WindmillFilePreview: type: object - properties: *ref_196 - required: *ref_197 + properties: *ref_203 + required: *ref_204 S3Resource: type: object - properties: *ref_105 - required: *ref_106 + properties: *ref_114 + required: *ref_115 WorkspaceGitSyncSettings: type: object properties: *ref_18 @@ -14417,8 +15125,8 @@ components: properties: *ref_20 GitRepositorySettings: type: object - properties: *ref_198 - required: *ref_199 + properties: *ref_205 + required: *ref_206 UploadFilePart: type: object properties: @@ -14431,117 +15139,126 @@ components: - tag MetricMetadata: type: object - properties: *ref_200 - required: *ref_201 + properties: *ref_207 + required: *ref_208 ScalarMetric: type: object - properties: *ref_202 - required: *ref_203 + properties: *ref_209 + required: *ref_210 TimeseriesMetric: type: object - properties: *ref_204 - required: *ref_205 + properties: *ref_211 + required: *ref_212 MetricDataPoint: type: object - properties: *ref_206 - required: *ref_207 + properties: *ref_213 + required: *ref_214 RawScriptForDependencies: type: object - properties: *ref_208 - required: *ref_209 + properties: *ref_215 + required: *ref_216 ConcurrencyGroup: type: object - properties: *ref_210 - required: *ref_211 + properties: *ref_217 + required: *ref_218 ExtendedJobs: type: object - properties: *ref_212 - required: *ref_213 + properties: *ref_219 + required: *ref_220 ExportedUser: type: object properties: *ref_3 required: *ref_4 GlobalSetting: - type: object - properties: *ref_214 - required: *ref_215 - Config: - type: object - properties: *ref_216 - required: *ref_217 - ExportedInstanceGroup: - type: object - properties: *ref_95 - required: *ref_96 - JobSearchHit: - type: object - properties: *ref_218 - StaticTransform: - type: object - properties: *ref_219 - required: *ref_220 - JavascriptTransform: type: object properties: *ref_221 required: *ref_222 + Config: + type: object + properties: *ref_223 + required: *ref_224 + ExportedInstanceGroup: + type: object + properties: *ref_104 + required: *ref_105 + JobSearchHit: + type: object + properties: *ref_225 + LogSearchHit: + type: object + properties: *ref_226 + AutoscalingEvent: + type: object + properties: *ref_227 + CriticalAlert: + type: object + properties: *ref_228 + StaticTransform: + type: object + properties: *ref_229 + required: *ref_230 + JavascriptTransform: + type: object + properties: *ref_231 + required: *ref_232 InputTransform: oneOf: *ref_29 discriminator: *ref_30 RawScript: type: object - properties: *ref_223 - required: *ref_224 + properties: *ref_233 + required: *ref_234 PathScript: type: object - properties: *ref_225 - required: *ref_226 + properties: *ref_235 + required: *ref_236 PathFlow: type: object - properties: *ref_227 - required: *ref_228 + properties: *ref_237 + required: *ref_238 FlowModule: type: object properties: *ref_31 required: *ref_32 ForloopFlow: type: object - properties: *ref_229 - required: *ref_230 + properties: *ref_239 + required: *ref_240 WhileloopFlow: type: object - properties: *ref_231 - required: *ref_232 + properties: *ref_241 + required: *ref_242 BranchOne: type: object - properties: *ref_233 - required: *ref_234 + properties: *ref_243 + required: *ref_244 BranchAll: type: object - properties: *ref_235 - required: *ref_236 + properties: *ref_245 + required: *ref_246 Identity: type: object - properties: *ref_237 - required: *ref_238 + properties: *ref_247 + required: *ref_248 FlowModuleValue: - oneOf: *ref_239 - discriminator: *ref_240 + oneOf: *ref_249 + discriminator: *ref_250 Retry: type: object - properties: *ref_87 + properties: *ref_93 FlowValue: type: object - properties: *ref_58 - required: *ref_59 + properties: *ref_64 + required: *ref_65 OpenFlow: type: object - properties: *ref_50 - required: *ref_51 + properties: *ref_52 + required: *ref_53 FlowStatusModule: type: object - properties: *ref_60 - required: *ref_61 + properties: *ref_66 + required: *ref_67 FlowStatus: type: object - properties: *ref_76 - required: *ref_77 + properties: *ref_82 + required: *ref_83 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 5b274610bd..964df7ee5f 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -773,6 +773,78 @@ paths: schema: type: string + /settings/critical_alerts: + get: + summary: Get all critical alerts + operationId: getCriticalAlerts + tags: + - setting + parameters: + - in: query + name: page + schema: + type: integer + default: 1 + description: The page number to retrieve (minimum value is 1) + - in: query + name: page_size + schema: + type: integer + default: 10 + maximum: 100 + description: Number of alerts per page (maximum is 100) + - in: query + name: acknowledged + schema: + type: boolean + nullable: true + description: Filter by acknowledgment status; true for acknowledged, false for unacknowledged, and omit for all alerts + responses: + "200": + description: Successfully retrieved all critical alerts + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CriticalAlert' + + /settings/critical_alerts/{id}/acknowledge: + post: + summary: Acknowledge a critical alert + operationId: acknowledgeCriticalAlert + tags: + - setting + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The ID of the critical alert to acknowledge + responses: + "200": + description: Successfully acknowledged the critical alert + content: + application/json: + schema: + type: string + example: "Critical alert acknowledged" + + /settings/critical_alerts/acknowledge_all: + post: + summary: Acknowledge all unacknowledged critical alerts + operationId: acknowledgeAllCriticalAlerts + tags: + - setting + responses: + "200": + description: Successfully acknowledged all unacknowledged critical alerts. + content: + application/json: + schema: + type: string + example: "All unacknowledged critical alerts acknowledged" /settings/test_license_key: post: @@ -12721,3 +12793,23 @@ components: type: string format: date-time + CriticalAlert: + type: object + properties: + id: + type: integer + description: Unique identifier for the alert + alert_type: + type: string + description: Type of alert (e.g., critical_error) + message: + type: string + description: The message content of the alert + created_at: + type: string + format: date-time + description: Time when the alert was created + acknowledged: + type: boolean + nullable: true + description: Acknowledgment status of the alert, can be true, false, or null if not set diff --git a/backend/windmill-api/src/settings.rs b/backend/windmill-api/src/settings.rs index 0299145a38..5dc46e4382 100644 --- a/backend/windmill-api/src/settings.rs +++ b/backend/windmill-api/src/settings.rs @@ -58,7 +58,10 @@ pub fn global_service() -> Router { ) .route("/renew_license_key", post(renew_license_key)) .route("/customer_portal", post(create_customer_portal_session)) - .route("/test_critical_channels", post(test_critical_channels)); + .route("/test_critical_channels", post(test_critical_channels)) + .route("/critical_alerts", get(get_critical_alerts)) + .route("/critical_alerts/:id/acknowledge", post(acknowledge_critical_alert)) + .route("/critical_alerts/acknowledge_all", post(acknowledge_all_critical_alerts)); #[cfg(feature = "parquet")] { @@ -430,3 +433,117 @@ pub async fn test_critical_channels( pub async fn test_critical_channels() -> Result { Ok("Critical channels require EE".to_string()) } + +use serde::Serialize; + +#[derive(Serialize)] +pub struct CriticalAlert { + id: i32, + alert_type: String, + message: String, + created_at: chrono::DateTime, + acknowledged: Option, +} + +#[cfg(feature = "enterprise")] +#[derive(Deserialize)] +pub struct AlertQueryParams { + pub page: Option, + pub page_size: Option, + pub acknowledged: Option, +} + +#[cfg(feature = "enterprise")] +pub async fn get_critical_alerts( + Extension(db): Extension, + authed: ApiAuthed, + Query(params): Query, +) -> JsonResult> { + require_super_admin(&db, &authed.email).await?; + + // Default pagination values if not provided + let page = params.page.unwrap_or(1).max(1); + let page_size = params.page_size.unwrap_or(10).min(100) as i64; + let offset = ((page - 1) * page_size as i32) as i64; + + let alerts = if let Some(acknowledged) = params.acknowledged { + sqlx::query_as!( + CriticalAlert, + "SELECT id, alert_type, message, created_at, acknowledged + FROM alerts + WHERE acknowledged = $1 + ORDER BY created_at DESC + LIMIT $2 OFFSET $3", + acknowledged, + page_size, + offset + ) + .fetch_all(&db) + .await? + } else { + sqlx::query_as!( + CriticalAlert, + "SELECT id, alert_type, message, created_at, acknowledged + FROM alerts + ORDER BY created_at DESC + LIMIT $1 OFFSET $2", + page_size, + offset + ) + .fetch_all(&db) + .await? + }; + + Ok(Json(alerts)) +} + +#[cfg(not(feature = "enterprise"))] +pub async fn get_critical_alerts() -> error::Error { + error::Error::NotFound("Critical Alerts require EE".to_string()) +} + +#[cfg(feature = "enterprise")] +pub async fn acknowledge_critical_alert( + Extension(db): Extension, + authed: ApiAuthed, + Path(id): Path, +) -> error::Result { + require_super_admin(&db, &authed.email).await?; + + sqlx::query!( + "UPDATE alerts SET acknowledged = true WHERE id = $1", + id + ) + .execute(&db) + .await?; + + tracing::info!("Acknowledged critical alert with id: {}", id); + Ok("Critical alert acknowledged".to_string()) +} + +#[cfg(not(feature = "enterprise"))] +pub async fn acknowledge_critical_alert() -> error::Error { + error::Error::NotFound("Critical Alerts require EE".to_string()) +} + +#[cfg(feature = "enterprise")] +pub async fn acknowledge_all_critical_alerts( + Extension(db): Extension, + authed: ApiAuthed, +) -> error::Result { + require_super_admin(&db, &authed.email).await?; + + sqlx::query!( + "UPDATE alerts SET acknowledged = true WHERE acknowledged = false" + ) + .execute(&db) + .await?; + + tracing::info!("Acknowledged all unacknowledged critical alerts"); + Ok("All unacknowledged critical alerts acknowledged".to_string()) +} + +#[cfg(not(feature = "enterprise"))] +pub async fn acknowledge_all_critical_alerts() -> error::Error { + error::Error::NotFound("Critical Alerts require EE".to_string()) +} diff --git a/backend/windmill-common/src/global_settings.rs b/backend/windmill-common/src/global_settings.rs index b0420ca248..a48db22b1f 100644 --- a/backend/windmill-common/src/global_settings.rs +++ b/backend/windmill-common/src/global_settings.rs @@ -29,6 +29,7 @@ pub const AUTOMATE_USERNAME_CREATION_SETTING: &str = "automate_username_creation pub const HUB_BASE_URL_SETTING: &str = "hub_base_url"; pub const HUB_ACCESSIBLE_URL_SETTING: &str = "hub_accessible_url"; pub const CRITICAL_ERROR_CHANNELS_SETTING: &str = "critical_error_channels"; +pub const CRITICAL_ALERT_MUTE_UI_SETTING: &str = "critical_alert_mute_ui"; pub const DEV_INSTANCE_SETTING: &str = "dev_instance"; pub const JWT_SECRET_SETTING: &str = "jwt_secret"; pub const EMAIL_DOMAIN_SETTING: &str = "email_domain"; diff --git a/backend/windmill-common/src/lib.rs b/backend/windmill-common/src/lib.rs index ad96594ac8..8eb57cb236 100644 --- a/backend/windmill-common/src/lib.rs +++ b/backend/windmill-common/src/lib.rs @@ -86,6 +86,8 @@ lazy_static::lazy_static! { pub static ref METRICS_ENABLED: AtomicBool = AtomicBool::new(std::env::var("METRICS_PORT").is_ok() || std::env::var("METRICS_ADDR").is_ok()); pub static ref METRICS_DEBUG_ENABLED: AtomicBool = AtomicBool::new(false); + pub static ref CRITICAL_ALERT_MUTE_UI_ENABLED: AtomicBool = AtomicBool::new(false); + pub static ref BASE_URL: Arc> = Arc::new(RwLock::new("".to_string())); pub static ref IS_READY: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); diff --git a/backend/windmill-common/src/utils.rs b/backend/windmill-common/src/utils.rs index 04f95a3406..18c0c93205 100644 --- a/backend/windmill-common/src/utils.rs +++ b/backend/windmill-common/src/utils.rs @@ -28,6 +28,9 @@ pub const DEFAULT_PER_PAGE: usize = 1000; pub const GIT_VERSION: &str = git_version!(args = ["--tag", "--always"], fallback = "unknown-version"); +use std::sync::atomic::Ordering; +use crate::CRITICAL_ALERT_MUTE_UI_ENABLED; + lazy_static::lazy_static! { pub static ref HTTP_CLIENT: Client = reqwest::ClientBuilder::new() .user_agent("windmill/beta") @@ -244,9 +247,12 @@ pub fn generate_lock_id(database_name: &str) -> i64 { pub async fn report_critical_error(error_message: String, _db: DB) -> () { tracing::error!("CRITICAL ERROR: {error_message}"); + let mute = CRITICAL_ALERT_MUTE_UI_ENABLED.load(Ordering::Relaxed); + if let Err(err) = sqlx::query!( - "INSERT INTO alerts (alert_type, message) VALUES ('critical_error', $1)", - error_message + "INSERT INTO alerts (alert_type, message, acknowledged) VALUES ('critical_error', $1, $2)", + error_message, + mute ) .execute(&_db) .await @@ -261,9 +267,12 @@ pub async fn report_critical_error(error_message: String, _db: DB) -> () { pub async fn report_recovered_critical_error(message: String, _db: DB) -> () { tracing::info!("RECOVERED CRITICAL ERROR: {message}"); + let mute = CRITICAL_ALERT_MUTE_UI_ENABLED.load(Ordering::Relaxed); + if let Err(err) = sqlx::query!( - "INSERT INTO alerts (alert_type, message) VALUES ('recovered_critical_error', $1)", - message + "INSERT INTO alerts (alert_type, message, acknowledged) VALUES ('recovered_critical_error', $1, $2)", + message, + mute ) .execute(&_db) .await diff --git a/frontend/src/lib/components/SuperadminSettings.svelte b/frontend/src/lib/components/SuperadminSettings.svelte index 1e81ace411..1670a51086 100644 --- a/frontend/src/lib/components/SuperadminSettings.svelte +++ b/frontend/src/lib/components/SuperadminSettings.svelte @@ -23,6 +23,7 @@ import { isCloudHosted } from '$lib/cloud' import InstanceNameEditor from './InstanceNameEditor.svelte' import Toggle from './Toggle.svelte' + import { instanceSettingsSelectedTab } from '$lib/stores'; let drawer: Drawer let filter = '' @@ -56,6 +57,9 @@ let tab: 'users' | string = 'users' + $: $instanceSettingsSelectedTab, tab = $instanceSettingsSelectedTab + $: tab, instanceSettingsSelectedTab.set(tab) + let nbDisplayed = 50 let instanceSettings diff --git a/frontend/src/lib/components/instanceSettings.ts b/frontend/src/lib/components/instanceSettings.ts index 016b5eef78..bd998970e7 100644 --- a/frontend/src/lib/components/instanceSettings.ts +++ b/frontend/src/lib/components/instanceSettings.ts @@ -146,6 +146,15 @@ export const settings: Record = { storage: 'setting', ee_only: 'Channels other than tracing are only available in the EE version' }, + { + label: 'Mute critical alerts in UI', + description: 'Enable to mute critical alerts in the UI', + key: 'critical_alert_mute_ui', + fieldType: 'boolean', + storage: 'setting', + requiresReloadOnChange: true, + ee_only: 'Critical alerts in UI are only available in the EE version' + }, { label: 'Azure OpenAI base path', description: diff --git a/frontend/src/lib/components/sidebar/CriticalAlertButton.svelte b/frontend/src/lib/components/sidebar/CriticalAlertButton.svelte new file mode 100644 index 0000000000..9c6d3db68d --- /dev/null +++ b/frontend/src/lib/components/sidebar/CriticalAlertButton.svelte @@ -0,0 +1,64 @@ + + +{#if !disabled} + +
+ +
+ + {#if label} + {label} + {/if} + +
+{/if} diff --git a/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte b/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte new file mode 100644 index 0000000000..9e306ea917 --- /dev/null +++ b/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte @@ -0,0 +1,69 @@ + + + diff --git a/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte b/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte new file mode 100644 index 0000000000..f1b6208962 --- /dev/null +++ b/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte @@ -0,0 +1,213 @@ + + + + {#if !hasCriticalAlertChannels} +
+ +

+ No critical alert channels are set up. Go to the + Instance Settings + page to configure critical alert channels. +

+
+ {/if} + +
+
+ +
+ + +
+ + +
+
+ + Page {page} + +
+
+ +
+
+ + +
+ + + + + + + + + + + {#each alerts as { id, alert_type, message, created_at, acknowledged }} + {#if !hideAcknowledged || !acknowledged} + + + + + + + + {/if} + {/each} + +
TypeMessageCreated AtAcknowledge
+ {#if alert_type === 'recovered_critical_error'} + + + + {:else} + + + + {/if} + {message}{formatDate(created_at)} +
+ {#if !acknowledged} + + {:else} + + {/if} +
+
+
+ + {#if alerts.length === 0} +

No critical alerts available.

+ {/if} +
diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts index 18cf32b074..9d8af53bae 100644 --- a/frontend/src/lib/stores.ts +++ b/frontend/src/lib/stores.ts @@ -121,3 +121,5 @@ export type DBSchema = SQLSchema | GraphqlSchema export type DBSchemas = Partial> export const dbSchemas = writable({}) + +export const instanceSettingsSelectedTab = writable('Core') \ No newline at end of file diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index e5b0c3271d..99fc3c0a0c 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -14,7 +14,9 @@ import { classNames, getModifierKey } from '$lib/utils' import WorkspaceMenu from '$lib/components/sidebar/WorkspaceMenu.svelte' import SidebarContent from '$lib/components/sidebar/SidebarContent.svelte' + import CriticalAlertModal from '$lib/components/sidebar/CriticalAlertModal.svelte' import { + enterpriseLicense, copilotInfo, isPremiumStore, starStore, @@ -48,6 +50,7 @@ import MenuButton from '$lib/components/sidebar/MenuButton.svelte' import { setContext } from 'svelte' import { base } from '$app/paths' + import CriticalAlertButton from '$lib/components/sidebar/CriticalAlertButton.svelte' OpenAPI.WITH_CREDENTIALS = true let menuOpen = false @@ -275,6 +278,26 @@ } setContext('openSearchWithPrefilledText', openSearchModal) + + $: { + if ($enterpriseLicense && $superadmin) { + loadCriticalAlertsMuted() + } + } + + let numUnacknowledgedCriticalAlerts = 0 + let isCriticalAlertsModalOpen = false + let isCriticalAlertsUiMuted = false + + async function loadCriticalAlertsMuted() { + isCriticalAlertsUiMuted = (await SettingService.getGlobal({ + key: 'critical_alert_mute_ui' + })) as boolean + } + + function openCriticalAlertsModal(text?: string): void { + isCriticalAlertsModalOpen = true + } @@ -291,6 +314,12 @@ {:else if $userStore} {#if $superadmin} + {#if !isCriticalAlertsUiMuted && $enterpriseLicense} + + {/if} {/if}
@@ -356,7 +385,6 @@ Windmill
-
@@ -405,6 +433,17 @@ {/if}
+ {#if $superadmin && $enterpriseLicense} + openCriticalAlertsModal()} + {numUnacknowledgedCriticalAlerts} + {isCollapsed} + label="Critical Alerts" + class="!text-xs" + disabled={numUnacknowledgedCriticalAlerts === 0} + /> + {/if}