Add `ProtocolFeaturesSupported` property of the `Root Service`

protocol_features_supported is the information about protocol features
supported by the service.

Story: #2003853
Task: #26649

Change-Id: I5103eabfa56fc049ca0c98bbfc62c82724fcbae9
This commit is contained in:
dnuka 2018-10-01 20:43:20 +05:30
parent 2bdae43029
commit fbdd61100d
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds `Product` and `ProductFeaturesSupported` properties support to
the Redfish `Root Service`

View File

@ -26,6 +26,24 @@ from sushy.resources.system import system
LOG = logging.getLogger(__name__)
class ProtocolFeaturesSupportedField(base.CompositeField):
excerpt_query = base.Field('ExcerptQuery')
"""The excerpt query parameter is supported"""
expand_query = base.Field('ExpandQuery')
"""The expand query parameter is supported"""
filter_query = base.Field('FilterQuery')
"""The filter query parameter is supported"""
only_member_query = base.Field('OnlyMemberQuery')
"""The only query parameter is supported"""
select_query = base.Field('SelectQuery')
"""The select query parameter is supported"""
class Sushy(base.ResourceBase):
identity = base.Field('Id', required=True)
@ -40,6 +58,10 @@ class Sushy(base.ResourceBase):
product = base.Field('Product')
"""The product associated with this Redfish service"""
protocol_features_supported = ProtocolFeaturesSupportedField(
'ProtocolFeaturesSupported')
"""The information about protocol features supported by the service"""
_systems_path = base.Field(['Systems', '@odata.id'])
"""SystemCollection path"""

View File

@ -5,6 +5,13 @@
"RedfishVersion": "1.0.2",
"UUID": "92384634-2938-2342-8820-489239905423",
"Product": "Product",
"ProtocolFeaturesSupported": {
"ExcerptQuery": true,
"ExpandQuery": false,
"FilterQuery": true,
"OnlyMemberQuery": true,
"SelectQuery": false
},
"Systems": {
"@odata.id": "/redfish/v1/Systems"
},

View File

@ -55,6 +55,12 @@ class MainTestCase(base.TestCase):
self.assertEqual('92384634-2938-2342-8820-489239905423',
self.root.uuid)
self.assertEqual('Product', self.root.product)
self.assertTrue(self.root.protocol_features_supported.excerpt_query)
self.assertFalse(self.root.protocol_features_supported.expand_query)
self.assertTrue(self.root.protocol_features_supported.filter_query)
self.assertTrue(
self.root.protocol_features_supported.only_member_query)
self.assertFalse(self.root.protocol_features_supported.select_query)
self.assertEqual('/redfish/v1/Systems', self.root._systems_path)
self.assertEqual('/redfish/v1/Managers', self.root._managers_path)
self.assertEqual('/redfish/v1/SessionService',