Debian Codegraph @

neutron_lib/api/definitions/agent.py

raw
1 # Copyright (c) 2013 OpenStack Foundation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain 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,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 import typing
17
18 from neutron_lib.api import converters
19 from neutron_lib.db import constants
20
21 ALIAS = 'agent'
22 IS_SHIM_EXTENSION = False
23 IS_STANDARD_ATTR_EXTENSION = False
24 NAME = ALIAS
25 API_PREFIX = ''
26 DESCRIPTION = 'The agent management extension.'
27 UPDATED_TIMESTAMP = '2013-02-03T10:00:00-00:00'
28 RESOURCE_NAME = ALIAS
29 COLLECTION_NAME = ALIAS + 's'
30 RESOURCE_ATTRIBUTE_MAP: dict[str, typing.Any] = {
31 COLLECTION_NAME: {
32 'id': {'allow_post': False, 'allow_put': False,
33 'validate': {'type:uuid': None},
34 'is_filter': True,
35 'is_visible': True},
36 'agent_type': {'allow_post': False, 'allow_put': False,
37 'is_filter': True, 'is_visible': True},
38 'binary': {'allow_post': False, 'allow_put': False,
39 'is_filter': True, 'is_visible': True},
40 'topic': {'allow_post': False, 'allow_put': False,
41 'is_filter': True, 'is_visible': True},
42 'host': {'allow_post': False, 'allow_put': False,
43 'is_filter': True, 'is_visible': True},
44 'admin_state_up': {'allow_post': False, 'allow_put': True,
45 'convert_to': converters.convert_to_boolean,
46 'is_filter': True,
47 'is_visible': True},
48 'created_at': {'allow_post': False, 'allow_put': False,
49 'is_visible': True},
50 'started_at': {'allow_post': False, 'allow_put': False,
51 'is_visible': True},
52 'heartbeat_timestamp': {'allow_post': False, 'allow_put': False,
53 'is_visible': True},
54 'alive': {'allow_post': False, 'allow_put': False,
55 'is_filter': True, 'is_visible': True},
56 'configurations': {'allow_post': False, 'allow_put': False,
57 'is_visible': True},
58 'description': {
59 'allow_post': False, 'allow_put': True,
60 'is_visible': True, 'is_filter': True,
61 'validate': {
62 'type:string_or_none': constants.DESCRIPTION_FIELD_SIZE}},
63 }
64 }
65 SUB_RESOURCE_ATTRIBUTE_MAP = {}
66 ACTION_MAP = {}
67 REQUIRED_EXTENSIONS = []
68 OPTIONAL_EXTENSIONS = []
69 ACTION_STATUS = {}