From 4e0890ee1fb422913aa4a6553cb135e43ebcc7f3 Mon Sep 17 00:00:00 2001 From: Deadman Date: Wed, 8 Apr 2026 18:32:46 -0400 Subject: [PATCH] feat(api): Add filter_dashboard_id parameter to apply dashboard filters to chart/data endpoint (#38638) Co-authored-by: Matthew Deadman Co-authored-by: Matthew Deadman Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com> --- docs/static/resources/openapi.json | 11724 +++++----------- superset/charts/data/api.py | 104 +- .../charts/data/dashboard_filter_context.py | 306 + superset/charts/schemas.py | 45 + .../charts/data/api_tests.py | 215 + .../charts/test_dashboard_filter_context.py | 525 + 6 files changed, 4997 insertions(+), 7922 deletions(-) create mode 100644 superset/charts/data/dashboard_filter_context.py create mode 100644 tests/unit_tests/charts/test_dashboard_filter_context.py diff --git a/docs/static/resources/openapi.json b/docs/static/resources/openapi.json index 4fa850bd838..60a7d803d97 100644 --- a/docs/static/resources/openapi.json +++ b/docs/static/resources/openapi.json @@ -11,9 +11,6 @@ } }, "type": "object" - }, - "example": { - "message": "Bad request: Invalid parameters provided" } } }, @@ -29,9 +26,6 @@ } }, "type": "object" - }, - "example": { - "message": "Unauthorized: Authentication required" } } }, @@ -47,9 +41,6 @@ } }, "type": "object" - }, - "example": { - "message": "Forbidden: You don't have permission to access this resource" } } }, @@ -65,9 +56,6 @@ } }, "type": "object" - }, - "example": { - "message": "Not found: The requested resource does not exist" } } }, @@ -179,9 +167,6 @@ } }, "type": "object" - }, - "example": { - "message": "Unprocessable entity: Validation error" } } }, @@ -197,9 +182,6 @@ } }, "type": "object" - }, - "example": { - "message": "Internal server error: An unexpected error occurred" } } }, @@ -276,7 +258,8 @@ "", "opacityLow", "opacityMedium", - "opacityHigh" + "opacityHigh", + null ], "nullable": true, "type": "string" @@ -980,15 +963,7 @@ "ChartDataDatasource": { "properties": { "id": { - "description": "Datasource id/uuid", - "oneOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ] + "description": "Datasource id or uuid" }, "type": { "description": "Datasource type", @@ -1009,6 +984,14 @@ }, "ChartDataExtras": { "properties": { + "column_order": { + "description": "Ordered list of column names for result ordering. Used to preserve user's column reordering (including mixed dimension columns and metrics)", + "items": { + "type": "string" + }, + "nullable": true, + "type": "array" + }, "having": { "description": "HAVING clause to be added to aggregate queries using AND operator.", "type": "string" @@ -1055,12 +1038,18 @@ "1969-12-28T00:00:00Z/P1W", "1969-12-29T00:00:00Z/P1W", "P1W/1970-01-03T00:00:00Z", - "P1W/1970-01-04T00:00:00Z" + "P1W/1970-01-04T00:00:00Z", + null ], "example": "P1D", "nullable": true, "type": "string" }, + "transpile_to_dialect": { + "description": "If true, WHERE/HAVING clauses will be transpiled to the target database dialect using SQLGlot.", + "nullable": true, + "type": "boolean" + }, "where": { "description": "WHERE clause to be added to queries using AND operator.", "type": "string" @@ -1095,6 +1084,7 @@ "LIKE", "NOT LIKE", "ILIKE", + "NOT ILIKE", "IS NULL", "IS NOT NULL", "IN", @@ -1466,6 +1456,12 @@ "nullable": true, "type": "string" }, + "group_others_when_limit_reached": { + "default": false, + "description": "When true, groups remaining series into an 'Others' category when series limit is reached. Prevents incomplete data.", + "nullable": true, + "type": "boolean" + }, "groupby": { "description": "Columns by which to group the query. This field is deprecated, use `columns` instead.", "items": {}, @@ -1537,7 +1533,8 @@ "samples", "timegrains", "post_processed", - "drill_detail" + "drill_detail", + null ], "nullable": true }, @@ -1669,6 +1666,12 @@ }, "type": "array" }, + "detected_currency": { + "default": null, + "description": "Detected ISO 4217 currency code when AUTO mode is used. Returns the currency code if all filtered data contains a single currency or null if multiple currencies are present.", + "nullable": true, + "type": "string" + }, "error": { "description": "Error", "nullable": true, @@ -1683,8 +1686,14 @@ "description": "Is the result cached", "type": "boolean" }, + "queried_dttm": { + "description": "UTC timestamp when the query was executed (ISO 8601 format)", + "nullable": true, + "type": "string" + }, "query": { - "description": "The executed query statement", + "description": "The executed query statement. May be absent when validation errors occur.", + "nullable": true, "type": "string" }, "rejected_filters": { @@ -1727,12 +1736,20 @@ "cache_timeout", "cached_dttm", "is_cached", - "query" + "queried_dttm" ], "type": "object" }, "ChartDataResponseSchema": { "properties": { + "dashboard_filters": { + "allOf": [ + { + "$ref": "#/components/schemas/DashboardFiltersResponseSchema" + } + ], + "description": "Metadata about dashboard native filters applied to the query. Only present when filters_dashboard_id is provided." + }, "result": { "description": "A list of results for each corresponding query in the request.", "items": { @@ -1745,125 +1762,12 @@ }, "ChartDataRestApi.get": { "properties": { - "cache_timeout": { - "nullable": true, - "type": "integer" - }, - "certification_details": { - "nullable": true, - "type": "string" - }, - "certified_by": { - "nullable": true, - "type": "string" - }, - "changed_on_delta_humanized": { - "readOnly": true - }, - "dashboards": { - "$ref": "#/components/schemas/ChartDataRestApi.get.Dashboard" - }, - "description": { - "nullable": true, - "type": "string" - }, "id": { "type": "integer" - }, - "is_managed_externally": { - "type": "boolean" - }, - "owners": { - "$ref": "#/components/schemas/ChartDataRestApi.get.User" - }, - "params": { - "nullable": true, - "type": "string" - }, - "query_context": { - "nullable": true, - "type": "string" - }, - "slice_name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "tags": { - "$ref": "#/components/schemas/ChartDataRestApi.get.Tag" - }, - "thumbnail_url": { - "readOnly": true - }, - "url": { - "readOnly": true - }, - "viz_type": { - "maxLength": 250, - "nullable": true, - "type": "string" } }, "type": "object" }, - "ChartDataRestApi.get.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "json_metadata": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartDataRestApi.get.Tag": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] - } - }, - "type": "object" - }, - "ChartDataRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, "ChartDataRestApi.get_list": { "properties": { "cache_timeout": { @@ -2099,6 +2003,10 @@ }, "ChartDataRestApi.get_list.User3": { "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, "first_name": { "maxLength": 64, "type": "string" @@ -2112,6 +2020,7 @@ } }, "required": [ + "email", "first_name", "last_name" ], @@ -2202,6 +2111,11 @@ "minLength": 1, "type": "string" }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + }, "viz_type": { "description": "The type of chart visualization used.", "example": [ @@ -2257,7 +2171,8 @@ "dataset", "query", "saved_query", - "view" + "view", + null ], "nullable": true, "type": "string" @@ -2311,6 +2226,11 @@ }, "type": "array" }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + }, "viz_type": { "description": "The type of chart visualization used.", "example": [ @@ -2568,127 +2488,97 @@ }, "type": "object" }, - "ChartRestApi.get": { + "ChartGetResponseSchema": { "properties": { "cache_timeout": { - "nullable": true, - "type": "integer" + "type": "string" }, "certification_details": { - "nullable": true, "type": "string" }, "certified_by": { - "nullable": true, "type": "string" }, "changed_on_delta_humanized": { - "readOnly": true + "type": "string" }, "dashboards": { - "$ref": "#/components/schemas/ChartRestApi.get.Dashboard" + "items": { + "$ref": "#/components/schemas/Dashboard" + }, + "type": "array" + }, + "datasource_id": { + "type": "integer" + }, + "datasource_name_text": { + "readOnly": true + }, + "datasource_type": { + "type": "string" + }, + "datasource_url": { + "readOnly": true + }, + "datasource_uuid": { + "format": "uuid", + "type": "string" }, "description": { - "nullable": true, "type": "string" }, "id": { + "description": "The id of the chart.", "type": "integer" }, "is_managed_externally": { "type": "boolean" }, "owners": { - "$ref": "#/components/schemas/ChartRestApi.get.User" + "items": { + "$ref": "#/components/schemas/User" + }, + "type": "array" }, "params": { - "nullable": true, "type": "string" }, "query_context": { - "nullable": true, "type": "string" }, "slice_name": { - "maxLength": 250, - "nullable": true, "type": "string" }, "tags": { - "$ref": "#/components/schemas/ChartRestApi.get.Tag" + "items": { + "$ref": "#/components/schemas/Tag" + }, + "type": "array" }, "thumbnail_url": { - "readOnly": true + "type": "string" }, "url": { - "readOnly": true + "type": "string" + }, + "uuid": { + "format": "uuid", + "type": "string" }, "viz_type": { - "maxLength": 250, - "nullable": true, "type": "string" } }, "type": "object" }, - "ChartRestApi.get.Dashboard": { - "properties": { - "dashboard_title": { - "maxLength": 500, - "nullable": true, - "type": "string" - }, - "id": { - "type": "integer" - }, - "json_metadata": { - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "ChartRestApi.get.Tag": { + "ChartRestApi.get": { "properties": { "id": { "type": "integer" - }, - "name": { - "maxLength": 250, - "nullable": true, - "type": "string" - }, - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ] } }, "type": "object" }, - "ChartRestApi.get.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - } - }, - "required": [ - "first_name", - "last_name" - ], - "type": "object" - }, "ChartRestApi.get_list": { "properties": { "cache_timeout": { @@ -2924,6 +2814,10 @@ }, "ChartRestApi.get_list.User3": { "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, "first_name": { "maxLength": 64, "type": "string" @@ -2937,6 +2831,7 @@ } }, "required": [ + "email", "first_name", "last_name" ], @@ -3027,6 +2922,11 @@ "minLength": 1, "type": "string" }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + }, "viz_type": { "description": "The type of chart visualization used.", "example": [ @@ -3082,7 +2982,8 @@ "dataset", "query", "saved_query", - "view" + "view", + null ], "nullable": true, "type": "string" @@ -3136,6 +3037,11 @@ }, "type": "array" }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + }, "viz_type": { "description": "The type of chart visualization used.", "example": [ @@ -3316,6 +3222,41 @@ }, "type": "object" }, + "CurrentUserPutSchema": { + "properties": { + "first_name": { + "description": "The current user's first name", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + "last_name": { + "description": "The current user's last name", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + "password": { + "description": "The current user's password for authentication", + "type": "string" + } + }, + "type": "object" + }, + "Dashboard": { + "properties": { + "dashboard_title": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "json_metadata": { + "type": "string" + } + }, + "type": "object" + }, "DashboardCacheScreenshotResponseSchema": { "properties": { "cache_key": { @@ -3397,6 +3338,9 @@ }, "type": "array" }, + "currency_code_column": { + "type": "string" + }, "database": { "$ref": "#/components/schemas/Database" }, @@ -3514,6 +3458,45 @@ }, "type": "object" }, + "DashboardFilterInfo": { + "properties": { + "column": { + "description": "Target column name for the filter", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The native filter ID", + "type": "string" + }, + "name": { + "description": "The native filter name", + "type": "string" + }, + "status": { + "description": "Filter status: 'applied' (default value was included in the query), 'not_applied' (filter had no default value and was omitted, matching dashboard initial-load behavior), or 'not_applied_uses_default_to_first_item_prequery' (filter uses defaultToFirstItem which requires a pre-query to resolve and cannot be applied server-side)", + "type": "string" + } + }, + "required": [ + "id", + "name", + "status" + ], + "type": "object" + }, + "DashboardFiltersResponseSchema": { + "properties": { + "filters": { + "description": "Metadata about each in-scope dashboard native filter and whether its default value was applied to the query", + "items": { + "$ref": "#/components/schemas/DashboardFilterInfo" + }, + "type": "array" + } + }, + "type": "object" + }, "DashboardGetResponseSchema": { "properties": { "certification_details": { @@ -3525,7 +3508,7 @@ "type": "string" }, "changed_by": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" }, "changed_by_name": { "type": "string" @@ -3545,7 +3528,7 @@ "type": "array" }, "created_by": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" }, "created_on_delta_humanized": { "type": "string" @@ -3554,6 +3537,12 @@ "description": "Override CSS for the dashboard.", "type": "string" }, + "custom_tags": { + "items": { + "$ref": "#/components/schemas/Tag1" + }, + "type": "array" + }, "dashboard_title": { "description": "A title for the dashboard.", "type": "string" @@ -3571,7 +3560,7 @@ }, "owners": { "items": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" }, "type": "array" }, @@ -3593,16 +3582,29 @@ }, "tags": { "items": { - "$ref": "#/components/schemas/Tag" + "$ref": "#/components/schemas/Tag1" }, "type": "array" }, + "theme": { + "allOf": [ + { + "$ref": "#/components/schemas/Theme" + } + ], + "nullable": true + }, "thumbnail_url": { "nullable": true, "type": "string" }, "url": { "type": "string" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "type": "object" @@ -3622,6 +3624,11 @@ "nullable": true, "type": "string" }, + "chartStates": { + "description": "Chart-level state for stateful tables (column order, sorting, filtering)", + "nullable": true, + "type": "object" + }, "dataMask": { "description": "Data mask used for native filter state", "nullable": true, @@ -3799,6 +3806,10 @@ }, "DashboardRestApi.get_list.User2": { "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, "first_name": { "maxLength": 64, "type": "string" @@ -3812,6 +3823,7 @@ } }, "required": [ + "email", "first_name", "last_name" ], @@ -3880,6 +3892,16 @@ "minLength": 1, "nullable": true, "type": "string" + }, + "theme_id": { + "description": "Theme ID for the dashboard", + "nullable": true, + "type": "integer" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "type": "object" @@ -3961,6 +3983,42 @@ "type": "integer" }, "type": "array" + }, + "theme_id": { + "description": "Theme ID for the dashboard", + "nullable": true, + "type": "integer" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "DashboardScreenshotPostSchema": { + "properties": { + "activeTabs": { + "description": "A list representing active tabs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "anchor": { + "description": "A string representing the anchor.", + "type": "string" + }, + "dataMask": { + "additionalProperties": {}, + "description": "An object representing the data mask.", + "type": "object" + }, + "urlParams": { + "description": "A list of tuples, each containing two strings.", + "items": {}, + "type": "array" } }, "type": "object" @@ -4333,6 +4391,11 @@ "changed_on_delta_humanized": { "readOnly": true }, + "configuration_method": { + "maxLength": 255, + "nullable": true, + "type": "string" + }, "created_by": { "$ref": "#/components/schemas/DatabaseRestApi.get_list.User1" }, @@ -5067,6 +5130,12 @@ "minLength": 1, "type": "string" }, + "datetime_format": { + "maxLength": 100, + "minLength": 1, + "nullable": true, + "type": "string" + }, "description": { "nullable": true, "type": "string" @@ -5170,6 +5239,21 @@ ], "type": "object" }, + "DatasetMetricCurrencyPut": { + "properties": { + "symbol": { + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + "symbolPosition": { + "maxLength": 128, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, "DatasetMetricRestApi.get": { "properties": { "id": { @@ -5205,10 +5289,12 @@ "DatasetMetricsPut": { "properties": { "currency": { - "maxLength": 128, - "minLength": 1, - "nullable": true, - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/DatasetMetricCurrencyPut" + } + ], + "nullable": true }, "d3format": { "maxLength": 128, @@ -5342,8 +5428,7 @@ "type": "boolean" }, "cache_timeout": { - "nullable": true, - "type": "integer" + "readOnly": true }, "catalog": { "maxLength": 256, @@ -5378,6 +5463,11 @@ "created_on_humanized": { "readOnly": true }, + "currency_code_column": { + "maxLength": 250, + "nullable": true, + "type": "string" + }, "database": { "$ref": "#/components/schemas/DatasetRestApi.get.Database" }, @@ -5480,6 +5570,11 @@ "url": { "readOnly": true }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + }, "verbose_map": { "readOnly": true } @@ -5506,6 +5601,11 @@ }, "id": { "type": "integer" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "required": [ @@ -5793,6 +5893,11 @@ }, "id": { "type": "integer" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "required": [ @@ -5887,6 +5992,15 @@ "maxLength": 250, "minLength": 1, "type": "string" + }, + "template_params": { + "nullable": true, + "type": "string" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "required": [ @@ -5917,6 +6031,12 @@ }, "type": "array" }, + "currency_code_column": { + "maxLength": 250, + "minLength": 0, + "nullable": true, + "type": "string" + }, "database_id": { "type": "integer" }, @@ -6003,6 +6123,11 @@ "template_params": { "nullable": true, "type": "string" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" } }, "type": "object" @@ -6090,7 +6215,7 @@ "type": "array" }, "changed_by": { - "$ref": "#/components/schemas/User1" + "$ref": "#/components/schemas/User2" }, "changed_on": { "format": "date-time", @@ -6214,10 +6339,6 @@ "nullable": true, "type": "boolean" }, - "json": { - "nullable": true, - "type": "boolean" - }, "queryLimit": { "nullable": true, "type": "integer" @@ -6281,6 +6402,11 @@ }, "ExplorePermalinkStateSchema": { "properties": { + "chartState": { + "description": "Chart-level state for stateful tables (column filters, sorting, column order)", + "nullable": true, + "type": "object" + }, "formData": { "description": "Chart form data", "type": "object" @@ -6404,6 +6530,31 @@ ], "type": "object" }, + "FormatQueryPayloadSchema": { + "properties": { + "database_id": { + "description": "The database id", + "nullable": true, + "type": "integer" + }, + "engine": { + "nullable": true, + "type": "string" + }, + "sql": { + "type": "string" + }, + "template_params": { + "description": "The SQL query template params as JSON string", + "nullable": true, + "type": "string" + } + }, + "required": [ + "sql" + ], + "type": "object" + }, "GetFavStarIdsSchema": { "properties": { "result": { @@ -6459,6 +6610,290 @@ ], "type": "object" }, + "GroupApi.get": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + }, + "roles": { + "$ref": "#/components/schemas/GroupApi.get.Role" + }, + "users": { + "$ref": "#/components/schemas/GroupApi.get.User" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get.Role": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get.User": { + "properties": { + "id": { + "type": "integer" + }, + "username": { + "maxLength": 128, + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + }, + "GroupApi.get_list": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + }, + "roles": { + "$ref": "#/components/schemas/GroupApi.get_list.Role" + }, + "users": { + "$ref": "#/components/schemas/GroupApi.get_list.User" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get_list.Role": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get_list.User": { + "properties": { + "id": { + "type": "integer" + }, + "username": { + "maxLength": 128, + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + }, + "GroupApi.post": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.put": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + }, + "GroupPostSchema": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupPutSchema": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + }, "GuestTokenCreate": { "properties": { "resources": { @@ -6474,7 +6909,7 @@ "type": "array" }, "user": { - "$ref": "#/components/schemas/User2" + "$ref": "#/components/schemas/User3" } }, "required": [ @@ -6504,6 +6939,15 @@ "nullable": true, "type": "integer" }, + "configuration_method": { + "default": "sqlalchemy_form", + "enum": [ + "sqlalchemy_form", + "dynamic_form", + null + ], + "nullable": true + }, "database_name": { "type": "string" }, @@ -6528,6 +6972,9 @@ "nullable": true, "type": "boolean" }, + "masked_encrypted_extra": { + "type": "string" + }, "password": { "nullable": true, "type": "string" @@ -6593,6 +7040,9 @@ "additionalProperties": {}, "type": "object" }, + "per_user_caching": { + "type": "boolean" + }, "schema_options": { "additionalProperties": {}, "type": "object" @@ -6646,21 +7096,28 @@ "user": { "$ref": "#/components/schemas/LogRestApi.get.User" }, - "user_id": { - "nullable": true, - "type": "integer" - } + "user_id": {} }, "type": "object" }, "LogRestApi.get.User": { "properties": { - "username": { + "first_name": { "maxLength": 64, "type": "string" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "username": { + "maxLength": 128, + "type": "string" } }, "required": [ + "first_name", + "last_name", "username" ], "type": "object" @@ -6701,21 +7158,28 @@ "user": { "$ref": "#/components/schemas/LogRestApi.get_list.User" }, - "user_id": { - "nullable": true, - "type": "integer" - } + "user_id": {} }, "type": "object" }, "LogRestApi.get_list.User": { "properties": { - "username": { + "first_name": { "maxLength": 64, "type": "string" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "username": { + "maxLength": 128, + "type": "string" } }, "required": [ + "first_name", + "last_name", "username" ], "type": "object" @@ -6882,27 +7346,15 @@ }, "PermissionViewMenuApi.post": { "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } + "permission_id": {}, + "view_menu_id": {} }, "type": "object" }, "PermissionViewMenuApi.put": { "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } + "permission_id": {}, + "view_menu_id": {} }, "type": "object" }, @@ -7112,7 +7564,7 @@ "type": "string" }, "user": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" } }, "type": "object" @@ -7272,7 +7724,7 @@ "RLSRestApi.get_list": { "properties": { "changed_by": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" }, "changed_on_delta_humanized": { "readOnly": true @@ -7644,7 +8096,8 @@ "enum": [ "Email", "Slack", - "SlackV2" + "SlackV2", + "Webhook" ], "type": "string" } @@ -7861,6 +8314,10 @@ }, "ReportScheduleRestApi.get.User": { "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, "first_name": { "maxLength": 64, "type": "string" @@ -7874,6 +8331,7 @@ } }, "required": [ + "email", "first_name", "last_name" ], @@ -7896,10 +8354,7 @@ "changed_on_delta_humanized": { "readOnly": true }, - "chart_id": { - "nullable": true, - "type": "integer" - }, + "chart_id": {}, "created_by": { "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User1" }, @@ -7920,10 +8375,7 @@ "crontab_humanized": { "readOnly": true }, - "dashboard_id": { - "nullable": true, - "type": "integer" - }, + "dashboard_id": {}, "description": { "nullable": true, "type": "string" @@ -8022,6 +8474,10 @@ }, "ReportScheduleRestApi.get_list.User2": { "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, "first_name": { "maxLength": 64, "type": "string" @@ -8035,6 +8491,7 @@ } }, "required": [ + "email", "first_name", "last_name" ], @@ -8255,6 +8712,7 @@ "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -8807,7 +9265,8 @@ "enum": [ "charts", "dashboards", - "alerts_reports" + "alerts_reports", + null ], "nullable": true }, @@ -8828,6 +9287,7 @@ "type": "integer" }, "database": { + "nullable": true, "type": "integer" }, "description": { @@ -8996,6 +9456,7 @@ "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -9511,7 +9972,8 @@ "description": "Determines when to trigger alert based off value from alert query. Alerts will be triggered with these validator types:\n- Not Null - When the return value is Not NULL, Empty, or 0\n- Operator - When `sql_return_value comparison_operator threshold` is True e.g. `50 <= 75`
Supports the comparison operators <, <=, >, >=, ==, and !=", "enum": [ "not null", - "operator" + "operator", + null ], "nullable": true, "type": "string" @@ -9557,6 +10019,21 @@ ], "type": "object" }, + "RoleGroupPutSchema": { + "properties": { + "group_ids": { + "description": "List of group ids", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "group_ids" + ], + "type": "object" + }, "RolePermissionListSchema": { "properties": { "id": { @@ -9831,10 +10308,7 @@ "database": { "$ref": "#/components/schemas/SavedQueryRestApi.get_list.Database" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -9958,10 +10432,7 @@ "nullable": true, "type": "string" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -9998,10 +10469,7 @@ "nullable": true, "type": "string" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -10265,6 +10733,9 @@ "maxLength": 64, "type": "string" }, + "groups": { + "$ref": "#/components/schemas/SupersetUserApi.get.Group" + }, "id": { "type": "integer" }, @@ -10285,7 +10756,7 @@ "$ref": "#/components/schemas/SupersetUserApi.get.Role" }, "username": { - "maxLength": 64, + "maxLength": 128, "type": "string" } }, @@ -10297,6 +10768,31 @@ ], "type": "object" }, + "SupersetUserApi.get.Group": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "SupersetUserApi.get.Role": { "properties": { "id": { @@ -10362,6 +10858,9 @@ "maxLength": 64, "type": "string" }, + "groups": { + "$ref": "#/components/schemas/SupersetUserApi.get_list.Group" + }, "id": { "type": "integer" }, @@ -10382,7 +10881,7 @@ "$ref": "#/components/schemas/SupersetUserApi.get_list.Role" }, "username": { - "maxLength": 64, + "maxLength": 128, "type": "string" } }, @@ -10394,6 +10893,31 @@ ], "type": "object" }, + "SupersetUserApi.get_list.Group": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "SupersetUserApi.get_list.Role": { "properties": { "id": { @@ -10439,6 +10963,13 @@ "description": "The user's first name", "type": "string" }, + "groups": { + "description": "The user's roles", + "items": { + "type": "integer" + }, + "type": "array" + }, "last_name": { "description": "The user's last name", "type": "string" @@ -10452,7 +10983,6 @@ "items": { "type": "integer" }, - "minItems": 1, "type": "array" }, "username": { @@ -10467,7 +10997,6 @@ "first_name", "last_name", "password", - "roles", "username" ], "type": "object" @@ -10486,6 +11015,13 @@ "description": "The user's first name", "type": "string" }, + "groups": { + "description": "The user's roles", + "items": { + "type": "integer" + }, + "type": "array" + }, "last_name": { "description": "The user's last name", "type": "string" @@ -10499,7 +11035,6 @@ "items": { "type": "integer" }, - "minItems": 1, "type": "array" }, "username": { @@ -10817,6 +11352,25 @@ }, "type": "object" }, + "Tag1": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "type": { + "enum": [ + 1, + 2, + 3, + 4 + ] + } + }, + "type": "object" + }, "TagGetResponseSchema": { "properties": { "id": { @@ -10939,63 +11493,18 @@ }, "TagRestApi.get.User1": { "properties": { - "active": { - "nullable": true, - "type": "boolean" - }, - "changed_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "created_on": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "email": { - "maxLength": 320, - "type": "string" - }, - "fail_login_count": { - "nullable": true, - "type": "integer" - }, "first_name": { "maxLength": 64, "type": "string" }, - "id": { - "type": "integer" - }, - "last_login": { - "format": "date-time", - "nullable": true, - "type": "string" - }, "last_name": { "maxLength": 64, "type": "string" - }, - "login_count": { - "nullable": true, - "type": "integer" - }, - "password": { - "maxLength": 256, - "nullable": true, - "type": "string" - }, - "username": { - "maxLength": 64, - "type": "string" } }, "required": [ - "email", "first_name", - "last_name", - "username" + "last_name" ], "type": "object" }, @@ -11113,7 +11622,7 @@ "type": "string" }, "created_by": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/User1" }, "creator": { "type": "string" @@ -11126,7 +11635,7 @@ }, "owners": { "items": { - "$ref": "#/components/schemas/User1" + "$ref": "#/components/schemas/User2" }, "type": "array" }, @@ -11169,6 +11678,218 @@ ], "type": "object" }, + "Theme": { + "properties": { + "id": { + "type": "integer" + }, + "json_data": { + "type": "string" + }, + "theme_name": { + "type": "string" + } + }, + "type": "object" + }, + "ThemeRestApi.get": { + "properties": { + "changed_by": { + "$ref": "#/components/schemas/ThemeRestApi.get.User" + }, + "changed_on_delta_humanized": { + "readOnly": true + }, + "created_by": { + "$ref": "#/components/schemas/ThemeRestApi.get.User1" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "is_system_dark": { + "type": "boolean" + }, + "is_system_default": { + "type": "boolean" + }, + "json_data": { + "nullable": true, + "type": "string" + }, + "theme_name": { + "maxLength": 250, + "nullable": true, + "type": "string" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "ThemeRestApi.get.User": { + "properties": { + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "first_name", + "last_name" + ], + "type": "object" + }, + "ThemeRestApi.get.User1": { + "properties": { + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "first_name", + "last_name" + ], + "type": "object" + }, + "ThemeRestApi.get_list": { + "properties": { + "changed_by": { + "$ref": "#/components/schemas/ThemeRestApi.get_list.User" + }, + "changed_by_name": { + "readOnly": true + }, + "changed_on_delta_humanized": { + "readOnly": true + }, + "created_by": { + "$ref": "#/components/schemas/ThemeRestApi.get_list.User1" + }, + "created_on": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "is_system_dark": { + "type": "boolean" + }, + "is_system_default": { + "type": "boolean" + }, + "json_data": { + "nullable": true, + "type": "string" + }, + "theme_name": { + "maxLength": 250, + "nullable": true, + "type": "string" + }, + "uuid": { + "format": "uuid", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "ThemeRestApi.get_list.User": { + "properties": { + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "first_name", + "last_name" + ], + "type": "object" + }, + "ThemeRestApi.get_list.User1": { + "properties": { + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "first_name", + "last_name" + ], + "type": "object" + }, + "ThemeRestApi.post": { + "properties": { + "json_data": { + "type": "string" + }, + "theme_name": { + "type": "string" + } + }, + "required": [ + "json_data", + "theme_name" + ], + "type": "object" + }, + "ThemeRestApi.put": { + "properties": { + "json_data": { + "type": "string" + }, + "theme_name": { + "type": "string" + } + }, + "required": [ + "json_data", + "theme_name" + ], + "type": "object" + }, "UploadFileMetadata": { "properties": { "items": { @@ -11346,6 +12067,9 @@ }, "User": { "properties": { + "email": { + "type": "string" + }, "first_name": { "type": "string" }, @@ -11368,9 +12092,6 @@ }, "last_name": { "type": "string" - }, - "username": { - "type": "string" } }, "type": "object" @@ -11380,6 +12101,9 @@ "first_name": { "type": "string" }, + "id": { + "type": "integer" + }, "last_name": { "type": "string" }, @@ -11389,6 +12113,84 @@ }, "type": "object" }, + "User3": { + "properties": { + "first_name": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "UserRegistrationsRestAPI.get": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, + "UserRegistrationsRestAPI.get_list": { + "properties": { + "email": { + "maxLength": 320, + "type": "string" + }, + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "registration_date": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "registration_hash": { + "maxLength": 256, + "nullable": true, + "type": "string" + }, + "username": { + "maxLength": 128, + "type": "string" + } + }, + "required": [ + "email", + "first_name", + "last_name", + "username" + ], + "type": "object" + }, + "UserRegistrationsRestAPI.post": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, + "UserRegistrationsRestAPI.put": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, "UserResponseSchema": { "properties": { "email": { @@ -11409,6 +12211,9 @@ "last_name": { "type": "string" }, + "login_count": { + "type": "integer" + }, "username": { "type": "string" } @@ -11714,6 +12519,19 @@ "type": "boolean" }, { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, "type": "array" } ] @@ -11856,159 +12674,6 @@ } }, "type": "object" - }, - "DashboardScreenshotPostSchema": { - "type": "object", - "properties": { - "dataMask": { - "type": "object", - "description": "An object representing the data mask.", - "additionalProperties": true - }, - "activeTabs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list representing active tabs." - }, - "anchor": { - "type": "string", - "description": "A string representing the anchor." - }, - "urlParams": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 2, - "maxItems": 2 - }, - "description": "A list of tuples, each containing two strings." - } - } - }, - "DashboardNativeFiltersConfigUpdateSchema": { - "type": "object", - "properties": { - "deleted": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of deleted filter IDs." - }, - "modified": { - "type": "array", - "items": { - "type": "object" - }, - "description": "List of modified filter configurations." - }, - "reordered": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of filter IDs in new order." - } - } - }, - "DashboardColorsConfigUpdateSchema": { - "type": "object", - "properties": { - "color_namespace": { - "type": "string", - "nullable": true, - "description": "The color namespace." - }, - "color_scheme": { - "type": "string", - "nullable": true, - "description": "The color scheme name." - }, - "map_label_colors": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Mapping of labels to colors." - }, - "shared_label_colors": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Shared label colors across charts." - }, - "label_colors": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Label to color mapping." - }, - "color_scheme_domain": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Color scheme domain values." - } - } - }, - "FormatQueryPayloadSchema": { - "type": "object", - "required": [ - "sql" - ], - "properties": { - "sql": { - "type": "string", - "description": "The SQL query to format." - }, - "engine": { - "type": "string", - "nullable": true, - "description": "The database engine." - }, - "database_id": { - "type": "integer", - "nullable": true, - "description": "The database id." - }, - "template_params": { - "type": "string", - "nullable": true, - "description": "The SQL query template params as JSON string." - } - } - }, - "get_slack_channels_schema": { - "type": "object", - "properties": { - "search_string": { - "type": "string", - "description": "String to search for in channel names." - }, - "types": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "public_channel", - "private_channel" - ] - }, - "description": "Types of channels to search." - }, - "exact_match": { - "type": "boolean", - "description": "Whether to match channel names exactly." - } - } } }, "securitySchemes": { @@ -12053,16 +12718,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/AdvancedDataTypeSchema" - }, - "example": { - "display_value": "string", - "error_message": "string", - "valid_filter_operators": [ - "string" - ], - "values": [ - "string" - ] } } }, @@ -12092,23 +12747,6 @@ "summary": "Return an AdvancedDataTypeResponse", "tags": [ "Advanced Data Type" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/advanced_data_type/convert\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/advanced_data_type/convert\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/advanced_data_type/convert\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -12128,11 +12766,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - "string" - ] } } }, @@ -12159,23 +12792,6 @@ "summary": "Return a list of available advanced data types", "tags": [ "Advanced Data Type" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/advanced_data_type/types\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/advanced_data_type/types\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/advanced_data_type/types\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -12205,9 +12821,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -12234,23 +12847,6 @@ "summary": "Delete multiple annotation layers in a bulk operation", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/annotation_layer/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -12333,28 +12929,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -12378,26 +12952,9 @@ "jwt": [] } ], - "summary": "Get a list of annotation layers (annotation-layer)", + "summary": "Get a list of annotation layers", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -12406,10 +12963,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/AnnotationLayerRestApi.post" - }, - "example": { - "descr": "string", - "name": "string" } } }, @@ -12430,13 +12983,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "descr": "string", - "name": "string" - } } } }, @@ -12460,26 +13006,9 @@ "jwt": [] } ], - "summary": "Create an annotation layer (annotation-layer)", + "summary": "Create an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/annotation_layer/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -12541,18 +13070,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -12576,26 +13093,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (annotation-layer--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -12628,10 +13128,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -12655,26 +13151,9 @@ "jwt": [] } ], - "summary": "Get related fields data (annotation-layer-related-column-name)", + "summary": "Get related fields data", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -12702,9 +13181,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -12725,26 +13201,9 @@ "jwt": [] } ], - "summary": "Delete annotation layer (annotation-layer-pk)", + "summary": "Delete annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/annotation_layer/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -12817,24 +13276,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "descr": "string", - "id": 1, - "name": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -12861,26 +13302,9 @@ "jwt": [] } ], - "summary": "Get an annotation layer (annotation-layer-pk)", + "summary": "Get an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -12900,10 +13324,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/AnnotationLayerRestApi.put" - }, - "example": { - "descr": "string", - "name": "string" } } }, @@ -12924,13 +13344,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "descr": "string", - "name": "string" - } } } }, @@ -12954,26 +13367,9 @@ "jwt": [] } ], - "summary": "Update an annotation layer (annotation-layer-pk)", + "summary": "Update an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/annotation_layer/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13012,9 +13408,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -13041,23 +13434,6 @@ "summary": "Bulk delete annotation layers", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -13110,15 +13486,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "ids": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -13142,26 +13509,9 @@ "jwt": [] } ], - "summary": "Get a list of annotation layers (annotation-layer-pk-annotation)", + "summary": "Get a list of annotation layers", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -13181,13 +13531,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/AnnotationRestApi.post" - }, - "example": { - "end_dttm": "2024-01-15T10:30:00Z", - "json_metadata": "string", - "long_descr": "string", - "short_descr": "string", - "start_dttm": "2024-01-15T10:30:00Z" } } }, @@ -13208,16 +13551,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "end_dttm": "2024-01-15T10:30:00Z", - "json_metadata": "string", - "long_descr": "string", - "short_descr": "string", - "start_dttm": "2024-01-15T10:30:00Z" - } } } }, @@ -13241,26 +13574,9 @@ "jwt": [] } ], - "summary": "Create an annotation layer (annotation-layer-pk-annotation)", + "summary": "Create an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13297,9 +13613,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -13320,26 +13633,9 @@ "jwt": [] } ], - "summary": "Delete annotation layer (annotation-layer-pk-annotation-annotation-id)", + "summary": "Delete annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -13389,17 +13685,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "end_dttm": "2024-01-15T10:30:00Z", - "id": 1, - "json_metadata": "string", - "long_descr": "string", - "short_descr": "string", - "start_dttm": "2024-01-15T10:30:00Z" - } } } }, @@ -13426,26 +13711,9 @@ "jwt": [] } ], - "summary": "Get an annotation layer (annotation-layer-pk-annotation-annotation-id)", + "summary": "Get an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -13474,13 +13742,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/AnnotationRestApi.put" - }, - "example": { - "end_dttm": "2024-01-15T10:30:00Z", - "json_metadata": "string", - "long_descr": "string", - "short_descr": "string", - "start_dttm": "2024-01-15T10:30:00Z" } } }, @@ -13501,16 +13762,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "end_dttm": "2024-01-15T10:30:00Z", - "json_metadata": "string", - "long_descr": "string", - "short_descr": "string", - "start_dttm": "2024-01-15T10:30:00Z" - } } } }, @@ -13534,26 +13785,9 @@ "jwt": [] } ], - "summary": "Update an annotation layer (annotation-layer-pk-annotation-annotation-id)", + "summary": "Update an annotation layer", "tags": [ "Annotation Layers" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/annotation_layer/1/annotation/{annotation_id}\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13590,23 +13824,6 @@ "summary": "Export all assets", "tags": [ "Import/export" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/assets/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/assets/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/assets/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13622,6 +13839,10 @@ "format": "binary", "type": "string" }, + "encrypted_extra_secrets": { + "description": "JSON map of secret values for masked encrypted_extra fields. Each key is a database file path and the value is a map of JSONPath expressions to secret values. For example: `{\"databases/db.yaml\": {\"$.credentials_info.secret\": \"foo\"}}`.", + "type": "string" + }, "passwords": { "description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.", "type": "string" @@ -13660,9 +13881,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -13689,23 +13907,6 @@ "summary": "Import multiple assets", "tags": [ "Import/export" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/assets/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/assets/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/assets/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13762,19 +13963,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - { - "channel_id": "string", - "errors": [], - "id": "string", - "job_id": "string", - "result_url": "string", - "status": "string", - "user_id": 1 - } - ] } } }, @@ -13795,23 +13983,6 @@ "summary": "Read off of the Redis events stream", "tags": [ "AsyncEventsRestApi" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/async_event/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/async_event/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/async_event/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13828,11 +13999,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "domains": [] - } } } }, @@ -13853,23 +14019,6 @@ "summary": "Get all available domains", "tags": [ "Available Domains" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/available_domains/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/available_domains/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/available_domains/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13881,14 +14030,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/CacheInvalidationRequestSchema" - }, - "example": { - "datasource_uids": [ - "string" - ], - "datasources": [ - {} - ] } } }, @@ -13914,23 +14055,6 @@ "summary": "Invalidate cache records and remove the database records", "tags": [ "CacheRestApi" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/cachekey/invalidate\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/cachekey/invalidate\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/cachekey/invalidate\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -13960,9 +14084,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -13992,23 +14113,6 @@ "summary": "Bulk delete charts", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/chart/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/chart/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -14091,28 +14195,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -14139,23 +14221,6 @@ "summary": "Get a list of charts", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -14164,32 +14229,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartRestApi.post" - }, - "example": { - "cache_timeout": 1, - "certification_details": "string", - "certified_by": "string", - "dashboards": [ - 1 - ], - "datasource_id": 1, - "datasource_name": "string", - "datasource_type": "table", - "description": "string", - "external_url": "string", - "is_managed_externally": true, - "owners": [ - 1 - ], - "params": "string", - "query_context": "string", - "query_context_generation": true, - "slice_name": "string", - "viz_type": [ - "bar", - "area", - "table" - ] } } }, @@ -14210,31 +14249,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "cache_timeout": 1, - "certification_details": "string", - "certified_by": "string", - "dashboards": [], - "datasource_id": 1, - "datasource_name": "string", - "datasource_type": "table", - "description": "string", - "external_url": "string", - "is_managed_externally": true, - "owners": [], - "params": "string", - "query_context": "string", - "query_context_generation": true, - "slice_name": "string", - "viz_type": [ - "bar", - "area", - "table" - ] - } } } }, @@ -14264,23 +14278,6 @@ "summary": "Create a new chart", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/chart/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/chart/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14342,18 +14339,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -14377,26 +14362,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (chart--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14408,20 +14376,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataQueryContextSchema" - }, - "example": { - "custom_cache_timeout": 1, - "datasource": { - "id": {}, - "type": "table" - }, - "force": true, - "form_data": {}, - "queries": [ - {} - ], - "result_format": {}, - "result_type": {} } } }, @@ -14434,9 +14388,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataResponseSchema" - }, - "example": { - "result": [] } } }, @@ -14447,13 +14398,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataAsyncResponseSchema" - }, - "example": { - "channel_id": "string", - "job_id": "string", - "result_url": "string", - "status": "string", - "user_id": "string" } } }, @@ -14474,26 +14418,9 @@ "jwt": [] } ], - "summary": "Return payload data response for the given query (chart-data)", + "summary": "Return payload data response for the given query", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/chart/data\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/chart/data\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/data\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14516,9 +14443,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataResponseSchema" - }, - "example": { - "result": [] } } }, @@ -14545,26 +14469,9 @@ "jwt": [] } ], - "summary": "Return payload data response for the given query (chart-data-cache-key)", + "summary": "Return payload data response for the given query", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/data/{cache_key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/data/{cache_key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/data/{cache_key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14616,23 +14523,6 @@ "summary": "Download multiple charts as YAML files", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14657,9 +14547,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/GetFavStarIdsSchema" - }, - "example": { - "result": [] } } }, @@ -14686,23 +14573,6 @@ "summary": "Check favorited charts for current user", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/favorite_status/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/favorite_status/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/favorite_status/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14756,9 +14626,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -14785,23 +14652,6 @@ "summary": "Import chart(s) with associated datasets and databases", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/chart/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/chart/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14835,10 +14685,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -14862,26 +14708,9 @@ "jwt": [] } ], - "summary": "Get related fields data (chart-related-column-name)", + "summary": "Get related fields data", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -14893,11 +14722,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartCacheWarmUpRequestSchema" - }, - "example": { - "chart_id": 1, - "dashboard_id": 1, - "extra_filters": "string" } } }, @@ -14910,9 +14734,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartCacheWarmUpResponseSchema" - }, - "example": { - "result": [] } } }, @@ -14936,23 +14757,60 @@ "summary": "Warm up the cache for the chart", "tags": [ "Charts" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/chart/{id_or_uuid}": { + "get": { + "description": "Get a chart", + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/chart/warm_up_cache\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/chart/warm_up_cache\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/warm_up_cache\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "description": "Either the id of the chart, or its uuid", + "in": "path", + "name": "id_or_uuid", + "required": true, + "schema": { + "type": "string" + } } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/ChartGetResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "Chart" + }, + "302": { + "description": "Redirects to the current digest" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get a chart detail information", + "tags": [ + "Charts" ] } }, @@ -14979,9 +14837,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -15011,169 +14866,6 @@ "summary": "Delete a chart", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/chart/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/chart/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } - ] - }, - "get": { - "description": "Get an item model", - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/get_item_schema" - } - } - }, - "in": "query", - "name": "q" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "description_columns": { - "properties": { - "column_name": { - "description": "The description for the column name. Will be translated by babel", - "example": "A Nice description for the column", - "type": "string" - } - }, - "type": "object" - }, - "id": { - "description": "The item id", - "type": "string" - }, - "label_columns": { - "properties": { - "column_name": { - "description": "The label for the column name. Will be translated by babel", - "example": "A Nice label for the column", - "type": "string" - } - }, - "type": "object" - }, - "result": { - "$ref": "#/components/schemas/ChartRestApi.get" - }, - "show_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "show_title": { - "description": "A title to render. Will be translated by babel", - "example": "Show Item Details", - "type": "string" - } - }, - "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "cache_timeout": 1, - "certification_details": "string", - "certified_by": "string", - "changed_on_delta_humanized": {}, - "description": "string", - "id": 1, - "is_managed_externally": true, - "params": "string", - "query_context": "string", - "slice_name": "string", - "thumbnail_url": {}, - "url": {}, - "viz_type": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" - } - } - }, - "description": "Item from Model" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get a chart detail information", - "tags": [ - "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -15192,34 +14884,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartRestApi.put" - }, - "example": { - "cache_timeout": 1, - "certification_details": "string", - "certified_by": "string", - "dashboards": [ - 1 - ], - "datasource_id": 1, - "datasource_type": "table", - "description": "string", - "external_url": "string", - "is_managed_externally": true, - "owners": [ - 1 - ], - "params": "string", - "query_context": "string", - "query_context_generation": true, - "slice_name": "string", - "tags": [ - 1 - ], - "viz_type": [ - "bar", - "area", - "table" - ] } } }, @@ -15240,31 +14904,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "cache_timeout": 1, - "certification_details": "string", - "certified_by": "string", - "dashboards": [], - "datasource_id": 1, - "datasource_type": "table", - "description": "string", - "external_url": "string", - "is_managed_externally": true, - "owners": [], - "params": "string", - "query_context": "string", - "query_context_generation": true, - "slice_name": "string", - "tags": [], - "viz_type": [ - "bar", - "area", - "table" - ] - } } } }, @@ -15297,23 +14936,6 @@ "summary": "Update a chart", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/chart/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/chart/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -15346,13 +14968,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartCacheScreenshotResponseSchema" - }, - "example": { - "cache_key": "string", - "chart_url": "string", - "image_url": "string", - "task_status": "string", - "task_updated_at": "string" } } }, @@ -15363,13 +14978,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartCacheScreenshotResponseSchema" - }, - "example": { - "cache_key": "string", - "chart_url": "string", - "image_url": "string", - "task_status": "string", - "task_updated_at": "string" } } }, @@ -15393,32 +15001,15 @@ "jwt": [] } ], - "summary": "Compute and cache a screenshot (chart-pk-cache-screenshot)", + "summary": "Compute and cache a screenshot", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/1/cache_screenshot/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/1/cache_screenshot/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/cache_screenshot/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, "/api/v1/chart/{pk}/data/": { "get": { - "description": "Takes a chart ID and uses the query context stored when the chart was saved to return payload data response.", + "description": "Takes a chart ID and uses the query context stored when the chart was saved to return payload data response. When filters_dashboard_id is provided, the chart's compiled SQL includes in scope dashboard filter default values.", "parameters": [ { "description": "The chart ID", @@ -15452,6 +15043,14 @@ "schema": { "type": "boolean" } + }, + { + "description": "Dashboard ID whose filter defaults should be applied to the chart's query context. The chart must belong to the specified dashboard. Only in scope filters with static default values are applied; filters that require a database query (I.E. defaultToFirstItem) or have no default are reported in the dashboard_filters response metadata.", + "in": "query", + "name": "filters_dashboard_id", + "schema": { + "type": "integer" + } } ], "responses": { @@ -15460,9 +15059,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataResponseSchema" - }, - "example": { - "result": [] } } }, @@ -15473,13 +15069,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ChartDataAsyncResponseSchema" - }, - "example": { - "channel_id": "string", - "job_id": "string", - "result_url": "string", - "status": "string", - "user_id": "string" } } }, @@ -15491,6 +15080,12 @@ "401": { "$ref": "#/components/responses/401" }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, "500": { "$ref": "#/components/responses/500" } @@ -15503,23 +15098,6 @@ "summary": "Return payload data response for a chart", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/1/data/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/1/data/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/data/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -15546,9 +15124,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -15572,23 +15147,6 @@ "summary": "Remove the chart from the user favorite list", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/chart/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/chart/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/favorites/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "post": { @@ -15613,9 +15171,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -15639,23 +15194,6 @@ "summary": "Mark the chart as favorite for the current user", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/chart/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/chart/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/favorites/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -15709,26 +15247,9 @@ "jwt": [] } ], - "summary": "Get a computed screenshot from cache (chart-pk-screenshot-digest)", + "summary": "Get a computed screenshot from cache", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/1/screenshot/{digest}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/1/screenshot/{digest}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/screenshot/{digest}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -15790,23 +15311,6 @@ "summary": "Get chart thumbnail", "tags": [ "Charts" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/chart/1/thumbnail/{digest}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/chart/1/thumbnail/{digest}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/chart/1/thumbnail/{digest}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -15836,9 +15340,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -15865,23 +15366,6 @@ "summary": "Bulk delete CSS templates", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/css_template/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/css_template/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -15964,28 +15448,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -16012,23 +15474,6 @@ "summary": "Get a list of CSS templates", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/css_template/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/css_template/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -16037,10 +15482,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/CssTemplateRestApi.post" - }, - "example": { - "css": "string", - "template_name": "string" } } }, @@ -16061,13 +15502,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "css": "string", - "template_name": "string" - } } } }, @@ -16094,23 +15528,6 @@ "summary": "Create a CSS template", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/css_template/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/css_template/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -16172,18 +15589,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -16207,26 +15612,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (css-template--info)", + "summary": "Get metadata information about this API resource", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/css_template/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/css_template/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -16259,10 +15647,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -16286,26 +15670,9 @@ "jwt": [] } ], - "summary": "Get related fields data (css-template-related-column-name)", + "summary": "Get related fields data", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/css_template/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/css_template/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -16332,9 +15699,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -16358,23 +15722,6 @@ "summary": "Delete a CSS template", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/css_template/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/css_template/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -16447,25 +15794,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "changed_on_delta_humanized": {}, - "css": "string", - "id": 1, - "template_name": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -16495,23 +15823,6 @@ "summary": "Get a CSS template", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/css_template/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/css_template/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -16530,10 +15841,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/CssTemplateRestApi.put" - }, - "example": { - "css": "string", - "template_name": "string" } } }, @@ -16551,12 +15858,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "css": "string", - "template_name": "string" - } } } }, @@ -16586,23 +15887,6 @@ "summary": "Update a CSS template", "tags": [ "CSS Templates" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/css_template/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/css_template/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/css_template/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -16632,9 +15916,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -16664,23 +15945,6 @@ "summary": "Bulk delete dashboards", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dashboard/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dashboard/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -16705,90 +15969,26 @@ "schema": { "properties": { "count": { - "description": "The total record count on the backend", - "type": "number" - }, - "description_columns": { - "properties": { - "column_name": { - "description": "The description for the column name. Will be translated by babel", - "example": "A Nice description for the column", - "type": "string" - } - }, - "type": "object" + "type": "integer" }, "ids": { - "description": "A list of item ids, useful when you don't know the column id", "items": { - "type": "string" - }, - "type": "array" - }, - "label_columns": { - "properties": { - "column_name": { - "description": "The label for the column name. Will be translated by babel", - "example": "A Nice label for the column", - "type": "string" - } - }, - "type": "object" - }, - "list_columns": { - "description": "A list of columns", - "items": { - "type": "string" - }, - "type": "array" - }, - "list_title": { - "description": "A title to render. Will be translated by babel", - "example": "List Items", - "type": "string" - }, - "order_columns": { - "description": "A list of allowed columns to sort", - "items": { - "type": "string" + "type": "integer" }, "type": "array" }, "result": { - "description": "The result from the get list query", "items": { - "$ref": "#/components/schemas/DashboardRestApi.get_list" + "type": "object" }, "type": "array" } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, - "description": "Items from Model" + "description": "Dashboards" }, "400": { "$ref": "#/components/responses/400" @@ -16811,23 +16011,6 @@ "summary": "Get a list of dashboards", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -16836,24 +16019,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardRestApi.post" - }, - "example": { - "certification_details": "string", - "certified_by": "string", - "css": "string", - "dashboard_title": "string", - "external_url": "string", - "is_managed_externally": true, - "json_metadata": "string", - "owners": [ - 1 - ], - "position_json": "string", - "published": true, - "roles": [ - 1 - ], - "slug": "string" } } }, @@ -16874,23 +16039,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "certification_details": "string", - "certified_by": "string", - "css": "string", - "dashboard_title": "string", - "external_url": "string", - "is_managed_externally": true, - "json_metadata": "string", - "owners": [], - "position_json": "string", - "published": true, - "roles": [], - "slug": "string" - } } } }, @@ -16917,23 +16065,6 @@ "summary": "Create a new dashboard", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -16995,18 +16126,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -17030,26 +16149,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (dashboard--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17103,23 +16205,6 @@ "summary": "Download multiple dashboards as YAML files", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17144,9 +16229,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/GetFavStarIdsSchema" - }, - "example": { - "result": [] } } }, @@ -17173,23 +16255,6 @@ "summary": "Check favorited dashboards for current user", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/favorite_status/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/favorite_status/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/favorite_status/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17243,9 +16308,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -17272,23 +16334,6 @@ "summary": "Import dashboard(s) with associated charts/datasets/databases", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17316,9 +16361,6 @@ } }, "type": "object" - }, - "example": { - "state": {} } } }, @@ -17348,23 +16390,6 @@ "summary": "Get dashboard's permanent link state", "tags": [ "Dashboard Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/permalink/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/permalink/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/permalink/{key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17398,10 +16423,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -17425,26 +16446,9 @@ "jwt": [] } ], - "summary": "Get related fields data (dashboard-related-column-name)", + "summary": "Get related fields data", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17459,6 +16463,17 @@ "schema": { "type": "string" } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" } ], "responses": { @@ -17472,30 +16487,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "certification_details": "string", - "certified_by": "string", - "changed_by_name": "string", - "changed_on": "2024-01-15T10:30:00Z", - "changed_on_delta_humanized": "string", - "charts": [], - "created_on_delta_humanized": "string", - "css": "string", - "dashboard_title": "string", - "id": 1, - "is_managed_externally": true, - "json_metadata": "string", - "owners": [], - "position_json": "string", - "published": true, - "roles": [], - "slug": "string", - "tags": [], - "thumbnail_url": "string", - "url": "string" - } } } }, @@ -17522,23 +16513,6 @@ "summary": "Get a dashboard detail information", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17568,11 +16542,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -17599,23 +16568,6 @@ "summary": "Get a dashboard's chart definitions.", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/charts\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/charts\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/charts\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17637,12 +16589,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardCopySchema" - }, - "example": { - "css": "string", - "dashboard_title": "string", - "duplicate_slices": true, - "json_metadata": "string" } } }, @@ -17662,10 +16608,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "last_modified_time": 1.0 } } }, @@ -17695,23 +16637,6 @@ "summary": "Create a copy of an existing dashboard", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/copy/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/copy/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/copy/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17743,11 +16668,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -17774,23 +16694,6 @@ "summary": "Get dashboard's datasets", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/datasets\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/datasets\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/datasets\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -17818,9 +16721,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -17841,23 +16741,6 @@ "summary": "Delete a dashboard's embedded configuration", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dashboard/1/embedded\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -17883,14 +16766,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "allowed_domains": [], - "changed_on": "2024-01-15T10:30:00Z", - "dashboard_id": "string", - "uuid": "string" - } } } }, @@ -17911,23 +16786,6 @@ "summary": "Get the dashboard's embedded configuration", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/embedded\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -17947,11 +16805,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddedDashboardConfig" - }, - "example": { - "allowed_domains": [ - "string" - ] } } }, @@ -17969,14 +16822,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "allowed_domains": [], - "changed_on": "2024-01-15T10:30:00Z", - "dashboard_id": "string", - "uuid": "string" - } } } }, @@ -17997,23 +16842,6 @@ "summary": "Set a dashboard's embedded configuration", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/embedded\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -18034,11 +16862,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddedDashboardConfig" - }, - "example": { - "allowed_domains": [ - "string" - ] } } }, @@ -18056,14 +16879,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "allowed_domains": [], - "changed_on": "2024-01-15T10:30:00Z", - "dashboard_id": "string", - "uuid": "string" - } } } }, @@ -18083,25 +16898,6 @@ ], "tags": [ "Dashboards" - ], - "operationId": "update_dashboard_by_id_or_slug_embedded", - "summary": "Update dashboard by id_or_slug embedded", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dashboard/1/embedded\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/embedded\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -18133,9 +16929,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -18162,23 +16955,6 @@ "summary": "Get dashboard's tabs", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/tabs\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/tabs\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/tabs\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -18205,9 +16981,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -18237,23 +17010,6 @@ "summary": "Delete a dashboard", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dashboard/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dashboard/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "put": { @@ -18272,27 +17028,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardRestApi.put" - }, - "example": { - "certification_details": "string", - "certified_by": "string", - "css": "string", - "dashboard_title": "string", - "external_url": "string", - "is_managed_externally": true, - "json_metadata": "string", - "owners": [ - 1 - ], - "position_json": "string", - "published": true, - "roles": [ - 1 - ], - "slug": "string", - "tags": [ - 1 - ] } } }, @@ -18316,25 +17051,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "last_modified_time": 1.0, - "result": { - "certification_details": "string", - "certified_by": "string", - "css": "string", - "dashboard_title": "string", - "external_url": "string", - "is_managed_externally": true, - "json_metadata": "string", - "owners": [], - "position_json": "string", - "published": true, - "roles": [], - "slug": "string", - "tags": [] - } } } }, @@ -18367,23 +17083,6 @@ "summary": "Update a dashboard", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dashboard/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dashboard/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -18404,20 +17103,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardScreenshotPostSchema" - }, - "example": { - "dataMask": { - "key": "value" - }, - "activeTabs": [ - "string" - ], - "anchor": "string", - "urlParams": [ - [ - "string" - ] - ] } } } @@ -18428,13 +17113,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardCacheScreenshotResponseSchema" - }, - "example": { - "cache_key": "string", - "dashboard_url": "string", - "image_url": "string", - "task_status": "string", - "task_updated_at": "string" } } }, @@ -18458,26 +17136,78 @@ "jwt": [] } ], - "summary": "Compute and cache a screenshot (dashboard-pk-cache-dashboard-screenshot)", + "summary": "Compute and cache a screenshot", "tags": [ "Dashboards" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/dashboard/{pk}/chart_customizations": { + "put": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/cache_dashboard_screenshot/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/cache_dashboard_screenshot/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/cache_dashboard_screenshot/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DashboardChartCustomizationsConfigUpdateSchema" + } + } + }, + "description": "Chart customizations configuration", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Dashboard chart customizations updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Update chart customizations configuration for a dashboard.", + "tags": [ + "Dashboards" ] } }, @@ -18506,22 +17236,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardColorsConfigUpdateSchema" - }, - "example": { - "color_namespace": "string", - "color_scheme": "string", - "map_label_colors": { - "key": "value" - }, - "shared_label_colors": { - "key": "value" - }, - "label_colors": { - "key": "value" - }, - "color_scheme_domain": [ - "string" - ] } } }, @@ -18539,9 +17253,6 @@ } }, "type": "object" - }, - "example": { - "result": [] } } }, @@ -18574,23 +17285,73 @@ "summary": "Update colors configuration for a dashboard.", "tags": [ "Dashboards" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/dashboard/{pk}/export_as_example/": { + "get": { + "description": "Exports a dashboard with its charts and datasets in the example format used by the Superset example loading system. The export includes Parquet data files and YAML configuration files.", + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dashboard/1/colors\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" + "description": "The dashboard id", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } }, { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dashboard/1/colors\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" + "description": "Whether to include Parquet data files", + "in": "query", + "name": "export_data", + "schema": { + "default": true, + "type": "boolean" + } }, { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/colors\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "description": "Limit data export to this many rows per dataset", + "in": "query", + "name": "sample_rows", + "schema": { + "type": "integer" + } } + ], + "responses": { + "200": { + "content": { + "application/zip": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "description": "Example bundle ZIP file" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Export dashboard as example bundle", + "tags": [ + "Dashboards" ] } }, @@ -18617,9 +17378,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -18643,23 +17401,6 @@ "summary": "Remove the dashboard from the user favorite list", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dashboard/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dashboard/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/favorites/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "post": { @@ -18684,9 +17425,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -18710,23 +17448,6 @@ "summary": "Mark the dashboard as favorite for the current user", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/favorites/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -18855,9 +17576,6 @@ }, "schema": { "$ref": "#/components/schemas/TemporaryCachePostSchema" - }, - "example": { - "value": "string" } } }, @@ -18875,9 +17593,6 @@ } }, "type": "object" - }, - "example": { - "key": "string" } } }, @@ -18904,23 +17619,6 @@ "summary": "Create a dashboard's filter state", "tags": [ "Dashboard Filter State" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/filter_state\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -18957,9 +17655,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -18989,23 +17684,6 @@ "summary": "Delete a dashboard's filter state value", "tags": [ "Dashboard Filter State" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -19039,9 +17717,6 @@ } }, "type": "object" - }, - "example": { - "value": "string" } } }, @@ -19071,23 +17746,6 @@ "summary": "Get a dashboard's filter state value", "tags": [ "Dashboard Filter State" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -19121,9 +17779,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TemporaryCachePutSchema" - }, - "example": { - "value": "string" } } }, @@ -19141,9 +17796,6 @@ } }, "type": "object" - }, - "example": { - "key": "string" } } }, @@ -19173,23 +17825,6 @@ "summary": "Update a dashboard's filter state value", "tags": [ "Dashboard Filter State" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/filter_state/{key}\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -19210,17 +17845,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DashboardNativeFiltersConfigUpdateSchema" - }, - "example": { - "deleted": [ - "string" - ], - "modified": [ - {} - ], - "reordered": [ - "string" - ] } } }, @@ -19238,9 +17862,6 @@ } }, "type": "object" - }, - "example": { - "result": [] } } }, @@ -19273,23 +17894,6 @@ "summary": "Update native filters configuration for a dashboard.", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dashboard/1/filters\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dashboard/1/filters\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/filters\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -19416,16 +18020,6 @@ }, "schema": { "$ref": "#/components/schemas/DashboardPermalinkStateSchema" - }, - "example": { - "activeTabs": [ - "string" - ], - "anchor": "string", - "dataMask": {}, - "urlParams": [ - {} - ] } } }, @@ -19447,10 +18041,6 @@ } }, "type": "object" - }, - "example": { - "key": "string", - "url": "string" } } }, @@ -19477,23 +18067,6 @@ "summary": "Create a new dashboard's permanent link", "tags": [ "Dashboard Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dashboard/1/permalink\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dashboard/1/permalink\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/permalink\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -19558,26 +18131,9 @@ "jwt": [] } ], - "summary": "Get a computed screenshot from cache (dashboard-pk-screenshot-digest)", + "summary": "Get a computed screenshot from cache", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/screenshot/{digest}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/screenshot/{digest}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/screenshot/{digest}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -19625,9 +18181,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -19657,23 +18210,6 @@ "summary": "Get dashboard's thumbnail", "tags": [ "Dashboards" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dashboard/1/thumbnail/{digest}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dashboard/1/thumbnail/{digest}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dashboard/1/thumbnail/{digest}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -19758,28 +18294,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -19806,23 +18320,6 @@ "summary": "Get a list of databases", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -19831,30 +18328,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRestApi.post" - }, - "example": { - "allow_ctas": true, - "allow_cvas": true, - "allow_dml": true, - "allow_file_upload": true, - "allow_run_async": true, - "cache_timeout": 1, - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "expose_in_sqllab": true, - "external_url": "string", - "extra": "string", - "force_ctas_schema": "string", - "impersonate_user": true, - "is_managed_externally": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {}, - "uuid": "string" } } }, @@ -19875,33 +18348,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "allow_ctas": true, - "allow_cvas": true, - "allow_dml": true, - "allow_file_upload": true, - "allow_run_async": true, - "cache_timeout": 1, - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "expose_in_sqllab": true, - "external_url": "string", - "extra": "string", - "force_ctas_schema": "string", - "impersonate_user": true, - "is_managed_externally": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {}, - "uuid": "string" - } } } }, @@ -19928,23 +18374,6 @@ "summary": "Create a new database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20006,18 +18435,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -20041,26 +18458,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (database--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20122,24 +18522,7 @@ "type": "object" }, "type": "array" - }, - "example": [ - { - "available_drivers": [ - "string" - ], - "default_driver": "string", - "engine": "string", - "engine_information": { - "disable_ssh_tunneling": true, - "supports_file_upload": true - }, - "name": "string", - "parameters": {}, - "preferred": true, - "sqlalchemy_uri_placeholder": "string" - } - ] + } } }, "description": "Database names" @@ -20159,23 +18542,6 @@ "summary": "Get names of databases currently available", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/available/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/available/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/available/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20224,23 +18590,6 @@ "summary": "Download database(s) and associated dataset(s) as a zip file", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20251,6 +18600,10 @@ "multipart/form-data": { "schema": { "properties": { + "encrypted_extra_secrets": { + "description": "JSON map of sensitive values for masked_encrypted_extra fields. Keys are file paths (e.g., \"databases/db.yaml\") and values are JSON objects mapping JSONPath expressions to secrets. (e.g., `{\"databases/MyDatabase.yaml\": {\"$.credentials_info.private_key\": \"actual_key\"}}`).", + "type": "string" + }, "formData": { "description": "upload file (ZIP)", "format": "binary", @@ -20294,9 +18647,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -20323,23 +18673,6 @@ "summary": "Import database(s) with associated datasets", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20405,23 +18738,6 @@ "summary": "Receive personal access tokens from OAuth2", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/oauth2/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/oauth2/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/oauth2/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20454,10 +18770,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -20481,26 +18793,9 @@ "jwt": [] } ], - "summary": "Get related fields data (database-related-column-name)", + "summary": "Get related fields data", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20511,19 +18806,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseTestConnectionSchema" - }, - "example": { - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "extra": "string", - "impersonate_user": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {} } } }, @@ -20541,9 +18823,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -20567,23 +18846,6 @@ "summary": "Test a database connection", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/test_connection/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/test_connection/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/test_connection/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20610,11 +18872,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "items": [] - } } } }, @@ -20641,23 +18898,6 @@ "summary": "Upload a file and returns file metadata", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/upload_metadata/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/upload_metadata/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/upload_metadata/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20668,23 +18908,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseValidateParametersSchema" - }, - "example": { - "catalog": { - "key": "value" - }, - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "extra": "string", - "id": 1, - "impersonate_user": true, - "masked_encrypted_extra": "string", - "parameters": { - "key": "value" - }, - "server_cert": "string" } } }, @@ -20702,9 +18925,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -20728,23 +18948,6 @@ "summary": "Validate database connection parameters", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/validate_parameters/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/validate_parameters/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/validate_parameters/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -20771,9 +18974,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -20803,23 +19003,6 @@ "summary": "Delete a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/database/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/database/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -20866,23 +19049,6 @@ "summary": "Get a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -20901,30 +19067,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRestApi.put" - }, - "example": { - "allow_ctas": true, - "allow_cvas": true, - "allow_dml": true, - "allow_file_upload": true, - "allow_run_async": true, - "cache_timeout": 1, - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "expose_in_sqllab": true, - "external_url": "string", - "extra": "string", - "force_ctas_schema": "string", - "impersonate_user": true, - "is_managed_externally": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {}, - "uuid": "string" } } }, @@ -20945,33 +19087,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "allow_ctas": true, - "allow_cvas": true, - "allow_dml": true, - "allow_file_upload": true, - "allow_run_async": true, - "cache_timeout": 1, - "configuration_method": {}, - "database_name": "string", - "driver": "string", - "engine": "string", - "expose_in_sqllab": true, - "external_url": "string", - "extra": "string", - "force_ctas_schema": "string", - "impersonate_user": true, - "is_managed_externally": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {}, - "uuid": "string" - } } } }, @@ -21004,23 +19119,6 @@ "summary": "Change a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/database/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/database/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21054,11 +19152,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/CatalogsResponseSchema" - }, - "example": { - "result": [ - "string" - ] } } }, @@ -21085,23 +19178,6 @@ "summary": "Get all catalogs from a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/catalogs/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/catalogs/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/catalogs/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21124,32 +19200,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseConnectionSchema" - }, - "example": { - "allow_ctas": true, - "allow_cvas": true, - "allow_dml": true, - "allow_file_upload": true, - "allow_run_async": true, - "backend": "string", - "cache_timeout": 1, - "configuration_method": "string", - "database_name": "string", - "driver": "string", - "engine_information": {}, - "expose_in_sqllab": true, - "extra": "string", - "force_ctas_schema": "string", - "id": 1, - "impersonate_user": true, - "is_managed_externally": true, - "masked_encrypted_extra": "string", - "parameters": {}, - "parameters_schema": {}, - "server_cert": "string", - "sqlalchemy_uri": "string", - "ssh_tunnel": {}, - "uuid": "string" } } }, @@ -21176,23 +19226,6 @@ "summary": "Get a database connection info", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/connection\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/connection\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/connection\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21214,11 +19247,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseFunctionNamesResponse" - }, - "example": { - "function_names": [ - "string" - ] } } }, @@ -21242,23 +19270,6 @@ "summary": "Get function names supported by a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/function_names/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/function_names/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/function_names/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21280,10 +19291,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseRelatedObjectsResponse" - }, - "example": { - "charts": {}, - "dashboards": {} } } }, @@ -21307,23 +19314,6 @@ "summary": "Get charts and dashboards count associated to a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/related_objects/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/related_objects/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/related_objects/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21357,11 +19347,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SchemasResponseSchema" - }, - "example": { - "result": [ - "string" - ] } } }, @@ -21388,23 +19373,6 @@ "summary": "Get all schemas from a database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/schemas/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/schemas/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/schemas/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21426,11 +19394,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseSchemaAccessForFileUploadResponse" - }, - "example": { - "schemas": [ - "string" - ] } } }, @@ -21454,23 +19417,6 @@ "summary": "The list of the database schemas where to upload information", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/schemas_access_for_file_upload/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/schemas_access_for_file_upload/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/schemas_access_for_file_upload/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21511,9 +19457,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SelectStarResponseSchema" - }, - "example": { - "result": "string" } } }, @@ -21540,26 +19483,9 @@ "jwt": [] } ], - "summary": "Get database select star for table (database-pk-select-star-table-name)", + "summary": "Get database select star for table", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21600,9 +19526,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SelectStarResponseSchema" - }, - "example": { - "result": "string" } } }, @@ -21629,101 +19552,9 @@ "jwt": [] } ], - "summary": "Get database select star for table (database-pk-select-star-table-name-schema-name)", + "summary": "Get database select star for table", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/{schema_name}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/{schema_name}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/select_star/{table_name}/{schema_name}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } - ] - } - }, - "/api/v1/database/{pk}/ssh_tunnel/": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - }, - "example": { - "message": "string" - } - } - }, - "description": "SSH Tunnel deleted" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a SSH tunnel", - "tags": [ - "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/database/1/ssh_tunnel/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/database/1/ssh_tunnel/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/ssh_tunnel/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] } }, @@ -21751,9 +19582,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -21780,23 +19608,6 @@ "summary": "Re-sync all permissions for a database connection", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/1/sync_permissions/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/1/sync_permissions/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/sync_permissions/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21837,14 +19648,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TableMetadataResponseSchema" - }, - "example": { - "columns": [], - "foreignKeys": [], - "indexes": [], - "name": "string", - "primaryKey": {}, - "selectStar": "string" } } }, @@ -21874,23 +19677,6 @@ "summary": "Get database table metadata", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/table/{table_name}/{schema_name}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/table/{table_name}/{schema_name}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/table/{table_name}/{schema_name}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -21932,11 +19718,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" - }, - "example": { - "clustering": {}, - "metadata": {}, - "partitions": {} } } }, @@ -21963,26 +19744,9 @@ "jwt": [] } ], - "summary": "Get table extra metadata (database-pk-table-extra-table-name-schema-name)", + "summary": "Get table extra metadata", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/table_extra/{table_name}/{schema_name}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/table_extra/{table_name}/{schema_name}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/table_extra/{table_name}/{schema_name}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22031,11 +19795,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" - }, - "example": { - "clustering": {}, - "metadata": {}, - "partitions": {} } } }, @@ -22059,23 +19818,6 @@ "summary": "Get table metadata", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/table_metadata/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/table_metadata/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/table_metadata/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22124,11 +19866,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" - }, - "example": { - "clustering": {}, - "metadata": {}, - "partitions": {} } } }, @@ -22149,26 +19886,9 @@ "jwt": [] } ], - "summary": "Get table extra metadata (database-pk-table-metadata-extra)", + "summary": "Get table extra metadata", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/table_metadata/extra/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/table_metadata/extra/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/table_metadata/extra/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22214,12 +19934,6 @@ } }, "type": "object" - }, - "example": { - "count": 1, - "result": [ - {} - ] } } }, @@ -22249,23 +19963,6 @@ "summary": "Get a list of tables for given database", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/database/1/tables/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/database/1/tables/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/tables/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22302,9 +19999,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -22334,23 +20028,6 @@ "summary": "Upload a file to a database table", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/1/upload/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/1/upload/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/upload/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22372,12 +20049,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ValidateSQLRequest" - }, - "example": { - "catalog": "string", - "schema": "string", - "sql": "string", - "template_params": {} } } }, @@ -22399,11 +20070,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -22430,23 +20096,6 @@ "summary": "Validate arbitrary SQL", "tags": [ "Database" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/database/1/validate_sql/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/database/1/validate_sql/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/database/1/validate_sql/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22476,9 +20125,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -22511,23 +20157,6 @@ "summary": "Bulk delete datasets", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dataset/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dataset/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -22610,28 +20239,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -22658,23 +20265,6 @@ "summary": "Get a list of datasets", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -22683,20 +20273,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatasetRestApi.post" - }, - "example": { - "always_filter_main_dttm": true, - "catalog": "string", - "database": 1, - "external_url": "string", - "is_managed_externally": true, - "normalize_columns": true, - "owners": [ - 1 - ], - "schema": "string", - "sql": "string", - "table_name": "string" } } }, @@ -22717,21 +20293,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "always_filter_main_dttm": true, - "catalog": "string", - "database": 1, - "external_url": "string", - "is_managed_externally": true, - "normalize_columns": true, - "owners": [], - "schema": "string", - "sql": "string", - "table_name": "string" - } } } }, @@ -22758,23 +20319,6 @@ "summary": "Create a new dataset", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dataset/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dataset/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22836,18 +20380,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -22871,26 +20403,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (dataset--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22923,10 +20438,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DistincResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -22950,26 +20461,9 @@ "jwt": [] } ], - "summary": "Get distinct values from field data (dataset-distinct-column-name)", + "summary": "Get distinct values from field data", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/distinct/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/distinct/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/distinct/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -22980,10 +20474,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatasetDuplicateSchema" - }, - "example": { - "base_model_id": 1, - "table_name": "string" } } }, @@ -23004,13 +20494,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "base_model_id": 1, - "table_name": "string" - } } } }, @@ -23043,23 +20526,6 @@ "summary": "Duplicate a dataset", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dataset/duplicate\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dataset/duplicate\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/duplicate\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23110,23 +20576,6 @@ "summary": "Download multiple datasets as YAML files", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23137,15 +20586,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/GetOrCreateDatasetSchema" - }, - "example": { - "always_filter_main_dttm": true, - "catalog": "string", - "database_id": 1, - "normalize_columns": true, - "schema": "string", - "table_name": "string", - "template_params": "string" } } }, @@ -23167,11 +20607,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "table_id": 1 - } } } }, @@ -23198,23 +20633,6 @@ "summary": "Retrieve a table by name, or create it if it does not exist", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dataset/get_or_create/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dataset/get_or_create/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/get_or_create/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23276,9 +20694,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -23305,23 +20720,6 @@ "summary": "Import dataset(s) with associated databases", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/dataset/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/dataset/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23354,10 +20752,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -23381,26 +20775,9 @@ "jwt": [] } ], - "summary": "Get related fields data (dataset-related-column-name)", + "summary": "Get related fields data", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23412,12 +20789,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatasetCacheWarmUpRequestSchema" - }, - "example": { - "dashboard_id": 1, - "db_name": "string", - "extra_filters": "string", - "table_name": "string" } } }, @@ -23430,9 +20801,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatasetCacheWarmUpResponseSchema" - }, - "example": { - "result": [] } } }, @@ -23456,110 +20824,20 @@ "summary": "Warm up the cache for each chart powered by the given table", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dataset/warm_up_cache\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dataset/warm_up_cache\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/warm_up_cache\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, - "/api/v1/dataset/{pk}": { - "delete": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - } - }, - "type": "object" - }, - "example": { - "message": "string" - } - } - }, - "description": "Dataset delete" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Delete a dataset", - "tags": [ - "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dataset/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dataset/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } - ] - }, + "/api/v1/dataset/{id_or_uuid}": { "get": { "description": "Get a dataset by ID", "parameters": [ { - "description": "The dataset ID", + "description": "Either the id of the dataset, or its uuid", "in": "path", - "name": "pk", + "name": "id_or_uuid", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { @@ -23597,46 +20875,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "always_filter_main_dttm": true, - "cache_timeout": 1, - "catalog": "string", - "changed_on": "2024-01-15T10:30:00Z", - "changed_on_humanized": {}, - "column_formats": {}, - "created_on": "2024-01-15T10:30:00Z", - "created_on_humanized": {}, - "datasource_name": {}, - "datasource_type": {}, - "default_endpoint": "string", - "description": "string", - "extra": "string", - "fetch_values_predicate": "string", - "filter_select_enabled": true, - "folders": {}, - "granularity_sqla": {}, - "id": 1, - "is_managed_externally": true, - "is_sqllab_view": true, - "kind": {}, - "main_dttm_col": "string", - "name": {}, - "normalize_columns": true, - "offset": 1, - "order_by_choices": {}, - "schema": "string", - "select_star": {}, - "sql": "string", - "table_name": "string", - "template_params": "string", - "time_grain_sqla": {}, - "uid": {}, - "url": {}, - "verbose_map": {} - } } } }, @@ -23663,23 +20901,105 @@ "summary": "Get a dataset", "tags": [ "Datasets" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/dataset/{id_or_uuid}/related_objects": { + "get": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "in": "path", + "name": "id_or_uuid", + "required": true, + "schema": { + "type": "string" + } } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetRelatedObjectsResponse" + } + } + }, + "description": "Query result" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get charts and dashboards count associated to a dataset", + "tags": [ + "Datasets" + ] + } + }, + "/api/v1/dataset/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Dataset delete" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Delete a dataset", + "tags": [ + "Datasets" ] }, "put": { @@ -23705,39 +21025,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DatasetRestApi.put" - }, - "example": { - "always_filter_main_dttm": true, - "cache_timeout": 1, - "catalog": "string", - "columns": [ - {} - ], - "database_id": 1, - "default_endpoint": "string", - "description": "string", - "external_url": "string", - "extra": "string", - "fetch_values_predicate": "string", - "filter_select_enabled": true, - "folders": [ - {} - ], - "is_managed_externally": true, - "is_sqllab_view": true, - "main_dttm_col": "string", - "metrics": [ - {} - ], - "normalize_columns": true, - "offset": 1, - "owners": [ - 1 - ], - "schema": "string", - "sql": "string", - "table_name": "string", - "template_params": "string" } } }, @@ -23758,34 +21045,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "always_filter_main_dttm": true, - "cache_timeout": 1, - "catalog": "string", - "columns": [], - "database_id": 1, - "default_endpoint": "string", - "description": "string", - "external_url": "string", - "extra": "string", - "fetch_values_predicate": "string", - "filter_select_enabled": true, - "folders": [], - "is_managed_externally": true, - "is_sqllab_view": true, - "main_dttm_col": "string", - "metrics": [], - "normalize_columns": true, - "offset": 1, - "owners": [], - "schema": "string", - "sql": "string", - "table_name": "string", - "template_params": "string" - } } } }, @@ -23818,23 +21077,6 @@ "summary": "Update a dataset", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dataset/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dataset/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -23871,9 +21113,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -23903,23 +21142,62 @@ "summary": "Delete a dataset column", "tags": [ "Datasets" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/dataset/{pk}/drill_info/": { + "get": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dataset/1/column/{column_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dataset/1/column/{column_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1/column/{column_id}\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" + "description": "The dataset ID", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Dataset drill info" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get dataset drill info", + "tags": [ + "Datasets" ] } }, @@ -23956,9 +21234,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -23988,23 +21263,6 @@ "summary": "Delete a dataset metric", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/dataset/1/metric/{metric_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/dataset/1/metric/{metric_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1/metric/{metric_id}\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] } }, @@ -24031,9 +21289,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -24063,88 +21318,6 @@ "summary": "Refresh and update columns of a dataset", "tags": [ "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/dataset/1/refresh\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/dataset/1/refresh\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1/refresh\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } - ] - } - }, - "/api/v1/dataset/{pk}/related_objects": { - "get": { - "parameters": [ - { - "in": "path", - "name": "pk", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetRelatedObjectsResponse" - }, - "example": { - "charts": {}, - "dashboards": {} - } - } - }, - "description": "Query result" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "500": { - "$ref": "#/components/responses/500" - } - }, - "security": [ - { - "jwt": [] - } - ], - "summary": "Get charts and dashboards count associated to a dataset", - "tags": [ - "Datasets" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/dataset/1/related_objects\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/dataset/1/related_objects\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/dataset/1/related_objects\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24209,11 +21382,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -24243,23 +21411,127 @@ "summary": "Get possible values for a datasource column", "tags": [ "Datasources" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/datasource/{datasource_type}/{datasource_id}/validate_expression/": { + "post": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/datasource/{datasource_type}/{datasource_id}/column/{column_name}/values/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" + "description": "The type of datasource", + "in": "path", + "name": "datasource_type", + "required": true, + "schema": { + "type": "string" + } }, { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/datasource/{datasource_type}/{datasource_id}/column/{column_name}/values/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/datasource/{datasource_type}/{datasource_id}/column/{column_name}/values/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "description": "The id of the datasource", + "in": "path", + "name": "datasource_id", + "required": true, + "schema": { + "type": "integer" + } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "clause": { + "description": "SQL clause type for filter expressions", + "enum": [ + "WHERE", + "HAVING" + ], + "type": "string" + }, + "expression": { + "description": "The SQL expression to validate", + "type": "string" + }, + "expression_type": { + "default": "where", + "description": "The type of SQL expression", + "enum": [ + "column", + "metric", + "where", + "having" + ], + "type": "string" + } + }, + "required": [ + "expression" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "description": "Empty array for success, errors for failure", + "items": { + "properties": { + "end_column": { + "type": "integer" + }, + "line_number": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "start_column": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Validation result" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Validate a SQL expression against a datasource", + "tags": [ + "Datasources" ] } }, @@ -24327,14 +21599,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "allowed_domains": [], - "changed_on": "2024-01-15T10:30:00Z", - "dashboard_id": "string", - "uuid": "string" - } } }, "text/html": { @@ -24360,26 +21624,9 @@ "jwt": [] } ], - "summary": "Get a report schedule log (embedded-dashboard-uuid)", + "summary": "Get a report schedule log", "tags": [ "Embedded Dashboard" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/embedded_dashboard/{uuid}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/embedded_dashboard/{uuid}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/embedded_dashboard/{uuid}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24429,12 +21676,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ExploreContextSchema" - }, - "example": { - "dataset": {}, - "form_data": {}, - "message": "string", - "slice": {} } } }, @@ -24464,23 +21705,6 @@ "summary": "Assemble Explore related information in a single endpoint", "tags": [ "Explore" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/explore/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/explore/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24500,12 +21724,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/FormDataPostSchema" - }, - "example": { - "chart_id": 1, - "datasource_id": 1, - "datasource_type": "table", - "form_data": "string" } } }, @@ -24523,9 +21741,6 @@ } }, "type": "object" - }, - "example": { - "key": "string" } } }, @@ -24552,23 +21767,6 @@ "summary": "Create a new form_data", "tags": [ "Explore Form Data" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/explore/form_data\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/explore/form_data\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/form_data\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24597,9 +21795,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -24629,23 +21824,6 @@ "summary": "Delete a form_data", "tags": [ "Explore Form Data" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/explore/form_data/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -24671,9 +21849,6 @@ } }, "type": "object" - }, - "example": { - "form_data": "string" } } }, @@ -24703,23 +21878,6 @@ "summary": "Get a form_data", "tags": [ "Explore Form Data" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/explore/form_data/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -24745,12 +21903,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/FormDataPutSchema" - }, - "example": { - "chart_id": 1, - "datasource_id": 1, - "datasource_type": "table", - "form_data": "string" } } }, @@ -24768,9 +21920,6 @@ } }, "type": "object" - }, - "example": { - "key": "string" } } }, @@ -24800,23 +21949,6 @@ "summary": "Update an existing form_data", "tags": [ "Explore Form Data" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/explore/form_data/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/form_data/{key}\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24827,12 +21959,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ExplorePermalinkStateSchema" - }, - "example": { - "formData": {}, - "urlParams": [ - {} - ] } } }, @@ -24854,10 +21980,6 @@ } }, "type": "object" - }, - "example": { - "key": "string", - "url": "string" } } }, @@ -24881,26 +22003,9 @@ "jwt": [] } ], - "summary": "Create a new permanent link (explore-permalink)", + "summary": "Create a new permanent link", "tags": [ "Explore Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/explore/permalink\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/explore/permalink\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/permalink\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -24928,9 +22033,6 @@ } }, "type": "object" - }, - "example": { - "state": {} } } }, @@ -24960,23 +22062,6 @@ "summary": "Get chart's permanent link state", "tags": [ "Explore Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/explore/permalink/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/explore/permalink/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/explore/permalink/{key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25061,28 +22146,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -25109,23 +22172,6 @@ "summary": "Get a list of logs", "tags": [ "LogRestApi" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/log/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/log/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/log/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -25134,9 +22180,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/LogRestApi.post" - }, - "example": { - "id": 1 } } }, @@ -25157,12 +22200,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "id": 1 - } } } }, @@ -25188,25 +22225,6 @@ ], "tags": [ "LogRestApi" - ], - "operationId": "create_log", - "summary": "Create log", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/log/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/log/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/log/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25240,9 +22258,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RecentActivityResponseSchema" - }, - "example": { - "result": [] } } }, @@ -25269,23 +22284,6 @@ "summary": "Get recent activity data for a user", "tags": [ "LogRestApi" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/log/recent_activity/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/log/recent_activity/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/log/recent_activity/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25360,29 +22358,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "action": "string", - "dashboard_id": 1, - "dttm": "2024-01-15T10:30:00Z", - "duration_ms": 1, - "json": "string", - "referrer": "string", - "slice_id": 1, - "user_id": 1 - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -25412,23 +22387,6 @@ "summary": "Get a log detail information", "tags": [ "LogRestApi" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/log/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/log/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/log/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25446,17 +22404,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "email": "string", - "first_name": "string", - "id": 1, - "is_active": true, - "is_anonymous": true, - "last_name": "string", - "username": "string" - } } } }, @@ -25466,26 +22413,59 @@ "$ref": "#/components/responses/401" } }, + "security": [ + { + "jwt": [] + } + ], "summary": "Get the user object", "tags": [ "Current User" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/me/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" + ] + }, + "put": { + "description": "Updates the current user's first name, last name, or password.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CurrentUserPutSchema" + } + } }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/me/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/UserResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "User updated successfully" }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/me/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Update the current user", + "tags": [ + "Current User" ] } }, @@ -25503,17 +22483,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "email": "string", - "first_name": "string", - "id": 1, - "is_active": true, - "is_anonymous": true, - "last_name": "string", - "username": "string" - } } } }, @@ -25523,26 +22492,14 @@ "$ref": "#/components/responses/401" } }, + "security": [ + { + "jwt": [] + } + ], "summary": "Get the user roles", "tags": [ "Current User" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/me/roles/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/me/roles/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/me/roles/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25588,17 +22545,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - { - "childs": [], - "icon": "string", - "label": "string", - "name": "string", - "url": "string" - } - ] } } }, @@ -25615,25 +22561,6 @@ ], "tags": [ "Menu" - ], - "operationId": "get_menu", - "summary": "Get menu", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/menu/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/menu/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/menu/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25718,28 +22645,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -25766,23 +22671,6 @@ "summary": "Get a list of queries", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/query/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/query/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25815,10 +22703,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DistincResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -25842,26 +22726,9 @@ "jwt": [] } ], - "summary": "Get distinct values from field data (query-distinct-column-name)", + "summary": "Get distinct values from field data", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/query/distinct/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/query/distinct/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/distinct/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25894,10 +22761,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -25921,26 +22784,9 @@ "jwt": [] } ], - "summary": "Get related fields data (query-related-column-name)", + "summary": "Get related fields data", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/query/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/query/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -25951,9 +22797,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/StopQuerySchema" - }, - "example": { - "client_id": "string" } } }, @@ -25971,9 +22814,6 @@ } }, "type": "object" - }, - "example": { - "result": "string" } } }, @@ -26000,23 +22840,6 @@ "summary": "Manually stop a query with client_id", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/query/stop\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/query/stop\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/stop\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26050,11 +22873,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -26081,23 +22899,6 @@ "summary": "Get a list of queries that changed after last_updated_ms", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/query/updated_since\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/query/updated_since\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/updated_since\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26172,45 +22973,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "changed_on": "2024-01-15T10:30:00Z", - "client_id": "string", - "end_result_backend_time": 1.0, - "end_time": 1.0, - "error_message": "string", - "executed_sql": "string", - "id": 1, - "limit": 1, - "progress": 1, - "results_key": "string", - "rows": 1, - "schema": "string", - "select_as_cta": true, - "select_as_cta_used": true, - "select_sql": "string", - "sql": "string", - "sql_editor_id": "string", - "start_running_time": 1.0, - "start_time": 1.0, - "status": "string", - "tab_name": "string", - "tmp_schema_name": "string", - "tmp_table_name": "string", - "tracking_url": {} - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -26240,23 +23002,6 @@ "summary": "Get query detail information", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/query/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/query/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/query/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26286,9 +23031,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -26318,23 +23060,6 @@ "summary": "Bulk delete report schedules", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/report/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/report/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -26417,28 +23142,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -26465,23 +23168,6 @@ "summary": "Get a list of report schedules", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -26490,42 +23176,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ReportScheduleRestApi.post" - }, - "example": { - "active": true, - "chart": 1, - "context_markdown": "string", - "creation_method": {}, - "crontab": "*/5 * * * *", - "custom_width": 1000, - "dashboard": 1, - "database": 1, - "description": "Daily sales dashboard to marketing", - "email_subject": "[Report] Report name: Dashboard or chart name", - "extra": {}, - "force_screenshot": true, - "grace_period": 14400, - "log_retention": 90, - "name": "Daily dashboard email", - "owners": [ - 1 - ], - "recipients": [ - {} - ], - "report_format": "PDF", - "selected_tabs": [ - 1 - ], - "sql": "SELECT value FROM time_series_table", - "timezone": "Africa/Abidjan", - "type": "Alert", - "validator_config_json": { - "op": "<", - "threshold": 1.0 - }, - "validator_type": "not null", - "working_timeout": 3600 } } }, @@ -26546,35 +23196,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "active": true, - "chart": 1, - "context_markdown": "string", - "creation_method": {}, - "crontab": "*/5 * * * *", - "custom_width": 1000, - "dashboard": 1, - "database": 1, - "description": "Daily sales dashboard to marketing", - "email_subject": "[Report] Report name: Dashboard or chart name", - "extra": {}, - "force_screenshot": true, - "grace_period": 14400, - "log_retention": 90, - "name": "Daily dashboard email", - "owners": [], - "recipients": [], - "report_format": "PDF", - "selected_tabs": [], - "sql": "SELECT value FROM time_series_table", - "timezone": "Africa/Abidjan", - "type": "Alert", - "validator_type": "not null", - "working_timeout": 3600 - } } } }, @@ -26604,23 +23225,6 @@ "summary": "Create a report schedule", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/report/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/report/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26682,18 +23286,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -26717,26 +23309,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (report--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26769,10 +23344,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -26796,26 +23367,9 @@ "jwt": [] } ], - "summary": "Get related fields data (report-related-column-name)", + "summary": "Get related fields data", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26857,14 +23411,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - { - "id": "string", - "name": "string" - } - ] } } }, @@ -26894,23 +23440,6 @@ "summary": "Get slack channels", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/slack_channels/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/slack_channels/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/slack_channels/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -26938,9 +23467,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -26967,23 +23493,6 @@ "summary": "Delete a report schedule", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/report/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/report/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -27056,45 +23565,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "active": true, - "context_markdown": "string", - "creation_method": "string", - "crontab": "string", - "custom_width": 1, - "description": "string", - "email_subject": "string", - "extra": {}, - "force_screenshot": true, - "grace_period": 1, - "id": 1, - "last_eval_dttm": "2024-01-15T10:30:00Z", - "last_state": "string", - "last_value": 1.0, - "last_value_row_json": "string", - "log_retention": 1, - "name": "string", - "report_format": "string", - "sql": "string", - "timezone": "string", - "type": "string", - "validator_config_json": "string", - "validator_type": "string", - "working_timeout": 1 - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -27124,23 +23594,6 @@ "summary": "Get a report schedule", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -27160,39 +23613,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ReportScheduleRestApi.put" - }, - "example": { - "active": true, - "chart": 1, - "context_markdown": "string", - "creation_method": {}, - "crontab": "string", - "custom_width": 1000, - "dashboard": 1, - "database": 1, - "description": "Daily sales dashboard to marketing", - "email_subject": "[Report] Report name: Dashboard or chart name", - "extra": {}, - "force_screenshot": true, - "grace_period": 14400, - "log_retention": 90, - "name": "string", - "owners": [ - 1 - ], - "recipients": [ - {} - ], - "report_format": "PDF", - "sql": "SELECT value FROM time_series_table", - "timezone": "Africa/Abidjan", - "type": "Alert", - "validator_config_json": { - "op": "<", - "threshold": 1.0 - }, - "validator_type": "not null", - "working_timeout": 3600 } } }, @@ -27213,34 +23633,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "active": true, - "chart": 1, - "context_markdown": "string", - "creation_method": {}, - "crontab": "string", - "custom_width": 1000, - "dashboard": 1, - "database": 1, - "description": "Daily sales dashboard to marketing", - "email_subject": "[Report] Report name: Dashboard or chart name", - "extra": {}, - "force_screenshot": true, - "grace_period": 14400, - "log_retention": 90, - "name": "string", - "owners": [], - "recipients": [], - "report_format": "PDF", - "sql": "SELECT value FROM time_series_table", - "timezone": "Africa/Abidjan", - "type": "Alert", - "validator_type": "not null", - "working_timeout": 3600 - } } } }, @@ -27273,23 +23665,6 @@ "summary": "Update a report schedule", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/report/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/report/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -27344,15 +23719,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "ids": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -27379,23 +23745,6 @@ "summary": "Get a list of report schedule logs", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/1/log/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/1/log/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/1/log/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -27447,20 +23796,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "end_dttm": "2024-01-15T10:30:00Z", - "error_message": "string", - "id": 1, - "scheduled_dttm": "2024-01-15T10:30:00Z", - "start_dttm": "2024-01-15T10:30:00Z", - "state": "string", - "uuid": "550e8400-e29b-41d4-a716-446655440000", - "value": 1.0, - "value_row_json": "string" - } } } }, @@ -27487,26 +23822,9 @@ "jwt": [] } ], - "summary": "Get a report schedule log (report-pk-log-log-id)", + "summary": "Get a report schedule log", "tags": [ "Report Schedules" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/report/1/log/{log_id}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/report/1/log/{log_id}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/report/1/log/{log_id}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -27536,9 +23854,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -27568,23 +23883,6 @@ "summary": "Bulk delete RLS rules", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/rowlevelsecurity/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -27667,28 +23965,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -27715,23 +23991,6 @@ "summary": "Get a list of RLS", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/rowlevelsecurity/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -27740,19 +23999,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RLSRestApi.post" - }, - "example": { - "clause": "string", - "description": "string", - "filter_type": "Regular", - "group_key": "string", - "name": "string", - "roles": [ - 1 - ], - "tables": [ - 1 - ] } } }, @@ -27773,18 +24019,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "clause": "string", - "description": "string", - "filter_type": "Regular", - "group_key": "string", - "name": "string", - "roles": [], - "tables": [] - } } } }, @@ -27814,23 +24048,6 @@ "summary": "Create a new RLS rule", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/rowlevelsecurity/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -27892,18 +24109,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -27927,26 +24132,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (rowlevelsecurity--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/rowlevelsecurity/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/rowlevelsecurity/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -27979,10 +24167,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -28006,26 +24190,9 @@ "jwt": [] } ], - "summary": "Get related fields data (rowlevelsecurity-related-column-name)", + "summary": "Get related fields data", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/rowlevelsecurity/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/rowlevelsecurity/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28052,9 +24219,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -28078,23 +24242,6 @@ "summary": "Delete an RLS", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/rowlevelsecurity/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -28167,29 +24314,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "clause": "string", - "description": "string", - "filter_type": "Regular", - "group_key": "string", - "id": 1, - "name": "string", - "roles": [], - "tables": [] - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -28219,23 +24343,6 @@ "summary": "Get an RLS", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/rowlevelsecurity/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -28255,19 +24362,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RLSRestApi.put" - }, - "example": { - "clause": "string", - "description": "string", - "filter_type": "Regular", - "group_key": "string", - "name": "string", - "roles": [ - 1 - ], - "tables": [ - 1 - ] } } }, @@ -28288,18 +24382,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "clause": "string", - "description": "string", - "filter_type": "Regular", - "group_key": "string", - "name": "string", - "roles": [], - "tables": [] - } } } }, @@ -28332,23 +24414,6 @@ "summary": "Update an RLS rule", "tags": [ "Row Level Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/rowlevelsecurity/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/rowlevelsecurity/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28378,9 +24443,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -28407,23 +24469,6 @@ "summary": "Bulk delete saved queries", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/saved_query/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/saved_query/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -28506,28 +24551,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -28554,23 +24577,6 @@ "summary": "Get a list of saved queries", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -28579,16 +24585,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SavedQueryRestApi.post" - }, - "example": { - "catalog": "string", - "db_id": 1, - "description": "string", - "extra_json": "string", - "label": "string", - "schema": "string", - "sql": "string", - "template_parameters": "string" } } }, @@ -28609,19 +24605,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "catalog": "string", - "db_id": 1, - "description": "string", - "extra_json": "string", - "label": "string", - "schema": "string", - "sql": "string", - "template_parameters": "string" - } } } }, @@ -28648,23 +24631,6 @@ "summary": "Create a saved query", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/saved_query/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/saved_query/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28726,18 +24692,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -28761,26 +24715,9 @@ "jwt": [] } ], - "summary": "Get metadata information about this API resource (saved-query--info)", + "summary": "Get metadata information about this API resource", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28813,10 +24750,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DistincResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -28840,26 +24773,9 @@ "jwt": [] } ], - "summary": "Get distinct values from field data (saved-query-distinct-column-name)", + "summary": "Get distinct values from field data", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/distinct/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/distinct/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/distinct/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28911,23 +24827,6 @@ "summary": "Download multiple saved queries as YAML files", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/export/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/export/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/export/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -28981,9 +24880,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -29010,23 +24906,6 @@ "summary": "Import saved queries with associated databases", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/saved_query/import/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/saved_query/import/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/import/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29059,10 +24938,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -29086,26 +24961,9 @@ "jwt": [] } ], - "summary": "Get related fields data (saved-query-related-column-name)", + "summary": "Get related fields data", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29132,9 +24990,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -29158,23 +25013,6 @@ "summary": "Delete a saved query", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/saved_query/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/saved_query/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -29247,31 +25085,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "catalog": "string", - "changed_on": "2024-01-15T10:30:00Z", - "changed_on_delta_humanized": {}, - "description": "string", - "id": 1, - "label": "string", - "schema": "string", - "sql": "string", - "sql_tables": {}, - "template_parameters": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -29301,23 +25114,6 @@ "summary": "Get a saved query", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/saved_query/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/saved_query/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -29336,16 +25132,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SavedQueryRestApi.put" - }, - "example": { - "catalog": "string", - "db_id": 1, - "description": "string", - "extra_json": "string", - "label": "string", - "schema": "string", - "sql": "string", - "template_parameters": "string" } } }, @@ -29363,18 +25149,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "catalog": "string", - "db_id": 1, - "description": "string", - "extra_json": "string", - "label": "string", - "schema": "string", - "sql": "string", - "template_parameters": "string" - } } } }, @@ -29404,23 +25178,6 @@ "summary": "Update a saved query", "tags": [ "Queries" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/saved_query/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/saved_query/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/saved_query/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29437,9 +25194,6 @@ } }, "type": "object" - }, - "example": { - "result": "string" } } }, @@ -29460,23 +25214,462 @@ "summary": "Get the CSRF token", "tags": [ "Security" - ], - "x-codeSamples": [ + ] + } + }, + "/api/v1/security/groups/": { + "get": { + "description": "Get a list of models", + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/csrf_token/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/csrf_token/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/csrf_token/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_list_schema" + } + } + }, + "in": "query", + "name": "q" } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total record count on the backend", + "type": "number" + }, + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "ids": { + "description": "A list of item ids, useful when you don't know the column id", + "items": { + "type": "string" + }, + "type": "array" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "list_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "list_title": { + "description": "A title to render. Will be translated by babel", + "example": "List Items", + "type": "string" + }, + "order_columns": { + "description": "A list of allowed columns to sort", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "description": "The result from the get list query", + "items": { + "$ref": "#/components/schemas/GroupApi.get_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Items from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupPostSchema" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/GroupPostSchema" + } + }, + "type": "object" + } + } + }, + "description": "Group created" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + } + }, + "/api/v1/security/groups/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + } + }, + "/api/v1/security/groups/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item deleted" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "get": { + "description": "Get an item model", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The item id", + "type": "string" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "$ref": "#/components/schemas/GroupApi.get" + }, + "show_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "show_title": { + "description": "A title to render. Will be translated by babel", + "example": "Show Item Details", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "put": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupPutSchema" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/GroupPutSchema" + } + }, + "type": "object" + } + } + }, + "description": "Group updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" ] } }, @@ -29487,19 +25680,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/GuestTokenCreate" - }, - "example": { - "resources": [ - {} - ], - "rls": [ - {} - ], - "user": { - "first_name": "string", - "last_name": "string", - "username": "string" - } } } }, @@ -29517,9 +25697,6 @@ } }, "type": "object" - }, - "example": { - "token": "string" } } }, @@ -29543,23 +25720,6 @@ "summary": "Get a guest token", "tags": [ "Security" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/guest_token/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/guest_token/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/guest_token/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29597,12 +25757,6 @@ } }, "type": "object" - }, - "example": { - "password": "complex-password", - "provider": "db", - "refresh": true, - "username": "admin" } } }, @@ -29622,10 +25776,6 @@ } }, "type": "object" - }, - "example": { - "access_token": "string", - "refresh_token": "string" } } }, @@ -29643,25 +25793,6 @@ }, "tags": [ "Security" - ], - "operationId": "create_security_login", - "summary": "Create security login", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/login\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/login\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/login\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29746,28 +25877,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -29793,25 +25902,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "get_security_permissions_resources", - "summary": "Get security permissions resources", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions-resources/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions-resources/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -29820,10 +25910,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/PermissionViewMenuApi.post" - }, - "example": { - "permission_id": 1, - "view_menu_id": 1 } } }, @@ -29844,13 +25930,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "permission_id": 1, - "view_menu_id": 1 - } } } }, @@ -29876,25 +25955,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "create_security_permissions_resources", - "summary": "Create security permissions resources", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/permissions-resources/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/permissions-resources/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -29956,18 +26016,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -29993,25 +26041,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "get_security_permissions_resources__info", - "summary": "Get security permissions resources info", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions-resources/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions-resources/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30038,9 +26067,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -30063,25 +26089,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "delete_security_permissions_resources_by_pk", - "summary": "Delete security permissions resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/security/permissions-resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -30154,22 +26161,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "id": 1 - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -30198,25 +26189,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "get_security_permissions_resources_by_pk", - "summary": "Get security permissions resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions-resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -30235,10 +26207,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/PermissionViewMenuApi.put" - }, - "example": { - "permission_id": 1, - "view_menu_id": 1 } } }, @@ -30256,12 +26224,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "permission_id": 1, - "view_menu_id": 1 - } } } }, @@ -30290,25 +26252,6 @@ ], "tags": [ "Security Permissions on Resources (View Menus)" - ], - "operationId": "update_security_permissions_resources_by_pk", - "summary": "Update security permissions resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/security/permissions-resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions-resources/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30393,28 +26336,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -30440,25 +26361,6 @@ ], "tags": [ "Security Permissions" - ], - "operationId": "get_security_permissions", - "summary": "Get security permissions", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30520,18 +26422,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -30557,25 +26447,6 @@ ], "tags": [ "Security Permissions" - ], - "operationId": "get_security_permissions__info", - "summary": "Get security permissions info", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30650,23 +26521,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "id": 1, - "name": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -30695,25 +26549,6 @@ ], "tags": [ "Security Permissions" - ], - "operationId": "get_security_permissions_by_pk", - "summary": "Get security permissions by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/permissions/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/permissions/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/permissions/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30732,9 +26567,6 @@ } }, "type": "object" - }, - "example": { - "access_token": "string" } } }, @@ -30754,25 +26586,6 @@ ], "tags": [ "Security" - ], - "operationId": "create_security_refresh", - "summary": "Create security refresh", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/refresh\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/refresh\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/refresh\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -30857,28 +26670,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -30904,25 +26695,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "get_security_resources", - "summary": "Get security resources", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/resources/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/resources/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -30931,9 +26703,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ViewMenuApi.post" - }, - "example": { - "name": "string" } } }, @@ -30954,12 +26723,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "name": "string" - } } } }, @@ -30985,25 +26748,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "create_security_resources", - "summary": "Create security resources", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/resources/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/resources/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31065,18 +26809,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -31102,25 +26834,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "get_security_resources__info", - "summary": "Get security resources info", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/resources/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/resources/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31147,9 +26860,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -31172,25 +26882,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "delete_security_resources_by_pk", - "summary": "Delete security resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/security/resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/security/resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -31263,23 +26954,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "id": 1, - "name": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -31308,25 +26982,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "get_security_resources_by_pk", - "summary": "Get security resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -31345,9 +27000,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ViewMenuApi.put" - }, - "example": { - "name": "string" } } }, @@ -31365,11 +27017,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "name": "string" - } } } }, @@ -31398,25 +27045,6 @@ ], "tags": [ "Security Resources (View Menus)" - ], - "operationId": "update_security_resources_by_pk", - "summary": "Update security resources by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/security/resources/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/security/resources/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/resources/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31501,28 +27129,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -31548,25 +27154,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "get_security_roles", - "summary": "Get security roles", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/roles/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/roles/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -31575,9 +27162,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SupersetRoleApi.post" - }, - "example": { - "name": "string" } } }, @@ -31598,12 +27182,6 @@ } }, "type": "object" - }, - "example": { - "id": "string", - "result": { - "name": "string" - } } } }, @@ -31629,25 +27207,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "create_security_roles", - "summary": "Create security roles", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/roles/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/roles/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31709,18 +27268,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -31746,25 +27293,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "get_security_roles__info", - "summary": "Get security roles info", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/roles/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/roles/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31831,13 +27359,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RolesResponseSchema" - }, - "example": { - "count": 1, - "ids": [ - 1 - ], - "result": [] } } }, @@ -31853,9 +27374,6 @@ } }, "type": "object" - }, - "example": { - "error": "string" } } }, @@ -31871,9 +27389,6 @@ } }, "type": "object" - }, - "example": { - "error": "string" } } }, @@ -31888,23 +27403,6 @@ "summary": "List roles", "tags": [ "Security Roles" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/roles/search/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/roles/search/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/search/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -31931,9 +27429,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -31956,25 +27451,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "delete_security_roles_by_pk", - "summary": "Delete security roles by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/security/roles/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/security/roles/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -32047,23 +27523,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "id": 1, - "name": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -32092,25 +27551,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "get_security_roles_by_pk", - "summary": "Get security roles by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/roles/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/roles/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -32129,9 +27569,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SupersetRoleApi.put" - }, - "example": { - "name": "string" } } }, @@ -32149,11 +27586,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "name": "string" - } } } }, @@ -32182,25 +27614,71 @@ ], "tags": [ "Security Roles" - ], - "operationId": "update_security_roles_by_pk", - "summary": "Update security roles by pk", - "x-codeSamples": [ + ] + } + }, + "/api/v1/security/roles/{role_id}/groups": { + "put": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/security/roles/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/security/roles/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "in": "path", + "name": "role_id", + "required": true, + "schema": { + "type": "integer" + } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleGroupPutSchema" + } + } + }, + "description": "Update role groups schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/RoleGroupPutSchema" + } + }, + "type": "object" + } + } + }, + "description": "Role groups updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Roles" ] } }, @@ -32221,11 +27699,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RolePermissionPostSchema" - }, - "example": { - "permission_view_menu_ids": [ - 1 - ] } } }, @@ -32243,11 +27716,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "permission_view_menu_ids": [] - } } } }, @@ -32276,25 +27744,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "create_security_roles_by_role_id_permissions", - "summary": "Create security roles by role_id permissions", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -32317,17 +27766,13 @@ "schema": { "properties": { "result": { - "$ref": "#/components/schemas/RolePermissionListSchema" + "items": { + "$ref": "#/components/schemas/RolePermissionListSchema" + }, + "type": "array" } }, "type": "object" - }, - "example": { - "result": { - "id": 1, - "permission_name": "string", - "view_menu_name": "string" - } } } }, @@ -32356,25 +27801,6 @@ ], "tags": [ "Security Roles" - ], - "operationId": "get_security_roles_by_role_id_permissions", - "summary": "Get security roles by role_id permissions", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/permissions/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -32395,11 +27821,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RoleUserPutSchema" - }, - "example": { - "user_ids": [ - 1 - ] } } }, @@ -32417,11 +27838,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "user_ids": [] - } } } }, @@ -32450,25 +27866,581 @@ ], "tags": [ "Security Roles" - ], - "operationId": "update_security_roles_by_role_id_users", - "summary": "Update security roles by role_id users", - "x-codeSamples": [ + ] + } + }, + "/api/v1/security/user_registrations/": { + "get": { + "description": "Get a list of models", + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/security/roles/{role_id}/users\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/users\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/roles/{role_id}/users\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_list_schema" + } + } + }, + "in": "query", + "name": "q" } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total record count on the backend", + "type": "number" + }, + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "ids": { + "description": "A list of item ids, useful when you don't know the column id", + "items": { + "type": "string" + }, + "type": "array" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "list_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "list_title": { + "description": "A title to render. Will be translated by babel", + "example": "List Items", + "type": "string" + }, + "order_columns": { + "description": "A list of allowed columns to sort", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "description": "The result from the get list query", + "items": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.get_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Items from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.post" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string" + }, + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.post" + } + }, + "type": "object" + } + } + }, + "description": "Item inserted" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/distinct/{column_name}": { + "get": { + "parameters": [ + { + "in": "path", + "name": "column_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_related_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistincResponseSchema" + } + } + }, + "description": "Distinct field data" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get distinct values from field data", + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/related/{column_name}": { + "get": { + "parameters": [ + { + "in": "path", + "name": "column_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_related_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelatedResponseSchema" + } + } + }, + "description": "Related column data" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get related fields data", + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item deleted" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "get": { + "description": "Get an item model", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The item id", + "type": "string" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.get" + }, + "show_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "show_title": { + "description": "A title to render. Will be translated by babel", + "example": "Show Item Details", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "put": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.put" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.put" + } + }, + "type": "object" + } + } + }, + "description": "Item changed" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" ] } }, @@ -32553,28 +28525,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -32600,25 +28550,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "get_security_users", - "summary": "Get security users", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/users/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/users/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -32627,17 +28558,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SupersetUserApi.post" - }, - "example": { - "active": true, - "email": "string", - "first_name": "string", - "last_name": "string", - "password": "string", - "roles": [ - 1 - ], - "username": "string" } } }, @@ -32655,17 +28575,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "active": true, - "email": "string", - "first_name": "string", - "last_name": "string", - "password": "string", - "roles": [], - "username": "string" - } } } }, @@ -32694,25 +28603,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "create_security_users", - "summary": "Create security users", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/security/users/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/security/users/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -32774,18 +28664,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -32811,25 +28689,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "get_security_users__info", - "summary": "Get security users info", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/users/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/users/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -32856,9 +28715,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -32881,25 +28737,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "delete_security_users_by_pk", - "summary": "Delete security users by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/security/users/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/security/users/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -32972,32 +28809,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "active": true, - "changed_on": "2024-01-15T10:30:00Z", - "created_on": "2024-01-15T10:30:00Z", - "email": "string", - "fail_login_count": 1, - "first_name": "string", - "id": 1, - "last_login": "2024-01-15T10:30:00Z", - "last_name": "string", - "login_count": 1, - "username": "string" - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -33026,25 +28837,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "get_security_users_by_pk", - "summary": "Get security users by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/security/users/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/security/users/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -33063,17 +28855,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SupersetUserApi.put" - }, - "example": { - "active": true, - "email": "string", - "first_name": "string", - "last_name": "string", - "password": "string", - "roles": [ - 1 - ], - "username": "string" } } }, @@ -33091,17 +28872,6 @@ } }, "type": "object" - }, - "example": { - "result": { - "active": true, - "email": "string", - "first_name": "string", - "last_name": "string", - "password": "string", - "roles": [], - "username": "string" - } } } }, @@ -33130,25 +28900,6 @@ ], "tags": [ "Security Users" - ], - "operationId": "update_security_users_by_pk", - "summary": "Update security users by pk", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/security/users/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/security/users/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/security/users/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33161,18 +28912,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SQLLabBootstrapSchema" - }, - "example": { - "active_tab": {}, - "databases": { - "key": "value" - }, - "queries": { - "key": "value" - }, - "tab_state_ids": [ - "string" - ] } } }, @@ -33199,23 +28938,6 @@ "summary": "Get the bootstrap data for SqlLab page", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/sqllab/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/sqllab/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33226,13 +28948,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/EstimateQueryCostSchema" - }, - "example": { - "catalog": "string", - "database_id": 1, - "schema": "string", - "sql": "string", - "template_params": {} } } }, @@ -33250,9 +28965,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -33279,23 +28991,6 @@ "summary": "Estimate the SQL query execution cost", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/sqllab/estimate/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/sqllab/estimate/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/estimate/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33306,23 +29001,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ExecutePayloadSchema" - }, - "example": { - "catalog": "string", - "client_id": "string", - "ctas_method": "string", - "database_id": 1, - "expand_data": true, - "json": true, - "queryLimit": 1, - "runAsync": true, - "schema": "string", - "select_as_cta": true, - "sql": "string", - "sql_editor_id": "string", - "tab": "string", - "templateParams": "string", - "tmp_table_name": "string" } } }, @@ -33335,23 +29013,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/QueryExecutionResponseSchema" - }, - "example": { - "columns": [ - {} - ], - "data": [ - {} - ], - "expanded_columns": [ - {} - ], - "query": {}, - "query_id": 1, - "selected_columns": [ - {} - ], - "status": "string" } } }, @@ -33362,23 +29023,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/QueryExecutionResponseSchema" - }, - "example": { - "columns": [ - {} - ], - "data": [ - {} - ], - "expanded_columns": [ - {} - ], - "query": {}, - "query_id": 1, - "selected_columns": [ - {} - ], - "status": "string" } } }, @@ -33408,23 +29052,6 @@ "summary": "Execute a SQL query", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/sqllab/execute/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/sqllab/execute/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/execute/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33476,23 +29103,71 @@ "summary": "Export the SQL query results to a CSV", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/sqllab/export/{client_id}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" + ] + } + }, + "/api/v1/sqllab/export_streaming/": { + "post": { + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "properties": { + "client_id": { + "description": "The SQL query result identifier", + "type": "string" + }, + "expected_rows": { + "description": "Optional expected row count for progress tracking", + "type": "integer" + }, + "filename": { + "description": "Optional filename for the export", + "type": "string" + } + }, + "type": "object" + } + } }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/sqllab/export/{client_id}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" + "description": "Export parameters", + "required": true + }, + "responses": { + "200": { + "content": { + "text/csv": { + "schema": { + "type": "string" + } + } + }, + "description": "Streaming CSV export" }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/export/{client_id}/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Export SQL query results to CSV with streaming", + "tags": [ + "SQL Lab" ] } }, @@ -33503,12 +29178,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/FormatQueryPayloadSchema" - }, - "example": { - "sql": "string", - "engine": "string", - "database_id": 1, - "template_params": "string" } } }, @@ -33526,9 +29195,6 @@ } }, "type": "object" - }, - "example": { - "result": "string" } } }, @@ -33555,23 +29221,6 @@ "summary": "Format SQL code", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/sqllab/format_sql/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/sqllab/format_sql/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/format_sql/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33582,12 +29231,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ExplorePermalinkStateSchema" - }, - "example": { - "formData": {}, - "urlParams": [ - {} - ] } } }, @@ -33609,10 +29252,6 @@ } }, "type": "object" - }, - "example": { - "key": "string", - "url": "string" } } }, @@ -33636,26 +29275,9 @@ "jwt": [] } ], - "summary": "Create a new permanent link (sqllab-permalink)", + "summary": "Create a new permanent link", "tags": [ "SQL Lab Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/sqllab/permalink\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/sqllab/permalink\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/permalink\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33683,9 +29305,6 @@ } }, "type": "object" - }, - "example": { - "state": {} } } }, @@ -33715,23 +29334,6 @@ "summary": "Get permanent link state for SQLLab editor.", "tags": [ "SQL Lab Permanent Link" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/sqllab/permalink/{key}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/sqllab/permalink/{key}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/permalink/{key}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33756,23 +29358,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/QueryExecutionResponseSchema" - }, - "example": { - "columns": [ - {} - ], - "data": [ - {} - ], - "expanded_columns": [ - {} - ], - "query": {}, - "query_id": 1, - "selected_columns": [ - {} - ], - "status": "string" } } }, @@ -33805,23 +29390,6 @@ "summary": "Get the result of a SQL query execution", "tags": [ "SQL Lab" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/sqllab/results/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/sqllab/results/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/sqllab/results/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -33852,9 +29420,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -33884,23 +29449,6 @@ "summary": "Bulk delete tags", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/tag/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/tag/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -33983,28 +29531,6 @@ } }, "type": "object" - }, - "example": { - "count": 1.0, - "description_columns": { - "column_name": "A Nice description for the column" - }, - "ids": [ - "string" - ], - "label_columns": { - "column_name": "A Nice label for the column" - }, - "list_columns": [ - "string" - ], - "list_title": "List Items", - "order_columns": [ - "string" - ], - "result": [ - {} - ] } } }, @@ -34031,23 +29557,6 @@ "summary": "Get a list of tags", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "post": { @@ -34057,11 +29566,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TagRestApi.post" - }, - "example": { - "description": "string", - "name": "string", - "objects_to_tag": [] } } }, @@ -34082,14 +29586,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "description": "string", - "name": "string", - "objects_to_tag": [] - } } } }, @@ -34116,23 +29612,6 @@ "summary": "Create a tag", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/tag/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/tag/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34194,18 +29673,6 @@ } }, "type": "object" - }, - "example": { - "add_columns": {}, - "edit_columns": {}, - "filters": { - "column_name": [ - {} - ] - }, - "permissions": [ - "string" - ] } } }, @@ -34232,23 +29699,6 @@ "summary": "Get metadata information about tag API endpoints", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/_info\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/_info\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/_info\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34259,11 +29709,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TagPostBulkSchema" - }, - "example": { - "tags": [ - {} - ] } } }, @@ -34276,9 +29721,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TagPostBulkResponseSchema" - }, - "example": { - "result": {} } } }, @@ -34308,23 +29750,6 @@ "summary": "Bulk create tags and tagged objects", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/tag/bulk_create\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/tag/bulk_create\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/bulk_create\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34350,9 +29775,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/GetFavStarIdsSchema" - }, - "example": { - "result": [] } } }, @@ -34378,25 +29800,6 @@ ], "tags": [ "Tags" - ], - "operationId": "get_tag_favorite_status", - "summary": "Get tag favorite status", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/favorite_status/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/favorite_status/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/favorite_status/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34426,11 +29829,6 @@ } }, "type": "object" - }, - "example": { - "result": [ - {} - ] } } }, @@ -34460,23 +29858,6 @@ "summary": "Get all objects associated with a tag", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/get_objects/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/get_objects/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/get_objects/\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34509,10 +29890,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/RelatedResponseSchema" - }, - "example": { - "count": 1, - "result": [] } } }, @@ -34536,26 +29913,9 @@ "jwt": [] } ], - "summary": "Get related fields data (tag-related-column-name)", + "summary": "Get related fields data", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/related/{column_name}\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/related/{column_name}\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/related/{column_name}\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34594,11 +29954,6 @@ } }, "type": "object" - }, - "example": { - "tags": [ - "string" - ] } } }, @@ -34633,23 +29988,6 @@ "summary": "Add tags to an object", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -34692,9 +30030,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -34724,23 +30059,6 @@ "summary": "Delete a tagged object", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/{tag}/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/{tag}/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/{object_type}/{object_id}/{tag}/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] } }, @@ -34767,9 +30085,6 @@ } }, "type": "object" - }, - "example": { - "message": "string" } } }, @@ -34793,23 +30108,6 @@ "summary": "Delete a tag", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/tag/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/tag/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/1\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "get": { @@ -34882,27 +30180,6 @@ } }, "type": "object" - }, - "example": { - "description_columns": { - "column_name": "A Nice description for the column" - }, - "id": "string", - "label_columns": { - "column_name": "A Nice label for the column" - }, - "result": { - "changed_on_delta_humanized": {}, - "created_on_delta_humanized": {}, - "description": "string", - "id": 1, - "name": "string", - "type": {} - }, - "show_columns": [ - "string" - ], - "show_title": "Show Item Details" } } }, @@ -34932,23 +30209,6 @@ "summary": "Get a tag detail information", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/tag/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/tag/1\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/1\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] }, "put": { @@ -34968,11 +30228,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/TagRestApi.put" - }, - "example": { - "description": "string", - "name": "string", - "objects_to_tag": [] } } }, @@ -34993,14 +30248,6 @@ } }, "type": "object" - }, - "example": { - "id": 1.0, - "result": { - "description": "string", - "name": "string", - "objects_to_tag": [] - } } } }, @@ -35033,23 +30280,6 @@ "summary": "Update a tag", "tags": [ "Tags" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X PUT \"http://localhost:8088/api/v1/tag/1\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"key\": \"value\"}'" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.put(\n \"http://localhost:8088/api/v1/tag/1\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/1\",\n {\n method: \"PUT\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -35077,9 +30307,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -35105,25 +30332,6 @@ ], "tags": [ "Tags" - ], - "operationId": "delete_tag_by_pk_favorites", - "summary": "Delete tag by pk favorites", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X DELETE \"http://localhost:8088/api/v1/tag/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.delete(\n \"http://localhost:8088/api/v1/tag/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.status_code)" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/1/favorites/\",\n {\n method: \"DELETE\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconsole.log(response.status);" - } ] }, "post": { @@ -35149,9 +30357,6 @@ } }, "type": "object" - }, - "example": { - "result": {} } } }, @@ -35177,25 +30382,911 @@ ], "tags": [ "Tags" - ], - "operationId": "create_tag_by_pk_favorites", - "summary": "Create tag by pk favorites", - "x-codeSamples": [ + ] + } + }, + "/api/v1/theme/": { + "delete": { + "parameters": [ { - "lang": "cURL", - "label": "cURL", - "source": "curl -X POST \"http://localhost:8088/api/v1/tag/1/favorites/\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"http://localhost:8088/api/v1/tag/1/favorites/\",\n headers={\"Authorization\": \"Bearer \" + access_token},\n json={\"key\": \"value\"}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/tag/1/favorites/\",\n {\n method: \"POST\",\n headers: {\n \"Authorization\": `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ key: \"value\" })\n }\n);\nconst data = await response.json();\nconsole.log(data);" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_delete_ids_schema" + } + } + }, + "in": "query", + "name": "q" } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Themes bulk delete" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Bulk delete themes", + "tags": [ + "Themes" + ] + }, + "get": { + "description": "Gets a list of themes, use Rison or JSON query parameters for filtering, sorting, pagination and for selecting specific columns and metadata.", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_list_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total record count on the backend", + "type": "number" + }, + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "ids": { + "description": "A list of item ids, useful when you don't know the column id", + "items": { + "type": "string" + }, + "type": "array" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "list_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "list_title": { + "description": "A title to render. Will be translated by babel", + "example": "List Items", + "type": "string" + }, + "order_columns": { + "description": "A list of allowed columns to sort", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "description": "The result from the get list query", + "items": { + "$ref": "#/components/schemas/ThemeRestApi.get_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Items from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get a list of themes", + "tags": [ + "Themes" + ] + }, + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeRestApi.post" + } + } + }, + "description": "Theme schema", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "number" + }, + "result": { + "$ref": "#/components/schemas/ThemeRestApi.post" + } + }, + "type": "object" + } + } + }, + "description": "Theme created" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Create a theme", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get metadata information about this API resource", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/export/": { + "get": { + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_export_ids_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/zip": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "description": "Theme export" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Download multiple themes as YAML files", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/import/": { + "post": { + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "formData": { + "format": "binary", + "type": "string" + }, + "overwrite": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Theme imported" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Import themes from a ZIP file", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/related/{column_name}": { + "get": { + "parameters": [ + { + "in": "path", + "name": "column_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_related_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelatedResponseSchema" + } + } + }, + "description": "Related column data" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get related fields data", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/unset_system_dark": { + "delete": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "System dark theme cleared" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Clear the system dark theme", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/unset_system_default": { + "delete": { + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "System default theme cleared" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Clear the system default theme", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Theme deleted" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Delete a theme", + "tags": [ + "Themes" + ] + }, + "get": { + "description": "Get an item model", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The item id", + "type": "string" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "$ref": "#/components/schemas/ThemeRestApi.get" + }, + "show_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "show_title": { + "description": "A title to render. Will be translated by babel", + "example": "Show Item Details", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get a theme", + "tags": [ + "Themes" + ] + }, + "put": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeRestApi.put" + } + } + }, + "description": "Theme schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "number" + }, + "result": { + "$ref": "#/components/schemas/ThemeRestApi.put" + } + }, + "type": "object" + } + } + }, + "description": "Theme updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Update a theme", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/{pk}/set_system_dark": { + "put": { + "parameters": [ + { + "description": "The theme id", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "integer" + }, + "result": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Theme successfully set as system dark" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Set a theme as the system dark theme", + "tags": [ + "Themes" + ] + } + }, + "/api/v1/theme/{pk}/set_system_default": { + "put": { + "parameters": [ + { + "description": "The theme id", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "integer" + }, + "result": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Theme successfully set as system default" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Set a theme as the system default theme", + "tags": [ + "Themes" ] } }, @@ -35227,23 +31318,6 @@ "summary": "Get the user avatar", "tags": [ "User" - ], - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/v1/user/{user_id}/avatar.png\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/v1/user/{user_id}/avatar.png\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/v1/user/{user_id}/avatar.png\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } }, @@ -35285,197 +31359,13 @@ ], "tags": [ "OpenApi" - ], - "operationId": "get_api_by_version__openapi", - "summary": "Get api by version openapi", - "x-codeSamples": [ - { - "lang": "cURL", - "label": "cURL", - "source": "curl -X GET \"http://localhost:8088/api/{version}/_openapi\" \\\n -H \"Authorization: Bearer $ACCESS_TOKEN\"" - }, - { - "lang": "Python", - "label": "Python", - "source": "import requests\n\nresponse = requests.get(\n \"http://localhost:8088/api/{version}/_openapi\",\n headers={\"Authorization\": \"Bearer \" + access_token}\n)\nprint(response.json())" - }, - { - "lang": "JavaScript", - "label": "JavaScript", - "source": "const response = await fetch(\n \"http://localhost:8088/api/{version}/_openapi\",\n {\n headers: {\n \"Authorization\": `Bearer ${accessToken}`\n }\n }\n);\nconst data = await response.json();\nconsole.log(data);" - } ] } } }, "servers": [ { - "url": "http://localhost:8088", - "description": "Local development server" - }, - { - "url": "{protocol}://{host}:{port}", - "description": "Custom server", - "variables": { - "protocol": { - "default": "http", - "enum": [ - "http", - "https" - ], - "description": "HTTP protocol" - }, - "host": { - "default": "localhost", - "description": "Server hostname or IP" - }, - "port": { - "default": "8088", - "description": "Server port" - } - } - } - ], - "tags": [ - { - "name": "Advanced Data Type", - "description": "Endpoints for advanced data type operations and conversions." - }, - { - "name": "Annotation Layers", - "description": "Manage annotation layers and annotations for charts." - }, - { - "name": "AsyncEventsRestApi", - "description": "Real-time event streaming via Server-Sent Events (SSE)." - }, - { - "name": "Available Domains", - "description": "Get available domains for the Superset instance." - }, - { - "name": "CSS Templates", - "description": "Manage CSS templates for custom dashboard styling." - }, - { - "name": "CacheRestApi", - "description": "Cache management and invalidation operations." - }, - { - "name": "Charts", - "description": "Create, read, update, and delete charts (slices)." - }, - { - "name": "Current User", - "description": "Get information about the currently authenticated user." - }, - { - "name": "Dashboard Filter State", - "description": "Manage temporary filter state for dashboards." - }, - { - "name": "Dashboard Permanent Link", - "description": "Create and retrieve permanent links to dashboard states." - }, - { - "name": "Dashboards", - "description": "Create, read, update, and delete dashboards." - }, - { - "name": "Database", - "description": "Manage database connections and metadata." - }, - { - "name": "Datasets", - "description": "Manage datasets (tables) used for building charts." - }, - { - "name": "Datasources", - "description": "Query datasource metadata and column values." - }, - { - "name": "Embedded Dashboard", - "description": "Configure embedded dashboard settings." - }, - { - "name": "Explore", - "description": "Chart exploration and data querying endpoints." - }, - { - "name": "Explore Form Data", - "description": "Manage temporary form data for chart exploration." - }, - { - "name": "Explore Permanent Link", - "description": "Create and retrieve permanent links to chart explore states." - }, - { - "name": "Import/export", - "description": "Import and export Superset assets (dashboards, charts, databases)." - }, - { - "name": "LogRestApi", - "description": "Access audit logs and activity history." - }, - { - "name": "Menu", - "description": "Get the Superset menu structure." - }, - { - "name": "OpenApi", - "description": "Access the OpenAPI specification." - }, - { - "name": "Queries", - "description": "View and manage SQL Lab query history." - }, - { - "name": "Report Schedules", - "description": "Configure scheduled reports and alerts." - }, - { - "name": "Row Level Security", - "description": "Manage row-level security rules for data access control." - }, - { - "name": "SQL Lab", - "description": "Execute SQL queries and manage SQL Lab sessions." - }, - { - "name": "SQL Lab Permanent Link", - "description": "Create and retrieve permanent links to SQL Lab states." - }, - { - "name": "Security", - "description": "Authentication and token management." - }, - { - "name": "Security Permissions", - "description": "View available permissions." - }, - { - "name": "Security Permissions on Resources (View Menus)", - "description": "Manage permission-resource mappings." - }, - { - "name": "Security Resources (View Menus)", - "description": "Manage security resources (view menus)." - }, - { - "name": "Security Roles", - "description": "Manage security roles and their permissions." - }, - { - "name": "Security Users", - "description": "Manage user accounts." - }, - { - "name": "Tags", - "description": "Organize assets with tags." - }, - { - "name": "User", - "description": "User profile and preferences." + "url": "http://localhost:8088" } ] } diff --git a/superset/charts/data/api.py b/superset/charts/data/api.py index 707ce79f918..d310dc626f6 100644 --- a/superset/charts/data/api.py +++ b/superset/charts/data/api.py @@ -31,6 +31,10 @@ from superset import is_feature_enabled, security_manager from superset.async_events.async_query_manager import AsyncQueryTokenException from superset.charts.api import ChartRestApi from superset.charts.client_processing import apply_client_processing +from superset.charts.data.dashboard_filter_context import ( + DashboardFilterContext, + get_dashboard_filter_context, +) from superset.charts.data.query_context_cache_loader import QueryContextCacheLoader from superset.charts.schemas import ChartDataQueryContextSchema from superset.commands.chart.data.create_async_job_command import ( @@ -46,9 +50,13 @@ from superset.commands.chart.exceptions import ( ) from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType from superset.connectors.sqla.models import BaseDatasource -from superset.constants import CACHE_DISABLED_TIMEOUT +from superset.constants import ( + CACHE_DISABLED_TIMEOUT, + EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS, + EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS, +) from superset.daos.exceptions import DatasourceNotFound -from superset.exceptions import QueryObjectValidationError +from superset.exceptions import QueryObjectValidationError, SupersetSecurityException from superset.extensions import event_logger from superset.models.sql_lab import Query from superset.utils import json @@ -91,7 +99,9 @@ class ChartDataRestApi(ChartRestApi): summary: Return payload data response for a chart description: >- Takes a chart ID and uses the query context stored when the chart was saved - to return payload data response. + to return payload data response. When filters_dashboard_id is provided, + the chart's compiled SQL includes in scope dashboard filter + default values. parameters: - in: path schema: @@ -113,6 +123,16 @@ class ChartDataRestApi(ChartRestApi): description: Should the queries be forced to load from the source schema: type: boolean + - in: query + name: filters_dashboard_id + description: >- + Dashboard ID whose filter defaults should be applied to the + chart's query context. The chart must belong to the specified dashboard. + Only in scope filters with static default values are applied; filters that + require a database query (I.E. defaultToFirstItem) or have no default are + reported in the dashboard_filters response metadata. + schema: + type: integer responses: 200: description: Query result @@ -130,6 +150,10 @@ class ChartDataRestApi(ChartRestApi): $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' """ @@ -156,6 +180,63 @@ class ChartDataRestApi(ChartRestApi): json_body["result_type"] = request.args.get("type", ChartDataResultType.FULL) json_body["force"] = request.args.get("force") + # Apply dashboard filter context when filters_dashboard_id is provided + dashboard_filter_context: DashboardFilterContext | None = None + if "filters_dashboard_id" in request.args: + raw = request.args.get("filters_dashboard_id") + try: + filters_dashboard_id = int(raw) + except (ValueError, TypeError): + return self.response_400( + message="filters_dashboard_id must be an integer" + ) + else: + filters_dashboard_id = None + + if filters_dashboard_id is not None: + try: + dashboard_filter_context = get_dashboard_filter_context( + dashboard_id=filters_dashboard_id, + chart_id=pk, + ) + except ValueError as error: + return self.response_400(message=str(error)) + except SupersetSecurityException: + return self.response_403() + + if dashboard_filter_context.extra_form_data: + efd = dashboard_filter_context.extra_form_data + extra_filters = efd.get("filters", []) + + for query in json_body.get("queries", []): + if extra_filters: + existing = query.get("filters") or [] + query["filters"] = existing + [ + {**f, "isExtra": True} for f in extra_filters + ] + + extras = query.get("extras") or {} + for key in EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS: + if key in efd: + extras[key] = efd[key] + if extras: + query["extras"] = extras + + for ( + src_key, + target_key, + ) in EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS.items(): + if src_key in efd: + query[target_key] = efd[src_key] + + query["extra_form_data"] = efd + + # We need to apply the form data to the global context as jinja + # templating pulls form data from the request globally, so this + # fallback ensures it has the filters and extra_form_data applied + # when used in get_sqla_query which constructs the final query. + g.form_data = json_body + try: query_context = self._create_query_context_from_form(json_body) command = ChartDataCommand(query_context) @@ -194,6 +275,7 @@ class ChartDataRestApi(ChartRestApi): form_data=form_data, datasource=query_context.datasource, add_extra_log_payload=add_extra_log_payload, + dashboard_filter_context=dashboard_filter_context, ) @expose("/data", methods=("POST",)) @@ -394,6 +476,7 @@ class ChartDataRestApi(ChartRestApi): datasource: BaseDatasource | Query | None = None, filename: str | None = None, expected_rows: int | None = None, + dashboard_filter_context: DashboardFilterContext | None = None, ) -> Response: result_type = result["query_context"].result_type result_format = result["query_context"].result_format @@ -456,9 +539,14 @@ class ChartDataRestApi(ChartRestApi): if security_manager.is_guest_user(): for query in queries: query.pop("query", None) + + payload: dict[str, Any] = {"result": queries} + if dashboard_filter_context is not None: + payload["dashboard_filters"] = dashboard_filter_context.to_dict() + with event_logger.log_context(f"{self.__class__.__name__}.json_dumps"): response_data = json.dumps( - {"result": queries}, + payload, default=json.json_int_dttm_ser, ignore_nan=True, ) @@ -497,6 +585,7 @@ class ChartDataRestApi(ChartRestApi): filename: str | None = None, expected_rows: int | None = None, add_extra_log_payload: Callable[..., None] | None = None, + dashboard_filter_context: DashboardFilterContext | None = None, ) -> Response: """Get data response and optionally log is_cached information.""" try: @@ -512,7 +601,12 @@ class ChartDataRestApi(ChartRestApi): add_extra_log_payload(is_cached=is_cached_values) return self._send_chart_response( - result, form_data, datasource, filename, expected_rows + result, + form_data, + datasource, + filename, + expected_rows, + dashboard_filter_context=dashboard_filter_context, ) def _extract_export_params_from_request(self) -> tuple[str | None, int | None]: diff --git a/superset/charts/data/dashboard_filter_context.py b/superset/charts/data/dashboard_filter_context.py new file mode 100644 index 00000000000..df889b52ace --- /dev/null +++ b/superset/charts/data/dashboard_filter_context.py @@ -0,0 +1,306 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import annotations + +import logging +from dataclasses import dataclass, field +from enum import Enum +from typing import Any + +from flask_babel import gettext as _ + +from superset import db, security_manager +from superset.constants import ( + EXTRA_FORM_DATA_APPEND_KEYS, + EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS, + EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS, +) +from superset.models.dashboard import Dashboard +from superset.utils import json + +logger = logging.getLogger(__name__) + +CHART_TYPE = "CHART" + + +class DashboardFilterStatus(str, Enum): + APPLIED = "applied" + NOT_APPLIED = "not_applied" + NOT_APPLIED_USES_DEFAULT_TO_FIRST_ITEM_PREQUERY = ( + "not_applied_uses_default_to_first_item_prequery" + ) + + +@dataclass +class DashboardFilterInfo: + id: str + name: str + status: DashboardFilterStatus + column: str | None = None + + +@dataclass +class DashboardFilterContext: + extra_form_data: dict[str, Any] = field(default_factory=dict) + filters: list[DashboardFilterInfo] = field(default_factory=list) + + def to_dict(self) -> dict[str, Any]: + return { + "filters": [ + { + "id": f.id, + "name": f.name, + "status": f.status.value, + **({"column": f.column} if f.column else {}), + } + for f in self.filters + ], + } + + +def _is_filter_in_scope_for_chart( + filter_config: dict[str, Any], + chart_id: int, + position_json: dict[str, Any], +) -> bool: + """ + Determines whether a native filter applies to a given chart. When + chartsInScope is present on the filter config, uses that directly. + Otherwise falls back to scope.rootPath and scope.excluded with + the dashboard layout. + """ + if (charts_in_scope := filter_config.get("chartsInScope")) is not None: + return chart_id in charts_in_scope + + scope = filter_config.get("scope", {}) + root_path: list[str] = scope.get("rootPath", []) + excluded: list[int] = scope.get("excluded", []) + + if chart_id in excluded: + return False + + chart_layout_item = _find_chart_layout_item(chart_id, position_json) + if not chart_layout_item: + return False + + parents: list[str] = chart_layout_item.get("parents", []) + return any(parent in root_path for parent in parents) + + +def _find_chart_layout_item( + chart_id: int, + position_json: dict[str, Any], +) -> dict[str, Any] | None: + """Find the layout item for a chart in the dashboard position JSON.""" + for item in position_json.values(): + if not isinstance(item, dict): + continue + if ( + item.get("type") == CHART_TYPE + and item.get("meta", {}).get("chartId") == chart_id + ): + return item + return None + + +def _merge_extra_form_data( + base: dict[str, Any], + new: dict[str, Any], +) -> dict[str, Any]: + """ + Merge two extra_form_data dicts, appending list-type keys (like filters, + adhoc_filters), merging dict-type keys (like custom_form_data), and overriding + scalar keys (like granularity_sqla, time_range). + """ + append_keys = EXTRA_FORM_DATA_APPEND_KEYS - {"custom_form_data"} + override_keys = ( + set(EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS.keys()) + | EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS + ) + + merged: dict[str, Any] = {} + + for key in append_keys: + base_val = base.get(key, []) + new_val = new.get(key, []) + combined = list(base_val) + list(new_val) + if combined: + merged[key] = combined + + # Merge custom_form_data as dicts so multiple filters' contributions combine + base_custom = base.get("custom_form_data") or {} + new_custom = new.get("custom_form_data") or {} + if isinstance(base_custom, dict) and isinstance(new_custom, dict): + merged_custom = dict(base_custom) + for key, value in new_custom.items(): + if ( + key in merged_custom + and isinstance(merged_custom[key], list) + and isinstance(value, list) + ): + merged_custom[key] = merged_custom[key] + value + else: + merged_custom[key] = value + if merged_custom: + merged["custom_form_data"] = merged_custom + + for key in override_keys: + if key in new: + merged[key] = new[key] + elif key in base: + merged[key] = base[key] + + return merged + + +def _extract_filter_extra_form_data( + filter_config: dict[str, Any], +) -> tuple[dict[str, Any] | None, DashboardFilterStatus]: + """ + Extract extra_form_data from a native filter's defaultDataMask. + + Mirrors frontend dashboard behavior except for defaultToFirstItem + filters: filters with a static default contribute their + extraFormData to the query. Filters without a default or with + defaultToFirstItem set to True are simply not applied. + + Returns (extra_form_data, status). + """ + default_data_mask = filter_config.get("defaultDataMask", {}) + control_values = filter_config.get("controlValues", {}) + + extra_form_data = default_data_mask.get("extraFormData") + filter_state = default_data_mask.get("filterState", {}) + has_static_default = filter_state.get("value") is not None + + if control_values.get("defaultToFirstItem"): + return ( + None, + DashboardFilterStatus.NOT_APPLIED_USES_DEFAULT_TO_FIRST_ITEM_PREQUERY, + ) + + if has_static_default and extra_form_data: + return extra_form_data, DashboardFilterStatus.APPLIED + + return None, DashboardFilterStatus.NOT_APPLIED + + +def _get_filter_target_column(filter_config: dict[str, Any]) -> str | None: + """Extract the target column name from a native filter configuration.""" + if targets := filter_config.get("targets", []): + column = targets[0].get("column", {}) + if isinstance(column, dict): + return column.get("name") + if isinstance(column, str): + return column + return None + + +def _validate_chart_on_dashboard( + dashboard: Dashboard, + chart_id: int, +) -> None: + """ + Validate that a chart belongs to a dashboard. + + :raises ValueError: if the chart is not found on the dashboard + """ + slice_ids = {slc.id for slc in dashboard.slices} + if chart_id not in slice_ids: + raise ValueError( + _( + "Chart %(chart_id)s is not on dashboard %(dashboard_id)s", + chart_id=chart_id, + dashboard_id=dashboard.id, + ) + ) + + +def _check_dashboard_access(dashboard: Dashboard) -> None: + """ + Check that the user has access to the dashboard. + Uses the security manager's raise_for_access which handles + guest users, admins, owners, and DASHBOARD_RBAC. + + :raises SupersetSecurityException: if the user cannot access the dashboard + """ + security_manager.raise_for_access(dashboard=dashboard) + + +def get_dashboard_filter_context( + dashboard_id: int, + chart_id: int, +) -> DashboardFilterContext: + """ + Build a DashboardFilterContext for a chart on a dashboard. + + Loads the dashboard's native filter configuration, determines which + filters are in scope for the given chart, extracts default filter values, + and returns the merged extra_form_data along with metadata about each filter. + + :param dashboard_id: The ID of the dashboard + :param chart_id: The ID of the chart + :returns: DashboardFilterContext with merged extra_form_data and filter metadata + :raises ValueError: if dashboard not found or chart not on dashboard + :raises SupersetSecurityException: if the user cannot access the dashboard + """ + dashboard = db.session.query(Dashboard).filter_by(id=dashboard_id).one_or_none() + if not dashboard: + raise ValueError( + _("Dashboard %(dashboard_id)s not found", dashboard_id=dashboard_id) + ) + + _check_dashboard_access(dashboard) + _validate_chart_on_dashboard(dashboard, chart_id) + + metadata = json.loads(dashboard.json_metadata or "{}") + native_filter_config: list[dict[str, Any]] = metadata.get( + "native_filter_configuration", [] + ) + + position_json: dict[str, Any] = json.loads(dashboard.position_json or "{}") + + context = DashboardFilterContext() + + for flt in native_filter_config: + flt_type = flt.get("type", "") + if flt_type == "DIVIDER": + continue + + if not _is_filter_in_scope_for_chart(flt, chart_id, position_json): + continue + + flt_id = flt.get("id", "") + flt_name = flt.get("name", "") + target_column = _get_filter_target_column(flt) + extra_form_data, status = _extract_filter_extra_form_data(flt) + + if extra_form_data and status == DashboardFilterStatus.APPLIED: + context.extra_form_data = _merge_extra_form_data( + context.extra_form_data, extra_form_data + ) + + context.filters.append( + DashboardFilterInfo( + id=flt_id, + name=flt_name, + status=status, + column=target_column, + ) + ) + + return context diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py index 81b9509cd0a..e0cee7758c4 100644 --- a/superset/charts/schemas.py +++ b/superset/charts/schemas.py @@ -1563,6 +1563,42 @@ class ChartDataResponseResult(Schema): ) +class DashboardFilterInfoSchema(Schema): + id = fields.String( + metadata={"description": "The native filter ID"}, + required=True, + ) + name = fields.String( + metadata={"description": "The native filter name"}, + required=True, + ) + status = fields.String( + metadata={ + "description": "Filter status: 'applied' (default value was included " + "in the query), 'not_applied' (filter had no default value and was " + "omitted, matching dashboard initial-load behavior), or " + "'not_applied_uses_default_to_first_item_prequery' (filter uses " + "defaultToFirstItem which requires a pre-query to resolve and cannot " + "be applied server-side)", + }, + required=True, + ) + column = fields.String( + metadata={"description": "Target column name for the filter"}, + allow_none=True, + ) + + +class DashboardFiltersResponseSchema(Schema): + filters = fields.List( + fields.Nested(DashboardFilterInfoSchema), + metadata={ + "description": "Metadata about each in-scope dashboard native filter " + "and whether its default value was applied to the query" + }, + ) + + class ChartDataResponseSchema(Schema): result = fields.List( fields.Nested(ChartDataResponseResult), @@ -1571,6 +1607,14 @@ class ChartDataResponseSchema(Schema): "request." }, ) + dashboard_filters = fields.Nested( + DashboardFiltersResponseSchema, + metadata={ + "description": "Metadata about dashboard native filters applied to " + "the query. Only present when filters_dashboard_id is provided." + }, + required=False, + ) class ChartDataAsyncResponseSchema(Schema): @@ -1711,6 +1755,7 @@ CHART_SCHEMAS = ( ChartCacheWarmUpRequestSchema, ChartCacheWarmUpResponseSchema, ChartDataQueryContextSchema, + DashboardFiltersResponseSchema, ChartDataResponseSchema, ChartDataAsyncResponseSchema, # TODO: These should optimally be included in the QueryContext schema as an `anyOf` diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py index a4c1b95c9e6..d22b920e2d2 100644 --- a/tests/integration_tests/charts/data/api_tests.py +++ b/tests/integration_tests/charts/data/api_tests.py @@ -1810,3 +1810,218 @@ def test_chart_data_subquery_allowed( rv = test_client.post(CHART_DATA_URI, json=physical_query_context) assert rv.status_code == status_code + + +@pytest.mark.chart_data_flow +class TestGetChartDataWithDashboardFilter(BaseTestChartDataApi): + """Tests for the filters_dashboard_id parameter on GET /api/v1/chart//data/.""" + + def _setup_chart_with_query_context(self) -> Slice: + chart = db.session.query(Slice).filter_by(slice_name="Genders").one() + chart.query_context = json.dumps( + { + "datasource": {"id": chart.table.id, "type": "table"}, + "force": False, + "queries": [ + { + "time_range": "1900-01-01T00:00:00 : 2000-01-01T00:00:00", + "granularity": "ds", + "filters": [], + "extras": {"having": "", "where": ""}, + "applied_time_extras": {}, + "columns": ["gender"], + "metrics": ["sum__num"], + "orderby": [["sum__num", False]], + "annotation_layers": [], + "row_limit": 50000, + "timeseries_limit": 0, + "order_desc": True, + "url_params": {}, + "custom_params": {}, + "custom_form_data": {}, + } + ], + "result_format": "json", + "result_type": "full", + } + ) + return chart + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_with_dashboard_filter_context(self, mock_get_filter_ctx): + """ + Chart data API: Test GET with filters_dashboard_id returns + dashboard_filters metadata in the response. + """ + from superset.charts.data.dashboard_filter_context import ( + DashboardFilterContext, + DashboardFilterInfo, + DashboardFilterStatus, + ) + + chart = self._setup_chart_with_query_context() + mock_get_filter_ctx.return_value = DashboardFilterContext( + extra_form_data={}, + filters=[ + DashboardFilterInfo( + id="f1", + name="Region", + status=DashboardFilterStatus.APPLIED, + column="region", + ), + DashboardFilterInfo( + id="f2", + name="City", + status=DashboardFilterStatus.NOT_APPLIED, + column="city", + ), + ], + ) + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=1", "get_data" + ) + data = json.loads(rv.data.decode("utf-8")) + + assert rv.status_code == 200 + assert "dashboard_filters" in data + assert len(data["dashboard_filters"]["filters"]) == 2 + assert data["dashboard_filters"]["filters"][0]["status"] == "applied" + assert data["dashboard_filters"]["filters"][1]["status"] == "not_applied" + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_with_dashboard_filter_applies_filters_to_query( + self, mock_get_filter_ctx + ): + """ + Chart data API: Test GET with filters_dashboard_id merges + extra_form_data filters into the query so they appear in the + compiled SQL. + """ + from superset.charts.data.dashboard_filter_context import ( + DashboardFilterContext, + DashboardFilterInfo, + DashboardFilterStatus, + ) + + chart = self._setup_chart_with_query_context() + mock_get_filter_ctx.return_value = DashboardFilterContext( + extra_form_data={ + "filters": [{"col": "gender", "op": "IN", "val": ["boy"]}], + }, + filters=[ + DashboardFilterInfo( + id="f1", + name="Gender", + status=DashboardFilterStatus.APPLIED, + column="gender", + ), + ], + ) + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=1&type=query", + "get_data", + ) + data = json.loads(rv.data.decode("utf-8")) + + assert rv.status_code == 200 + assert "dashboard_filters" in data + assert data["dashboard_filters"]["filters"][0]["status"] == "applied" + + query_sql = data["result"][0]["query"] + assert "gender" in query_sql.lower() + assert "boy" in query_sql.lower() + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_without_dashboard_filter_has_no_metadata( + self, mock_get_filter_ctx + ): + """ + Chart data API: Test GET without filters_dashboard_id does not + include dashboard_filters in the response. + """ + chart = self._setup_chart_with_query_context() + + rv = self.get_assert_metric(f"api/v1/chart/{chart.id}/data/", "get_data") + data = json.loads(rv.data.decode("utf-8")) + + assert rv.status_code == 200 + assert "dashboard_filters" not in data + mock_get_filter_ctx.assert_not_called() + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + def test_get_data_invalid_filters_dashboard_id_returns_400(self): + """ + Chart data API: Test GET with non-integer filters_dashboard_id returns 400. + Invalid values (e.g. 'abc', '1.5', empty) are not silently ignored. + """ + chart = self._setup_chart_with_query_context() + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=abc", "get_data" + ) + data = json.loads(rv.data.decode("utf-8")) + + assert rv.status_code == 400 + assert "filters_dashboard_id" in data["message"].lower() + assert "integer" in data["message"].lower() + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_dashboard_not_found_returns_400(self, mock_get_filter_ctx): + """ + Chart data API: Test GET with invalid dashboard ID returns 400. + """ + chart = self._setup_chart_with_query_context() + mock_get_filter_ctx.side_effect = ValueError("Dashboard 999 not found") + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=999", "get_data" + ) + + assert rv.status_code == 400 + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_dashboard_access_denied_returns_403(self, mock_get_filter_ctx): + """ + Chart data API: Test GET with inaccessible dashboard returns 403. + """ + from superset.errors import SupersetError, SupersetErrorType + from superset.exceptions import SupersetSecurityException + + chart = self._setup_chart_with_query_context() + mock_get_filter_ctx.side_effect = SupersetSecurityException( + SupersetError( + error_type=SupersetErrorType.DASHBOARD_SECURITY_ACCESS_ERROR, + message="Access denied", + level="warning", + ) + ) + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=1", "get_data" + ) + + assert rv.status_code == 403 + + @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") + @mock.patch("superset.charts.data.api.get_dashboard_filter_context") + def test_get_data_chart_not_on_dashboard_returns_400(self, mock_get_filter_ctx): + """ + Chart data API: Test GET where chart is not on the dashboard returns 400. + """ + chart = self._setup_chart_with_query_context() + mock_get_filter_ctx.side_effect = ValueError("Chart 10 is not on dashboard 42") + + rv = self.get_assert_metric( + f"api/v1/chart/{chart.id}/data/?filters_dashboard_id=42", "get_data" + ) + + assert rv.status_code == 400 + data = json.loads(rv.data.decode("utf-8")) + assert "not on dashboard" in data["message"] diff --git a/tests/unit_tests/charts/test_dashboard_filter_context.py b/tests/unit_tests/charts/test_dashboard_filter_context.py new file mode 100644 index 00000000000..9be05929f64 --- /dev/null +++ b/tests/unit_tests/charts/test_dashboard_filter_context.py @@ -0,0 +1,525 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import annotations + +from typing import Any +from unittest.mock import MagicMock, patch + +import pytest + +from superset.charts.data.dashboard_filter_context import ( + _extract_filter_extra_form_data, + _find_chart_layout_item, + _is_filter_in_scope_for_chart, + _merge_extra_form_data, + _validate_chart_on_dashboard, + DashboardFilterContext, + DashboardFilterStatus, + get_dashboard_filter_context, +) +from superset.utils import json + +SAMPLE_POSITION_JSON = { + "ROOT_ID": { + "id": "ROOT_ID", + "type": "ROOT", + "children": ["GRID_ID"], + }, + "GRID_ID": { + "id": "GRID_ID", + "type": "GRID", + "children": ["ROW-abc"], + "parents": ["ROOT_ID"], + }, + "ROW-abc": { + "id": "ROW-abc", + "type": "ROW", + "children": ["CHART-xyz"], + "parents": ["ROOT_ID", "GRID_ID"], + }, + "CHART-xyz": { + "id": "CHART-xyz", + "type": "CHART", + "meta": {"chartId": 10}, + "parents": ["ROOT_ID", "GRID_ID", "ROW-abc"], + }, + "CHART-other": { + "id": "CHART-other", + "type": "CHART", + "meta": {"chartId": 20}, + "parents": ["ROOT_ID", "GRID_ID", "ROW-abc"], + }, +} + + +def _make_filter( + flt_id: str = "NATIVE_FILTER-1", + name: str = "Region Filter", + scope_root: list[str] | None = None, + scope_excluded: list[int] | None = None, + charts_in_scope: list[int] | None = None, + default_value: list[str] | None = None, + extra_form_data: dict[str, Any] | None = None, + default_to_first_item: bool = False, + target_column: str | None = "region", + flt_type: str = "NATIVE_FILTER", +) -> dict[str, Any]: + """Helper to build a native filter config dict for testing.""" + flt: dict[str, Any] = { + "id": flt_id, + "name": name, + "type": flt_type, + "filterType": "filter_select", + "targets": [{"datasetId": 1, "column": {"name": target_column}}] + if target_column + else [], + "scope": { + "rootPath": scope_root or ["ROOT_ID"], + "excluded": scope_excluded or [], + }, + "controlValues": { + "defaultToFirstItem": default_to_first_item, + "multiSelect": True, + "enableEmptyFilter": False, + }, + "defaultDataMask": {}, + } + if charts_in_scope is not None: + flt["chartsInScope"] = charts_in_scope + if default_value is not None: + flt["defaultDataMask"]["filterState"] = {"value": default_value} + if extra_form_data is None: + extra_form_data = { + "filters": [{"col": target_column, "op": "IN", "val": default_value}] + } + if extra_form_data is not None: + flt["defaultDataMask"]["extraFormData"] = extra_form_data + return flt + + +# --- _find_chart_layout_item --- + + +def test_find_chart_layout_item_found() -> None: + result = _find_chart_layout_item(10, SAMPLE_POSITION_JSON) + assert result is not None + assert result["id"] == "CHART-xyz" + assert result["meta"]["chartId"] == 10 + + +def test_find_chart_layout_item_not_found() -> None: + result = _find_chart_layout_item(999, SAMPLE_POSITION_JSON) + assert result is None + + +def test_find_chart_layout_item_skips_non_dict_entries() -> None: + position = {**SAMPLE_POSITION_JSON, "DASHBOARD_VERSION_KEY": "v2"} + result = _find_chart_layout_item(10, position) + assert result is not None + + +# --- _is_filter_in_scope_for_chart --- + + +def test_filter_in_scope_via_charts_in_scope() -> None: + flt = _make_filter(charts_in_scope=[10, 20]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is True + + +def test_filter_not_in_scope_via_charts_in_scope() -> None: + flt = _make_filter(charts_in_scope=[20, 30]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is False + + +def test_filter_empty_charts_in_scope_not_in_scope() -> None: + """Empty chartsInScope means in scope for no charts; do not fall back to rootPath""" + flt = _make_filter(charts_in_scope=[], scope_root=["ROOT_ID"]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is False + + +def test_filter_in_scope_via_root_path() -> None: + flt = _make_filter(scope_root=["ROOT_ID"]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is True + + +def test_filter_excluded_from_scope() -> None: + flt = _make_filter(scope_root=["ROOT_ID"], scope_excluded=[10]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is False + + +def test_filter_not_in_scope_different_root() -> None: + flt = _make_filter(scope_root=["TABS-nonexistent"]) + assert _is_filter_in_scope_for_chart(flt, 10, SAMPLE_POSITION_JSON) is False + + +def test_filter_in_scope_chart_not_in_layout() -> None: + flt = _make_filter(scope_root=["ROOT_ID"]) + assert _is_filter_in_scope_for_chart(flt, 999, SAMPLE_POSITION_JSON) is False + + +# --- _extract_filter_extra_form_data --- + + +def test_extract_static_default_applied() -> None: + flt = _make_filter(default_value=["US", "UK"]) + extra_form_data, status = _extract_filter_extra_form_data(flt) + assert status == DashboardFilterStatus.APPLIED + assert extra_form_data is not None + assert extra_form_data["filters"][0]["val"] == ["US", "UK"] + + +def test_extract_default_to_first_item_not_applied() -> None: + """defaultToFirstItem filters require a pre-query and cannot be applied.""" + flt = _make_filter(default_to_first_item=True) + extra_form_data, status = _extract_filter_extra_form_data(flt) + assert ( + status == DashboardFilterStatus.NOT_APPLIED_USES_DEFAULT_TO_FIRST_ITEM_PREQUERY + ) + assert extra_form_data is None + + +def test_extract_no_default_value_not_applied() -> None: + """Filters with no default are not applied, matching dashboard initial load.""" + flt = _make_filter() + extra_form_data, status = _extract_filter_extra_form_data(flt) + assert status == DashboardFilterStatus.NOT_APPLIED + assert extra_form_data is None + + +def test_extract_default_to_first_item_overrides_static_default() -> None: + """defaultToFirstItem takes precedence even when a static default exists.""" + flt = _make_filter(default_value=["US"], default_to_first_item=True) + extra_form_data, status = _extract_filter_extra_form_data(flt) + assert ( + status == DashboardFilterStatus.NOT_APPLIED_USES_DEFAULT_TO_FIRST_ITEM_PREQUERY + ) + assert extra_form_data is None + + +def test_extract_filter_state_value_but_no_extra_form_data() -> None: + """Edge case: filterState.value set but extraFormData not persisted.""" + flt = _make_filter() + flt["defaultDataMask"] = {"filterState": {"value": ["US"]}} + extra_form_data, status = _extract_filter_extra_form_data(flt) + assert status == DashboardFilterStatus.NOT_APPLIED + assert extra_form_data is None + + +# --- _merge_extra_form_data --- + + +def test_merge_extra_form_data_appends_filters() -> None: + base = {"filters": [{"col": "a", "op": "IN", "val": ["x"]}]} + new = {"filters": [{"col": "b", "op": "IN", "val": ["y"]}]} + merged = _merge_extra_form_data(base, new) + assert len(merged["filters"]) == 2 + + +def test_merge_extra_form_data_overrides_scalars() -> None: + base = {"time_range": "last week"} + new = {"time_range": "last month"} + merged = _merge_extra_form_data(base, new) + assert merged["time_range"] == "last month" + + +def test_merge_extra_form_data_empty_inputs() -> None: + assert _merge_extra_form_data({}, {}) == {} + + +def test_merge_extra_form_data_merges_custom_form_data_dicts() -> None: + """custom_form_data is a dict; multiple filters' contributions are merged.""" + base = {"custom_form_data": {"groupby": ["col1"]}} + new = {"custom_form_data": {"foo": "bar"}} + merged = _merge_extra_form_data(base, new) + assert merged["custom_form_data"] == {"groupby": ["col1"], "foo": "bar"} + + +# --- _get_filter_target_column --- + + +def test_target_column_from_dict() -> None: + from superset.charts.data.dashboard_filter_context import _get_filter_target_column + + flt = _make_filter(target_column="country") + assert _get_filter_target_column(flt) == "country" + + +def test_target_column_no_targets() -> None: + from superset.charts.data.dashboard_filter_context import _get_filter_target_column + + flt = _make_filter(target_column=None) + flt["targets"] = [] + assert _get_filter_target_column(flt) is None + + +# --- validate_chart_on_dashboard --- + + +def test_validate_chart_on_dashboard_success() -> None: + dashboard = MagicMock() + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + _validate_chart_on_dashboard(dashboard, 10) + + +def test_validate_chart_on_dashboard_fails() -> None: + dashboard = MagicMock() + dashboard.id = 42 + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + with pytest.raises(ValueError, match="not on dashboard"): + _validate_chart_on_dashboard(dashboard, 999) + + +# --- DashboardFilterContext.to_dict --- + + +def test_dashboard_filter_context_to_dict() -> None: + from superset.charts.data.dashboard_filter_context import DashboardFilterInfo + + ctx = DashboardFilterContext( + extra_form_data={"filters": [{"col": "a", "op": "IN", "val": ["x"]}]}, + filters=[ + DashboardFilterInfo( + id="f1", + name="Filter 1", + status=DashboardFilterStatus.APPLIED, + column="a", + ), + DashboardFilterInfo( + id="f2", + name="Filter 2", + status=DashboardFilterStatus.NOT_APPLIED, + ), + ], + ) + result = ctx.to_dict() + assert len(result["filters"]) == 2 + assert result["filters"][0]["status"] == "applied" + assert result["filters"][0]["column"] == "a" + assert result["filters"][1]["status"] == "not_applied" + assert "column" not in result["filters"][1] + + +# --- get_dashboard_filter_context (integration with mocks) --- + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_dashboard_not_found( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = None + with pytest.raises(ValueError, match="not found"): + get_dashboard_filter_context(dashboard_id=999, chart_id=10) + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_chart_not_on_dashboard( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + dashboard = MagicMock() + dashboard.id = 42 + slice_obj = MagicMock() + slice_obj.id = 20 + dashboard.slices = [slice_obj] + dashboard.json_metadata = "{}" + dashboard.position_json = "{}" + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = dashboard + with pytest.raises(ValueError, match="not on dashboard"): + get_dashboard_filter_context(dashboard_id=42, chart_id=10) + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_static_defaults( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + filter_config = [ + _make_filter( + flt_id="f1", + name="Region", + scope_root=["ROOT_ID"], + default_value=["US", "UK"], + target_column="region", + ), + ] + metadata = {"native_filter_configuration": filter_config} + + dashboard = MagicMock() + dashboard.id = 1 + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + dashboard.json_metadata = json.dumps(metadata) + dashboard.position_json = json.dumps(SAMPLE_POSITION_JSON) + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = dashboard + + ctx = get_dashboard_filter_context(dashboard_id=1, chart_id=10) + + assert len(ctx.filters) == 1 + assert ctx.filters[0].status == DashboardFilterStatus.APPLIED + assert ctx.filters[0].column == "region" + assert len(ctx.extra_form_data.get("filters", [])) == 1 + assert ctx.extra_form_data["filters"][0]["val"] == ["US", "UK"] + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_mixed_filter_types( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + """Test with a mix of static, dynamic, and no-default filters.""" + filter_config = [ + _make_filter( + flt_id="f1", + name="Region", + scope_root=["ROOT_ID"], + default_value=["US"], + target_column="region", + ), + _make_filter( + flt_id="f2", + name="City", + scope_root=["ROOT_ID"], + default_to_first_item=True, + target_column="city", + ), + _make_filter( + flt_id="f3", + name="Status", + scope_root=["ROOT_ID"], + target_column="status", + ), + ] + metadata = {"native_filter_configuration": filter_config} + + dashboard = MagicMock() + dashboard.id = 1 + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + dashboard.json_metadata = json.dumps(metadata) + dashboard.position_json = json.dumps(SAMPLE_POSITION_JSON) + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = dashboard + + ctx = get_dashboard_filter_context(dashboard_id=1, chart_id=10) + + assert len(ctx.filters) == 3 + assert ctx.filters[0].status == DashboardFilterStatus.APPLIED + assert ( + ctx.filters[1].status + == DashboardFilterStatus.NOT_APPLIED_USES_DEFAULT_TO_FIRST_ITEM_PREQUERY + ) + assert ctx.filters[2].status == DashboardFilterStatus.NOT_APPLIED + + # Only the static-default filter should contribute to extra_form_data + assert len(ctx.extra_form_data.get("filters", [])) == 1 + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_skips_dividers( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + filter_config = [ + { + "id": "div-1", + "type": "DIVIDER", + "name": "Separator", + }, + _make_filter( + flt_id="f1", + name="Region", + scope_root=["ROOT_ID"], + default_value=["US"], + target_column="region", + ), + ] + metadata = {"native_filter_configuration": filter_config} + + dashboard = MagicMock() + dashboard.id = 1 + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + dashboard.json_metadata = json.dumps(metadata) + dashboard.position_json = json.dumps(SAMPLE_POSITION_JSON) + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = dashboard + + ctx = get_dashboard_filter_context(dashboard_id=1, chart_id=10) + assert len(ctx.filters) == 1 + assert ctx.filters[0].name == "Region" + + +@patch("superset.charts.data.dashboard_filter_context._check_dashboard_access") +@patch("superset.charts.data.dashboard_filter_context.db") +def test_get_dashboard_filter_context_out_of_scope_filter_excluded( + mock_db: MagicMock, + mock_check_access: MagicMock, +) -> None: + """Filters not in scope for the chart should be excluded.""" + filter_config = [ + _make_filter( + flt_id="f1", + name="In-scope", + scope_root=["ROOT_ID"], + default_value=["US"], + target_column="region", + ), + _make_filter( + flt_id="f2", + name="Out-of-scope", + scope_root=["TABS-nonexistent"], + default_value=["active"], + target_column="status", + ), + ] + metadata = {"native_filter_configuration": filter_config} + + dashboard = MagicMock() + dashboard.id = 1 + slice_obj = MagicMock() + slice_obj.id = 10 + dashboard.slices = [slice_obj] + dashboard.json_metadata = json.dumps(metadata) + dashboard.position_json = json.dumps(SAMPLE_POSITION_JSON) + ( + mock_db.session.query.return_value.filter_by.return_value.one_or_none.return_value + ) = dashboard + + ctx = get_dashboard_filter_context(dashboard_id=1, chart_id=10) + assert len(ctx.filters) == 1 + assert ctx.filters[0].id == "f1"