Custom Search

Tuesday, May 5, 2015

OpenContrail API list all Virtual machines, find their interfaces and associated floating ip and floating ip pool

a)
List all Virtual machines

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:8082/virtual-machines | python -mjson.tool

b)
Show detail of a Virtial Machine and find it's virtual machine interfaces.

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:8082/virtual-machine/379b51c9-ff9a-4585-a92b-107069edbfed | python -mjson.tool

c)
Show detail of a Virtial Machine Interface

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:8082/virtual-machine-interface/b6e27360-b6ea-41fe-9686-1be695b1eac7 | python -mjson.tool

You will get following details:
* floating-ip attached to the interface
    - http://192.168.56.102:8082/floating-ip/3bebdc3c-6663-4945-8f6e-8f7e436c82b6
* instance-ip/private-ip attached to the interface
    - http://192.168.56.102:8082/instance-ip/e3174033-70bd-4c1a-bd3b-85b9f29d5371
* project/tenant
    - http://192.168.56.102:8082/project/f2714474-e74e-4b79-a6c5-1ab6022c6bac
* routing-instance. Interface belogs to which routing instance
    - http://192.168.56.102:8082/routing-instance/0a5d30fc-80c8-4248-8796-22dddcf6eb0c
* Security groups attached to the Interface
    - http://192.168.56.102:8082/security-group/8b3d2cd4-be86-405a-b189-c88515febb5a
* virtual-machine, interface belongs to which virtual-machine
    - http://192.168.56.102:8082/virtual-machine/379b51c9-ff9a-4585-a92b-107069edbfed
* virtual-network, interface belongs to which virtual-network
    - http://192.168.56.102:8082/virtual-network/a35745a8-64c7-40f0-a677-dfb666e4463a

d)
Show detail of a floating IP

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:8082/floating-ip/3bebdc3c-6663-4945-8f6e-8f7e436c82b6 | python -mjson.tool

You will get following details:
* floating-ip-pool, pool from where floating-ip allocated.
    - http://192.168.56.102:8082/floating-ip-pool/fe8356b4-6bbe-431a-9163-da3b9e3fa0f2
* project/tenant
    - http://192.168.56.102:8082/project/f2714474-e74e-4b79-a6c5-1ab6022c6bac
* virtual-machine-interface, interface to which floating-ip attached.
    - http://192.168.56.102:8082/virtual-machine-interface/b6e27360-b6ea-41fe-9686-1be695b1eac7

e)
Show detail of a floating IP Pool

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:8082/floating-ip-pool/fe8356b4-6bbe-431a-9163-da3b9e3fa0f2 | python -mjson.tool

You will get following details:

* floating-ip, floating-ips allocated from this pool
    - http://192.168.56.102:8082/floating-ip/3bebdc3c-6663-4945-8f6e-8f7e436c82b6
* project/tenant
    - http://192.168.56.102:8082/project/f2714474-e74e-4b79-a6c5-1ab6022c6bac
* virtual-network, virtual-network to which this pool is mapped to.
    - http://192.168.56.102:8082/virtual-network/38fff8c1-4090-4fe5-abb8-9cc7d4d1224f




No comments:

Post a Comment