API Daftar Putar - Amazon Managed Grafana

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

API Daftar Putar

Gunakan API Daftar Putar untuk bekerja dengan daftar putar di ruang kerja Grafana Terkelola Amazon.

catatan

Untuk menggunakan Grafana API dengan ruang kerja Grafana Amazon Managed, Anda harus memiliki token Grafana API yang valid. Anda menyertakan ini di Authorization bidang dalam permintaan API. Untuk informasi tentang cara membuat token untuk mengautentikasi panggilan API Anda, lihatOtentikasi dengan token.

GET /api/playlists

Mengembalikan semua daftar putar untuk ruang kerja Grafana Terkelola Amazon saat ini, menggunakan pagination.

Contoh permintaan

GET /api/playlists HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Parameter Querystring:

  • query — Batasi respons ke daftar putar yang memiliki nama seperti nilai ini.

  • limit — Batasi respons ke X jumlah playlist.

Contoh respon

HTTP/1.1 200 Content-Type: application/json [ { "id": 1, "name": "my playlist", "interval": "5m" } ]

Dapatkan satu daftar putar

GET /api/playlists/:id

Contoh permintaan

GET /api/playlists/1 HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json { "id" : 1, "name": "my playlist", "interval": "5m", "orgId": "my org", "items": [ { "id": 1, "playlistId": 1, "type": "dashboard_by_id", "value": "3", "order": 1, "title":"my third dashboard" }, { "id": 2, "playlistId": 1, "type": "dashboard_by_tag", "value": "myTag", "order": 2, "title":"my other dashboard" } ] }

Dapatkan item daftar putar

GET /api/playlists/:id/items

Contoh permintaan

GET /api/playlists/1/items HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json [ { "id": 1, "playlistId": 1, "type": "dashboard_by_id", "value": "3", "order": 1, "title":"my third dashboard" }, { "id": 2, "playlistId": 1, "type": "dashboard_by_tag", "value": "myTag", "order": 2, "title":"my other dashboard" } ]

Dapatkan dasbor daftar putar

GET /api/playlists/:id/dashboards

Contoh permintaan

GET /api/playlists/1/dashboards HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json [ { "id": 3, "title": "my third dashboard", "order": 1, }, { "id": 5, "title":"my other dashboard" "order": 2, } ]

Buat daftar putar

POST /api/playlists/

Contoh permintaan

PUT /api/playlists/1 HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk { "name": "my playlist", "interval": "5m", "items": [ { "type": "dashboard_by_id", "value": "3", "order": 1, "title":"my third dashboard" }, { "type": "dashboard_by_tag", "value": "myTag", "order": 2, "title":"my other dashboard" } ] }

Contoh respon

HTTP/1.1 200 Content-Type: application/json { "id": 1, "name": "my playlist", "interval": "5m" }

Memperbarui daftar putar

PUT /api/playlists/:id

Contoh permintaan

PUT /api/playlists/1 HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk { "name": "my playlist", "interval": "5m", "items": [ { "playlistId": 1, "type": "dashboard_by_id", "value": "3", "order": 1, "title":"my third dashboard" }, { "playlistId": 1, "type": "dashboard_by_tag", "value": "myTag", "order": 2, "title":"my other dashboard" } ] }

Contoh respon

HTTP/1.1 200 Content-Type: application/json { "id" : 1, "name": "my playlist", "interval": "5m", "orgId": "my org", "items": [ { "id": 1, "playlistId": 1, "type": "dashboard_by_id", "value": "3", "order": 1, "title":"my third dashboard" }, { "id": 2, "playlistId": 1, "type": "dashboard_by_tag", "value": "myTag", "order": 2, "title":"my other dashboard" } ] }

Menghapus daftar putar

DELETE /api/playlists/:id

Contoh permintaan

DELETE /api/playlists/1 HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json {}