Fix ListInstances in external provider examples

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-02-03 19:16:20 +02:00
parent 05137675d2
commit 4982cab608
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5
2 changed files with 4 additions and 4 deletions

View file

@ -316,7 +316,7 @@ function GetInstance() {
function ListInstances() {
INSTANCES=$(az vm list --query "[?tags.garm_pool_id == '${GARM_POOL_ID}']" -o json --only-show-errors 2>&1)
echo $info | jq -r '
echo $info | jq -r '[
.[] | {
provider_id: .name,
name: .name,
@ -326,7 +326,7 @@ function ListInstances() {
os_arch: .tags.os_arch,
pool_id: .tags.garm_pool_id,
status: {"Creating": "pending_create", "Migrating": "pending_create", "Failed": "error", "Succeeded": "running", "Deleting": "pending_delete"}[.provisioningState]
}'
}]'
}
# Login to Azure

View file

@ -397,12 +397,12 @@ function StopServer() {
function ListInstances() {
INSTANCES=$(openstack server list --os-compute-api-version 2.52 --tags garm-pool-id=${GARM_POOL_ID} --long -f json)
echo ${INSTANCES} | jq -r '
echo ${INSTANCES} | jq -r '[
.[] | .Properties * {
provider_id: .ID,
name: .Name,
status: {"ACTIVE": "running", "SHUTOFF": "stopped", "BUILD": "pending_create", "ERROR": "error", "DELETING": "pending_delete"}[.Status]
}'
}]'
}
function GetInstance() {