Fix ListInstances in external provider examples
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
05137675d2
commit
4982cab608
2 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue