| 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 | # not use this file except in compliance with the License. You may obtain |
| 3 | # a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 | # License for the specific language governing permissions and limitations |
| 11 | # under the License. |
| 12 | |
| 13 | from oslo_versionedobjects import base |
| 14 | from oslo_versionedobjects import fields |
| 15 | |
| 16 | from os_vif.objects import base as osv_base |
| 17 | |
| 18 | |
| 19 | @base.VersionedObjectRegistry.register |
| 20 | class Route(osv_base.VersionedObject): |
| 21 | """Represents a route.""" |
| 22 | # Version 1.0: Initial version |
| 23 | VERSION = '1.0' |
| 24 | |
| 25 | fields = { |
| 26 | 'cidr': fields.IPNetworkField(), |
| 27 | 'gateway': fields.IPAddressField(), |
| 28 | # TODO(mriedem): This field is never set by Nova, remove it in v2.0 |
| 29 | # of this object. |
| 30 | 'interface': fields.StringField(), |
| 31 | } |
| 32 | |
| 33 | |
| 34 | @base.VersionedObjectRegistry.register |
| 35 | class RouteList(osv_base.VersionedObject, base.ObjectListBase): |
| 36 | # Version 1.0: Initial version |
| 37 | VERSION = '1.0' |
| 38 | |
| 39 | fields = { |
| 40 | 'objects': fields.ListOfObjectsField('Route'), |
| 41 | } |