Skip to content

Commit e3d56aa

Browse files
Merge pull request DataDog#663 from DataDog/samantha/api_dash_read_only
[api] document dashboard read_only parameter
2 parents 76f9026 + b235cca commit e3d56aa

28 files changed

+62
-27
lines changed

code_snippets/api-dashboard-create.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@
2626
"default": "host:my-host"
2727
}]
2828

29-
api.Timeboard.create(title=title, description=description, graphs=graphs, template_variables=template_variables)
29+
read_only = True
30+
31+
api.Timeboard.create(title=title, description=description, graphs=graphs, template_variables=template_variables, read_only=read_only)

code_snippets/api-dashboard-create.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
"prefix" => "host",
2525
"default" => "host:my-host"
2626
}]
27+
read_only=true
2728

28-
dog.create_dashboard(title, description, graphs, template_variables)
29+
dog.create_dashboard(title, description, graphs, template_variables, read_only)

code_snippets/api-dashboard-create.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ curl -X POST -H "Content-type: application/json" \
1919
"name": "host1",
2020
"prefix": "host",
2121
"default": "host:my-host"
22-
}]
22+
}],
23+
"read_only": "True"
2324
}' \
2425
"https://app.datadoghq.com/api/v1/dash?api_key=${api_key}&application_key=${app_key}"

code_snippets/api-dashboard-update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
"prefix": "host",
2525
"default": "host:my-host"
2626
}]
27+
read_only = True
2728

28-
api.Timeboard.update(4952, title=title, description=description, graphs=graphs, template_variables=template_variables)
29+
api.Timeboard.update(4952, title=title, description=description, graphs=graphs, template_variables=template_variables, read_only=read_only)

code_snippets/api-dashboard-update.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"name" => "host1",
2424
"prefix" => "host",
2525
"default" => "host:my-host"
26-
}]
26+
}],
27+
read_only = true
2728

28-
dog.update_dashboard(dash_id, title, description, graphs, template_variables)
29+
dog.update_dashboard(dash_id, title, description, graphs, template_variables, read_only)

code_snippets/results/result.api-dashboard-create.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{'dash': {'description': 'An informative timeboard.',
22
'created': '2015-12-17T21:29:40.890824+00:00',
33
'modified': '2015-12-17T21:29:40.890824+00:00',
4+
'read_only': 'True',
45
'graphs': [{'definition': {'events': [],
56
'requests': [{'q': 'avg:system.mem.free{*}'}],
67
'viz': 'timeseries'},

code_snippets/results/result.api-dashboard-create.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
"url"=>"/dash/dash/2552",
1313
"resource"=>"/api/v1/dash/2552",
1414
"created"=>"2015-12-17T21:29:40.890824+00:00",
15-
"modified"=>"2015-12-17T21:29:40.890824+00:00"}]
15+
"modified"=>"2015-12-17T21:29:40.890824+00:00",
16+
"read_only"=>true}]

code_snippets/results/result.api-dashboard-create.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
"url": "/dash/dash/2532",
2222
"created": "2015-12-17T23:06:06.703087+00:00",
2323
"modified": "2015-12-17T23:06:06.726234+00:00",
24+
"read_only": "true"
2425
}

code_snippets/results/result.api-dashboard-get-all.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
'resource': '/api/v1/dash/2552',
1010
'title': 'My First Metrics',
1111
'created': '2015-12-17T21:29:40.890824+00:00',
12-
'modified': '2015-12-17T21:39:20.770834+00:00'}
12+
'modified': '2015-12-17T21:39:20.770834+00:00',
13+
'read_only': True}
1314
]

code_snippets/results/result.api-dashboard-get-all.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"id"=>"2552",
1212
"description"=>"And they are marvelous.",
1313
"created"=>"2015-12-17T20:09:33.890824+00:00",
14-
"modified"=>"2015-12-17T20:19:22.770834+00:00"}
14+
"modified"=>"2015-12-17T20:19:22.770834+00:00",
15+
"read_only"=>true}
1516
]}]

0 commit comments

Comments
 (0)