Browse Source

get/delete projects etc

master
root 1 year ago
parent
commit
cb2cefd7fb
  1. 2
      eqx-delete-project
  2. 24
      eqx-delete-project-devices
  3. 24
      eqx-delete-project-devices-force
  4. 2
      eqx-delete-project-force
  5. 27
      eqx-get-project-devices
  6. 24
      eqx-get-project-devices-id
  7. 24
      eqx-get-project-devices-name

2
eqx-delete-project

@ -21,6 +21,8 @@ fi
EQXPROJECTID=`eqx-get-project-uuid $EQXPROJECT`
eqx-delete-project-devices $EQXPROJECT
packet \
project \
delete \

24
eqx-delete-project-devices

@ -0,0 +1,24 @@
#!/bin/bash
# eqx-delete-project-devices
#
# Usage:
# eqx-delete-project-devices [project name]
# Example:
# eqx-delete-project-devices fooproject
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
for i in `eqx-get-project-devices-id "$EQXPROJECT"`
do \
echo "Deleting $i"
packet device delete --id "$i"
done

24
eqx-delete-project-devices-force

@ -0,0 +1,24 @@
#!/bin/bash
# eqx-delete-project-devices
#
# Usage:
# eqx-delete-project-devices [project name]
# Example:
# eqx-delete-project-devices fooproject
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
for i in `eqx-get-project-devices-id "$EQXPROJECT"`
do \
echo "Deleting $i"
packet device delete --force --id "$i"
done

2
eqx-delete-project-forced → eqx-delete-project-force

@ -25,6 +25,8 @@ EQXPROJECTID=`eqx-get-project-uuid $EQXPROJECT`
echo "ProjectID: $EQXPROJECTID"
sleep 1
eqx-delete-project-devices-force $EQXPROJECT
packet \
project \
delete \

27
eqx-get-project-devices

@ -0,0 +1,27 @@
#!/bin/bash
# eqx-get-project-devices
#
# Usage:
# eqx-get-project-devices [project name]
# Example:
# eqx-get-project-devices fooproject
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
EQXPROJECTID=`eqx-get-project-uuid $EQXPROJECT`
packet \
device \
get \
--project-id \
$EQXPROJECTID \
2>/dev/null

24
eqx-get-project-devices-id

@ -0,0 +1,24 @@
#!/bin/bash
# eqx-get-project-devices-id
#
# Usage:
# eqx-get-project-devices-id [project name]
# Example:
# eqx-get-project-devices-id fooproject
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
eqx-get-project-devices \
"$EQXPROJECT" | \
grep -v -e '^+' -e "CREATED" | \
cut -f 2 -d " "

24
eqx-get-project-devices-name

@ -0,0 +1,24 @@
#!/bin/bash
# eqx-get-project-devices-id
#
# Usage:
# eqx-get-project-devices-id [project name]
# Example:
# eqx-get-project-devices-id fooproject
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
eqx-get-project-devices \
"$EQXPROJECT" | \
grep -v -e '^+' -e "CREATED" | \
cut -f 4 -d " "
Loading…
Cancel
Save