diff --git a/api-ref/source/v1/flavors.inc b/api-ref/source/v1/flavors.inc index 163658d0..49b2d079 100644 --- a/api-ref/source/v1/flavors.inc +++ b/api-ref/source/v1/flavors.inc @@ -35,7 +35,6 @@ Response - links: links - description: flavor_description - resources: flavor_resources - - resource_traits: flavor_resource_traits - resource_aggregates: flavor_aggregates - uuid: flavor_uuid - created_at: created_at @@ -71,7 +70,6 @@ Request - name: flavor_name - description: flavor_description - resources: flavor_resources - - resource_traits: flavor_resource_traits - resource_aggregates: flavor_aggregates - is_public: flavor_is_public_not_required - disabled: flavor_disabled @@ -90,7 +88,6 @@ Response - links: links - description: flavor_description - resources: flavor_resources - - resource_traits: flavor_resource_traits - resource_aggregates: flavor_aggregates - uuid: flavor_uuid - created_at: created_at @@ -142,7 +139,6 @@ Response - links: links - description: flavor_description - resources: flavor_resources - - resource_traits: flavor_resource_traits - resource_aggregates: flavor_aggregates - uuid: flavor_uuid - created_at: created_at @@ -182,7 +178,6 @@ Response - links: links - description: flavor_description - resources: flavor_resources - - resource_traits: flavor_resource_traits - resource_aggregates: flavor_aggregates - uuid: flavor_uuid - created_at: created_at diff --git a/api-ref/source/v1/parameters.yaml b/api-ref/source/v1/parameters.yaml index 036c9243..fb11d9ed 100644 --- a/api-ref/source/v1/parameters.yaml +++ b/api-ref/source/v1/parameters.yaml @@ -289,13 +289,6 @@ flavor_name: in: body required: true type: string -flavor_resource_traits: - description: | - A dict of key and value pairs associate with the flavor including the resource - name and the qualities. - in: body - required: false - type: object flavor_resources: description: | A dict of key and value pairs associate with the flavor including the resource diff --git a/api-ref/source/v1/samples/flavors/flavor-create-post-req.json b/api-ref/source/v1/samples/flavors/flavor-create-post-req.json index c9866463..a0318e14 100644 --- a/api-ref/source/v1/samples/flavors/flavor-create-post-req.json +++ b/api-ref/source/v1/samples/flavors/flavor-create-post-req.json @@ -4,9 +4,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, diff --git a/api-ref/source/v1/samples/flavors/flavor-create-post-resp.json b/api-ref/source/v1/samples/flavors/flavor-create-post-resp.json index 240d98b9..139add6e 100644 --- a/api-ref/source/v1/samples/flavors/flavor-create-post-resp.json +++ b/api-ref/source/v1/samples/flavors/flavor-create-post-resp.json @@ -13,9 +13,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, diff --git a/api-ref/source/v1/samples/flavors/flavor-get-resp.json b/api-ref/source/v1/samples/flavors/flavor-get-resp.json index 16bacd20..3e4271b5 100644 --- a/api-ref/source/v1/samples/flavors/flavor-get-resp.json +++ b/api-ref/source/v1/samples/flavors/flavor-get-resp.json @@ -13,9 +13,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, diff --git a/api-ref/source/v1/samples/flavors/flavor-update-put-resp.json b/api-ref/source/v1/samples/flavors/flavor-update-put-resp.json index 644be357..35d3c0ff 100644 --- a/api-ref/source/v1/samples/flavors/flavor-update-put-resp.json +++ b/api-ref/source/v1/samples/flavors/flavor-update-put-resp.json @@ -13,9 +13,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, diff --git a/api-ref/source/v1/samples/flavors/flavors-list-resp.json b/api-ref/source/v1/samples/flavors/flavors-list-resp.json index 7ad83fdd..310a483d 100644 --- a/api-ref/source/v1/samples/flavors/flavors-list-resp.json +++ b/api-ref/source/v1/samples/flavors/flavors-list-resp.json @@ -15,9 +15,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, @@ -43,9 +40,6 @@ "resources": { "CUSTOM_BAREMETAL_GOLD": 1 }, - "resource_traits": { - "CUSTOM_BAREMETAL_GOLD": "FPGA" - }, "resource_aggregates": { "high_mem": "true" }, diff --git a/mogan/api/controllers/v1/flavors.py b/mogan/api/controllers/v1/flavors.py index 3af45b67..ec1c79ce 100644 --- a/mogan/api/controllers/v1/flavors.py +++ b/mogan/api/controllers/v1/flavors.py @@ -69,9 +69,6 @@ class Flavor(base.APIBase): resources = {wtypes.text: types.jsontype} """The resources of the flavor""" - resource_traits = {wtypes.text: types.jsontype} - """The resource traits of the flavor""" - resource_aggregates = {wtypes.text: types.jsontype} """The resource aggregates of the flavor""" @@ -112,7 +109,6 @@ class FlavorPatchType(types.JsonPatchType): def internal_attrs(): defaults = types.JsonPatchType.internal_attrs() return defaults + ['/description', '/resources', - '/resource_traits', '/resource_aggregates'] diff --git a/mogan/api/controllers/v1/schemas/flavor.py b/mogan/api/controllers/v1/schemas/flavor.py index 25a97c70..5ee9cba9 100644 --- a/mogan/api/controllers/v1/schemas/flavor.py +++ b/mogan/api/controllers/v1/schemas/flavor.py @@ -23,7 +23,6 @@ create_flavor = { 'name': parameter_types.name, 'description': {'type': 'string', 'minLength': 1}, 'resources': parameter_types.resources, - 'resource_traits': parameter_types.resource_traits, 'resource_aggregates': parameter_types.metadata, 'is_public': parameter_types.boolean, 'disabled': parameter_types.boolean, diff --git a/mogan/api/validation/parameter_types.py b/mogan/api/validation/parameter_types.py index 2125a5d4..eace15f5 100644 --- a/mogan/api/validation/parameter_types.py +++ b/mogan/api/validation/parameter_types.py @@ -92,17 +92,6 @@ resources = { } -resource_traits = { - 'type': 'object', - 'patternProperties': { - '^[a-zA-Z0-9-_:.]{1,255}$': { - 'type': 'string', 'maxLength': 255 - } - }, - 'additionalProperties': False -} - - mac_address = { 'type': 'string', 'pattern': '^([0-9a-fA-F]{2})(:[0-9a-fA-F]{2}){5}$' diff --git a/mogan/tests/functional/api/v1/test_flavors.py b/mogan/tests/functional/api/v1/test_flavors.py index a4c2f34e..656e3cbc 100644 --- a/mogan/tests/functional/api/v1/test_flavors.py +++ b/mogan/tests/functional/api/v1/test_flavors.py @@ -41,7 +41,6 @@ class TestFlavor(v1_test.APITestV1): def test_flavor_post(self): body = {"name": "test", "description": "just test", "resources": {"CUSTOM_GOLD": 1}, - "resource_traits": {"CUSTOM_GOLD": "FPGA"}, "resource_aggregates": {"high_mem": "true"}} resp = self.post_json( '/flavors', body, headers=self.headers, status=201) @@ -50,7 +49,6 @@ class TestFlavor(v1_test.APITestV1): self.assertEqual('just test', resp['description']) self.assertTrue(resp['is_public']) self.assertEqual({'CUSTOM_GOLD': 1}, resp['resources']) - self.assertEqual({'CUSTOM_GOLD': 'FPGA'}, resp['resource_traits']) self.assertEqual({'high_mem': 'true'}, resp['resource_aggregates']) self.assertIn('uuid', resp) self.assertIn('links', resp) diff --git a/mogan/tests/tempest/api/base.py b/mogan/tests/tempest/api/base.py index 8800714e..1d30ed39 100644 --- a/mogan/tests/tempest/api/base.py +++ b/mogan/tests/tempest/api/base.py @@ -56,8 +56,7 @@ class BaseBaremetalComputeTest(tempest.test.BaseTestCase): resource_class = CONF.baremetal_compute_plugin.baremetal_resource_class body = {"name": data_utils.rand_name('tempest-flavor'), "description": "flavor to be used by tempest", - 'is_public': True, 'resources': {resource_class: 1}, - 'resource_traits': {resource_class: 'foo'}} + 'is_public': True, 'resources': {resource_class: 1}} tempest_flavor = cls.baremetal_compute_client.create_flavor(**body) return tempest_flavor['uuid'] diff --git a/mogan/tests/tempest/api/test_flavors.py b/mogan/tests/tempest/api/test_flavors.py index 702cfaf7..ced1b599 100644 --- a/mogan/tests/tempest/api/test_flavors.py +++ b/mogan/tests/tempest/api/test_flavors.py @@ -53,7 +53,6 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest): body = {"name": 'mogan_flavor_create', "description": "mogan flavor description", 'is_public': True, 'resources': {'gold': 1}, - 'resource_traits': {'gold': 'foo'}, 'resource_aggregates': {'high_mem': 'true'}} resp = self.baremetal_compute_client.create_flavor(**body) self.assertEqual('mogan_flavor_create', resp['name']) @@ -62,7 +61,6 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest): self.assertTrue(resp['is_public']) self.assertFalse(resp['disabled']) self.assertEqual({'gold': 1}, resp['resources']) - self.assertEqual({'gold': 'foo'}, resp['resource_traits']) self.assertEqual({'high_mem': 'true'}, resp['resource_aggregates']) self.assertIn('uuid', resp) self.assertIn('links', resp) @@ -77,7 +75,6 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest): self.assertTrue(resp['is_public']) self.assertFalse(resp['disabled']) self.assertEqual({'CUSTOM_GOLD': 1}, resp['resources']) - self.assertEqual({}, resp['resource_traits']) self.assertIn('uuid', resp) self.assertIn('links', resp) diff --git a/mogan/tests/unit/api/v1/test_flavor.py b/mogan/tests/unit/api/v1/test_flavor.py index 101936ea..f453e1c6 100644 --- a/mogan/tests/unit/api/v1/test_flavor.py +++ b/mogan/tests/unit/api/v1/test_flavor.py @@ -34,7 +34,6 @@ class TestFlavorAuthorization(v1_test.APITestV1): self.assertIn('description', resp) self.assertIn('links', resp) self.assertNotIn('resources', resp) - self.assertNotIn('resource_traits', resp) def test_flavor_get_one_by_admin(self): # role is admin, he can get everything. @@ -47,4 +46,3 @@ class TestFlavorAuthorization(v1_test.APITestV1): self.assertIn('description', resp) self.assertIn('links', resp) self.assertIn('resources', resp) - self.assertIn('resource_traits', resp)