You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
908 B
29 lines
908 B
#!/bin/bash
|
|
# eqx-get-deviceid-termination
|
|
#
|
|
# Give a device ID, get termination time
|
|
|
|
EQXTOKEN=`cat ~/.packet-cli.json | jq ".token" --raw-output`
|
|
EQXDEVICEID="$1"
|
|
|
|
echo "XXX not tested on server with actual termination time!!!"
|
|
|
|
if [[ $1 == "" ]]
|
|
then \
|
|
echo -e "Need device ID"
|
|
echo -e "To get device IDs in a project, run:"
|
|
echo -e "eqx-get-project-devices [project name]"
|
|
echo
|
|
exit
|
|
fi
|
|
|
|
curl \
|
|
--silent \
|
|
-X GET \
|
|
--header 'Accept: application/json' \
|
|
--header "X-Auth-Token: ${EQXTOKEN}" \
|
|
"https://api.equinix.com/metal/v1/devices/$EQXDEVICEID" | \
|
|
jq '.[]' | \
|
|
grep -i termination
|
|
|