| 1 |
# Copyright (c) 2020 Red Hat, Inc. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 |
# not use this file except in compliance with the License. You may obtain |
| 5 |
# a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
from neutron_lib.api.definitions import port |
| 16 |
from neutron_lib import constants |
| 17 |
|
| 18 |
|
| 19 |
ALIAS = 'port-numa-affinity-policy' |
| 20 |
IS_SHIM_EXTENSION = False |
| 21 |
IS_STANDARD_ATTR_EXTENSION = False |
| 22 |
NAME = 'Port NUMA affinity policy' |
| 23 |
DESCRIPTION = "Expose the port NUMA affinity policy" |
| 24 |
UPDATED_TIMESTAMP = "2020-07-08T10:00:00-00:00" |
| 25 |
RESOURCE_NAME = port.RESOURCE_NAME |
| 26 |
COLLECTION_NAME = port.COLLECTION_NAME |
| 27 |
NUMA_AFFINITY_POLICY = 'numa_affinity_policy' |
| 28 |
|
| 29 |
RESOURCE_ATTRIBUTE_MAP = { |
| 30 |
COLLECTION_NAME: { |
| 31 |
NUMA_AFFINITY_POLICY: { |
| 32 |
'allow_post': True, |
| 33 |
'allow_put': True, |
| 34 |
'validate': { |
| 35 |
'type:values': (constants.PORT_NUMA_POLICY_REQUIRED, |
| 36 |
constants.PORT_NUMA_POLICY_PREFERRED, |
| 37 |
constants.PORT_NUMA_POLICY_LEGACY, |
| 38 |
None)}, |
| 39 |
'default': None, |
| 40 |
'is_visible': True} |
| 41 |
}, |
| 42 |
} |
| 43 |
|
| 44 |
SUB_RESOURCE_ATTRIBUTE_MAP = None |
| 45 |
ACTION_MAP = {} |
| 46 |
ACTION_STATUS = {} |
| 47 |
REQUIRED_EXTENSIONS = [] |
| 48 |
OPTIONAL_EXTENSIONS = [] |