All commands support -o json for structured output. Combine with jq for extraction:
# get connection URL for an instance
cloudamqp instance get --id 1234 -o json | jq -r '.url'
# list instance IDs matching a tag
cloudamqp instance list -o json | jq -r '.[] | select(.tags[]? == "production") | .id'
# get all instance names and plans
cloudamqp instance list -o json | jq -r '.[] | "\(.id) \(.name) \(.plan)"'RESULT=$(cloudamqp instance create --name=temp --plan=lemming --region=amazon-web-services::us-east-1 -o json)
INSTANCE_ID=$(echo "$RESULT" | jq -r '.id')
echo "Created instance: $INSTANCE_ID"Use the built-in --wait flag (default timeout: 15 minutes):
cloudamqp instance create --name=my-instance --plan=bunny-1 \
--region=amazon-web-services::us-east-1 --wait --wait-timeout=20mOr poll manually:
while true; do
STATUS=$(cloudamqp instance get --id "$INSTANCE_ID" -o json | jq -r '.ready')
[ "$STATUS" = "true" ] && break
sleep 30
doneUse --force on destructive commands:
cloudamqp instance delete --id 1234 --forceexport CLOUDAMQP_APIKEY="your-api-key"
cloudamqp instance list # no prompts# restart all instances tagged "staging"
for ID in $(cloudamqp instance list -o json | jq -r '.[] | select(.tags[]? == "staging") | .id'); do
echo "Restarting instance $ID"
cloudamqp instance restart-rabbitmq --id "$ID"
donecloudamqp instance create \
--name=staging-copy \
--plan=bunny-1 \
--region=amazon-web-services::us-east-1 \
--copy-from-id=1234 \
--copy-settings=alarms,metrics,logs,firewall,config,definitions,plugins \
--wait