diff --git a/setup.py b/setup.py index 08db7bd..08499ac 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def read(fname): setuptools.setup( name='siolib', - version='2.0.2', + version='2.0.3', description='ScaleIO API base library', url='https://github.com/codedellemc/python-scaleioclient', license='ASL 2.0', diff --git a/siolib/scaleio.py b/siolib/scaleio.py index f12e918..868bb1c 100644 --- a/siolib/scaleio.py +++ b/siolib/scaleio.py @@ -1105,3 +1105,19 @@ def get_storage_pool_statistics(self, protection_domain, storage_pool, props): stats = req.json()[sp_id] return stats + + def get_configuration(self): + """ + Returns the system, configuration + :return: dict of system properties + """ + + r_uri = '/api/Configuration' + req = self._get(r_uri) + if req.status_code != 200: + raise exceptions.Error('Error retrieving system properties: %s' + % req.json().get('message')) + + props = req.json() + + return props diff --git a/siolib/tests/test_system.py b/siolib/tests/test_system.py index 30efb5c..ede3bdc 100644 --- a/siolib/tests/test_system.py +++ b/siolib/tests/test_system.py @@ -80,3 +80,7 @@ def test_storage_pool_statistics(self): stats = self.scaleio.get_storage_pool_statistics(self.domain, self.pool, requested_stats) self.assertEqual(len(stats), len(requested_stats)) + def test_configuration(self): + props = self.scaleio.get_configuration() + self.assertIsNotNone(props['systemId']) +