1 From ee74cb2a5ccdc13e8bf137d7387f01c6b202c150 Mon Sep 17 00:00:00 2001
2 From: Carlos Goncalves <carlos.goncalves@neclab.eu>
3 Date: Tue, 24 Jan 2017 21:52:27 +0000
4 Subject: [PATCH] API definition and reference for data plane status extension
9 Partial-Implements: blueprint port-data-plane-status
11 Change-Id: I04eef902b3310f799b1ce7ea44ed7cf77c74da04
13 neutron_lib/api/definitions/base.py | 1 +
14 neutron_lib/api/definitions/data_plane_status.py | 78 ++++++++++++++++++++++++
15 2 files changed, 79 insertions(+)
16 create mode 100644 neutron_lib/api/definitions/data_plane_status.py
18 diff --git a/neutron_lib/api/definitions/base.py b/neutron_lib/api/definitions/base.py
19 index 6fbcbfa..38f183c 100644
20 --- a/neutron_lib/api/definitions/base.py
21 +++ b/neutron_lib/api/definitions/base.py
22 @@ -44,6 +44,7 @@ KNOWN_EXTENSIONS = (
23 'auto-allocated-topology',
26 + 'data-plane-status',
27 'default-subnetpools',
28 'dhcp_agent_scheduler',
30 diff --git a/neutron_lib/api/definitions/data_plane_status.py b/neutron_lib/api/definitions/data_plane_status.py
32 index 0000000..5bcbf60
34 +++ b/neutron_lib/api/definitions/data_plane_status.py
36 +# Copyright (c) 2017 NEC Corporation. All rights reserved.
38 +# Licensed under the Apache License, Version 2.0 (the "License"); you may
39 +# not use this file except in compliance with the License. You may obtain
40 +# a copy of the License at
42 +# http://www.apache.org/licenses/LICENSE-2.0
44 +# Unless required by applicable law or agreed to in writing, software
45 +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
46 +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
47 +# License for the specific language governing permissions and limitations
50 +from neutron_lib import constants
53 +VALID_VALUES = [None, constants.ACTIVE, constants.DOWN]
55 +# The alias of the extension.
56 +ALIAS = 'data-plane-status'
58 +# Whether or not this extension is simply signaling behavior to the user
59 +# or it actively modifies the attribute map.
60 +IS_SHIM_EXTENSION = False
62 +# Whether the extension is marking the adoption of standardattr model for
63 +# legacy resources, or introducing new standardattr attributes. False or
64 +# None if the standardattr model is adopted since the introduction of
65 +# resource extension.
66 +# If this is True, the alias for the extension should be prefixed with
68 +IS_STANDARD_ATTR_EXTENSION = False
70 +# The name of the extension.
71 +NAME = 'Port data plane status extension'
73 +# The description of the extension.
74 +DESCRIPTION = "Expose status of underlying data plane"
76 +# A timestamp of when the extension was introduced.
77 +UPDATED_TIMESTAMP = "2017-01-24T10:00:00-00:00"
79 +# The name of the resource introduced or being extended.
80 +RESOURCE_NAME = 'port'
82 +# The plural for the resource introduced or being extended.
83 +COLLECTION_NAME = 'ports'
85 +# The specific resources and/or attributes for the extension (optional).
86 +DATA_PLANE_STATUS = 'data_plane_status'
88 +# The resource attribute map for the extension.
89 +RESOURCE_ATTRIBUTE_MAP = {
91 + DATA_PLANE_STATUS: {'allow_post': False, 'allow_put': True,
92 + 'default': constants.ATTR_NOT_SPECIFIED,
93 + 'validate': {'type:values': VALID_VALUES},
95 + 'enforce_policy': True, }
99 +# The subresource attribute map for the extension.
100 +SUB_RESOURCE_ATTRIBUTE_MAP = {
107 +# The list of required extensions.
108 +REQUIRED_EXTENSIONS = [
111 +# The list of optional extensions.
112 +OPTIONAL_EXTENSIONS = [