View a markdown version of this page

Preferensi API - Amazon Managed Grafana

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

Preferensi API

Gunakan Preferences API untuk bekerja dengan preferensi pengguna di ruang kerja Amazon Managed Grafana.

Kunci:

  • tema - Nilai yang valid adalah lightdark,, atau string kosong untuk menggunakan tema default.

  • rumah DashboardId — Numerik :id dari dasbor favorit. Default-nya adalah 0.

  • zona waktu - Nilai yang valid adalah utcbrowser,, atau string kosong untuk menggunakan default.

Menghilangkan kunci menyebabkan nilai saat ini diganti dengan nilai default sistem.

catatan

Untuk menggunakan API Grafana dengan ruang kerja Grafana yang Dikelola Amazon, Anda harus memiliki token akun layanan yang valid. Anda menyertakan ini di Authorization bidang dalam permintaan API.

Dapatkan preferensi pengguna saat ini

GET /api/user/preferences

Permintaan contoh

GET /api/user/preferences HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json {"theme":"","homeDashboardId":0,"timezone":""}

Perbarui preferensi pengguna saat ini

PUT /api/user/preferences

Permintaan contoh

PUT /api/user/preferences HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk { "theme": "", "homeDashboardId":0, "timezone":"utc" }

Contoh respon

HTTP/1.1 200 Content-Type: text/plain; charset=utf-8 {"message":"Preferences updated"}

Dapatkan preferensi organisasi saat ini

GET /api/org/preferences

Permintaan contoh

GET /api/org/preferences HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Contoh respon

HTTP/1.1 200 Content-Type: application/json {"theme":"","homeDashboardId":0,"timezone":""}

Perbarui preferensi organisasi saat ini

PUT /api/org/preferences

Permintaan contoh

PUT /api/org/preferences HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk { "theme": "", "homeDashboardId":0, "timezone":"utc" }

Contoh respon

HTTP/1.1 200 Content-Type: text/plain; charset=utf-8 {"message":"Preferences updated"}