Custom Search
Showing posts with label neutron. Show all posts
Showing posts with label neutron. Show all posts

Wednesday, August 10, 2016

neutron server to DHCP agent and DHCP agent to neutron server RPC call example

1)
DHCP agent Service
-----------
a)
client side API:
neutron.agent.dhcp.agent.DhcpPluginAPI
neutron/agent/dhcp/agent.py

b)
Server side API:
neutron.agent.dhcp.agent.DhcpAgent
neutron/agent/dhcp/agent.py

* Here client and server side API classes are defined in same file neutron/agent/dhcp/agent.py

2)
Neutron Server service
-----------
a)
Server side API:
neutron.api.rpc.handlers.dhcp_rpc.DhcpRpcCallback
neutron/api/rpc/handlers/dhcp_rpc.py

b)
client side API:
neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.DhcpAgentNotifyApi
neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

3)
Here:
1a (DhcpPluginAPI) make rpc call to 2a (DhcpRpcCallback)
2b (DhcpAgentNotifyApi) make rpc call to 1b (DhcpAgent).

* DHCP agent Service make rpc call to Neutron Server Service.
* Neutron Server also make rpc call to DHCP agent Service.

Neutron RPC APIs
================

As discussed before, RPC APIs are defined in two parts: a client side and a
server side.  Several of these pairs exist in the Neutron code base.  The code
base is being updated with documentation on every rpc interface implementation
that indicates where the corresponding server or client code is located.

Example: DHCP
-------------

The DHCP agent includes a client API, neutron.agent.dhcp.agent.DhcpPluginAPI.
The DHCP agent uses this class to call remote methods back in the Neutron
server.  The server side is defined in
neutron.api.rpc.handlers.dhcp_rpc.DhcpRpcCallback.  It is up to the Neutron
plugin in use to decide whether the DhcpRpcCallback interface should be
exposed.

Similarly, there is an RPC interface defined that allows the Neutron plugin to
remotely invoke methods in the DHCP agent.  The client side is defined in
neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.DhcpAgentNotifyApi.  Th
server side of this interface that runs in the DHCP agent is
neutron.agent.dhcp.agent.DhcpAgent.

--------------



Thursday, April 23, 2015

OpenStack Neutron API Examples using curl

1)
export OS_USERNAME=admin
export OS_PASSWORD=secret123
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://127.0.0.1:35357/v2.0


2)
You can find endpoint of neutron service with following command
#keystone service-list
#keystone endpoint-list

3)
List networks

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

List subnets
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/subnets | python -mjson.tool

List security-groups
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/security-groups | python -mjson.tool

List ports
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/ports | python -mjson.tool

List routers

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

List extensions

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