Custom Search

Tuesday, November 11, 2014

OpenContrail API

1)
Find endpoint of API Server

Note: --listen_port 9100

root@contrailsys:~# ps -aux | grep contrail-api
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root      2436  0.6  1.2 324380 48168 ?        Sl   17:43   0:47 /usr/bin/python /usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --listen_port 9100 --worker_id 0

2)
EndPoint of API Server
http://192.168.56.102:9100/
* Replace 192.168.56.102 with IP of API Server
3)
APIs
3a)
API: Documentation
>>> for x in api_dict['links']:
...     if x['link']['rel']=='documentation':
...             print x['link']['href']
... 
http://192.168.56.102:9100/documentation/index.html
3b)
API: Root
>>> for x in api_dict['links']:
...     if x['link']['rel']=='root':
...             print x['link']['href']
... 
http://192.168.56.102:9100/config-root
3c)
API: collection
>>> for x in d['links']:
...     if x['link']['rel']=='collection':
...             print x['link']['href']
... 
http://192.168.56.102:9100/domains
http://192.168.56.102:9100/global-vrouter-configs
http://192.168.56.102:9100/instance-ips
http://192.168.56.102:9100/network-policys
http://192.168.56.102:9100/virtual-DNS-records
http://192.168.56.102:9100/route-targets
http://192.168.56.102:9100/floating-ips
http://192.168.56.102:9100/floating-ip-pools
http://192.168.56.102:9100/physical-routers
http://192.168.56.102:9100/bgp-routers
http://192.168.56.102:9100/virtual-routers
http://192.168.56.102:9100/global-system-configs
http://192.168.56.102:9100/loadbalancer-members
http://192.168.56.102:9100/service-instances
http://192.168.56.102:9100/namespaces
http://192.168.56.102:9100/route-tables
http://192.168.56.102:9100/physical-interfaces
http://192.168.56.102:9100/access-control-lists
http://192.168.56.102:9100/virtual-DNSs
http://192.168.56.102:9100/customer-attachments
http://192.168.56.102:9100/loadbalancer-pools
http://192.168.56.102:9100/virtual-machines
http://192.168.56.102:9100/interface-route-tables
http://192.168.56.102:9100/service-templates
http://192.168.56.102:9100/virtual-ips
http://192.168.56.102:9100/security-groups
http://192.168.56.102:9100/provider-attachments
http://192.168.56.102:9100/network-ipams
http://192.168.56.102:9100/loadbalancer-healthmonitors
http://192.168.56.102:9100/virtual-networks
http://192.168.56.102:9100/projects
http://192.168.56.102:9100/logical-interfaces
http://192.168.56.102:9100/routing-instances
http://192.168.56.102:9100/virtual-machine-interfaces
http://192.168.56.102:9100/logical-routers
>>> 
3d)
API: resource-base
>>> for x in d['links']:
...     if x['link']['rel']=='resource-base':
...             print x['link']['href']
... 
http://192.168.56.102:9100/domain
http://192.168.56.102:9100/global-vrouter-config
http://192.168.56.102:9100/instance-ip
http://192.168.56.102:9100/network-policy
http://192.168.56.102:9100/virtual-DNS-record
http://192.168.56.102:9100/route-target
http://192.168.56.102:9100/floating-ip
http://192.168.56.102:9100/floating-ip-pool
http://192.168.56.102:9100/physical-router
http://192.168.56.102:9100/bgp-router
http://192.168.56.102:9100/virtual-router
http://192.168.56.102:9100/config-root
http://192.168.56.102:9100/global-system-config
http://192.168.56.102:9100/loadbalancer-member
http://192.168.56.102:9100/service-instance
http://192.168.56.102:9100/namespace
http://192.168.56.102:9100/route-table
http://192.168.56.102:9100/physical-interface
http://192.168.56.102:9100/access-control-list
http://192.168.56.102:9100/virtual-DNS
http://192.168.56.102:9100/customer-attachment
http://192.168.56.102:9100/loadbalancer-pool
http://192.168.56.102:9100/virtual-machine
http://192.168.56.102:9100/interface-route-table
http://192.168.56.102:9100/service-template
http://192.168.56.102:9100/virtual-ip
http://192.168.56.102:9100/security-group
http://192.168.56.102:9100/provider-attachment
http://192.168.56.102:9100/network-ipam
http://192.168.56.102:9100/loadbalancer-healthmonitor
http://192.168.56.102:9100/virtual-network
http://192.168.56.102:9100/project
http://192.168.56.102:9100/logical-interface
http://192.168.56.102:9100/routing-instance
http://192.168.56.102:9100/virtual-machine-interface
http://192.168.56.102:9100/logical-router
>>> 
3e)
API: action
>>> for x in d['links']:
...     if x['link']['rel']=='action':
...             print x['link']['href']
... 
http://192.168.56.102:9100/ref-update
http://192.168.56.102:9100/fqname-to-id
http://192.168.56.102:9100/id-to-fqname
http://192.168.56.102:9100/ifmap-to-id
http://192.168.56.102:9100/useragent-kv
http://192.168.56.102:9100/db-check
http://192.168.56.102:9100/fetch-records
http://192.168.56.102:9100/start-profile
http://192.168.56.102:9100/stop-profile
http://192.168.56.102:9100/virtual-network/%s/ip-alloc
http://192.168.56.102:9100/virtual-network/%s/ip-free
http://192.168.56.102:9100/virtual-network/%s/subnet-ip-count
>>> 
4)
Contrail Version

#sudo contrail-version
Package                                Version                        Build-ID | Repo | Package Name
-------------------------------------- ------------------------------ ----------------------------------
contrail-analytics                     1.10-34                        34                  
contrail-config                        1.10-34                        34                  
contrail-config-openstack              1.10-34                        34                  
contrail-control                       1.10-34                        34                  
contrail-dns                           1.10-34                        34                  
contrail-fabric-utils                  1.10-34                        34                  
contrail-install-packages              1.10-34~havana                 34                  
contrail-lib                           1.10-34                        34                  
contrail-nodemgr                       1.10-34                        34                  
contrail-nova-vif                      1.10-34                        34                  
contrail-openstack                     1.10-34                        34                  
contrail-openstack-analytics           1.10-34                        34                  
contrail-openstack-config              1.10-34                        34                  
contrail-openstack-control             1.10-34                        34                  
contrail-openstack-dashboard           2013.2-0ubuntu1                34                  
contrail-openstack-database            1.10-34                        34                  
contrail-openstack-vrouter             1.10-34                        34                  
contrail-openstack-webui               1.10-34                        34                  
contrail-setup                         1.10-34                        34                  
contrail-utils                         1.10-34                        34                  
contrail-vrouter-agent                 1.10-34                        34                  
contrail-vrouter-dkms                  1.10-34                        34                  
contrail-vrouter-init                  1.10-34                        34                  
contrail-vrouter-utils                 1.10-34                        34                  
contrail-web-controller                1.10-34                        34                  
contrail-web-core                      1.10-34                        34                  
euca2ools                              1:2.1.3-2                      34                  
ifmap-python-client                    0.1-2                          34                  
ifmap-server                           0.3.2-1contrail1               34                  
libvirt-bin                            2:0.9.8-2ubuntu17.17           34                  
libvirt0                               2:0.9.8-2ubuntu17.17           34                  
neutron-common                         2:2013.2~rc3-0ubuntu1          34                  
neutron-plugin-contrail                1.10-34                        34                  
neutron-server                         2:2013.2~rc3-0ubuntu1          34                  
nova-api                               2:2013.2.1-0ubuntu1            34                  
nova-common                            2:2013.2.1-0ubuntu1            34                  
nova-compute                           2:2013.2.1-0ubuntu1            34                  
nova-compute-kvm                       2:2013.2.1-0ubuntu1            34                  
nova-conductor                         2:2013.2.1-0ubuntu1            34                  
nova-console                           2:2013.2.1-0ubuntu1            34                  
nova-consoleauth                       2:2013.2.1-0ubuntu1            34                  
nova-novncproxy                        2:2013.2.1-0ubuntu1            34                  
nova-objectstore                       2:2013.2.1-0ubuntu1            34                  
nova-scheduler                         2:2013.2.1-0ubuntu1            34                  
openstack-dashboard                    1:2013.2.1-0ubuntu1            34                  
python-boto                            1:2.12.0                       34                  
python-contrail                        1.10-34                        34                  
python-contrail-vrouter-api            1.10-34                        34                  
python-libvirt                         2:0.9.8-2ubuntu17.17           34                  
python-neutron                         2:2013.2~rc3-0ubuntu1          34                  
python-neutronclient                   2:2.3.0-0ubuntu1               34                  
python-nova                            2:2013.2.1-0ubuntu1            34                  
python-opencontrail-vrouter-netns      1.10-34                        34                  
supervisor                             1:3.0a8-1.2                    34 
>>>

No comments:

Post a Comment