1313# License for the specific language governing permissions and limitations
1414# under the License.
1515
16+ """This module is used for the initialization of PowerFlex Client."""
17+
1618from packaging import version
1719
1820from PyPowerFlex import configuration
2830
2931
3032class PowerFlexClient :
33+ """
34+ Client class for interacting with PowerFlex API.
35+
36+ This class initializes the client with the provided configuration and provides
37+ access to the various storage entities available in the PowerFlex system.
38+ """
3139 __slots__ = (
3240 '__is_initialized' ,
3341 'configuration' ,
@@ -82,6 +90,12 @@ def __add_storage_entity(self, attr_name, entity_class):
8290 setattr (self , attr_name , entity_class (self .token , self .configuration ))
8391
8492 def initialize (self ):
93+ """
94+ Initializes the client.
95+
96+ Raises:
97+ PowerFlexClientException: If the PowerFlex API version is lower than 3.0.
98+ """
8599 self .configuration .validate ()
86100 self .__add_storage_entity ('device' , objects .Device )
87101 self .__add_storage_entity ('fault_set' , objects .FaultSet )
@@ -97,12 +111,16 @@ def initialize(self):
97111 self .__add_storage_entity ('system' , objects .System )
98112 self .__add_storage_entity ('volume' , objects .Volume )
99113 self .__add_storage_entity ('utility' , objects .PowerFlexUtility )
100- self .__add_storage_entity ('replication_consistency_group' , objects .ReplicationConsistencyGroup )
114+ self .__add_storage_entity (
115+ 'replication_consistency_group' ,
116+ objects .ReplicationConsistencyGroup )
101117 self .__add_storage_entity ('replication_pair' , objects .ReplicationPair )
102118 self .__add_storage_entity ('service_template' , objects .ServiceTemplate )
103119 self .__add_storage_entity ('managed_device' , objects .ManagedDevice )
104120 self .__add_storage_entity ('deployment' , objects .Deployment )
105- self .__add_storage_entity ('firmware_repository' , objects .FirmwareRepository )
121+ self .__add_storage_entity (
122+ 'firmware_repository' ,
123+ objects .FirmwareRepository )
106124 self .__add_storage_entity ('host' , objects .Host )
107125 utils .init_logger (self .configuration .log_level )
108126 if version .parse (self .system .api_version ()) < version .Version ('3.0' ):
0 commit comments