Server-side push notifications for ML2

ML2 server-side push notifications for subnets, networks,
ports, security groups, and security group rules.

This adds a registry callback listener for each of the objects
above for the AFTER_CREATE and AFTER_UPDATE events. Whenever
one of these is triggered, it will parse the ID out of the event
and use it to retrieve an OVO object from the DB and dispatch
it to the RPC callback notifier.

This is only the logic to push changes to the agents. It does not
include an interface for the agents to query the server or the agent
side code to receive the notifications.

Partially-Implements: blueprint push-notifications
Change-Id: I5efc625c5e8565693e795d70e0f85810552d38cd
This commit is contained in:
Kevin Benton
2016-10-19 16:45:08 -07:00
parent e834986084
commit d8440e41e0
4 changed files with 233 additions and 0 deletions

View File

@@ -10,7 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron.objects import network
from neutron.objects import ports
from neutron.objects.qos import policy
from neutron.objects import securitygroup
from neutron.objects import subnet
from neutron.objects import trunk
@@ -18,12 +22,21 @@ from neutron.objects import trunk
TRUNK = trunk.Trunk.obj_name()
QOS_POLICY = policy.QosPolicy.obj_name()
SUBPORT = trunk.SubPort.obj_name()
PORT = ports.Port.obj_name()
NETWORK = network.Network.obj_name()
SECURITYGROUP = securitygroup.SecurityGroup.obj_name()
SECURITYGROUPRULE = securitygroup.SecurityGroupRule.obj_name()
_VALID_CLS = (
policy.QosPolicy,
trunk.Trunk,
trunk.SubPort,
ports.Port,
subnet.Subnet,
network.Network,
securitygroup.SecurityGroup,
securitygroup.SecurityGroupRule,
)
_TYPE_TO_CLS_MAP = {cls.obj_name(): cls for cls in _VALID_CLS}