Add extension "subnet-external-network"
This extension adds a new field to the "subnet" resource: "router:external". This boolean field, that is False by default, represents if the subnet belongs to an external network. Related-Bug: #2051831 Change-Id: I75a9c30f1e8031d40a548df345b02fbe0bc47706
This commit is contained in:
parent
a5d8a6fd7c
commit
fc2f383dd6
|
@ -1661,6 +1661,12 @@ subnet-network_id-query:
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
subnet-router:external:
|
||||||
|
description: |
|
||||||
|
The membership of a subnet to an external network.
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
subnet-segment_id-query:
|
subnet-segment_id-query:
|
||||||
description: |
|
description: |
|
||||||
Filter the subnet list result by the ID of a network segment the subnet
|
Filter the subnet list result by the ID of a network segment the subnet
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"service_types": [],
|
"service_types": [],
|
||||||
"subnetpool_id": null,
|
"subnetpool_id": null,
|
||||||
"tags": ["tag1,tag2"],
|
"tags": ["tag1,tag2"],
|
||||||
"updated_at": "2016-10-10T14:35:47Z"
|
"updated_at": "2016-10-10T14:35:47Z",
|
||||||
|
"router:external": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"revision_number": 2,
|
"revision_number": 2,
|
||||||
"service_types": [],
|
"service_types": [],
|
||||||
"subnetpool_id": null,
|
"subnetpool_id": null,
|
||||||
"tags": ["tag1,tag2"]
|
"tags": ["tag1,tag2"],
|
||||||
|
"router:external": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"updated_at": "2016-03-08T20:19:41",
|
"updated_at": "2016-03-08T20:19:41",
|
||||||
"id": "08eae331-0402-425a-923c-34f7cfe39c1b",
|
"id": "08eae331-0402-425a-923c-34f7cfe39c1b",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tags": ["tag1,tag2"]
|
"tags": ["tag1,tag2"],
|
||||||
|
"router:external": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
"service_types": [],
|
"service_types": [],
|
||||||
"subnetpool_id": null,
|
"subnetpool_id": null,
|
||||||
"tags": ["tag1,tag2"],
|
"tags": ["tag1,tag2"],
|
||||||
"updated_at": "2016-10-10T14:35:34Z"
|
"updated_at": "2016-10-10T14:35:34Z",
|
||||||
|
"router:external": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "my_subnet",
|
"name": "my_subnet",
|
||||||
|
@ -58,7 +59,8 @@
|
||||||
"service_types": [],
|
"service_types": [],
|
||||||
"subnetpool_id": null,
|
"subnetpool_id": null,
|
||||||
"tags": ["tag1,tag2"],
|
"tags": ["tag1,tag2"],
|
||||||
"updated_at": "2016-10-10T14:35:47Z"
|
"updated_at": "2016-10-10T14:35:47Z",
|
||||||
|
"router:external": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,6 +165,7 @@ Response Parameters
|
||||||
- updated_at: updated_at_resource
|
- updated_at: updated_at_resource
|
||||||
- tags: tags
|
- tags: tags
|
||||||
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
||||||
|
- router:external: subnet-router:external
|
||||||
|
|
||||||
Response Example
|
Response Example
|
||||||
----------------
|
----------------
|
||||||
|
@ -289,6 +290,7 @@ Response Parameters
|
||||||
- updated_at: updated_at_resource
|
- updated_at: updated_at_resource
|
||||||
- tags: tags
|
- tags: tags
|
||||||
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
||||||
|
- router:external: subnet-router:external
|
||||||
|
|
||||||
Response Example
|
Response Example
|
||||||
----------------
|
----------------
|
||||||
|
@ -372,6 +374,7 @@ Response Parameters
|
||||||
- updated_at: updated_at_resource
|
- updated_at: updated_at_resource
|
||||||
- tags: tags
|
- tags: tags
|
||||||
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
||||||
|
- router:external: subnet-router:external
|
||||||
|
|
||||||
Response Example
|
Response Example
|
||||||
----------------
|
----------------
|
||||||
|
@ -428,6 +431,7 @@ Response Parameters
|
||||||
- subnetpool_id: subnet-subnetpool_id
|
- subnetpool_id: subnet-subnetpool_id
|
||||||
- tags: tags
|
- tags: tags
|
||||||
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
||||||
|
- router:external: subnet-router:external
|
||||||
|
|
||||||
Response Example
|
Response Example
|
||||||
----------------
|
----------------
|
||||||
|
@ -502,6 +506,7 @@ Response Parameters
|
||||||
- updated_at: updated_at_resource
|
- updated_at: updated_at_resource
|
||||||
- tags: tags
|
- tags: tags
|
||||||
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
- dns_publish_fixed_ip: subnet-dns_publish_fixed_ip
|
||||||
|
- router:external: subnet-router:external
|
||||||
|
|
||||||
Response Example
|
Response Example
|
||||||
----------------
|
----------------
|
||||||
|
|
|
@ -145,6 +145,7 @@ from neutron_lib.api.definitions import standard_attr_segment
|
||||||
from neutron_lib.api.definitions import stateful_security_group
|
from neutron_lib.api.definitions import stateful_security_group
|
||||||
from neutron_lib.api.definitions import subnet
|
from neutron_lib.api.definitions import subnet
|
||||||
from neutron_lib.api.definitions import subnet_dns_publish_fixed_ip
|
from neutron_lib.api.definitions import subnet_dns_publish_fixed_ip
|
||||||
|
from neutron_lib.api.definitions import subnet_external_network
|
||||||
from neutron_lib.api.definitions import subnet_onboard
|
from neutron_lib.api.definitions import subnet_onboard
|
||||||
from neutron_lib.api.definitions import subnet_segmentid_enforce
|
from neutron_lib.api.definitions import subnet_segmentid_enforce
|
||||||
from neutron_lib.api.definitions import subnet_segmentid_writable
|
from neutron_lib.api.definitions import subnet_segmentid_writable
|
||||||
|
@ -300,6 +301,7 @@ _ALL_API_DEFINITIONS = {
|
||||||
stateful_security_group,
|
stateful_security_group,
|
||||||
subnet,
|
subnet,
|
||||||
subnet_dns_publish_fixed_ip,
|
subnet_dns_publish_fixed_ip,
|
||||||
|
subnet_external_network,
|
||||||
subnet_onboard,
|
subnet_onboard,
|
||||||
subnet_segmentid_enforce,
|
subnet_segmentid_enforce,
|
||||||
subnet_segmentid_writable,
|
subnet_segmentid_writable,
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
# Copyright (c) 2024 Red Hat Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from neutron_lib.api import converters
|
||||||
|
from neutron_lib.api.definitions import external_net as extnet_def
|
||||||
|
from neutron_lib.api.definitions import subnet as subnet_def
|
||||||
|
|
||||||
|
|
||||||
|
ALIAS = 'subnet-external-network'
|
||||||
|
IS_SHIM_EXTENSION = False
|
||||||
|
IS_STANDARD_ATTR_EXTENSION = False
|
||||||
|
NAME = 'Subnet belongs to an external network'
|
||||||
|
API_PREFIX = ''
|
||||||
|
DESCRIPTION = 'Informs if the subnet belongs to an external network'
|
||||||
|
UPDATED_TIMESTAMP = '2024-02-05T18:00:00-00:00'
|
||||||
|
RESOURCE_NAME = extnet_def.EXTERNAL # 'router:external'
|
||||||
|
|
||||||
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
subnet_def.COLLECTION_NAME: {
|
||||||
|
RESOURCE_NAME: {
|
||||||
|
'allow_post': False,
|
||||||
|
'allow_put': False,
|
||||||
|
'default': False,
|
||||||
|
'is_visible': True,
|
||||||
|
'is_filter': False,
|
||||||
|
'convert_to': converters.convert_to_boolean,
|
||||||
|
'enforce_policy': True,
|
||||||
|
'required_by_policy': True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||||
|
ACTION_MAP = {}
|
||||||
|
ACTION_STATUS = {}
|
||||||
|
REQUIRED_EXTENSIONS = []
|
||||||
|
OPTIONAL_EXTENSIONS = []
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Copyright (c) 2024 Red Hat Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from neutron_lib.api.definitions import subnet_external_network
|
||||||
|
from neutron_lib.tests.unit.api.definitions import base
|
||||||
|
|
||||||
|
|
||||||
|
class SubnetExternalNetworkDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||||
|
extension_module = subnet_external_network
|
||||||
|
extension_attributes = (subnet_external_network.RESOURCE_NAME,)
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added new extension ``subnet-router:external``. This extension adds a
|
||||||
|
new field to the ``subnet`` resource definition, called
|
||||||
|
``router:external``, that is a boolean that represents if the subnet
|
||||||
|
belongs to an external network. This is the same parameter name used in
|
||||||
|
the external network flag.
|
Loading…
Reference in New Issue