rehome service type api def

This patch rehomes the service type extension's API definition into
neutron_lib.

Change-Id: I301f74d09eb4c0f1d8a0e065403da59e222b78e3
This commit is contained in:
Boden R 2017-12-06 13:47:55 -07:00
parent e0cc5efb74
commit 43fda0fd99
4 changed files with 79 additions and 0 deletions

View File

@ -56,6 +56,7 @@ from neutron_lib.api.definitions import provider_net
from neutron_lib.api.definitions import qos
from neutron_lib.api.definitions import router_availability_zone
from neutron_lib.api.definitions import router_interface_fip
from neutron_lib.api.definitions import servicetype
from neutron_lib.api.definitions import subnet
from neutron_lib.api.definitions import subnet_onboard
from neutron_lib.api.definitions import subnetpool
@ -110,6 +111,7 @@ _ALL_API_DEFINITIONS = {
qos,
router_availability_zone,
router_interface_fip,
servicetype,
subnet,
subnet_onboard,
subnetpool,

View File

@ -0,0 +1,53 @@
# Copyright 2013 OpenStack Foundation.
# 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.
SERVICE_ATTR = 'service_type'
PLUGIN_ATTR = 'plugin'
DRIVER_ATTR = 'driver'
ALIAS = 'service-type'
IS_SHIM_EXTENSION = False
IS_STANDARD_ATTR_EXTENSION = False
NAME = 'Neutron Service Type Management'
API_PREFIX = ''
DESCRIPTION = ("API for retrieving service providers for "
"Neutron advanced services")
UPDATED_TIMESTAMP = '2013-01-20T00:00:00-00:00'
RESOURCE_NAME = 'service_provider'
COLLECTION_NAME = RESOURCE_NAME + 's'
RESOURCE_ATTRIBUTE_MAP = {
COLLECTION_NAME: {
SERVICE_ATTR: {
'allow_post': False,
'allow_put': False,
'is_visible': True
},
'name': {
'allow_post': False,
'allow_put': False,
'is_visible': True
},
'default': {
'allow_post': False,
'allow_put': False,
'is_visible': True
}
}
}
SUB_RESOURCE_ATTRIBUTE_MAP = {}
ACTION_MAP = {}
REQUIRED_EXTENSIONS = []
OPTIONAL_EXTENSIONS = []
ACTION_STATUS = {}

View File

@ -0,0 +1,20 @@
# 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 servicetype
from neutron_lib.tests.unit.api.definitions import base
class ServiceTypeDefinitionTestCase(base.DefinitionBaseTestCase):
extension_module = servicetype
extension_resources = (servicetype.COLLECTION_NAME,)
extension_attributes = ('default', servicetype.SERVICE_ATTR,)

View File

@ -0,0 +1,4 @@
---
features:
- The ``service-type`` extension's API definition is now available in
``neutron_lib.api.definitions.servicetype``.