feat: add various infrastructure check and automation scripts
This commit is contained in:
24
scripts/create_grafana_folders.py
Normal file
24
scripts/create_grafana_folders.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
auth = ("admin", "Katzir476!!!")
|
||||
url = "https://grafana.snarfnet.net/api/folders"
|
||||
|
||||
folders = [
|
||||
{"uid": "folder-aerodrome", "title": "Aerodrome"},
|
||||
{"uid": "folder-spaceport", "title": "Spaceport"},
|
||||
{"uid": "folder-shipyard", "title": "Shipyard"}
|
||||
]
|
||||
|
||||
for f in folders:
|
||||
resp = requests.post(url, json=f, auth=auth, verify=False, timeout=10)
|
||||
print(f"Folder {f['title']}: {resp.status_code} - {resp.text}")
|
||||
|
||||
# List all folders
|
||||
resp2 = requests.get(url, auth=auth, verify=False, timeout=10)
|
||||
print("\nCurrent Folders:")
|
||||
for item in resp2.json():
|
||||
print(f" ID: {item.get('id')} | UID: {item.get('uid')} | Title: {item.get('title')}")
|
||||
|
||||
Reference in New Issue
Block a user