Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ghe-manage-v1-set-the-status-of-maintenance-mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
# POST /manage/v1/maintenance


json_file=tmp/set-the-status-of-maintenance-mode.json

enabled=false
if [ -z "$1" ]
then
enabled=$1
else
enabled=false
fi

json_file=tmp/set-the-status-of-maintenance-mode.json
jq -n \
--argjson enabled "${enabled}" \
'{
enabled : $enabled
enabled : $enabled | $enabled
}' > ${json_file}


echo json file being submitted:
echo

cat ${json_file} | jq -r

curl -L ${curl_custom_flags} \
-H "Content-Type: application/json" \
-u "api_key:${mgmt_password}" \
"https://${hostname}:${mgmt_port}/manage/v1/maintenance" --data @${json_file}