Refactor northbound API

Registered by Dima Kuznetsov on 2016-12-08

We handle a lot of get/create/update/delete for our models (ports, chassis, etc) in northbound API code.
We can significantly reduce code size by introducing a common code path for operations that repeat themselves

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Dima Kuznetsov
Direction:
Needs approval
Assignee:
Dima Kuznetsov
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/refactor-nb-api,n,z

Addressed by: https://review.openstack.org/407009
    [WIP] Add CRUD class to API NB

Addressed by: https://review.openstack.org/407010
    [WIP] Refactor lswitch northbound API methods

Addressed by: https://review.openstack.org/407011
    [8/8] Refactor chassis northbound API methods

Addressed by: https://review.openstack.org/407012
    [WIP] Refactor lport northbound API methods

Addressed by: https://review.openstack.org/407014
    [WIP] Refactor lrouter northbound API methods

Addressed by: https://review.openstack.org/407015
    [WIP] Refactor floatingip northbound API methods

Addressed by: https://review.openstack.org/407478
    [WIP] Refactor secgroup northbound API methods

Addressed by: https://review.openstack.org/407016
    [WIP] Refactor publisher northbound API methods

Addressed by: https://review.openstack.org/407017
    [WIP] Refactor qos policy northbound API methods

Addressed by: https://review.openstack.org/407548
    Rename publisher & subscriber in nb api

Addressed by: https://review.openstack.org/410298
    North Bound Code Refactor

Addressed by: https://review.openstack.org/414984
    [6/8]Proposition of model definition and construction

Gerrit topic: https://review.openstack.org/#q,topic:refactor_models,n,z

Addressed by: https://review.openstack.org/417824
    [7/8] [WIP] Add temporary DbStore wrapper

Addressed by: https://review.openstack.org/417819
    [1/8] Add namespace helper class

Addressed by: https://review.openstack.org/417821
    [3/8] Add model-proxy helpers

Addressed by: https://review.openstack.org/417820
    [2/8] Add basic framework for new DF models

Addressed by: https://review.openstack.org/417823
    [5/8] Introduce NbAPI crud helper

Addressed by: https://review.openstack.org/417822
    [4/8] Add custom field types for dragonflow models

Addressed by: https://review.openstack.org/422617
    NbApi: Use SEND_ALL_TOPIC when topic is omitted

Gerrit topic: https://review.openstack.org/#q,topic:bp/service-function-chaining,n,z

Addressed by: https://review.openstack.org/406602
    RyuBaseApp: automatically dispatch on new models

Addressed by: https://review.openstack.org/406605
    Add new models to obj refresher

Addressed by: https://review.openstack.org/423809
    Make parameter optional in NbApi.get_instance

Addressed by: https://review.openstack.org/424143
    Move process_object to local controller

Addressed by: https://review.openstack.org/425091
    [12/12] DfLocalController: Register new models

Addressed by: https://review.openstack.org/432775
    fixup chassis conf

Addressed by: https://review.openstack.org/434157
    Add models devref

Addressed by: https://review.openstack.org/436064
    [10/xx] Add id and version properties to old style models

Addressed by: https://review.openstack.org/436065
    [15/xx] Add dependency detection among models

Addressed by: https://review.openstack.org/436107
    [16/xx] DbConsistent: Adapt to new style ID/Version fields

Addressed by: https://review.openstack.org/436108
    [17/xx] Refactor DB consistent

Addressed by: https://review.openstack.org/436562
    [12/xx] Refresher: Move model refreshers to DfLocalController

Gerrit topic: https://review.openstack.org/#q,topic:refactor_models2,n,z

Addressed by: https://review.openstack.org/437519
    [19/xx] Implement indexes by nested values

Addressed by: https://review.openstack.org/438263
    [09/xx] Introduce models package and move old models inside

Addressed by: https://review.openstack.org/438264
    [21/xx] DbStore: Support list field indexes

Addressed by: https://review.openstack.org/439507
    [21/xx] Add DbStore2 member to DFlowApp

Addressed by: https://review.openstack.org/439602
    Add copy and deepcopy functionality to NB models

Addressed by: https://review.openstack.org/439757
    Make _get_topic more robust

Addressed by: https://review.openstack.org/439783
    Add create_reference syntactic sugar

Addressed by: https://review.openstack.org/439848
    Migrate QosPolicy to new model structure

Gerrit topic: https://review.openstack.org/#q,topic:bp/refactor-nb-api/create_ref,n,z

Addressed by: https://review.openstack.org/440797
    Add __repr__ to NB models

Addressed by: https://review.openstack.org/441284
    [14/xx] Add constants module for the models

Addressed by: https://review.openstack.org/441683
    [WIP] Refactor DB consistent (part 2)

Addressed by: https://review.openstack.org/441950
    [WIP]Migrate LogicalSwitch and Subnet models to NB model framework

Addressed by: https://review.openstack.org/443648
    [WIP]Migrate LogicalRouter and LogicalRouterPort to new model framework

Addressed by: https://review.openstack.org/444185
    Add uniform log for event

Addressed by: https://review.openstack.org/445548
    [WIP] Migrate Security Groups to new model structure

Gerrit topic: https://review.openstack.org/#q,topic:bp/refactor-nb-api/lport,n,z

Addressed by: https://review.openstack.org/447489
    Allow non-dependency references

Addressed by: https://review.openstack.org/447979
    Fix models overriding each other when using same class names.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1675030,n,z

Addressed by: https://review.openstack.org/450752
    Add clear method to new local cache

Addressed by: https://review.openstack.org/450759
    Use model dependency

Addressed by: https://review.openstack.org/450780
    Add hierarchical dependency to current model

Addressed by: https://review.openstack.org/451240
    Support equality for model instances

Addressed by: https://review.openstack.org/453835
    Fix iteration of first-class only models

Addressed by: https://review.openstack.org/454417
    Change HostRoute to a plain model

Addressed by: https://review.openstack.org/459108
    Migrate Publisher model to the new framework

Addressed by: https://review.openstack.org/459638
    Migrate OvsPort and remove LocalInterface

Addressed by: https://review.openstack.org/447366
    Migrate lport to NB models

Addressed by: https://review.openstack.org/459578
    Introduce ListOfField

Addressed by: https://review.openstack.org/459626
    Support comparison of ModelProxy with None

Gerrit topic: https://review.openstack.org/#q,topic:migrate_ovs_port,n,z

Addressed by: https://review.openstack.org/461287
    _is_physical_chassis returns False if object not in db_store2

Addressed by: https://review.openstack.org/462406
    db_store2 marks stale objects

Gerrit topic: https://review.openstack.org/#q,topic:bp/vlan-trunk,n,z

Addressed by: https://review.openstack.org/464319
    Allow invoking non-field attributes via proxies

Addressed by: https://review.openstack.org/464642
    Remove unnecessary SG code Remove unnecessary SG code

Addressed by: https://review.openstack.org/465461
    Migrate Listener to the new model framework

Addressed by: https://review.openstack.org/444918
    [WIP] Migrate FloatingIp to the new model framework

Addressed by: https://review.openstack.org/467263
    Migrate lport in metadata service daemon

Addressed by: https://review.openstack.org/471368
    Migrate ActivePort to the new model framework

Addressed by: https://review.openstack.org/472208
    [01/xx] Drop legacy DbStore module

Addressed by: https://review.openstack.org/472209
    [02/xx] Rename DbStore2 to DbStore

Addressed by: https://review.openstack.org/472210
    [03/xx] Drop legacy models

Gerrit topic: https://review.openstack.org/#q,topic:bug/1690775,n,z

Addressed by: https://review.openstack.org/472217
    [06/xx] Refactor Migration to be a NB model

Addressed by: https://review.openstack.org/466022
    Construct DbUpdate for subscriber received events

Addressed by: https://review.openstack.org/473062
    Drop pub-sub functionality from DB API and drivers

Addressed by: https://review.openstack.org/473063
    Move apply_db_changes from NbApi to controller

Addressed by: https://review.openstack.org/487908
    Remove ovsdb.objects

Addressed by: https://review.openstack.org/487830
    Remove OvsdbQos

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.