Annotate sort_key parameters for all resources
Add a 'is_sort_key' keyword for each attribute that can be used as a sort_key. In the future, we will rely on this keyword to perform validation: https://review.openstack.org/#/c/554368/ . This patch processes the following resources: ports, segments, trunks, address scopes, floating IPs, routers, subnetpools, subnets, flavors, logging, metering, qos related resources. Note: This patch only processes the attributes that are documented as sort_key in api-ref. Change-Id: I936378855ba43bd7dfdb25a5e324a4bd3e21345d Related-Bug: #1749820
This commit is contained in:
parent
eb27424cb0
commit
969cf9ecb8
|
@ -37,6 +37,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'name': {'allow_post': True,
|
'name': {'allow_post': True,
|
||||||
|
@ -44,6 +45,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'default': '',
|
'default': '',
|
||||||
'validate': {'type:string': db_constants.NAME_FIELD_SIZE},
|
'validate': {'type:string': db_constants.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True,
|
'tenant_id': {'allow_post': True,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
|
@ -51,6 +53,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': db_constants.PROJECT_ID_FIELD_SIZE},
|
'type:string': db_constants.PROJECT_ID_FIELD_SIZE},
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
constants.SHARED: {'allow_post': True,
|
constants.SHARED: {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -58,12 +61,14 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'enforce_policy': True},
|
'enforce_policy': True},
|
||||||
'ip_version': {'allow_post': True, 'allow_put': False,
|
'ip_version': {'allow_post': True, 'allow_put': False,
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'validate': {'type:values': [4, 6]},
|
'validate': {'type:values': [4, 6]},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
},
|
},
|
||||||
'subnetpools': {
|
'subnetpools': {
|
||||||
|
@ -72,6 +77,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'validate': {'type:uuid_or_none': None},
|
'validate': {'type:uuid_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True}
|
'is_visible': True}
|
||||||
},
|
},
|
||||||
'networks': {
|
'networks': {
|
||||||
|
|
|
@ -32,20 +32,20 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True, 'is_filter': True,
|
'is_visible': True, 'is_filter': True,
|
||||||
'primary_key': True},
|
'is_sort_key': True, 'primary_key': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True,
|
'name': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''},
|
'is_visible': True, 'default': ''},
|
||||||
'description': {'allow_post': True, 'allow_put': True,
|
'description': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string_or_none':
|
'validate': {'type:string_or_none':
|
||||||
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''},
|
'is_visible': True, 'default': ''},
|
||||||
'service_type': {'allow_post': True, 'allow_put': False,
|
'service_type': {'allow_post': True, 'allow_put': False,
|
||||||
'validate':
|
'validate':
|
||||||
{'type:service_plugin_type': None},
|
{'type:service_plugin_type': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
|
@ -57,26 +57,26 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'is_visible': True, 'default': []},
|
'is_visible': True, 'default': []},
|
||||||
'enabled': {'allow_post': True, 'allow_put': True,
|
'enabled': {'allow_post': True, 'allow_put': True,
|
||||||
'convert_to': converters.convert_to_boolean_if_not_none,
|
'convert_to': converters.convert_to_boolean_if_not_none,
|
||||||
'default': True, 'is_filter': True,
|
'default': True, 'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
},
|
},
|
||||||
SERVICE_PROFILES: {
|
SERVICE_PROFILES: {
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True, 'is_filter': True,
|
'is_visible': True, 'is_filter': True,
|
||||||
'primary_key': True},
|
'is_sort_key': True, 'primary_key': True},
|
||||||
'description': {'allow_post': True, 'allow_put': True,
|
'description': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string_or_none':
|
'validate': {'type:string_or_none':
|
||||||
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''},
|
'is_visible': True, 'default': ''},
|
||||||
'driver': {'allow_post': True, 'allow_put': True,
|
'driver': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string':
|
'validate': {'type:string':
|
||||||
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||||
'is_visible': True, 'is_filter': True,
|
'is_visible': True, 'is_filter': True,
|
||||||
'default': ''},
|
'is_sort_key': True, 'default': ''},
|
||||||
'metainfo': {'allow_post': True, 'allow_put': True,
|
'metainfo': {'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True,
|
'is_visible': True, 'is_sort_key': True,
|
||||||
'default': ''},
|
'default': ''},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
|
@ -85,7 +85,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'enabled': {'allow_post': True, 'allow_put': True,
|
'enabled': {'allow_post': True, 'allow_put': True,
|
||||||
'convert_to': converters.convert_to_boolean_if_not_none,
|
'convert_to': converters.convert_to_boolean_if_not_none,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': True},
|
'is_visible': True, 'default': True},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': False,
|
'allow_post': False,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,23 +65,28 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True,
|
'name': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string': constants.NAME_FIELD_SIZE},
|
'validate': {'type:string': constants.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''},
|
'is_visible': True, 'default': ''},
|
||||||
'admin_state_up': {'allow_post': True, 'allow_put': True,
|
'admin_state_up': {'allow_post': True, 'allow_put': True,
|
||||||
'default': True,
|
'default': True,
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'status': {'allow_post': False, 'allow_put': False,
|
'status': {'allow_post': False, 'allow_put': False,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': constants.PROJECT_ID_FIELD_SIZE},
|
'type:string': constants.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
EXTERNAL_GW_INFO: {'allow_post': True, 'allow_put': True,
|
EXTERNAL_GW_INFO: {'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True, 'default': None,
|
'is_visible': True, 'default': None,
|
||||||
|
@ -105,9 +110,11 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'floating_ip_address': {'allow_post': True, 'allow_put': False,
|
'floating_ip_address': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:ip_address_or_none': None},
|
'validate': {'type:ip_address_or_none': None},
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True, 'default': None,
|
'is_visible': True, 'default': None,
|
||||||
'enforce_policy': True},
|
'enforce_policy': True},
|
||||||
'subnet_id': {'allow_post': True, 'allow_put': False,
|
'subnet_id': {'allow_post': True, 'allow_put': False,
|
||||||
|
@ -116,11 +123,11 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'default': None},
|
'default': None},
|
||||||
'floating_network_id': {'allow_post': True, 'allow_put': False,
|
'floating_network_id': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'router_id': {'allow_post': False, 'allow_put': False,
|
'router_id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid_or_none': None},
|
'validate': {'type:uuid_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': None},
|
'is_visible': True, 'default': None},
|
||||||
'port_id': {'allow_post': True, 'allow_put': True,
|
'port_id': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:uuid_or_none': None},
|
'validate': {'type:uuid_or_none': None},
|
||||||
|
@ -129,16 +136,16 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'required_by_policy': True},
|
'required_by_policy': True},
|
||||||
'fixed_ip_address': {'allow_post': True, 'allow_put': True,
|
'fixed_ip_address': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:ip_address_or_none': None},
|
'validate': {'type:ip_address_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': None},
|
'is_visible': True, 'default': None},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': constants.PROJECT_ID_FIELD_SIZE},
|
'type:string': constants.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'status': {'allow_post': False, 'allow_put': False,
|
'status': {'allow_post': False, 'allow_put': False,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
FLAVOR_ID: {
|
FLAVOR_ID: {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True, 'enforce_policy': True
|
'is_visible': True, 'enforce_policy': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,29 +58,29 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'project_id': {'allow_post': True, 'allow_put': False,
|
'project_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string':
|
'type:string':
|
||||||
db_const.PROJECT_ID_FIELD_SIZE},
|
db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True,
|
'name': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'default': '', 'is_visible': True},
|
'default': '', 'is_visible': True},
|
||||||
'resource_type': {'allow_post': True, 'allow_put': False,
|
'resource_type': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string':
|
'type:string':
|
||||||
db_const.RESOURCE_TYPE_FIELD_SIZE},
|
db_const.RESOURCE_TYPE_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'resource_id': {'allow_post': True, 'allow_put': False,
|
'resource_id': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:uuid_or_none': None},
|
'validate': {'type:uuid_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'default': None, 'is_visible': True},
|
'default': None, 'is_visible': True},
|
||||||
'event': {'allow_post': True, 'allow_put': False,
|
'event': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:values': LOG_EVENTS},
|
'validate': {'type:values': LOG_EVENTS},
|
||||||
|
@ -88,11 +88,11 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'default': ALL_EVENT, 'is_visible': True},
|
'default': ALL_EVENT, 'is_visible': True},
|
||||||
'target_id': {'allow_post': True, 'allow_put': False,
|
'target_id': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:uuid_or_none': None},
|
'validate': {'type:uuid_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'default': None, 'is_visible': True},
|
'default': None, 'is_visible': True},
|
||||||
'enabled': {'allow_post': True, 'allow_put': True,
|
'enabled': {'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True, 'default': True,
|
'is_visible': True, 'default': True,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'convert_to': converters.convert_to_boolean},
|
'convert_to': converters.convert_to_boolean},
|
||||||
},
|
},
|
||||||
LOG_TYPES: {
|
LOG_TYPES: {
|
||||||
|
|
|
@ -33,19 +33,20 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': False, 'allow_put': False,
|
'allow_post': False, 'allow_put': False,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True
|
'primary_key': True
|
||||||
},
|
},
|
||||||
'name': {
|
'name': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''
|
'is_visible': True, 'default': ''
|
||||||
},
|
},
|
||||||
'description': {
|
'description': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': ''
|
'is_visible': True, 'default': ''
|
||||||
},
|
},
|
||||||
'tenant_id': {
|
'tenant_id': {
|
||||||
|
@ -53,12 +54,12 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
constants.SHARED: {
|
constants.SHARED: {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'default': False,
|
'is_visible': True, 'default': False,
|
||||||
'convert_to': converters.convert_to_boolean
|
'convert_to': converters.convert_to_boolean
|
||||||
}
|
}
|
||||||
|
@ -67,29 +68,30 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'id': {
|
'id': {
|
||||||
'allow_post': False, 'allow_put': False,
|
'allow_post': False, 'allow_put': False,
|
||||||
'is_visible': True, 'is_filter': True,
|
'is_visible': True, 'is_filter': True,
|
||||||
'primary_key': True
|
'is_sort_key': True, 'primary_key': True
|
||||||
},
|
},
|
||||||
'metering_label_id': {
|
'metering_label_id': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'required_by_policy': True
|
'is_visible': True, 'required_by_policy': True
|
||||||
},
|
},
|
||||||
'direction': {
|
'direction': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'is_visible': True, 'is_filter': True,
|
'is_visible': True, 'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'validate': {'type:values': ['ingress', 'egress']}
|
'validate': {'type:values': ['ingress', 'egress']}
|
||||||
},
|
},
|
||||||
'excluded': {
|
'excluded': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'is_visible': True, 'default': False,
|
'is_visible': True, 'default': False,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'convert_to': converters.convert_to_boolean
|
'convert_to': converters.convert_to_boolean
|
||||||
},
|
},
|
||||||
'remote_ip_prefix': {
|
'remote_ip_prefix': {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'is_visible': True, 'required_by_policy': True,
|
'is_visible': True, 'required_by_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'validate': {'type:subnet': None}
|
'validate': {'type:subnet': None}
|
||||||
},
|
},
|
||||||
'tenant_id': {
|
'tenant_id': {
|
||||||
|
|
|
@ -29,28 +29,33 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True, 'default': '',
|
'name': {'allow_post': True, 'allow_put': True, 'default': '',
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.NAME_FIELD_SIZE},
|
'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'network_id': {'allow_post': True, 'allow_put': False,
|
'network_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'admin_state_up': {'allow_post': True, 'allow_put': True,
|
'admin_state_up': {'allow_post': True, 'allow_put': True,
|
||||||
'default': True,
|
'default': True,
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'mac_address': {'allow_post': True, 'allow_put': True,
|
'mac_address': {'allow_post': True, 'allow_put': True,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'validate': {'type:mac_address': None},
|
'validate': {'type:mac_address': None},
|
||||||
'enforce_policy': True,
|
'enforce_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'fixed_ips': {'allow_post': True, 'allow_put': True,
|
'fixed_ips': {'allow_post': True, 'allow_put': True,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
|
@ -65,21 +70,25 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': db_const.DEVICE_ID_FIELD_SIZE},
|
'type:string': db_const.DEVICE_ID_FIELD_SIZE},
|
||||||
'default': '',
|
'default': '',
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'device_owner': {'allow_post': True, 'allow_put': True,
|
'device_owner': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.DEVICE_OWNER_FIELD_SIZE},
|
'type:string': db_const.DEVICE_OWNER_FIELD_SIZE},
|
||||||
'default': '', 'enforce_policy': True,
|
'default': '', 'enforce_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'status': {'allow_post': False, 'allow_put': False,
|
'status': {'allow_post': False, 'allow_put': False,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ _QOS_RULE_COMMON_FIELDS = {
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True
|
'primary_key': True
|
||||||
},
|
},
|
||||||
'tenant_id': {
|
'tenant_id': {
|
||||||
|
@ -54,13 +55,13 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'id': {
|
'id': {
|
||||||
'allow_post': False, 'allow_put': False,
|
'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True, 'primary_key': True
|
'is_visible': True, 'primary_key': True
|
||||||
},
|
},
|
||||||
'name': {
|
'name': {
|
||||||
'allow_post': True, 'allow_put': True,
|
'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True, 'default': '',
|
'is_visible': True, 'default': '',
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'validate': {'type:string': db_const.NAME_FIELD_SIZE}},
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE}},
|
||||||
constants.SHARED: {
|
constants.SHARED: {
|
||||||
'allow_post': True, 'allow_put': True,
|
'allow_post': True, 'allow_put': True,
|
||||||
|
@ -72,7 +73,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': True, 'allow_put': False,
|
'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True, 'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
'rules': {
|
'rules': {
|
||||||
|
@ -120,6 +121,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
|
||||||
},
|
},
|
||||||
|
@ -127,6 +129,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': True, 'allow_put': True,
|
'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True, 'default': 0,
|
'is_visible': True, 'default': 0,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}}}),
|
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}}}),
|
||||||
|
@ -140,6 +143,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:values': constants.VALID_DSCP_MARKS}}})
|
'type:values': constants.VALID_DSCP_MARKS}}})
|
||||||
},
|
},
|
||||||
|
@ -151,6 +155,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': True, 'allow_put': True,
|
'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}},
|
'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}},
|
||||||
|
@ -158,6 +163,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_post': True, 'allow_put': True,
|
'allow_post': True, 'allow_put': True,
|
||||||
'is_visible': True, 'default': constants.EGRESS_DIRECTION,
|
'is_visible': True, 'default': constants.EGRESS_DIRECTION,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:values': [constants.EGRESS_DIRECTION]}}})
|
'type:values': [constants.EGRESS_DIRECTION]}}})
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'default': constants.EGRESS_DIRECTION,
|
'default': constants.EGRESS_DIRECTION,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:values': constants.VALID_DIRECTIONS
|
'type:values': constants.VALID_DIRECTIONS
|
||||||
|
|
|
@ -44,6 +44,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:uuid': None
|
'type:uuid': None
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'primary_key': True
|
'primary_key': True
|
||||||
},
|
},
|
||||||
|
@ -61,6 +62,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:uuid': None
|
'type:uuid': None
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
PHYSICAL_NETWORK: {
|
PHYSICAL_NETWORK: {
|
||||||
|
@ -71,6 +73,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': provider_net.PHYSICAL_NETWORK_MAX_LEN
|
'type:string': provider_net.PHYSICAL_NETWORK_MAX_LEN
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
NETWORK_TYPE: {
|
NETWORK_TYPE: {
|
||||||
|
@ -80,6 +83,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': provider_net.NETWORK_TYPE_MAX_LEN
|
'type:string': provider_net.NETWORK_TYPE_MAX_LEN
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
SEGMENTATION_ID: {
|
SEGMENTATION_ID: {
|
||||||
|
@ -87,6 +91,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
'name': {
|
'name': {
|
||||||
|
@ -97,6 +102,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string_or_none': NAME_LEN
|
'type:string_or_none': NAME_LEN
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
},
|
},
|
||||||
'description': {
|
'description': {
|
||||||
|
@ -118,6 +124,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:uuid_or_none': None
|
'type:uuid_or_none': None
|
||||||
},
|
},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True
|
'is_visible': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,21 +30,25 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True, 'default': '',
|
'name': {'allow_post': True, 'allow_put': True, 'default': '',
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:string': db_const.NAME_FIELD_SIZE},
|
'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'ip_version': {'allow_post': True, 'allow_put': False,
|
'ip_version': {'allow_post': True, 'allow_put': False,
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'validate': {'type:values': [4, 6]},
|
'validate': {'type:values': [4, 6]},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'network_id': {'allow_post': True, 'allow_put': False,
|
'network_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'subnetpool_id': {'allow_post': True,
|
'subnetpool_id': {'allow_post': True,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
|
@ -52,6 +56,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'required_by_policy': False,
|
'required_by_policy': False,
|
||||||
'validate': {'type:subnetpool_id_or_none': None},
|
'validate': {'type:subnetpool_id_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'prefixlen': {'allow_post': True,
|
'prefixlen': {'allow_post': True,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
|
@ -66,11 +71,13 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:subnet_or_none': None},
|
'validate': {'type:subnet_or_none': None},
|
||||||
'required_by_policy': False,
|
'required_by_policy': False,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'gateway_ip': {'allow_post': True, 'allow_put': True,
|
'gateway_ip': {'allow_post': True, 'allow_put': True,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'validate': {'type:ip_address_or_none': None},
|
'validate': {'type:ip_address_or_none': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'allocation_pools': {'allow_post': True, 'allow_put': True,
|
'allocation_pools': {'allow_post': True, 'allow_put': True,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
|
@ -93,23 +100,27 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'enable_dhcp': {'allow_post': True, 'allow_put': True,
|
'enable_dhcp': {'allow_post': True, 'allow_put': True,
|
||||||
'default': True,
|
'default': True,
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'ipv6_ra_mode': {'allow_post': True, 'allow_put': False,
|
'ipv6_ra_mode': {'allow_post': True, 'allow_put': False,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:values': constants.IPV6_MODES},
|
'type:values': constants.IPV6_MODES},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'ipv6_address_mode': {'allow_post': True, 'allow_put': False,
|
'ipv6_address_mode': {'allow_post': True, 'allow_put': False,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'validate': {
|
'validate': {
|
||||||
'type:values': constants.IPV6_MODES},
|
'type:values': constants.IPV6_MODES},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
constants.SHARED: {
|
constants.SHARED: {
|
||||||
'allow_post': False,
|
'allow_post': False,
|
||||||
|
|
|
@ -31,11 +31,13 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'primary_key': True},
|
'primary_key': True},
|
||||||
'name': {'allow_post': True,
|
'name': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
'validate': {'type:not_empty_string': None},
|
'validate': {'type:not_empty_string': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True,
|
'tenant_id': {'allow_post': True,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
|
@ -43,6 +45,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'prefixes': {'allow_post': True,
|
'prefixes': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -54,10 +57,12 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'ip_version': {'allow_post': False,
|
'ip_version': {'allow_post': False,
|
||||||
'allow_put': False,
|
'allow_put': False,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'default_prefixlen': {'allow_post': True,
|
'default_prefixlen': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -65,6 +70,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'default': constants.ATTR_NOT_SPECIFIED,
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'min_prefixlen': {'allow_post': True,
|
'min_prefixlen': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -72,6 +78,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:non_negative': None},
|
'validate': {'type:non_negative': None},
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'max_prefixlen': {'allow_post': True,
|
'max_prefixlen': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -79,6 +86,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'validate': {'type:non_negative': None},
|
'validate': {'type:non_negative': None},
|
||||||
'convert_to': converters.convert_to_int,
|
'convert_to': converters.convert_to_int,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'is_default': {'allow_post': True,
|
'is_default': {'allow_post': True,
|
||||||
'allow_put': True,
|
'allow_put': True,
|
||||||
|
@ -86,6 +94,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'enforce_policy': True},
|
'enforce_policy': True},
|
||||||
constants.SHARED: {
|
constants.SHARED: {
|
||||||
|
@ -95,6 +104,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_visible': True,
|
'is_visible': True,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'enforce_policy': True
|
'enforce_policy': True
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,27 +52,33 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||||
'default': True,
|
'default': True,
|
||||||
'convert_to': converters.convert_to_boolean,
|
'convert_to': converters.convert_to_boolean,
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'id': {'allow_post': False, 'allow_put': False,
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True, 'primary_key': True},
|
'is_visible': True, 'primary_key': True},
|
||||||
'name': {'allow_post': True, 'allow_put': True,
|
'name': {'allow_post': True, 'allow_put': True,
|
||||||
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'default': '', 'is_visible': True},
|
'default': '', 'is_visible': True},
|
||||||
'tenant_id': {'allow_post': True, 'allow_put': False,
|
'tenant_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate':
|
'validate':
|
||||||
{'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
{'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'port_id': {'allow_post': True, 'allow_put': False,
|
'port_id': {'allow_post': True, 'allow_put': False,
|
||||||
'required_by_policy': True,
|
'required_by_policy': True,
|
||||||
'validate': {'type:uuid': None},
|
'validate': {'type:uuid': None},
|
||||||
'is_filter': True,
|
'is_filter': True,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
'status': {'allow_post': False, 'allow_put': False,
|
'status': {'allow_post': False, 'allow_put': False,
|
||||||
|
'is_sort_key': True,
|
||||||
'is_visible': True},
|
'is_visible': True},
|
||||||
SUB_PORTS: {'allow_post': True, 'allow_put': False,
|
SUB_PORTS: {'allow_post': True, 'allow_put': False,
|
||||||
'default': [],
|
'default': [],
|
||||||
|
|
Loading…
Reference in New Issue