2022-05-26 23:06:25 +08:00
|
|
|
---
|
|
|
|
aliases:
|
2022-12-10 00:36:04 +08:00
|
|
|
- ../../http_api/playlist/
|
2023-02-07 01:14:36 +08:00
|
|
|
canonical: /docs/grafana/latest/developers/http_api/playlist/
|
2022-05-26 23:06:25 +08:00
|
|
|
description: Playlist Admin HTTP API
|
|
|
|
keywords:
|
|
|
|
- grafana
|
|
|
|
- http
|
|
|
|
- documentation
|
|
|
|
- api
|
|
|
|
- playlist
|
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
|
|
|
labels:
|
|
|
|
products:
|
|
|
|
- enterprise
|
|
|
|
- oss
|
2022-05-26 23:06:25 +08:00
|
|
|
title: 'Playlist HTTP API '
|
|
|
|
---
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
# Playlist API
|
|
|
|
|
|
|
|
## Search Playlist
|
|
|
|
|
|
|
|
`GET /api/playlists`
|
|
|
|
|
|
|
|
Get all existing playlist for the current organization using pagination
|
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
GET /api/playlists HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
```
|
|
|
|
|
2021-08-06 21:52:36 +08:00
|
|
|
Querystring Parameters:
|
2018-07-17 22:45:39 +08:00
|
|
|
|
2021-08-06 21:52:36 +08:00
|
|
|
These parameters are used as querystring parameters.
|
2019-04-09 23:30:21 +08:00
|
|
|
|
2021-08-06 21:52:36 +08:00
|
|
|
- **query** - Limit response to playlist having a name like this value.
|
|
|
|
- **limit** - Limit response to _X_ number of playlist.
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
[
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"uid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
## Get one playlist
|
|
|
|
|
2022-06-15 03:32:52 +08:00
|
|
|
`GET /api/playlists/:uid`
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
GET /api/playlists/1 HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"uid" : "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m",
|
|
|
|
"items": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2024-09-13 16:59:20 +08:00
|
|
|
"type": "dashboard_by_uid",
|
2018-07-17 22:45:39 +08:00
|
|
|
"value": "3",
|
|
|
|
"order": 1,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my third dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 2,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"type": "dashboard_by_tag",
|
|
|
|
"value": "myTag",
|
|
|
|
"order": 2,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my other dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Get Playlist items
|
|
|
|
|
2022-06-15 03:32:52 +08:00
|
|
|
`GET /api/playlists/:uid/items`
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
GET /api/playlists/1/items HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"id": 1,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2024-09-13 16:59:20 +08:00
|
|
|
"type": "dashboard_by_uid",
|
2018-07-17 22:45:39 +08:00
|
|
|
"value": "3",
|
|
|
|
"order": 1,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my third dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 2,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"type": "dashboard_by_tag",
|
|
|
|
"value": "myTag",
|
|
|
|
"order": 2,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my other dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
## Create a playlist
|
|
|
|
|
|
|
|
`POST /api/playlists/`
|
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
PUT /api/playlists/1 HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Content-Type: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
{
|
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m",
|
|
|
|
"items": [
|
|
|
|
{
|
2024-09-13 16:59:20 +08:00
|
|
|
"type": "dashboard_by_uid",
|
2018-07-17 22:45:39 +08:00
|
|
|
"value": "3",
|
|
|
|
"order": 1,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my third dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "dashboard_by_tag",
|
|
|
|
"value": "myTag",
|
|
|
|
"order": 2,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my other dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"uid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Update a playlist
|
|
|
|
|
2022-06-15 03:32:52 +08:00
|
|
|
`PUT /api/playlists/:uid`
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
PUT /api/playlists/1 HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Content-Type: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
{
|
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m",
|
|
|
|
"items": [
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2024-09-13 16:59:20 +08:00
|
|
|
"type": "dashboard_by_uid",
|
2018-07-17 22:45:39 +08:00
|
|
|
"value": "3",
|
|
|
|
"order": 1,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my third dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
},
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"type": "dashboard_by_tag",
|
|
|
|
"value": "myTag",
|
|
|
|
"order": 2,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my other dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
{
|
2022-06-15 03:32:52 +08:00
|
|
|
"uid" : "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"name": "my playlist",
|
|
|
|
"interval": "5m",
|
|
|
|
"items": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2024-09-13 16:59:20 +08:00
|
|
|
"type": "dashboard_by_uid",
|
2018-07-17 22:45:39 +08:00
|
|
|
"value": "3",
|
|
|
|
"order": 1,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my third dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 2,
|
2022-06-15 03:32:52 +08:00
|
|
|
"playlistUid": "1",
|
2018-07-17 22:45:39 +08:00
|
|
|
"type": "dashboard_by_tag",
|
|
|
|
"value": "myTag",
|
|
|
|
"order": 2,
|
2020-07-01 05:42:50 +08:00
|
|
|
"title":"my other dashboard"
|
2018-07-17 22:45:39 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Delete a playlist
|
|
|
|
|
2022-06-15 03:32:52 +08:00
|
|
|
`DELETE /api/playlists/:uid`
|
2018-07-17 22:45:39 +08:00
|
|
|
|
|
|
|
**Example Request**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
DELETE /api/playlists/1 HTTP/1.1
|
|
|
|
Accept: application/json
|
|
|
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
|
|
|
2020-01-27 20:41:15 +08:00
|
|
|
```http
|
2018-07-17 22:45:39 +08:00
|
|
|
HTTP/1.1 200
|
|
|
|
Content-Type: application/json
|
|
|
|
{}
|
|
|
|
```
|