Commit Graph

74 Commits

Author SHA1 Message Date
Brian Haley b603093307 Fix some pylint indentation warnings
Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/objects.

Trivialfix

Change-Id: I5e885e2b2a09d48197de30d8c6de5d74c10f5987
2022-08-09 15:10:01 -04:00
Zuul dbe68a7454 Merge "[OVN] Implement GW IP network QoS inheritance" 2022-05-09 23:47:31 +00:00
Rodolfo Alonso Hernandez 15b826a05f [OVN] Implement GW IP network QoS inheritance
This patch enables the gateway IP network QoS inheritance in
the OVN backend driver. The OVN QoS extension will use the
router external network (GW network) QoS policy if the gateway
IP port has no QoS policy assigned.

Partial-Bug: #1950454

Change-Id: I5ee51dc124ae464b9e9fd366cf7bf85176376c25
2022-04-15 01:10:31 +00:00
Rodolfo Alonso Hernandez 8ad6c3bf60 [L3][QoS] Remove router QoS binding when GW is removed
Now when the external gateway of a router is removed, the QoS policy
assigned to this router is removed too. A router can only have a QoS
policy assigned if a gateway port is attached; if the port is removed,
the QoS binding must be removed too.

Closes-Bug: #1968269
Change-Id: Iced254259170972a9699aa35ae8062776e11285d
2022-03-22 18:02:43 +00:00
Rodolfo Alonso Hernandez 8dfe5cc95b [OVN] Implement floating IP network QoS inheritance
Floating IP now have information of the QoS policy of the external
network. The OVN QoS extension will use this network QoS policy if
there is no floating IP QoS policy.

Partial-Bug: #1950454
Change-Id: I380a130d97e8bfe54caa5f3a129877507d1ce2a6
2022-01-27 09:36:50 +00:00
Rodolfo Alonso Hernandez 8813b0ed2d Replace "target_tenant" with "target_project" in RBAC OVOs and models
This is part of the remaining technical debt of the specs
https://specs.openstack.org/openstack/neutron-specs/specs/newton/moving-to-keystone-v3.html

Blueprint: https://blueprints.launchpad.net/neutron/+spec/keystone-v3

Change-Id: I2d2fd4d1802c9dfe0778ac8fdddc7b9a8afe7d25
2021-12-03 10:48:57 +00:00
Rodolfo Alonso Hernandez 59b2ac0c2a Replace "tenant_id" with "project_id" in OVO base
This is part of the remaining technical debt of the specs
https://specs.openstack.org/openstack/neutron-specs/specs/newton/moving-to-keystone-v3.html

Blueprint: https://blueprints.launchpad.net/neutron/+spec/keystone-v3

Change-Id: I714d97449c41c9dd889d1842c0fa9b78ffa0f9f2
2021-10-28 15:37:07 +00:00
Przemyslaw Szczerbik 56044db26d Add API extension for QoS minimum pps rule
This patch implements support for CRUD operations for QoS minimum
packet rate, for example:

DELETE /qos/policies/$POLICY_ID/minimum_packet_rate_rules/$RULE_ID

Placement or dataplane enforcement is not implemented yet.

Partial-Bug: #1922237
See-Also: https://review.opendev.org/785236
Change-Id: Ie994bdab62bab33737f25287e568519c782dea9a
2021-09-29 12:27:30 +02:00
LIU Yulong 8e30639452 [QoS] Add rule type packet per second (pps)
This patch adds new API extension to QoS service plugin
to allow CURD actions for packet rate limit (packet per
second) rule in Neutron server side.

NOTE: This patch will NOT implement the real functionality
in L2/L3 backend to limit the pps.

Co-Authored-By:  NANALI <lin203@chinaunicom.cn>

Closes-bug: #1912460
Change-Id: Icc88accb88d9cec40c960c56f032c3c27317b42e
2021-07-22 09:53:38 +08:00
Rodolfo Alonso Hernandez 67f856e1e5 Provide object tagging using the tag plugin
Provide "tag" information to QoS policy, Trunk and Network Segment
Range objects using the tag plugin extension. This is the Neutron
defined way to extend an object dictionary using the standard
attributes.

Change-Id: I7bf4986a4d2628d0fa69e57199d59bd6ca4eafdc
Closes-Bug: #1704137
2021-01-18 11:57:39 +00:00
Rodolfo Alonso Hernandez e7e71b2ca6 [OVN] Implement floating IP QoS in OVN backend
This patch implements in the OVN backend the existing floating
IP QoS extension.

The OVN client, using the existing QoS extension, will retrieve
the QoS rules attached to each floating IP, the router where the
floating IP lives and the router gateway port. The QoS rules
will be applied on the router gateway port.

The OVN NB QoS rules for floating IP addresses have a "match"
field containing a tuple of parameters:
- The direction of the flow:
    'inport == "src"' or
    'outport == "dst"'
- The IP address to match:
    'ip4.src == 1.2.3.4' or
    'ip4.dst == 1.2.3.4'
- The chassis where the port is located:
    'is_chassis_resident("chassis")'

Closes-Bug: #1877408
Related-Bug: #1596611
Depends-On: https://review.opendev.org/#/c/727847/

Change-Id: Ib65d8edcb0a415f6d698c952334d3b4bb0d9fff6
2020-09-01 07:27:48 +00:00
Rodolfo Alonso Hernandez 1f018514d7 Optimize QoS bound objects queries
Optimize the following methods:
- get_bound_networks
- get_bound_ports
- get_bound_floatingips
- get_bound_routers

Those methods, using the "QosPolicy_XXXX_Binding" OVO interface, were
retrieving all objects with a certain policy ID and then returning
only the ID of the _XXXX_ object. That means to retrieve a full
register list from the DB, then converted them to OVOs and extract
only the _XXXX_ ID.

This patch retrieves only the _XXXX_ object IDs from the DB and
returns the list, without the OVO conversion.

Change-Id: I891eba93b3b4abaec8ada13a032b5440cbb0548d
Closes-Bug: #1877560
2020-05-13 16:44:15 +00:00
Boden R b4972e246d use objects common_types from neutron-lib
This patch consumes the neutron-lib OVO common_types module by
removing it from neutron and switching imports over to use neutron-lib
instead.

NeutronLibImpact

Change-Id: Ic9819a27e3e72038b819ab2fe845c26fc63b26d5
2019-11-26 15:34:18 +01:00
Rodolfo Alonso Hernandez db3001a7a2 Remove QoS related objects unneeded compatibility conversions
Last changes affecting to object compatibility, done in those OVOs:
* QoSPolicy: https://review.opendev.org/#/c/428304/, 2y 4m ago.
* QosBandwidthLimitRule: https://review.opendev.org/#/c/449831/,
  2y 5m ago
* QosDscpMarkingRule: https://review.opendev.org/#/c/300501/,
  3y 3m ago
* QosMinimumBandwidthRule: https://review.opendev.org/#/c/344145/,
  3y ago
* QosRuleType: https://review.opendev.org/#/c/475260/, 2y 3m ago

Change-Id: I5fd394c2deb4446e21e092ea490791cc5bbc5669
Related-Bug: #1828437
2019-09-27 12:06:07 +00:00
zhanghao2 2c83e07509 Fix objname error in QosPolicy
This patch fixes objname error in class QosPolicy.

Change-Id: Idc67b2d8f7cca19f59f39b9c884d8cec2c12e867
Closes-Bug: #1843368
2019-08-13 17:13:09 -04:00
Doug Wiegley 5e0fc3d2da Allow sharing of security groups via RBAC mechanism
Neutron-lib api ref: https://review.openstack.org/#/c/635313/
Tempest tests: https://review.openstack.org/#/c/635312/
Client: https://review.openstack.org/#/c/635428/

Partial-Bug: #1817119
Depends-On: https://review.openstack.org/635313
Change-Id: I974b0a603b6ca75cf080fb7b0751c7fb87df8443
2019-03-09 17:30:14 -06:00
Boden R 68fd13af40 remove neutron.common.exceptions
Today the neutron common exceptions already live in neutron-lib and are
shimmed from neutron. This patch removes the neutron.common.exceptions
module and changes neutron's imports over to use their respective
neutron-lib exception module instead.

NeutronLibImpact

Change-Id: I9704f20eb21da85d2cf024d83338b3d94593671e
2019-02-01 14:35:00 -07:00
Zuul bc190bef8a Merge "Use RBACBaseObject OVO in neutron/db/rbac_db_mixin.py" 2018-12-07 13:49:02 +00:00
LIU Yulong 00bf365025 [L3][QoS] Neutron server side router gateway IP QoS
This patch enables to bind a QoS policy to the router gateway,
then in L3 agent side SNAT traffic for the VMs without floating
IPs can be limited under the policy bandwidth rules. This is
suit for all kinds of L3 routers: DVR, DVR with SNAT HA, L3 HA
and Legacy.

API update router gateway json:
{
router": {
  "external_gateway_info": {
    ...
    "qos_policy_id": "policy-uuid"
    }
  }
}

Depends-On: https://review.openstack.org/#/c/567497/

Partially-Implements blueprint: router-gateway-ip-qos
Closes-Bug: #1757044
Related-Bug: #1596611
Change-Id: I26e22bce7edd1f93b2ac0048b61b14f858938537
2018-12-01 17:45:46 +08:00
Rodolfo Alonso Hernandez 8eee74f626 Use RBACBaseObject OVO in neutron/db/rbac_db_mixin.py
Implemented RBACBaseObject metaclass, inherited from NetworkRBAC
and QosPolicyRBAC.

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db

Change-Id: I07d1e0bb27e19bd19911255c069fa27a42451264
2018-11-08 13:41:36 +00:00
LIU Yulong a034e8e0f8 Refactor duplicated implementation of _get_policy_obj
This patch moves the implementation of the function
_get_policy_obj to the policy object code scope.

Change-Id: I7057558a5ec32a55a37a6b93dabc997d69abfb98
2018-06-20 09:51:02 +08:00
Brian Haley 7cfdf4aa81 Fix all pep8 E129 errors
Fixed all pep8 E129 errors and changed tox.ini to no longer
ignore them.

Change-Id: I0b06d99ce1d473b79a4cfdd173baa4f02e653847
2018-05-03 13:44:04 +09:00
Ihar Hrachyshka 6f83466307 Allow objects to opt in new engine facade
New facade is enabled by setting new_facade = True for the object of
interest. With new_facade on, all OVO actions will use the new reader /
writer decorator to activate sessions.

There are two new facade decorators added to OVO: db_context_reader and
db_context_write that should be used instead of explicit
autonested_transaction / reader.using / writer.using in OVO context.

All neutron.objects.db.api helpers now receive OVO classes / objects
instead of model classes, since they need to know which type of engine
facade to use for which object. While it means we change signatures for
those helper functions, they are not used anywhere outside neutron tree
except vmware-nsx unit tests, and the latter pass anyway because the
tests completely mock out them disregarding their signatures.

This patch also adds several new OVO objects to be able to continue
using neutron.objects.db.api helpers to persist models that previously
didn't have corresponding OVO classes.

Finally, the patch adds registration for missing options in
neutron/tests/unit/extensions/test_qos_fip.py to be able to debug
failures in those unit tests. Strictly speaking, this change doesn't
belong to the patch, but I include it nevertheless to speed up merge in
time close to release.

There are several non-obvious changes included, specifically:

- in neutron.objects.base, decorator() that refreshes / expunges models
from the active session now opens a subtransaction for the whole span of
call / refresh / expunge, so that we can safely refresh model regardless
of whether caller opened another parent subtransaction (it was not the
case for create_subnetpool in base db plugin code).

- in neutron.db.l3_fip_qos, removed code that updates obj.db_model
relationship directly after corresponding insertions for child policy
binding model. This code is not needed because the only caller to the
_process_extra_fip_qos_update method refetches latest state of floating
ip OVO object anyway, and this code triggers several unit test failures.

- unit tests checking that a single commit happens for get_object and
get_objects are no longer valid for new facade objects that use reader
decorator that doesn't commit but close. This change is as intended, so
unit tests were tweaked to check close for new facade objects.

Change-Id: I15ec238c18a464f977f7d1079605b82965052311
Related-Bug: #1746996
2018-02-09 04:07:34 +00:00
Frank Wang e2ebc7d7f8 [trivial fix]fix typos in neutron
Change-Id: I73364ac659dd325de4983cedf0c1e1e26bc3a30a
2017-12-31 06:43:52 +00:00
LIU Yulong 8fcda21a06 [L3][QoS] Neutron server side Floating IP QoS
Add qos_policy_id to floating IP, then the user could set/update
the binding QoS policy of a floating IP.

APIImpact: a new parameter qos_policy_id was added to floating IP
related API.

Partial-Bug: #1596611
Partially-Implements blueprint: floating-ip-rate-limit
Change-Id: I4efe9e49d268dffeb3df4de4ea1780152218633b
2017-11-29 16:45:38 +08:00
Sławek Kapłoński 5e08a9b0e7 [OVO] Switch to use own registry
Neutron will now use own registry for versionedobjects.
It avoids problems with loading wrong OVO objects from
different projects (like os_vif) when names are the same.

Change-Id: I9d4fab591fbe52271c613251321a6d03078976f7
Closes-Bug: #1731948
2017-11-22 17:44:22 +01:00
Boden R 0822b0aef4 consume common constants from lib
The neutron-lib commit I360545b6ee4291547e0c5c8e668ad03d3efa4725 moved
the externally consumed globals from neutron.common.constants into lib.
With the exception of PROVISIONAL_IPV6_PD_PREFIX all other constants
in neutron.common.constants should only be used in neutron, and will
hopefully remain that way. External consumers needing access to other
common constants should move them into lib first.

NeutronLibImpact

Change-Id: Ie4bcffccf626a6e1de84af01f3487feb825f8b65
2017-10-13 11:45:18 -06:00
Hirofumi Ichihara 96f0142b80 Tag mechanism supports resources with standard attribute
Tag mechanism supports network, subnet, port, subnetpool
router resources only. This patch allow tag mechanism to support
 resources with standard attribute.

Two old extenions are kept because of backward compatibility.
They will be removed in Queens release.

APIImpact: Tag is supported by resources with standard attribute
DocImpact: allow users to set tags on resources with standard attribute

Change-Id: Id7bb13b5beb58c313eea94ca03835d3daf5c94bc
Closes-Bug: #1682775
2017-07-25 08:14:04 +09:00
Rodolfo Alonso Hernandez 188aee25c6 Add QoS policy network binding OVO
Added QoS policy network binding OVO. Direct access to
'qos_network_policy_bindings' DB table is removed.

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I2a2037dae5a071bd220fa04b0988bc8e7172eb59
2017-07-07 10:53:04 +01:00
Rodolfo Alonso Hernandez 034a7a6f2d Add QoS policy port binding OVO
Added QoS policy port binding OVO. Direct access to 'qos_port_policy_bindings'
DB table is removed.

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I40268f84bef808dcebd5c123fafc7a50a4d036f4
2017-06-09 18:21:36 +00:00
Rodolfo Alonso Hernandez 9d69822e43 Add "default" behaviour to QoS policies
This patch implements the "default" behaviour for QoS policies.
If this flag is enabled for a QoS policy in a project, all
new networks created will have this QoS policy assigned by default.

If a new QoS policy is created or updated with this flag and another
QoS policy in the same project is set as the default policy, the new
one won't be created or updated. To set another QoS policy as default,
the current one must be unset.

DocImpact: A "default" flag is introduced for QoS policies. If this flag
           is enabled in a QoS policy (attached to a project), then all
           networks created in this project would have this QoS policy
           assigned, unless an explicit policy is specified.
APIImpact

Closes-Bug: #1639220
Change-Id: If5ff2b00fa828f93aa089e275ddbd1ff542b79d4
2017-05-26 23:31:36 +00:00
Sławek Kapłoński c29f3aaa7c Add QoS bandwidth limit for instance ingress traffic
This patch introduces the new parameter "direction" to
the QoS bandwidth limit rule. It will allow the creation
of bandwidth limit rules for either ingress or egress
traffic. For backwards compatibility the default direction
will be egress.

DocImpact: Ingress bandwidth limit available for QoS
APIImpact: New type of parameter for QoS rule in neutron API

Change-Id: Ia13568879c2b6f80fb190ccafe7e19ca05b0c6a8
Partial-Bug: #1560961
2017-04-27 12:51:50 +00:00
Sławek Kapłoński 0376d2f6ad Make QoS policy object compatible with versions 1.2 and higher
For version 1.2 or higher of QoS policy object it can contain
QoSMinumumBandwidtLimit rules and appending of such rule type
was missing in make_obj_compatible function.
Now such rules are appended to QoS policy.

Change-Id: I40d699db58c34e83272432376d1d59679a680db2
Closes-Bug: #1681440
2017-04-19 05:58:57 +00:00
Henry Gessau 8b048cc287 Use project_id instead of tenant_id in objects
Objects must use project_id and not tenant_id. The object framework
ensures that tenant_id is added as an extra field for backward
compatibility.

This patch reverts the workaround implemented in change
I4ec9340094bc51cd8aa6e5112bf8114aa26c2982 and implements a proper fix
by explicitly updating the objects.

Co-Authored-By: Artur Korzeniewski <artur.korzeniewski@intel.com>
Co-Authored-By: Darek Smigiel <smigiel.dariusz@gmail.com>

Closes-Bug: #1630748

Change-Id: Iab90bcab41655b2e210aea0e7581eb00b94ce5e5
2017-01-13 14:31:26 +00:00
Zainub Wahid bb78621a72 Make UUIDField actually validate UUIDs
Instead of using oslo.versionedobjects UUID type, use a custom UUIDField
class located in common_types that will actually validate passed values
for UUID-ness.

Closes-Bug: #1614537
Change-Id: I20b24ee57c521b1c68977c2ff7ae56b56875dd64
2016-12-07 15:11:43 +00:00
Jenkins 4d1d1c3167 Merge "Prevent use filter(lambda obj: test(obj), data)" 2016-09-14 15:45:35 +00:00
Jenkins ee4db9e1af Merge "Make optional the validation of filters" 2016-09-14 11:16:30 +00:00
Nguyen Phuong An 9afb9ca598 Prevent use filter(lambda obj: test(obj), data)
In Python3 [1], if we need filter on python3, replace
filter(lambda obj: test(obj), data) with:
[obj for obj in data if test(obj)]. This patch replaces
filter function and introduces a hacking rule to prevent
using filter in future.

[1] https://wiki.openstack.org/wiki/Python3

Change-Id: I83d22108c02f8da007a7233e71a4a7fb833170ec
2016-09-14 16:23:32 +07:00
Victor Morales c8f208c465 Make optional the validation of filters
This fix covers the cases where it's required to be
flexible in the validation of unknown filters.

Change-Id: I1becad77d48556181c5667ad06b2971b8b8517b2
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Closes-Bug: #1622672
2016-09-09 19:30:30 +00:00
Ihar Hrachyshka 9f0647e181 objects: don't call DeclarativeObject's __init__ twice for rbac objects
Due to the way we applied metaclasses to rbac aware objects, the
__init__ was executed twice: once when the DeclarativeObject metaclass
was applied to NeutronDbObject, and once when rbac metaclass was
applied, when we were calling type() in rbac metaclass' __new__.

To avoid that behaviour, we can introduce a separate base 'class' for
rbac aware objects that would be a result of with_metaclass call using
the rbac metaclass, and NeutronDbOjbect as the actual base. Then we use
the base class in place of NeutronDbObject base class for all objects
that are RBAC aware.

This avoids the duplicate call issue.

Change-Id: Ia12f56f7d40c38e679edc21e13871e27ad1820ee
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2016-09-09 10:29:48 +00:00
Kevin Benton f3f90027b1 Add standard attributes to qospolicy
This adds the standard attributes relationship to QoSPolicy.
This has the advantage of providing created_at and updated_at,
however, the primary reason is to ensure it has a revision number
so QoSPolicy objects can be safely used in push notifications.

Partially-Implements: blueprint push-notifications
Change-Id: I8c0c33eef5d53c704b609e5bc503f46f5caad1bb
2016-08-28 06:27:39 +00:00
Rodolfo Alonso Hernandez 60325f4ae9 Add QoS minimum bandwidth rule for instance egress traffic
This patch introduces the front end implementation for QoS
minimum bandwidth rule.

APIImpact: New type of parameter for QoS rule in neutron API
DocImpact

Change-Id: I6b619a96a2bfde164646c71409b671352bc6ce7d
Partial-Bug: #1560963
2016-08-27 17:08:18 +00:00
Kevin Benton be32eff928 Use StringField for tenant_id fields
OVO is going to start enforcing that UUIDFields are UUIDs:
http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField

This is a breaking API change for Neutron since Neutron can be deployed
without Keystone and has historically supported non-UUID tenant IDs. So
we need to use StringField for our tenant_id fields.

The version numbers of the OVO objects are not being bumped because both
UUIDField and StringField are just strings with no validation differences
and they both just serialize to a string. There is no distinguishable
difference between the two until UUIDField starts validating in the future.

Change-Id: I93488701c824a51b5588093b9aba499068ba36e8
2016-06-11 14:42:48 -07:00
Ihar Hrachyshka 594a2283fc objects: stop using internal _context attribute
oslo.versionedobjects 1.9.0+ introduced a public attribute to access the
context object.

Change-Id: Ia2a6280f5478863721b9e1d3360c41244eb4a141
2016-06-01 13:33:01 +02:00
Jenkins a091a783b6 Merge "QOS: Provide get methods for policy & network/port binding" 2016-03-29 14:49:25 +00:00
Adit Sarfaty 866e3455fc QOS: Provide get methods for policy & network/port binding
These methods were missing in the qos api.
These have been added to provide the ability to read the policy
and network/port binding, and will be accessed through the new
methods in the QosPolicy class.

Closes-bug: #1556812
Change-Id: I34e4851c0fec2cd037206868846644b99dfd7def
2016-03-22 09:49:52 +02:00
Jenkins d27b27c183 Merge "objects: fixed base to_dict implementation" 2016-03-21 16:26:46 +00:00
David Shaughnessy a9a1943fde DSCP QoS rule implementation
This patch adds the front end and back end implementation of QoS DSCP.

Associated patches that are dependent on this one:

* python-neutronclient: https://review.openstack.org/#/c/254280
* openstack-manuals: https://review.openstack.org/#/c/273638
* API Guide: https://review.openstack.org/#/c/275253
* Heat:
  * Spec: https://review.openstack.org/#/c/272173
  * QoSDscpMarkingRule resource: https://review.openstack.org/#/c/277567
* Fullstack tests: https://review.openstack.org/#/c/288392/

APIImpact - The API now supports marking traffic egressing from a VM's
            dscp field with a valid dscp value.

Co-Authored-By: Nate Johnston <nate_johnston@cable.comcast.com>
Co-Authored-By: Victor Howard <victor.r.howard@gmail.com>
Co-Authored-By: Margaret Frances <margaret_frances@cable.comcast.com>
Co-Authored-By: James Reeves <james.reeves5546@gmail.com>
Co-Authored-By: John Schwarz <jschwarz@redhat.com>
Needed-By: I25ad60c1b9a66e568276a772b8c496987d9f8299
Needed-By: I881b8f5bc9024c20275bc56062de72a1c70c8321
Needed-By: I48ead4b459183db795337ab729830a1b3c0022da
Needed-By: Ib92b172dce48276b90ec75ee5880ddd69040d7c8
Needed-By: I4eb21495e84feea46880caf3360759263e1e8f95
Needed-By: I0ab6a1a0d1430c5791fea1d5b54106c6cc93b937
Partial-Bug: #1468353

Change-Id: Ic3baefe176df05f049a2e06529c58fd65fe6b419
2016-03-18 10:07:24 +01:00
Ihar Hrachyshka d503c830fb objects: fixed base to_dict implementation
The implementation was using wrong approach to detect field type, and it
never triggered the actual code. Adopting the base class implementation
for QoS policy object revealed the problem.

Now, we fix the base class to_dict implementation for synthetic fields,
and are able to adopt it for the policy object.

Note that the bug in the base class was never exposed in production
because no objects are currently relying on it.

Change-Id: I3b8727fd3837b51cc1a778dc73d8a1e06f2de5a9
Partial-Bug: #1541928
2016-03-17 22:10:53 +00:00
Artur Korzeniewski 4b227c3771 Objects DB api: added composite key to handle multiple primary key
Moving CRUD DB operation for objects from db/api.py to objects/db/api.py
Renaming object get_by_id(id) to get_object(**kwargs)

Many models in Neutron DB have complex primary keys, concatenated from
a few properties. This patch adds ability to define multiple primary keys
in NeutronDbObject, which are automatically evaluated into DB query
when performing operations.

Partial-Bug: #1541928
Change-Id: I0f63a62418db76415ddd40c30c778ff7541b93dc
2016-03-01 17:05:11 +00:00