Merge "Add is_filter to network_ip_availability"

This commit is contained in:
Zuul 2018-08-29 10:28:52 +00:00 committed by Gerrit Code Review
commit 31b2af7e9f
3 changed files with 36 additions and 3 deletions

View File

@ -70,6 +70,14 @@ Error response codes: 401
Request
-------
.. rest_parameters:: parameters.yaml
- network_id: network_ip_availability-network_id-query
- network_name: network-name-query
- tenant_id: project_id-query
- project_id: project_id-query
- ip_version: ip_version-query
Response Parameters
-------------------

View File

@ -755,6 +755,12 @@ name-query:
in: query
required: false
type: string
network-name-query:
description: |
Filter the list result by the human-readable name of the network.
in: query
required: false
type: string
network-shared-query:
description: |
Filter the network list result based on if the network is shared across
@ -791,6 +797,13 @@ network_id-query:
in: query
required: false
type: string
network_ip_availability-network_id-query:
description: |
Filter the list result by the ID of the network whose IP availability
detail is reported.
in: query
required: false
type: string
network_is_default-query:
description: |
Filter the network list result based on if the network is default pool

View File

@ -27,15 +27,15 @@ RESOURCE_ATTRIBUTE_MAP = {
RESOURCE_PLURAL: {
'network_id': {
'allow_post': False, 'allow_put': False,
'is_visible': True
'is_visible': True, 'is_filter': True
},
'network_name': {
'allow_post': False, 'allow_put': False,
'is_visible': True
'is_visible': True, 'is_filter': True
},
'tenant_id': {
'allow_post': False, 'allow_put': False,
'is_visible': True
'is_visible': True, 'is_filter': True
},
'total_ips': {
'allow_post': False, 'allow_put': False,
@ -48,6 +48,18 @@ RESOURCE_ATTRIBUTE_MAP = {
'subnet_ip_availability': {
'allow_post': False, 'allow_put': False,
'is_visible': True
},
# NOTE(hongbin): This 'ip_version' attribute (top-level) is only used
# as a filter on listing the resources. There is another 'ip_version'
# attribute nested inside the 'subnet_ip_availability'.
# The difference is that the top-level attribute is used as input
# and the nested attribute is an output.
# In here, 'allow_post', 'allow_put' and 'is_visible' are set to False
# because this attribute should be used as filter only. Please do not
# set it to True to avoid introducing inconsistency.
'ip_version': {
'allow_post': False, 'allow_put': False,
'is_visible': False, 'is_filter': True
}
# TODO(wwriverrat) Make composite attribute for subnet_ip_availability
}