]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/run-backend-api-request.sh
5 API_URL
=`./bin/ceph mgr services 2>/dev/null | jq .dashboard | sed -e 's/"//g' -e 's!/$!!g'`
6 if [ "$API_URL" = "null" ]; then
7 echo "Couldn't retrieve API URL, exiting..." >&2
12 TOKEN
=`curl --insecure -s -H "Content-Type: application/json" -X POST \
13 -d '{"username":"admin","password":"admin"}' $API_URL/api/auth \
14 | jq .token | sed -e 's/"//g'`
17 echo "URL: ${API_URL}${2}"
21 curl
--insecure -s -b /tmp
/cd-cookie.txt
-H "Authorization: Bearer $TOKEN " \
22 -H "Content-Type: application/json" -X $1 -d "$3" ${API_URL}$2 | jq