Skip to content

Commit

Permalink
feat: add destroy_edge_hosts
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <[email protected]>
  • Loading branch information
TylerGillson committed Oct 26, 2023
1 parent b9c9d92 commit 45b89ba
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/test-two-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,54 @@ function wait_until_edge_hosts_ready() {
done
}

function destroy_edge_hosts() {
readarray -t edgeHosts < <(curl -s -X POST https://$DOMAIN/v1/dashboard/edgehosts/search \
-H "ApiKey: $API_KEY" \
-H "Content-Type: application/json" \
-H "ProjectUid: $PROJECT_UID" \
-d \
'
{
"filter": {
"conjuction": "and",
"filterGroups": [
{
"conjunction": "and",
"filters": [
{
"property": "state",
"type": "string",
"condition": {
"string": {
"operator": "eq",
"negation": false,
"match": {
"conjunction": "or",
"values": [
"ready",
"unpaired"
]
},
"ignoreCase": false
}
}
}
]
}
]
},
"sort": []
}
' | jq -r '.items[].metadata.uid')
for host in "${edgeHosts[@]}"; do
curl -s -X DELETE https://$DOMAIN/v1/edgehosts/$host \
-H "ApiKey: $API_KEY" \
-H "Content-Type: application/json" \
-H "ProjectUid: $PROJECT_UID"
echo Deleted Edge Host $host
done
}

function prepare_cluster_profile() {
if [ -z "${STYLUS_HASH}" ]; then
echo STYLUS_HASH is unset. Please execute build_all and retry.
Expand Down

0 comments on commit 45b89ba

Please sign in to comment.