Skip to content

Commit d2a8d39

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Allow Table Widget requests to specify text replace formatting in dashboards (#1803)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 12f958a commit d2a8d39

19 files changed

+1070
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-09-13 20:35:36.314189",
8-
"spec_repo_commit": "6093038f"
7+
"regenerated": "2024-09-16 14:02:55.755592",
8+
"spec_repo_commit": "966987f5"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-13 20:35:36.333143",
13-
"spec_repo_commit": "6093038f"
12+
"regenerated": "2024-09-16 14:02:55.775858",
13+
"spec_repo_commit": "966987f5"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16752,6 +16752,181 @@ components:
1675216752
$ref: '#/components/schemas/LogQueryDefinition'
1675316753
sort:
1675416754
$ref: '#/components/schemas/WidgetSortBy'
16755+
text_formats:
16756+
description: List of text formats for columns produced by tags.
16757+
items:
16758+
$ref: '#/components/schemas/TableWidgetTextFormat'
16759+
type: array
16760+
type: object
16761+
TableWidgetTextFormat:
16762+
description: Text format rules for a tag-based column within a table widget.
16763+
example:
16764+
- match:
16765+
type: is
16766+
value: fruit
16767+
replace:
16768+
type: all
16769+
with: vegetable
16770+
- match:
16771+
type: is
16772+
value: cake
16773+
palette: white_on_green
16774+
items:
16775+
$ref: '#/components/schemas/TableWidgetTextFormatRule'
16776+
minItems: 1
16777+
type: array
16778+
TableWidgetTextFormatMatch:
16779+
description: Match rule for the table widget text format.
16780+
example:
16781+
type: is
16782+
value: fruit
16783+
properties:
16784+
type:
16785+
$ref: '#/components/schemas/TableWidgetTextFormatMatchType'
16786+
value:
16787+
description: Table Widget Match String.
16788+
example: Match Value
16789+
type: string
16790+
required:
16791+
- type
16792+
- value
16793+
type: object
16794+
TableWidgetTextFormatMatchType:
16795+
description: Match or compare option.
16796+
enum:
16797+
- is
16798+
- is_not
16799+
- contains
16800+
- does_not_contain
16801+
- starts_with
16802+
- ends_with
16803+
example: is
16804+
type: string
16805+
x-enum-varnames:
16806+
- IS
16807+
- IS_NOT
16808+
- CONTAINS
16809+
- DOES_NOT_CONTAIN
16810+
- STARTS_WITH
16811+
- ENDS_WITH
16812+
TableWidgetTextFormatPalette:
16813+
default: white_on_green
16814+
description: Color-on-color palette to highlight replaced text.
16815+
enum:
16816+
- white_on_red
16817+
- white_on_yellow
16818+
- white_on_green
16819+
- black_on_light_red
16820+
- black_on_light_yellow
16821+
- black_on_light_green
16822+
- red_on_white
16823+
- yellow_on_white
16824+
- green_on_white
16825+
- custom_bg
16826+
- custom_text
16827+
type: string
16828+
x-enum-varnames:
16829+
- WHITE_ON_RED
16830+
- WHITE_ON_YELLOW
16831+
- WHITE_ON_GREEN
16832+
- BLACK_ON_LIGHT_RED
16833+
- BLACK_ON_LIGHT_YELLOW
16834+
- BLACK_ON_LIGHT_GREEN
16835+
- RED_ON_WHITE
16836+
- YELLOW_ON_WHITE
16837+
- GREEN_ON_WHITE
16838+
- CUSTOM_BG
16839+
- CUSTOM_TEXT
16840+
TableWidgetTextFormatReplace:
16841+
description: Replace rule for the table widget text format.
16842+
example:
16843+
type: all
16844+
with: vegetable
16845+
oneOf:
16846+
- $ref: '#/components/schemas/TableWidgetTextFormatReplaceAll'
16847+
- $ref: '#/components/schemas/TableWidgetTextFormatReplaceSubstring'
16848+
TableWidgetTextFormatReplaceAll:
16849+
description: Match All definition.
16850+
example:
16851+
type: all
16852+
with: vegetable
16853+
properties:
16854+
type:
16855+
$ref: '#/components/schemas/TableWidgetTextFormatReplaceAllType'
16856+
with:
16857+
description: Replace All type.
16858+
example: all
16859+
type: string
16860+
required:
16861+
- type
16862+
- with
16863+
type: object
16864+
TableWidgetTextFormatReplaceAllType:
16865+
description: Table widget text format replace all type.
16866+
enum:
16867+
- all
16868+
example: all
16869+
type: string
16870+
x-enum-varnames:
16871+
- ALL
16872+
TableWidgetTextFormatReplaceSubstring:
16873+
description: Match Sub-string definition.
16874+
example:
16875+
substring: fruit
16876+
type: substring
16877+
with: vegetable
16878+
properties:
16879+
substring:
16880+
description: Text that will be replaced.
16881+
example: string to replace
16882+
type: string
16883+
type:
16884+
$ref: '#/components/schemas/TableWidgetTextFormatReplaceSubstringType'
16885+
with:
16886+
description: Text that will replace original sub-string.
16887+
example: replacement
16888+
type: string
16889+
required:
16890+
- type
16891+
- with
16892+
- substring
16893+
type: object
16894+
TableWidgetTextFormatReplaceSubstringType:
16895+
description: Table widget text format replace sub-string type.
16896+
enum:
16897+
- substring
16898+
example: substring
16899+
type: string
16900+
x-enum-varnames:
16901+
- SUBSTRING
16902+
TableWidgetTextFormatRule:
16903+
description: Text format rules.
16904+
example:
16905+
match:
16906+
type: is
16907+
value: apple
16908+
replace:
16909+
type: all
16910+
with: vegetable
16911+
properties:
16912+
custom_bg_color:
16913+
description: Hex representation of the custom background color. Used with
16914+
custom background palette option.
16915+
example: '#632ca6'
16916+
type: string
16917+
custom_fg_color:
16918+
description: Hex representation of the custom text color. Used with custom
16919+
text palette option.
16920+
example: '#632ca6'
16921+
type: string
16922+
match:
16923+
$ref: '#/components/schemas/TableWidgetTextFormatMatch'
16924+
palette:
16925+
$ref: '#/components/schemas/TableWidgetTextFormatPalette'
16926+
replace:
16927+
$ref: '#/components/schemas/TableWidgetTextFormatReplace'
16928+
required:
16929+
- match
1675516930
type: object
1675616931
TagToHosts:
1675716932
description: In this object, the key is the tag, the value is a list of host
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-09-11T14:33:18.508Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with query_table widget and text formatting",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "02f6ca41db98eb0c896c7f7a603e4ebf",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 1713,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 560,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_query_table_widget_and_text_formatting-1726065198\",\"widgets\":[{\"definition\":{\"has_search_bar\":\"never\",\"requests\":[{\"formulas\":[],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:aws.stream.globalaccelerator.processed_bytes_in{*} by {aws_account,acceleratoripaddress}\"},{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query2\",\"query\":\"avg:aws.stream.globalaccelerator.processed_bytes_out{*} by {aws_account,acceleratoripaddress}\"}],\"response_format\":\"scalar\",\"text_formats\":[[{\"match\":{\"type\":\"is\",\"value\":\"fruit\"},\"palette\":\"white_on_red\",\"replace\":{\"type\":\"all\",\"with\":\"vegetable\"}},{\"custom_bg_color\":\"#632ca6\",\"match\":{\"type\":\"is\",\"value\":\"animal\"},\"palette\":\"custom_bg\"},{\"match\":{\"type\":\"is\",\"value\":\"robot\"},\"palette\":\"red_on_white\"},{\"match\":{\"type\":\"is\",\"value\":\"ai\"},\"palette\":\"yellow_on_white\"}],[{\"match\":{\"type\":\"is_not\",\"value\":\"xyz\"},\"palette\":\"white_on_yellow\"}],[{\"match\":{\"type\":\"contains\",\"value\":\"test\"},\"palette\":\"white_on_green\",\"replace\":{\"type\":\"all\",\"with\":\"vegetable\"}}],[{\"match\":{\"type\":\"does_not_contain\",\"value\":\"blah\"},\"palette\":\"black_on_light_red\"}],[{\"match\":{\"type\":\"starts_with\",\"value\":\"abc\"},\"palette\":\"black_on_light_yellow\"}],[{\"match\":{\"type\":\"ends_with\",\"value\":\"xyz\"},\"palette\":\"black_on_light_green\"},{\"match\":{\"type\":\"ends_with\",\"value\":\"zzz\"},\"palette\":\"green_on_white\"},{\"custom_fg_color\":\"#632ca6\",\"match\":{\"type\":\"is\",\"value\":\"animal\"},\"palette\":\"custom_text\"}]]}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 2062,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 2062,
45+
"text": "{\"id\":\"462-puf-hkg\",\"title\":\"Test-Create_a_new_dashboard_with_query_table_widget_and_text_formatting-1726065198\",\"description\":\"\",\"author_handle\":\"[email protected]\",\"author_name\":null,\"layout_type\":\"free\",\"url\":\"/dashboard/462-puf-hkg/test-createanewdashboardwithquerytablewidgetandtextformatting-1726065198\",\"is_read_only\":false,\"template_variables\":[],\"widgets\":[{\"definition\":{\"has_search_bar\":\"never\",\"requests\":[{\"formulas\":[],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:aws.stream.globalaccelerator.processed_bytes_in{*} by {aws_account,acceleratoripaddress}\"},{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query2\",\"query\":\"avg:aws.stream.globalaccelerator.processed_bytes_out{*} by {aws_account,acceleratoripaddress}\"}],\"response_format\":\"scalar\",\"text_formats\":[[{\"match\":{\"type\":\"is\",\"value\":\"fruit\"},\"palette\":\"white_on_red\",\"replace\":{\"type\":\"all\",\"with\":\"vegetable\"}},{\"custom_bg_color\":\"#632ca6\",\"match\":{\"type\":\"is\",\"value\":\"animal\"},\"palette\":\"custom_bg\"},{\"match\":{\"type\":\"is\",\"value\":\"robot\"},\"palette\":\"red_on_white\"},{\"match\":{\"type\":\"is\",\"value\":\"ai\"},\"palette\":\"yellow_on_white\"}],[{\"match\":{\"type\":\"is_not\",\"value\":\"xyz\"},\"palette\":\"white_on_yellow\"}],[{\"match\":{\"type\":\"contains\",\"value\":\"test\"},\"palette\":\"white_on_green\",\"replace\":{\"type\":\"all\",\"with\":\"vegetable\"}}],[{\"match\":{\"type\":\"does_not_contain\",\"value\":\"blah\"},\"palette\":\"black_on_light_red\"}],[{\"match\":{\"type\":\"starts_with\",\"value\":\"abc\"},\"palette\":\"black_on_light_yellow\"}],[{\"match\":{\"type\":\"ends_with\",\"value\":\"xyz\"},\"palette\":\"black_on_light_green\"},{\"match\":{\"type\":\"ends_with\",\"value\":\"zzz\"},\"palette\":\"green_on_white\"},{\"custom_fg_color\":\"#632ca6\",\"match\":{\"type\":\"is\",\"value\":\"animal\"},\"palette\":\"custom_text\"}]]}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0},\"id\":3373154044387493}],\"notify_list\":[],\"created_at\":\"2024-09-11T14:33:18.843540+00:00\",\"modified_at\":\"2024-09-11T14:33:18.843540+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 658,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2024-09-11T14:33:18.592Z",
61+
"time": 308
62+
},
63+
{
64+
"_id": "d906322dfa466921e909a3fdca54c1cd",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 520,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/462-puf-hkg"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"462-puf-hkg\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 656,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2024-09-11T14:33:18.919Z",
104+
"time": 288
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}

0 commit comments

Comments
 (0)