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