Browse Source

scriptlet to see if device id is spot price or not

master
Jeff Moe 2 years ago
parent
commit
75dc7d45ea
  1. 26
      eqx-get-deviceid-spot

26
eqx-get-deviceid-spot

@ -0,0 +1,26 @@
#!/bin/bash
# eqx-get-deviceid-spot
#
# Give a device ID, check if it is spot or not.
# null = not spot
# true = spot
EQXDEVICEID="$1"
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
packet \
device get \
--json \
--id $EQXDEVICEID \
2>/dev/null | \
jq '.spot_instance' | \
sed -e 's/"//g'
Loading…
Cancel
Save