Skip to content

Commit 8f0d201

Browse files
committed
chore(grafana): add drycc folder
1 parent a954edf commit 8f0d201

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

rootfs/usr/share/grafana/oauth2/hook/grafana.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ async def sync_datasources(context: dict, token: dict, userinfo: dict):
132132
async def sync_dashboards(context: dict, token: dict, userinfo: dict):
133133
dashboards_path = os.path.join(os.path.dirname(__file__), "..", "dashboards")
134134
async with httpx.AsyncClient() as client:
135+
await client.post(
136+
api_url("/api/folders"),
137+
headers=api_headers(context, userinfo),
138+
json={"uid": "drycc", "title": "drycc"},
139+
)
135140
for filename in os.listdir(dashboards_path):
136141
with open(os.path.join(dashboards_path, filename)) as f:
137142
dashboard = json.load(f)
@@ -141,6 +146,7 @@ async def sync_dashboards(context: dict, token: dict, userinfo: dict):
141146
headers=api_headers(context, userinfo),
142147
json={
143148
"dashboard": dashboard,
149+
"folderUid": "drycc",
144150
"overwrite": True,
145151
},
146152
)

rootfs/usr/share/grafana/provisioning/dashboards/drycc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apiVersion: 1
22
providers:
33
- name: 'default'
44
orgId: 1
5+
folder: 'drycc'
6+
folderUid: 'drycc'
57
type: file
68
options:
79
path: /usr/share/grafana/dashboards

0 commit comments

Comments
 (0)