| 1 |
# Copyright (c) 2013 OpenStack Foundation. |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 |
# not use this file except in compliance with the License. You may obtain |
| 6 |
# a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 |
# License for the specific language governing permissions and limitations |
| 14 |
# under the License. |
| 15 |
|
| 16 |
from neutron_lib.api.definitions import agent as agent_apidef |
| 17 |
from neutron_lib.api.definitions import network as net_apidef |
| 18 |
from neutron_lib import constants |
| 19 |
|
| 20 |
|
| 21 |
DHCP_NET = 'dhcp-network' |
| 22 |
DHCP_NETS = DHCP_NET + 's' |
| 23 |
DHCP_AGENT = 'dhcp-agent' |
| 24 |
DHCP_AGENTS = DHCP_AGENT + 's' |
| 25 |
|
| 26 |
ALIAS = constants.DHCP_AGENT_SCHEDULER_EXT_ALIAS |
| 27 |
IS_SHIM_EXTENSION = False |
| 28 |
IS_STANDARD_ATTR_EXTENSION = False |
| 29 |
NAME = 'DHCP Agent Scheduler' |
| 30 |
API_PREFIX = '' |
| 31 |
DESCRIPTION = 'Schedule networks among dhcp agents' |
| 32 |
UPDATED_TIMESTAMP = '2013-02-07T10:00:00-00:00' |
| 33 |
RESOURCE_ATTRIBUTE_MAP = {} |
| 34 |
SUB_RESOURCE_ATTRIBUTE_MAP = { |
| 35 |
DHCP_NETS: { |
| 36 |
'parent': { |
| 37 |
'collection_name': agent_apidef.COLLECTION_NAME, |
| 38 |
'member_name': agent_apidef.RESOURCE_NAME |
| 39 |
}, |
| 40 |
'parameters': { |
| 41 |
'network_id': { |
| 42 |
'allow_post': True, 'allow_put': False, |
| 43 |
'default': constants.ATTR_NOT_SPECIFIED, |
| 44 |
'enforce_policy': True, |
| 45 |
'is_visible': True, |
| 46 |
'validate': {'type:uuid': None} |
| 47 |
} |
| 48 |
} |
| 49 |
}, |
| 50 |
DHCP_AGENTS: { |
| 51 |
'parent': { |
| 52 |
'collection_name': net_apidef.COLLECTION_NAME, |
| 53 |
'member_name': net_apidef.RESOURCE_NAME |
| 54 |
}, |
| 55 |
# NOTE(boden): the reference implementation only allows the index |
| 56 |
# operation for the agent exposed under the network resource |
| 57 |
'parameters': agent_apidef.RESOURCE_ATTRIBUTE_MAP[ |
| 58 |
agent_apidef.COLLECTION_NAME] |
| 59 |
} |
| 60 |
} |
| 61 |
ACTION_MAP = {} |
| 62 |
REQUIRED_EXTENSIONS = [agent_apidef.ALIAS] |
| 63 |
OPTIONAL_EXTENSIONS = [] |
| 64 |
ACTION_STATUS = {} |