15 lines
534 B
Python
15 lines
534 B
Python
import requests
|
|
import json
|
|
import urllib3
|
|
urllib3.disable_warnings()
|
|
|
|
auth = ('admin', 'Katzir476!!!')
|
|
sa_id = 3
|
|
r = requests.patch(f"https://grafana.snarfnet.net/api/serviceaccounts/{sa_id}", auth=auth, json={"role": "Admin"}, verify=False)
|
|
print("Update role:", r.status_code, r.text)
|
|
|
|
headers = {"Authorization": "Bearer glsa_71Y8I8DSZt3nXUNFzygnmBcEF4FUmWdw_1f03e67c"}
|
|
r_stats = requests.get("https://grafana.snarfnet.net/api/admin/stats", headers=headers, verify=False)
|
|
print("Admin stats:", r_stats.status_code, r_stats.text)
|
|
|