Browse Source

Reformat all files with black auto formatter

Change-Id: I037b6b4a8d08862893060c5fe85865e9e11ac486
tags/1.2.0^0
Lin Yang 5 days ago
parent
commit
609075345c
95 changed files with 4990 additions and 3829 deletions
  1. 1
    1
      rsd_lib/__init__.py
  2. 3
    3
      rsd_lib/common.py
  3. 24
    31
      rsd_lib/constants.py
  4. 45
    21
      rsd_lib/main.py
  5. 80
    83
      rsd_lib/resources/v2_1/types.py
  6. 31
    23
      rsd_lib/resources/v2_3/ethernet_switch/ethernet_switch.py
  7. 95
    68
      rsd_lib/resources/v2_3/fabric/endpoint.py
  8. 64
    68
      rsd_lib/resources/v2_3/fabric/endpoint_schemas.py
  9. 16
    13
      rsd_lib/resources/v2_3/fabric/fabric.py
  10. 8
    8
      rsd_lib/resources/v2_3/fabric/zone.py
  11. 0
    2
      rsd_lib/resources/v2_3/manager/manager.py
  12. 9
    8
      rsd_lib/resources/v2_3/node/attach_action_info.py
  13. 107
    80
      rsd_lib/resources/v2_3/node/node.py
  14. 204
    179
      rsd_lib/resources/v2_3/node/schemas.py
  15. 56
    50
      rsd_lib/resources/v2_3/storage_service/drive.py
  16. 21
    19
      rsd_lib/resources/v2_3/storage_service/drive_metrics.py
  17. 35
    27
      rsd_lib/resources/v2_3/storage_service/storage_pool.py
  18. 24
    17
      rsd_lib/resources/v2_3/storage_service/storage_service.py
  19. 115
    84
      rsd_lib/resources/v2_3/storage_service/volume.py
  20. 6
    5
      rsd_lib/resources/v2_3/storage_service/volume_metrics.py
  21. 31
    39
      rsd_lib/resources/v2_3/storage_service/volume_schemas.py
  22. 9
    7
      rsd_lib/resources/v2_3/system/ethernet_interface.py
  23. 0
    2
      rsd_lib/resources/v2_3/system/system.py
  24. 98
    71
      rsd_lib/resources/v2_4/fabric/endpoint.py
  25. 113
    110
      rsd_lib/resources/v2_4/fabric/endpoint_schemas.py
  26. 5
    5
      rsd_lib/resources/v2_4/fabric/fabric.py
  27. 86
    59
      rsd_lib/resources/v2_4/node/node.py
  28. 237
    205
      rsd_lib/resources/v2_4/node/schemas.py
  29. 4
    4
      rsd_lib/resources/v2_4/storage_service/storage_service.py
  30. 50
    38
      rsd_lib/resources/v2_4/system/processor.py
  31. 0
    2
      rsd_lib/resources/v2_4/system/system.py
  32. 0
    2
      rsd_lib/tests/unit/fakes/request_fakes.py
  33. 1
    1
      rsd_lib/tests/unit/resources/v2_1/chassis/test_chassis.py
  34. 1
    1
      rsd_lib/tests/unit/resources/v2_1/chassis/test_power_zone.py
  35. 1
    1
      rsd_lib/tests/unit/resources/v2_1/chassis/test_thermal.py
  36. 1
    1
      rsd_lib/tests/unit/resources/v2_1/chassis/test_thermal_zone.py
  37. 2
    2
      rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch.py
  38. 2
    2
      rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_acl.py
  39. 3
    3
      rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_acl_rule.py
  40. 1
    1
      rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_vlan_network_interface.py
  41. 1
    1
      rsd_lib/tests/unit/resources/v2_1/event_service/test_event_destination.py
  42. 1
    1
      rsd_lib/tests/unit/resources/v2_1/event_service/test_event_service.py
  43. 3
    3
      rsd_lib/tests/unit/resources/v2_1/fabric/test_endpoint.py
  44. 13
    13
      rsd_lib/tests/unit/resources/v2_1/fabric/test_fabric.py
  45. 2
    2
      rsd_lib/tests/unit/resources/v2_1/fabric/test_port.py
  46. 7
    7
      rsd_lib/tests/unit/resources/v2_1/fabric/test_switch.py
  47. 2
    2
      rsd_lib/tests/unit/resources/v2_1/fabric/test_zone.py
  48. 3
    3
      rsd_lib/tests/unit/resources/v2_1/manager/test_manager.py
  49. 1
    1
      rsd_lib/tests/unit/resources/v2_1/node/test_node.py
  50. 3
    3
      rsd_lib/tests/unit/resources/v2_1/storage_service/test_storage_service.py
  51. 1
    1
      rsd_lib/tests/unit/resources/v2_1/system/test_memory.py
  52. 2
    2
      rsd_lib/tests/unit/resources/v2_1/system/test_network_interface.py
  53. 1
    1
      rsd_lib/tests/unit/resources/v2_1/system/test_pcie_device.py
  54. 1
    1
      rsd_lib/tests/unit/resources/v2_1/system/test_pcie_function.py
  55. 2
    2
      rsd_lib/tests/unit/resources/v2_1/system/test_storage.py
  56. 1
    1
      rsd_lib/tests/unit/resources/v2_1/task/test_task.py
  57. 4
    4
      rsd_lib/tests/unit/resources/v2_1/test_rsdlib_v2_1.py
  58. 3
    3
      rsd_lib/tests/unit/resources/v2_2/ethernet_switch/test_ethernet_switch.py
  59. 1
    1
      rsd_lib/tests/unit/resources/v2_2/ethernet_switch/test_ethernet_switch_metrics.py
  60. 1
    1
      rsd_lib/tests/unit/resources/v2_2/node/test_node.py
  61. 4
    4
      rsd_lib/tests/unit/resources/v2_2/system/test_memory.py
  62. 1
    1
      rsd_lib/tests/unit/resources/v2_2/system/test_memory_metrics.py
  63. 3
    3
      rsd_lib/tests/unit/resources/v2_2/system/test_processor.py
  64. 1
    1
      rsd_lib/tests/unit/resources/v2_2/system/test_processor_metrics.py
  65. 4
    4
      rsd_lib/tests/unit/resources/v2_2/system/test_system.py
  66. 1
    1
      rsd_lib/tests/unit/resources/v2_2/telemetry_service/test_metric_definition.py
  67. 1
    1
      rsd_lib/tests/unit/resources/v2_2/telemetry_service/test_metric_report.py
  68. 3
    4
      rsd_lib/tests/unit/resources/v2_2/test_rsdlib_v2_2.py
  69. 1
    1
      rsd_lib/tests/unit/resources/v2_2/update_service/test_update_service.py
  70. 150
    111
      rsd_lib/tests/unit/resources/v2_3/ethernet_switch/test_ethernet_switch.py
  71. 241
    192
      rsd_lib/tests/unit/resources/v2_3/fabric/test_endpoint.py
  72. 80
    65
      rsd_lib/tests/unit/resources/v2_3/fabric/test_fabric.py
  73. 99
    52
      rsd_lib/tests/unit/resources/v2_3/fabric/test_zone.py
  74. 61
    39
      rsd_lib/tests/unit/resources/v2_3/manager/test_manager.py
  75. 27
    20
      rsd_lib/tests/unit/resources/v2_3/node/test_attach_action_info.py
  76. 372
    269
      rsd_lib/tests/unit/resources/v2_3/node/test_node.py
  77. 79
    65
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_drive.py
  78. 14
    10
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_drive_metrics.py
  79. 149
    94
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_storage_pool.py
  80. 163
    107
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_storage_service.py
  81. 223
    160
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_volume.py
  82. 15
    11
      rsd_lib/tests/unit/resources/v2_3/storage_service/test_volume_metrics.py
  83. 87
    55
      rsd_lib/tests/unit/resources/v2_3/system/test_ethernet_interface.py
  84. 58
    38
      rsd_lib/tests/unit/resources/v2_3/system/test_system.py
  85. 137
    98
      rsd_lib/tests/unit/resources/v2_3/test_rsdlib_v2_3.py
  86. 193
    183
      rsd_lib/tests/unit/resources/v2_4/fabric/test_endpoint.py
  87. 80
    65
      rsd_lib/tests/unit/resources/v2_4/fabric/test_fabric.py
  88. 555
    415
      rsd_lib/tests/unit/resources/v2_4/node/test_node.py
  89. 69
    48
      rsd_lib/tests/unit/resources/v2_4/storage_service/test_storage_service.py
  90. 217
    129
      rsd_lib/tests/unit/resources/v2_4/system/test_processor.py
  91. 49
    38
      rsd_lib/tests/unit/resources/v2_4/system/test_system.py
  92. 134
    93
      rsd_lib/tests/unit/resources/v2_4/test_rsdlib_v2_4.py
  93. 30
    19
      rsd_lib/tests/unit/test_main.py
  94. 38
    28
      rsd_lib/tests/unit/test_utils.py
  95. 9
    6
      rsd_lib/utils.py

+ 1
- 1
rsd_lib/__init__.py View File

@@ -15,4 +15,4 @@
15 15
 
16 16
 from rsd_lib.main import RSDLib
17 17
 
18
-__all__ = ('RSDLib',)
18
+__all__ = ("RSDLib",)

+ 3
- 3
rsd_lib/common.py View File

@@ -19,11 +19,11 @@ from sushy.resources import base
19 19
 class StatusField(base.CompositeField):
20 20
     """This Field describes the status of a resource and its children."""
21 21
 
22
-    health = base.Field('Health')
22
+    health = base.Field("Health")
23 23
     """Represents health of resource w/o considering its dependent resources"""
24 24
 
25
-    health_rollup = base.Field('HealthRollup')
25
+    health_rollup = base.Field("HealthRollup")
26 26
     """Represents health state of resource and its dependent resources"""
27 27
 
28
-    state = base.Field('State')
28
+    state = base.Field("State")
29 29
     """Indicates the known state of the resource, such as if it is enabled."""

+ 24
- 31
rsd_lib/constants.py View File

@@ -14,40 +14,33 @@
14 14
 #    under the License.
15 15
 
16 16
 RESET_TYPE_VALUE = [
17
-    'On',
18
-    'ForceOff',
19
-    'GracefulShutdown',
20
-    'GracefulRestart',
21
-    'ForceRestart',
22
-    'Nmi',
23
-    'ForceOn',
24
-    'PushPowerButton'
17
+    "On",
18
+    "ForceOff",
19
+    "GracefulShutdown",
20
+    "GracefulRestart",
21
+    "ForceRestart",
22
+    "Nmi",
23
+    "ForceOn",
24
+    "PushPowerButton",
25 25
 ]
26 26
 
27 27
 BOOT_SOURCE_TARGET_VALUE = [
28
-    'None',
29
-    'Pxe',
30
-    'Floppy',
31
-    'Cd',
32
-    'Usb',
33
-    'Hdd',
34
-    'BiosSetup',
35
-    'Utilities',
36
-    'Diags',
37
-    'SDCard',
38
-    'UefiTarget',
39
-    'UefiShell',
40
-    'UefiHttp',
41
-    "RemoteDrive"
28
+    "None",
29
+    "Pxe",
30
+    "Floppy",
31
+    "Cd",
32
+    "Usb",
33
+    "Hdd",
34
+    "BiosSetup",
35
+    "Utilities",
36
+    "Diags",
37
+    "SDCard",
38
+    "UefiTarget",
39
+    "UefiShell",
40
+    "UefiHttp",
41
+    "RemoteDrive",
42 42
 ]
43 43
 
44
-BOOT_SOURCE_ENABLED_VALUE = {
45
-    'Once',
46
-    'Continuous',
47
-    'Disabled'
48
-}
44
+BOOT_SOURCE_ENABLED_VALUE = {"Once", "Continuous", "Disabled"}
49 45
 
50
-BOOT_SOURCE_MODE_VALUE = {
51
-    'Legacy',
52
-    'UEFI'
53
-}
46
+BOOT_SOURCE_MODE_VALUE = {"Legacy", "UEFI"}

+ 45
- 21
rsd_lib/main.py View File

@@ -26,15 +26,22 @@ from rsd_lib.resources import v2_4
26 26
 
27 27
 class RSDLib(base.ResourceBase):
28 28
 
29
-    _redfish_version = base.Field(['RedfishVersion'], required=True)
29
+    _redfish_version = base.Field(["RedfishVersion"], required=True)
30 30
     """FabricCollection path"""
31 31
 
32
-    _rsd_api_version = base.Field(['Oem', 'Intel_RackScale', 'ApiVersion'],
33
-                                  required=True)
32
+    _rsd_api_version = base.Field(
33
+        ["Oem", "Intel_RackScale", "ApiVersion"], required=True
34
+    )
34 35
     """RSD API version"""
35 36
 
36
-    def __init__(self, base_url, username=None, password=None,
37
-                 root_prefix='/redfish/v1/', verify=True):
37
+    def __init__(
38
+        self,
39
+        base_url,
40
+        username=None,
41
+        password=None,
42
+        root_prefix="/redfish/v1/",
43
+        verify=True,
44
+    ):
38 45
         """A class representing a RootService
39 46
 
40 47
         :param base_url: The base URL to the Redfish controller. It
@@ -55,7 +62,8 @@ class RSDLib(base.ResourceBase):
55 62
         self._root_prefix = root_prefix
56 63
         super(RSDLib, self).__init__(
57 64
             connector.Connector(base_url, username, password, verify),
58
-            path=self._root_prefix)
65
+            path=self._root_prefix,
66
+        )
59 67
 
60 68
     def factory(self):
61 69
         """Return different resource module according to RSD API Version
@@ -66,24 +74,40 @@ class RSDLib(base.ResourceBase):
66 74
         if rsd_version < version.StrictVersion("2.2.0"):
67 75
             # Use the interface of RSD API 2.1.0 to interact with RSD 2.1.0 and
68 76
             # all previous version.
69
-            return v2_1.RSDLibV2_1(self._conn, self._root_prefix,
70
-                                   redfish_version=self._redfish_version)
71
-        elif version.StrictVersion("2.2.0") <= rsd_version \
72
-            and rsd_version < version.StrictVersion("2.3.0"):
77
+            return v2_1.RSDLibV2_1(
78
+                self._conn,
79
+                self._root_prefix,
80
+                redfish_version=self._redfish_version,
81
+            )
82
+        elif version.StrictVersion(
83
+            "2.2.0"
84
+        ) <= rsd_version and rsd_version < version.StrictVersion("2.3.0"):
73 85
             # Specific interface for RSD 2.2 version
74
-            return v2_2.RSDLibV2_2(self._conn, self._root_prefix,
75
-                                   redfish_version=self._redfish_version)
76
-        elif version.StrictVersion("2.3.0") <= rsd_version \
77
-            and rsd_version < version.StrictVersion("2.4.0"):
86
+            return v2_2.RSDLibV2_2(
87
+                self._conn,
88
+                self._root_prefix,
89
+                redfish_version=self._redfish_version,
90
+            )
91
+        elif version.StrictVersion(
92
+            "2.3.0"
93
+        ) <= rsd_version and rsd_version < version.StrictVersion("2.4.0"):
78 94
             # Specific interface for RSD 2.3 version
79
-            return v2_3.RSDLibV2_3(self._conn, self._root_prefix,
80
-                                   redfish_version=self._redfish_version)
81
-        elif version.StrictVersion("2.4.0") <= rsd_version \
82
-            and rsd_version < version.StrictVersion("2.5.0"):
95
+            return v2_3.RSDLibV2_3(
96
+                self._conn,
97
+                self._root_prefix,
98
+                redfish_version=self._redfish_version,
99
+            )
100
+        elif version.StrictVersion(
101
+            "2.4.0"
102
+        ) <= rsd_version and rsd_version < version.StrictVersion("2.5.0"):
83 103
             # Specific interface for RSD 2.4 version
84
-            return v2_4.RSDLibV2_4(self._conn, self._root_prefix,
85
-                                   redfish_version=self._redfish_version)
104
+            return v2_4.RSDLibV2_4(
105
+                self._conn,
106
+                self._root_prefix,
107
+                redfish_version=self._redfish_version,
108
+            )
86 109
         else:
87 110
             raise NotImplementedError(
88 111
                 "The rsd-lib library doesn't support RSD API "
89
-                "version {0}.".format(self._rsd_api_version))
112
+                "version {0}.".format(self._rsd_api_version)
113
+            )

+ 80
- 83
rsd_lib/resources/v2_1/types.py View File

@@ -68,96 +68,93 @@ from rsd_lib.resources.v2_1.task import task
68 68
 from rsd_lib.resources.v2_1.task import task_service
69 69
 
70 70
 RESOURCE_CLASS = {
71
-    'Chassis': chassis.Chassis,
72
-    'ChassisCollection': chassis.ChassisCollection,
73
-    'ComposedNode': node.Node,
74
-    'ComposedNodeCollection': node.NodeCollection,
75
-    'ComputerSystem': system.System,
76
-    'ComputerSystemCollection': system.SystemCollection,
77
-    'Drive': drive.Drive,
78
-    'Endpoint': endpoint.Endpoint,
79
-    'EndpointCollection': endpoint.EndpointCollection,
80
-    'EthernetInterface': ethernet_interface.EthernetInterface,
81
-    'EthernetInterfaceCollection':
71
+    "Chassis": chassis.Chassis,
72
+    "ChassisCollection": chassis.ChassisCollection,
73
+    "ComposedNode": node.Node,
74
+    "ComposedNodeCollection": node.NodeCollection,
75
+    "ComputerSystem": system.System,
76
+    "ComputerSystemCollection": system.SystemCollection,
77
+    "Drive": drive.Drive,
78
+    "Endpoint": endpoint.Endpoint,
79
+    "EndpointCollection": endpoint.EndpointCollection,
80
+    "EthernetInterface": ethernet_interface.EthernetInterface,
81
+    "EthernetInterfaceCollection":
82 82
         ethernet_interface.EthernetInterfaceCollection,
83
-    'EthernetSwitch': ethernet_switch.EthernetSwitch,
84
-    'EthernetSwitchACL': ethernet_switch_acl.EthernetSwitchACL,
85
-    'EthernetSwitchACLCollection':
83
+    "EthernetSwitch": ethernet_switch.EthernetSwitch,
84
+    "EthernetSwitchACL": ethernet_switch_acl.EthernetSwitchACL,
85
+    "EthernetSwitchACLCollection":
86 86
         ethernet_switch_acl.EthernetSwitchACLCollection,
87
-    'EthernetSwitchACLRule': ethernet_switch_acl_rule.EthernetSwitchACLRule,
88
-    'EthernetSwitchACLRuleCollection':
87
+    "EthernetSwitchACLRule": ethernet_switch_acl_rule.EthernetSwitchACLRule,
88
+    "EthernetSwitchACLRuleCollection":
89 89
         ethernet_switch_acl_rule.EthernetSwitchACLRuleCollection,
90
-    'EthernetSwitchCollection': ethernet_switch.EthernetSwitchCollection,
91
-    'EthernetSwitchPort': ethernet_switch_port.EthernetSwitchPort,
92
-    'EthernetSwitchPortCollection':
90
+    "EthernetSwitchCollection": ethernet_switch.EthernetSwitchCollection,
91
+    "EthernetSwitchPort": ethernet_switch_port.EthernetSwitchPort,
92
+    "EthernetSwitchPortCollection":
93 93
         ethernet_switch_port.EthernetSwitchPortCollection,
94
-    'EthernetSwitchStaticMAC':
94
+    "EthernetSwitchStaticMAC":
95 95
         ethernet_switch_static_mac.EthernetSwitchStaticMAC,
96
-    'EthernetSwitchStaticMACCollection':
96
+    "EthernetSwitchStaticMACCollection":
97 97
         ethernet_switch_static_mac.EthernetSwitchStaticMACCollection,
98
-    'EventDestination': event_destination.EventDestination,
99
-    'EventDestinationCollection': event_destination.EventDestinationCollection,
100
-    'EventService': event_service.EventService,
101
-    'Fabric': fabric.Fabric,
102
-    'FabricCollection': fabric.FabricCollection,
103
-    'LogEntry': log_entry.LogEntry,
104
-    'LogEntryCollection': log_entry.LogEntryCollection,
105
-    'LogService': log_service.LogService,
106
-    'LogServiceCollection': log_service.LogServiceCollection,
107
-    'LogicalDrive': logical_drive.LogicalDrive,
108
-    'LogicalDriveCollection': logical_drive.LogicalDriveCollection,
109
-    'Manager': manager.Manager,
110
-    'ManagerCollection': manager.ManagerCollection,
111
-    'ManagerNetworkProtocol': manager_network_protocol.ManagerNetworkProtocol,
112
-    'Memory': memory.Memory,
113
-    'MemoryCollection': memory.MemoryCollection,
114
-    'MessageRegistryFile': message_registry_file.MessageRegistryFile,
115
-    'MessageRegistryFileCollection':
98
+    "EventDestination": event_destination.EventDestination,
99
+    "EventDestinationCollection": event_destination.EventDestinationCollection,
100
+    "EventService": event_service.EventService,
101
+    "Fabric": fabric.Fabric,
102
+    "FabricCollection": fabric.FabricCollection,
103
+    "LogEntry": log_entry.LogEntry,
104
+    "LogEntryCollection": log_entry.LogEntryCollection,
105
+    "LogService": log_service.LogService,
106
+    "LogServiceCollection": log_service.LogServiceCollection,
107
+    "LogicalDrive": logical_drive.LogicalDrive,
108
+    "LogicalDriveCollection": logical_drive.LogicalDriveCollection,
109
+    "Manager": manager.Manager,
110
+    "ManagerCollection": manager.ManagerCollection,
111
+    "ManagerNetworkProtocol": manager_network_protocol.ManagerNetworkProtocol,
112
+    "Memory": memory.Memory,
113
+    "MemoryCollection": memory.MemoryCollection,
114
+    "MessageRegistryFile": message_registry_file.MessageRegistryFile,
115
+    "MessageRegistryFileCollection":
116 116
         message_registry_file.MessageRegistryFileCollection,
117
-    'NetworkDeviceFunction': network_device_function.NetworkDeviceFunction,
118
-    'NetworkDeviceFunctionCollection':
117
+    "NetworkDeviceFunction": network_device_function.NetworkDeviceFunction,
118
+    "NetworkDeviceFunctionCollection":
119 119
         network_device_function.NetworkDeviceFunctionCollection,
120
-    'NetworkInterface': network_interface.NetworkInterface,
121
-    'NetworkInterfaceCollection': network_interface.NetworkInterfaceCollection,
122
-    'PCIeDevice': pcie_device.PCIeDevice,
123
-    'PCIeFunction': pcie_function.PCIeFunction,
124
-    'PhysicalDrive': physical_drive.PhysicalDrive,
125
-    'PhysicalDriveCollection': physical_drive.PhysicalDriveCollection,
126
-    'Port': port.Port,
127
-    'PortCollection': port.PortCollection,
128
-    'Power': power.Power,
129
-    'PowerZone': power_zone.PowerZone,
130
-    'PowerZoneCollection': power_zone.PowerZoneCollection,
131
-    'Processor': processor.Processor,
132
-    'ProcessorCollection': processor.ProcessorCollection,
133
-    'RemoteTarget': remote_target.RemoteTarget,
134
-    'RemoteTargetCollection':
135
-        remote_target.RemoteTargetCollection,
136
-    'SerialInterface': serial_interface.SerialInterface,
137
-    'SerialInterfaceCollection': serial_interface.SerialInterfaceCollection,
138
-    'SimpleStorage': simple_storage.SimpleStorage,
139
-    'SimpleStorageCollection': simple_storage.SimpleStorageCollection,
140
-    'Storage': storage.Storage,
141
-    'StorageCollection': storage.StorageCollection,
142
-    'StorageService': storage_service.StorageService,
143
-    'StorageServiceCollection': storage_service.StorageServiceCollection,
144
-    'Switch': switch.Switch,
145
-    'SwitchCollection': switch.SwitchCollection,
146
-    'Task': task.Task,
147
-    'TaskCollection': task.TaskCollection,
148
-    'TaskService': task_service.TaskService,
149
-    'Thermal': thermal.Thermal,
150
-    'ThermalZone': thermal_zone.ThermalZone,
151
-    'ThermalZoneCollection':
152
-        thermal_zone.ThermalZoneCollection,
153
-    'VLanNetworkInterface':
154
-        vlan_network_interface.VLanNetworkInterface,
155
-    'VLanNetworkInterfaceCollection':
120
+    "NetworkInterface": network_interface.NetworkInterface,
121
+    "NetworkInterfaceCollection": network_interface.NetworkInterfaceCollection,
122
+    "PCIeDevice": pcie_device.PCIeDevice,
123
+    "PCIeFunction": pcie_function.PCIeFunction,
124
+    "PhysicalDrive": physical_drive.PhysicalDrive,
125
+    "PhysicalDriveCollection": physical_drive.PhysicalDriveCollection,
126
+    "Port": port.Port,
127
+    "PortCollection": port.PortCollection,
128
+    "Power": power.Power,
129
+    "PowerZone": power_zone.PowerZone,
130
+    "PowerZoneCollection": power_zone.PowerZoneCollection,
131
+    "Processor": processor.Processor,
132
+    "ProcessorCollection": processor.ProcessorCollection,
133
+    "RemoteTarget": remote_target.RemoteTarget,
134
+    "RemoteTargetCollection": remote_target.RemoteTargetCollection,
135
+    "SerialInterface": serial_interface.SerialInterface,
136
+    "SerialInterfaceCollection": serial_interface.SerialInterfaceCollection,
137
+    "SimpleStorage": simple_storage.SimpleStorage,
138
+    "SimpleStorageCollection": simple_storage.SimpleStorageCollection,
139
+    "Storage": storage.Storage,
140
+    "StorageCollection": storage.StorageCollection,
141
+    "StorageService": storage_service.StorageService,
142
+    "StorageServiceCollection": storage_service.StorageServiceCollection,
143
+    "Switch": switch.Switch,
144
+    "SwitchCollection": switch.SwitchCollection,
145
+    "Task": task.Task,
146
+    "TaskCollection": task.TaskCollection,
147
+    "TaskService": task_service.TaskService,
148
+    "Thermal": thermal.Thermal,
149
+    "ThermalZone": thermal_zone.ThermalZone,
150
+    "ThermalZoneCollection": thermal_zone.ThermalZoneCollection,
151
+    "VLanNetworkInterface": vlan_network_interface.VLanNetworkInterface,
152
+    "VLanNetworkInterfaceCollection":
156 153
         vlan_network_interface.VLanNetworkInterfaceCollection,
157
-    'VirtualMedia': virtual_media.VirtualMedia,
158
-    'VirtualMediaCollection': virtual_media.VirtualMediaCollection,
159
-    'Volume': volume.Volume,
160
-    'VolumeCollection': volume.VolumeCollection,
161
-    'Zone': zone.Zone,
162
-    'ZoneCollection': zone.ZoneCollection
154
+    "VirtualMedia": virtual_media.VirtualMedia,
155
+    "VirtualMediaCollection": virtual_media.VirtualMediaCollection,
156
+    "Volume": volume.Volume,
157
+    "VolumeCollection": volume.VolumeCollection,
158
+    "Zone": zone.Zone,
159
+    "ZoneCollection": zone.ZoneCollection,
163 160
 }

+ 31
- 23
rsd_lib/resources/v2_3/ethernet_switch/ethernet_switch.py View File

@@ -26,80 +26,88 @@ LOG = logging.getLogger(__name__)
26 26
 
27 27
 
28 28
 class ClassToPriorityMappingField(base.ListField):
29
-    priority = base.Field('Priority', adapter=rsd_lib_utils.num_or_none)
29
+    priority = base.Field("Priority", adapter=rsd_lib_utils.num_or_none)
30 30
 
31 31
     traffic_class = base.Field(
32
-        'TrafficClass', adapter=rsd_lib_utils.num_or_none)
32
+        "TrafficClass", adapter=rsd_lib_utils.num_or_none
33
+    )
33 34
 
34 35
 
35 36
 class PriorityFlowControlField(base.CompositeField):
36
-    enabled = base.Field('Enabled', adapter=bool)
37
+    enabled = base.Field("Enabled", adapter=bool)
37 38
 
38
-    lossless_priorities = base.Field('LosslessPriorities')
39
+    lossless_priorities = base.Field("LosslessPriorities")
39 40
 
40 41
 
41 42
 class PriorityToClassMappingField(base.ListField):
42
-    priority = base.Field('Priority', adapter=rsd_lib_utils.num_or_none)
43
+    priority = base.Field("Priority", adapter=rsd_lib_utils.num_or_none)
43 44
 
44 45
     traffic_class = base.Field(
45
-        'TrafficClass', adapter=rsd_lib_utils.num_or_none)
46
+        "TrafficClass", adapter=rsd_lib_utils.num_or_none
47
+    )
46 48
 
47 49
 
48 50
 class TrafficClassficationField(base.ListField):
49
-    port = base.Field('Port', adapter=rsd_lib_utils.num_or_none)
51
+    port = base.Field("Port", adapter=rsd_lib_utils.num_or_none)
50 52
 
51
-    protocol = base.Field('Protocol')
53
+    protocol = base.Field("Protocol")
52 54
 
53 55
     traffic_class = base.Field(
54
-        'TrafficClass', adapter=rsd_lib_utils.num_or_none)
56
+        "TrafficClass", adapter=rsd_lib_utils.num_or_none
57
+    )
55 58
 
56 59
 
57 60
 class TransmissionSelectionField(base.ListField):
58 61
     bandwidth_percent = base.Field(
59
-        'BandwidthPercent', adapter=rsd_lib_utils.num_or_none)
62
+        "BandwidthPercent", adapter=rsd_lib_utils.num_or_none
63
+    )
60 64
 
61 65
     traffic_class = base.Field(
62
-        'TrafficClass', adapter=rsd_lib_utils.num_or_none)
66
+        "TrafficClass", adapter=rsd_lib_utils.num_or_none
67
+    )
63 68
 
64 69
 
65 70
 class EthernetSwitch(v2_2_ethernet_switch.EthernetSwitch):
66 71
     class_to_priority_mapping = ClassToPriorityMappingField(
67
-        'ClassToPriorityMapping')
72
+        "ClassToPriorityMapping"
73
+    )
68 74
     """The ethernet switch class to priority mapping"""
69 75
 
70
-    dcbx_enabled = base.Field('DCBXEnabled', adapter=bool)
76
+    dcbx_enabled = base.Field("DCBXEnabled", adapter=bool)
71 77
     """The boolean indicate this dcbx is enabled or not"""
72 78
 
73
-    ets_enabled = base.Field('ETSEnabled', adapter=bool)
79
+    ets_enabled = base.Field("ETSEnabled", adapter=bool)
74 80
     """The boolean indicate this etse is enabled or not"""
75 81
 
76
-    lldp_enabled = base.Field('LLDPEnabled', adapter=bool)
82
+    lldp_enabled = base.Field("LLDPEnabled", adapter=bool)
77 83
     """The boolean indicate this lldp is enabled or not"""
78 84
 
79
-    max_acl_number = base.Field('MaxACLNumber')
85
+    max_acl_number = base.Field("MaxACLNumber")
80 86
     """The ethernet switch max acl number"""
81 87
 
82
-    metrics = base.Field('Metrics', default=(),
83
-                         adapter=rsd_lib_utils.get_resource_identity)
88
+    metrics = base.Field(
89
+        "Metrics", default=(), adapter=rsd_lib_utils.get_resource_identity
90
+    )
84 91
     """The ethernet switch metrics"""
85 92
 
86
-    priority_flow_control = PriorityFlowControlField('PriorityFlowControl')
93
+    priority_flow_control = PriorityFlowControlField("PriorityFlowControl")
87 94
     """The ethernet switch priority flow control"""
88 95
 
89 96
     priority_to_class_mapping = PriorityToClassMappingField(
90
-        'PriorityToClassMapping')
97
+        "PriorityToClassMapping"
98
+    )
91 99
     """The ethernet switch priority to class mapping"""
92 100
 
93
-    traffic_classification = TrafficClassficationField('TrafficClassification')
101
+    traffic_classification = TrafficClassficationField("TrafficClassification")
94 102
     """The ethernet switch traffic classification"""
95 103
 
96 104
     transmission_selection = TransmissionSelectionField(
97
-        'TransmissionSelection')
105
+        "TransmissionSelection"
106
+    )
98 107
     """The ethernet switch transmission selection"""
99 108
 
100 109
 
101 110
 class EthernetSwitchCollection(rsd_lib_base.ResourceCollectionBase):
102
-
103 111
     @property
104 112
     def _resource_type(self):
105 113
         return EthernetSwitch

+ 95
- 68
rsd_lib/resources/v2_3/fabric/endpoint.py View File

@@ -29,72 +29,77 @@ LOG = logging.getLogger(__name__)
29 29
 
30 30
 
31 31
 class IdentifiersField(base.ListField):
32
-    name_format = base.Field('DurableNameFormat')
33
-    name = base.Field('DurableName')
32
+    name_format = base.Field("DurableNameFormat")
33
+    name = base.Field("DurableName")
34 34
 
35 35
 
36 36
 class ConnectedEntitiesField(base.ListField):
37
-    entity_type = base.Field('EntityType')
38
-    entity_role = base.Field('EntityRole')
39
-    entity_link = base.Field('EntityLink',
40
-                             adapter=rsd_lib_utils.get_resource_identity)
37
+    entity_type = base.Field("EntityType")
38
+    entity_role = base.Field("EntityRole")
39
+    entity_link = base.Field(
40
+        "EntityLink", adapter=rsd_lib_utils.get_resource_identity
41
+    )
41 42
 
42 43
 
43 44
 class LinksField(base.CompositeField):
44
-    ports = base.Field('Ports', adapter=utils.get_members_identities)
45
-    endpoints = base.Field('Endpoints', adapter=utils.get_members_identities)
46
-    zones = base.Field(['Oem', 'Intel_RackScale', 'Zones'],
47
-                       adapter=utils.get_members_identities)
48
-    interface = base.Field(['Oem', 'Intel_RackScale', 'Interface'],
49
-                           adapter=rsd_lib_utils.get_resource_identity)
45
+    ports = base.Field("Ports", adapter=utils.get_members_identities)
46
+    endpoints = base.Field("Endpoints", adapter=utils.get_members_identities)
47
+    zones = base.Field(
48
+        ["Oem", "Intel_RackScale", "Zones"],
49
+        adapter=utils.get_members_identities,
50
+    )
51
+    interface = base.Field(
52
+        ["Oem", "Intel_RackScale", "Interface"],
53
+        adapter=rsd_lib_utils.get_resource_identity,
54
+    )
50 55
 
51 56
 
52 57
 class IPTransportDetailsField(base.ListField):
53
-    transport_protocol = base.Field('TransportProtocol')
54
-    ipv4_address = base.Field(['IPv4Address', 'Address'])
55
-    ipv6_address = base.Field(['IPv6Address', 'Address'])
56
-    port = base.Field('Port', adapter=rsd_lib_utils.num_or_none)
58
+    transport_protocol = base.Field("TransportProtocol")
59
+    ipv4_address = base.Field(["IPv4Address", "Address"])
60
+    ipv6_address = base.Field(["IPv6Address", "Address"])
61
+    port = base.Field("Port", adapter=rsd_lib_utils.num_or_none)
57 62
 
58 63
 
59 64
 class AuthenticationField(base.CompositeField):
60
-    username = base.Field('Username')
61
-    password = base.Field('Password')
65
+    username = base.Field("Username")
66
+    password = base.Field("Password")
62 67
 
63 68
 
64 69
 class OemField(base.CompositeField):
65
-    authentication = AuthenticationField(['Intel_RackScale', 'Authentication'])
70
+    authentication = AuthenticationField(["Intel_RackScale", "Authentication"])
66 71
 
67 72
 
68 73
 class Endpoint(rsd_lib_base.ResourceBase):
69 74
 
70
-    connected_entities = ConnectedEntitiesField('ConnectedEntities')
75
+    connected_entities = ConnectedEntitiesField("ConnectedEntities")
71 76
     """Entities connected to endpoint"""
72 77
 
73
-    description = base.Field('Description')
78
+    description = base.Field("Description")
74 79
     """The endpoint description"""
75 80
 
76
-    protocol = base.Field('EndpointProtocol')
81
+    protocol = base.Field("EndpointProtocol")
77 82
     """Protocol for endpoint (i.e. PCIe)"""
78 83
 
79
-    identifiers = IdentifiersField('Identifiers')
84
+    identifiers = IdentifiersField("Identifiers")
80 85
     """Identifiers for endpoint"""
81 86
 
82
-    identity = base.Field('Id', required=True)
87
+    identity = base.Field("Id", required=True)
83 88
     """The endpoint identity string"""
84 89
 
85
-    name = base.Field('Name')
90
+    name = base.Field("Name")
86 91
     """The endpoint name"""
87 92
 
88
-    status = rsd_lib_common.StatusField('Status')
93
+    status = rsd_lib_common.StatusField("Status")
89 94
     """The endpoint status"""
90 95
 
91
-    links = LinksField('Links')
96
+    links = LinksField("Links")
92 97
     """These links to related components of this endpoint"""
93 98
 
94
-    ip_transport_details = IPTransportDetailsField('IPTransportDetails')
99
+    ip_transport_details = IPTransportDetailsField("IPTransportDetails")
95 100
     """IP transport details info of this endpoint"""
96 101
 
97
-    oem = OemField('Oem')
102
+    oem = OemField("Oem")
98 103
     """The OEM additional info of this endpoint"""
99 104
 
100 105
     def update_authentication(self, username=None, password=None):
@@ -106,83 +111,100 @@ class Endpoint(rsd_lib_base.ResourceBase):
106 111
         :raises: BadRequestError if at least one param isn't specified
107 112
         """
108 113
         if username is None and password is None:
109
-            raise ValueError('At least "username" or "password" parameter has '
110
-                             'to be specified')
114
+            raise ValueError(
115
+                'At least "username" or "password" parameter has '
116
+                "to be specified"
117
+            )
111 118
 
112 119
         data = {
113 120
             "Oem": {
114 121
                 "Intel_RackScale": {
115 122
                     "@odata.type": "#Intel.Oem.Endpoint",
116
-                    "Authentication": {}
123
+                    "Authentication": {},
117 124
                 }
118 125
             }
119 126
         }
120 127
         if username is not None:
121
-            data['Oem']['Intel_RackScale']['Authentication']['Username'] = \
122
-                username
128
+            data["Oem"]["Intel_RackScale"]["Authentication"][
129
+                "Username"
130
+            ] = username
123 131
         if password is not None:
124
-            data['Oem']['Intel_RackScale']['Authentication']['Password'] = \
125
-                password
132
+            data["Oem"]["Intel_RackScale"]["Authentication"][
133
+                "Password"
134
+            ] = password
126 135
 
127 136
         self._conn.patch(self.path, data=data)
128 137
 
129 138
 
130 139
 class EndpointCollection(rsd_lib_base.ResourceCollectionBase):
131
-
132 140
     @property
133 141
     def _resource_type(self):
134 142
         return Endpoint
135 143
 
136
-    def _create_endpoint_request(self, identifiers, connected_entities,
137
-                                 protocol=None, ip_transport_details=None,
138
-                                 interface=None, authentication=None):
144
+    def _create_endpoint_request(
145
+        self,
146
+        identifiers,
147
+        connected_entities,
148
+        protocol=None,
149
+        ip_transport_details=None,
150
+        interface=None,
151
+        authentication=None,
152
+    ):
139 153
 
140 154
         request = {}
141 155
 
142
-        jsonschema.validate(identifiers,
143
-                            endpoint_schemas.identifiers_req_schema)
144
-        request['Identifiers'] = identifiers
156
+        jsonschema.validate(
157
+            identifiers, endpoint_schemas.identifiers_req_schema
158
+        )
159
+        request["Identifiers"] = identifiers
145 160
 
146
-        jsonschema.validate(connected_entities,
147
-                            endpoint_schemas.connected_entities_req_schema)
148
-        request['ConnectedEntities'] = connected_entities
161
+        jsonschema.validate(
162
+            connected_entities, endpoint_schemas.connected_entities_req_schema
163
+        )
164
+        request["ConnectedEntities"] = connected_entities
149 165
 
150 166
         if protocol is not None:
151 167
             jsonschema.validate(protocol, endpoint_schemas.protocol_req_schema)
152
-            request['EndpointProtocol'] = protocol
168
+            request["EndpointProtocol"] = protocol
153 169
 
154 170
         if ip_transport_details is not None:
155 171
             jsonschema.validate(
156 172
                 ip_transport_details,
157
-                endpoint_schemas.ip_transport_details_req_schema)
158
-            request['IPTransportDetails'] = ip_transport_details
173
+                endpoint_schemas.ip_transport_details_req_schema,
174
+            )
175
+            request["IPTransportDetails"] = ip_transport_details
159 176
 
160 177
         if interface is not None:
161
-            jsonschema.validate(interface,
162
-                                endpoint_schemas.interface_req_schema)
163
-            request['Links'] = {
178
+            jsonschema.validate(
179
+                interface, endpoint_schemas.interface_req_schema
180
+            )
181
+            request["Links"] = {
164 182
                 "Oem": {
165 183
                     "Intel_RackScale": {
166
-                        "Interfaces": [
167
-                            {
168
-                                "@odata.id": interface
169
-                            }
170
-                        ]
184
+                        "Interfaces": [{"@odata.id": interface}]
171 185
                     }
172 186
                 }
173 187
             }
174 188
 
175 189
         if authentication is not None:
176
-            jsonschema.validate(authentication,
177
-                                endpoint_schemas.authentication_req_schema)
178
-            request['Oem'] = {"Intel_RackScale":
179
-                              {"Authentication": authentication}}
190
+            jsonschema.validate(
191
+                authentication, endpoint_schemas.authentication_req_schema
192
+            )
193
+            request["Oem"] = {
194
+                "Intel_RackScale": {"Authentication": authentication}
195
+            }
180 196
 
181 197
         return request
182 198
 
183
-    def create_endpoint(self, identifiers, connected_entities, protocol=None,
184
-                        ip_transport_details=None, interface=None,
185
-                        authentication=None):
199
+    def create_endpoint(
200
+        self,
201
+        identifiers,
202
+        connected_entities,
203
+        protocol=None,
204
+        ip_transport_details=None,
205
+        interface=None,
206
+        authentication=None,
207
+    ):
186 208
         """Create a new endpoint
187 209
 
188 210
         :param identifiers: provides iQN or NQN of created entity
@@ -199,9 +221,14 @@ class EndpointCollection(rsd_lib_base.ResourceCollectionBase):
199 221
         :returns: The uri of the new endpoint
200 222
         """
201 223
         properties = self._create_endpoint_request(
202
-            identifiers, connected_entities, protocol, ip_transport_details,
203
-            interface, authentication)
224
+            identifiers,
225
+            connected_entities,
226
+            protocol,
227
+            ip_transport_details,
228
+            interface,
229
+            authentication,
230
+        )
204 231
         resp = self._conn.post(self._path, data=properties)
205
-        LOG.info("Endpoint created at %s", resp.headers['Location'])
206
-        endpoint_url = resp.headers['Location']
232
+        LOG.info("Endpoint created at %s", resp.headers["Location"])
233
+        endpoint_url = resp.headers["Location"]
207 234
         return endpoint_url[endpoint_url.find(self._path):]

+ 64
- 68
rsd_lib/resources/v2_3/fabric/endpoint_schemas.py View File

@@ -13,91 +13,87 @@
13 13
 #    under the License.
14 14
 
15 15
 identifiers_req_schema = {
16
-    'type': 'array',
17
-    'items': {
18
-        'type': 'object',
19
-        'properties': {
20
-            'DurableNameFormat': {
21
-                'type': 'string',
22
-                'enum': ['NQN', 'iQN']
23
-            },
24
-            'DurableName': {'type': 'string'}
16
+    "type": "array",
17
+    "items": {
18
+        "type": "object",
19
+        "properties": {
20
+            "DurableNameFormat": {"type": "string", "enum": ["NQN", "iQN"]},
21
+            "DurableName": {"type": "string"},
25 22
         },
26
-        "required": ['DurableNameFormat', 'DurableName']
27
-    }
23
+        "required": ["DurableNameFormat", "DurableName"],
24
+    },
28 25
 }
29 26
 
30 27
 connected_entities_req_schema = {
31
-    'type': 'array',
32
-    'items': {
33
-        'type': 'object',
34
-        'properties': {
35
-            'EntityLink': {
36
-                'type': 'object',
37
-                'properties': {
38
-                    '@odata.id': {'type': 'string'}
39
-                },
40
-                "required": ['@odata.id']
28
+    "type": "array",
29
+    "items": {
30
+        "type": "object",
31
+        "properties": {
32
+            "EntityLink": {
33
+                "type": "object",
34
+                "properties": {"@odata.id": {"type": "string"}},
35
+                "required": ["@odata.id"],
41 36
             },
42
-            'EntityRole': {
43
-                'type': 'string',
44
-                'enum': ['Initiator', 'Target', 'Both']
37
+            "EntityRole": {
38
+                "type": "string",
39
+                "enum": ["Initiator", "Target", "Both"],
45 40
             },
46
-            'Identifiers': {
47
-                'type': 'array',
48
-                'items': {
49
-                    'type': 'object',
50
-                    'properties': {
51
-                        'DurableNameFormat': {
52
-                            'type': 'string',
53
-                            'enum': ['NQN', 'iQN', 'FC_WWN', 'UUID', 'EUI',
54
-                                     'NAA', 'NSID', 'SystemPath', 'LUN']
41
+            "Identifiers": {
42
+                "type": "array",
43
+                "items": {
44
+                    "type": "object",
45
+                    "properties": {
46
+                        "DurableNameFormat": {
47
+                            "type": "string",
48
+                            "enum": [
49
+                                "NQN",
50
+                                "iQN",
51
+                                "FC_WWN",
52
+                                "UUID",
53
+                                "EUI",
54
+                                "NAA",
55
+                                "NSID",
56
+                                "SystemPath",
57
+                                "LUN",
58
+                            ],
55 59
                         },
56
-                        'DurableName': {'type': 'string'}
60
+                        "DurableName": {"type": "string"},
57 61
                     },
58
-                    "required": ['DurableNameFormat', 'DurableName']
59
-                }
60
-            }
62
+                    "required": ["DurableNameFormat", "DurableName"],
63
+                },
64
+            },
61 65
         },
62
-        "required": ['EntityLink', 'EntityRole']
63
-    }
66
+        "required": ["EntityLink", "EntityRole"],
67
+    },
64 68
 }
65 69
 
66
-protocol_req_schema = {
67
-    'type': 'string'
68
-}
70
+protocol_req_schema = {"type": "string"}
69 71
 
70 72
 ip_transport_details_req_schema = {
71
-    'type': 'array',
72
-    'items': {
73
-        'type': 'object',
74
-        'properties': {
75
-            'TransportProtocol': {'type': 'string'},
76
-            'IPv4Address': {
77
-                'type': 'object',
78
-                'properties': {
79
-                    'Address': {'type': 'string'}
80
-                }
73
+    "type": "array",
74
+    "items": {
75
+        "type": "object",
76
+        "properties": {
77
+            "TransportProtocol": {"type": "string"},
78
+            "IPv4Address": {
79
+                "type": "object",
80
+                "properties": {"Address": {"type": "string"}},
81 81
             },
82
-            'IPv6Address': {
83
-                'type': 'object',
84
-                'properties': {
85
-                    'Address': {'type': 'string'}
86
-                }
82
+            "IPv6Address": {
83
+                "type": "object",
84
+                "properties": {"Address": {"type": "string"}},
87 85
             },
88
-            'Port': {'type': 'number'}
89
-        }
90
-    }
86
+            "Port": {"type": "number"},
87
+        },
88
+    },
91 89
 }
92 90
 
93
-interface_req_schema = {
94
-    'type': 'string'
95
-}
91
+interface_req_schema = {"type": "string"}
96 92
 
97 93
 authentication_req_schema = {
98
-    'type': 'object',
99
-    'properties': {
100
-        'Username': {'type': 'string'},
101
-        'Password': {'type': 'string'}
102
-    }
94
+    "type": "object",
95
+    "properties": {
96
+        "Username": {"type": "string"},
97
+        "Password": {"type": "string"},
98
+    },
103 99
 }

+ 16
- 13
rsd_lib/resources/v2_3/fabric/fabric.py View File

@@ -28,26 +28,26 @@ LOG = logging.getLogger(__name__)
28 28
 
29 29
 class Fabric(rsd_lib_base.ResourceBase):
30 30
 
31
-    description = base.Field('Description')
31
+    description = base.Field("Description")
32 32
     """The fabric description"""
33 33
 
34
-    fabric_type = base.Field('FabricType')
34
+    fabric_type = base.Field("FabricType")
35 35
     """The fabric type"""
36 36
 
37
-    identity = base.Field('Id', required=True)
37
+    identity = base.Field("Id", required=True)
38 38
     """The fabric identity string"""
39 39
 
40
-    max_zones = base.Field('MaxZones')
40
+    max_zones = base.Field("MaxZones")
41 41
     """Maximum number of zones for the fabric"""
42 42
 
43
-    name = base.Field('Name')
43
+    name = base.Field("Name")
44 44
     """The fabric name"""
45 45
 
46
-    status = rsd_lib_common.StatusField('Status')
46
+    status = rsd_lib_common.StatusField("Status")
47 47
 
48 48
     def _get_endpoint_collection_path(self):
49 49
         """Helper function to find the EndpointCollection path"""
50
-        return utils.get_sub_resource_path_by(self, 'Endpoints')
50
+        return utils.get_sub_resource_path_by(self, "Endpoints")
51 51
 
52 52
     @property
53 53
     @utils.cache_it
@@ -58,12 +58,14 @@ class Fabric(rsd_lib_base.ResourceBase):
58 58
         refresh, this property is reset.
59 59
         """
60 60
         return endpoint.EndpointCollection(
61
-            self._conn, self._get_endpoint_collection_path(),
62
-            redfish_version=self.redfish_version)
61
+            self._conn,
62
+            self._get_endpoint_collection_path(),
63
+            redfish_version=self.redfish_version,
64
+        )
63 65
 
64 66
     def _get_zone_collection_path(self):
65 67
         """Helper function to find the ZoneCollection path"""
66
-        return utils.get_sub_resource_path_by(self, 'Zones')
68
+        return utils.get_sub_resource_path_by(self, "Zones")
67 69
 
68 70
     @property
69 71
     @utils.cache_it
@@ -74,12 +76,13 @@ class Fabric(rsd_lib_base.ResourceBase):
74 76
         refresh, this property is reset.
75 77
         """
76 78
         return zone.ZoneCollection(
77
-            self._conn, self._get_zone_collection_path(),
78
-            redfish_version=self.redfish_version)
79
+            self._conn,
80
+            self._get_zone_collection_path(),
81
+            redfish_version=self.redfish_version,
82
+        )
79 83
 
80 84
 
81 85
 class FabricCollection(rsd_lib_base.ResourceCollectionBase):
82
-
83 86
     @property
84 87
     def _resource_type(self):
85 88
         return Fabric

+ 8
- 8
rsd_lib/resources/v2_3/fabric/zone.py View File

@@ -21,7 +21,6 @@ LOG = logging.getLogger(__name__)
21 21
 
22 22
 
23 23
 class Zone(v2_1_zone.Zone):
24
-
25 24
     def update(self, endpoints):
26 25
         """Add or remove Endpoints from a Zone
27 26
 
@@ -30,14 +29,14 @@ class Zone(v2_1_zone.Zone):
30 29
         :param endpoints: a full representation of Endpoints array
31 30
         """
32 31
         data = {"Links": {"Endpoints": []}}
33
-        data['Links']['Endpoints'] = [
34
-            {'@odata.id': endpoint} for endpoint in endpoints]
32
+        data["Links"]["Endpoints"] = [
33
+            {"@odata.id": endpoint} for endpoint in endpoints
34
+        ]
35 35
 
36 36
         self._conn.patch(self.path, data=data)
37 37
 
38 38
 
39 39
 class ZoneCollection(v2_1_zone.ZoneCollection):
40
-
41 40
     @property
42 41
     def _resource_type(self):
43 42
         return Zone
@@ -49,10 +48,11 @@ class ZoneCollection(v2_1_zone.ZoneCollection):
49 48
         :returns: The uri of the new zone
50 49
         """
51 50
         data = {"Links": {"Endpoints": []}}
52
-        data['Links']['Endpoints'] = [
53
-            {'@odata.id': endpoint} for endpoint in endpoints]
51
+        data["Links"]["Endpoints"] = [
52
+            {"@odata.id": endpoint} for endpoint in endpoints
53
+        ]
54 54
 
55 55
         resp = self._conn.post(self.path, data=data)
56
-        LOG.info("Zone created at %s", resp.headers['Location'])
57
-        zone_uri = resp.headers['Location']
56
+        LOG.info("Zone created at %s", resp.headers["Location"])
57
+        zone_uri = resp.headers["Location"]
58 58
         return zone_uri[zone_uri.find(self._path):]

+ 0
- 2
rsd_lib/resources/v2_3/manager/manager.py View File

@@ -20,7 +20,6 @@ from rsd_lib.resources.v2_3.system import ethernet_interface
20 20
 
21 21
 
22 22
 class Manager(manager.Manager):
23
-
24 23
     @property
25 24
     @utils.cache_it
26 25
     def ethernet_interfaces(self):
@@ -37,7 +36,6 @@ class Manager(manager.Manager):
37 36
 
38 37
 
39 38
 class ManagerCollection(manager.ManagerCollection):
40
-
41 39
     @property
42 40
     def _resource_type(self):
43 41
         return Manager

+ 9
- 8
rsd_lib/resources/v2_3/node/attach_action_info.py View File

@@ -27,19 +27,19 @@ NAME_MAPPING = {
27 27
     "Required": "required",
28 28
     "DataType": "data_type",
29 29
     "ObjectDataType": "object_data_type",
30
-    "AllowableValues": "allowable_values"
30
+    "AllowableValues": "allowable_values",
31 31
 }
32 32
 
33 33
 
34 34
 class AttachResourceActionInfo(rsd_lib_base.ResourceBase):
35 35
 
36
-    identity = base.Field('Id', required=True)
36
+    identity = base.Field("Id", required=True)
37 37
     """The storage pool  identity string"""
38 38
 
39
-    description = base.Field('Description')
39
+    description = base.Field("Description")
40 40
     """The storage pool  description string"""
41 41
 
42
-    name = base.Field('Name')
42
+    name = base.Field("Name")
43 43
     """The storage pool  name string"""
44 44
 
45 45
     @property
@@ -51,14 +51,15 @@ class AttachResourceActionInfo(rsd_lib_base.ResourceBase):
51 51
         refresh, this property is reset.
52 52
         """
53 53
         parameters = []
54
-        for i in self.json.get('Parameters'):
54
+        for i in self.json.get("Parameters"):
55 55
             item = {}
56 56
             for key in NAME_MAPPING:
57 57
                 item[NAME_MAPPING[key]] = i[key]
58 58
 
59
-            if item['name'] == 'Resource':
60
-                item['allowable_values'] = utils.get_members_identities(
61
-                    item['allowable_values'])
59
+            if item["name"] == "Resource":
60
+                item["allowable_values"] = utils.get_members_identities(
61
+                    item["allowable_values"]
62
+                )
62 63
 
63 64
             parameters.append(item)
64 65
 

+ 107
- 80
rsd_lib/resources/v2_3/node/node.py View File

@@ -30,32 +30,34 @@ LOG = logging.getLogger(__name__)
30 30
 
31 31
 
32 32
 class AttachEndpointActionField(base.CompositeField):
33
-    target_uri = base.Field('target', required=True)
34
-    action_info_path = base.Field('@Redfish.ActionInfo',
35
-                                  adapter=rsd_lib_utils.get_resource_identity)
33
+    target_uri = base.Field("target", required=True)
34
+    action_info_path = base.Field(
35
+        "@Redfish.ActionInfo", adapter=rsd_lib_utils.get_resource_identity
36
+    )
36 37
     action_info = None
37 38
 
38 39
 
39 40
 class DetachEndpointActionField(base.CompositeField):
40
-    target_uri = base.Field('target', required=True)
41
-    action_info_path = base.Field('@Redfish.ActionInfo',
42
-                                  adapter=rsd_lib_utils.get_resource_identity)
41
+    target_uri = base.Field("target", required=True)
42
+    action_info_path = base.Field(
43
+        "@Redfish.ActionInfo", adapter=rsd_lib_utils.get_resource_identity
44
+    )
43 45
     action_info = None
44 46
 
45 47
 
46 48
 class NodeActionsField(v2_1_node.NodeActionsField):
47
-    attach_endpoint = AttachEndpointActionField('#ComposedNode.AttachResource')
48
-    detach_endpoint = DetachEndpointActionField('#ComposedNode.DetachResource')
49
+    attach_endpoint = AttachEndpointActionField("#ComposedNode.AttachResource")
50
+    detach_endpoint = DetachEndpointActionField("#ComposedNode.DetachResource")
49 51
 
50 52
 
51 53
 class Node(v2_1_node.Node):
52 54
 
53
-    clear_tpm_on_delete = base.Field('ClearTPMOnDelete', adapter=bool)
55
+    clear_tpm_on_delete = base.Field("ClearTPMOnDelete", adapter=bool)
54 56
     """This is used to specify if TPM module should be cleared on composed node
55 57
        DELETE request
56 58
     """
57 59
 
58
-    _actions = NodeActionsField('Actions', required=True)
60
+    _actions = NodeActionsField("Actions", required=True)
59 61
 
60 62
     def update(self, clear_tpm_on_delete):
61 63
         """Update properties of this composed node
@@ -67,12 +69,12 @@ class Node(v2_1_node.Node):
67 69
         """
68 70
         if not isinstance(clear_tpm_on_delete, bool):
69 71
             raise exceptions.InvalidParameterValueError(
70
-                parameter='clear_tpm_on_delete', value=clear_tpm_on_delete,
71
-                valid_values=[True, False])
72
+                parameter="clear_tpm_on_delete",
73
+                value=clear_tpm_on_delete,
74
+                valid_values=[True, False],
75
+            )
72 76
 
73
-        data = {
74
-            'ClearTPMOnDelete': clear_tpm_on_delete
75
-        }
77
+        data = {"ClearTPMOnDelete": clear_tpm_on_delete}
76 78
 
77 79
         self._conn.patch(self.path, data=data)
78 80
 
@@ -80,14 +82,16 @@ class Node(v2_1_node.Node):
80 82
         attach_endpoint_action = self._actions.attach_endpoint
81 83
         if not attach_endpoint_action:
82 84
             raise exceptions.MissingActionError(
83
-                action='#ComposedNode.AttachResource',
84
-                resource=self._path)
85
+                action="#ComposedNode.AttachResource", resource=self._path
86
+            )
85 87
 
86 88
         if attach_endpoint_action.action_info is None:
87
-            attach_endpoint_action.action_info = \
88
-                attach_action_info.AttachResourceActionInfo(
89
-                    self._conn, attach_endpoint_action.action_info_path,
90
-                    redfish_version=self.redfish_version)
89
+            attach_endpoint_action.action_info = attach_action_info.\
90
+                AttachResourceActionInfo(
91
+                    self._conn,
92
+                    attach_endpoint_action.action_info_path,
93
+                    redfish_version=self.redfish_version,
94
+                )
91 95
         return attach_endpoint_action
92 96
 
93 97
     def get_allowed_attach_endpoints(self):
@@ -97,8 +101,8 @@ class Node(v2_1_node.Node):
97 101
         """
98 102
         attach_action = self._get_attach_endpoint_action_element()
99 103
         for i in attach_action.action_info.parameters:
100
-            if i['name'] == 'Resource':
101
-                return i['allowable_values']
104
+            if i["name"] == "Resource":
105
+                return i["allowable_values"]
102 106
         return ()
103 107
 
104 108
     def attach_endpoint(self, resource, protocol=None):
@@ -114,14 +118,16 @@ class Node(v2_1_node.Node):
114 118
 
115 119
         if resource and resource not in valid_endpoints:
116 120
             raise exceptions.InvalidParameterValueError(
117
-                parameter='resource', value=resource,
118
-                valid_values=valid_endpoints)
121
+                parameter="resource",
122
+                value=resource,
123
+                valid_values=valid_endpoints,
124
+            )
119 125
 
120 126
         data = {}
121 127
         if resource is not None:
122
-            data['Resource'] = {'@odata.id': resource}
128
+            data["Resource"] = {"@odata.id": resource}
123 129
         if protocol is not None:
124
-            data['Protocol'] = protocol
130
+            data["Protocol"] = protocol
125 131
 
126 132
         self._conn.post(target_uri, data=data)
127 133
 
@@ -129,14 +135,16 @@ class Node(v2_1_node.Node):
129 135
         detach_endpoint_action = self._actions.detach_endpoint
130 136
         if not detach_endpoint_action:
131 137
             raise exceptions.MissingActionError(
132
-                action='#ComposedNode.DetachResource',
133
-                resource=self._path)
138
+                action="#ComposedNode.DetachResource", resource=self._path
139
+            )
134 140
 
135 141
         if detach_endpoint_action.action_info is None:
136
-            detach_endpoint_action.action_info = \
137
-                attach_action_info.AttachResourceActionInfo(
138
-                    self._conn, detach_endpoint_action.action_info_path,
139
-                    redfish_version=self.redfish_version)
142
+            detach_endpoint_action.action_info = attach_action_info.\
143
+                AttachResourceActionInfo(
144
+                    self._conn,
145
+                    detach_endpoint_action.action_info_path,
146
+                    redfish_version=self.redfish_version,
147
+                )
140 148
         return detach_endpoint_action
141 149
 
142 150
     def get_allowed_detach_endpoints(self):
@@ -146,8 +154,8 @@ class Node(v2_1_node.Node):
146 154
         """
147 155
         detach_action = self._get_detach_endpoint_action_element()
148 156
         for i in detach_action.action_info.parameters:
149
-            if i['name'] == 'Resource':
150
-                return i['allowable_values']
157
+            if i["name"] == "Resource":
158
+                return i["allowable_values"]
151 159
         return ()
152 160
 
153 161
     def detach_endpoint(self, resource):
@@ -162,12 +170,14 @@ class Node(v2_1_node.Node):
162 170
 
163 171
         if resource not in valid_endpoints:
164 172
             raise exceptions.InvalidParameterValueError(
165
-                parameter='resource', value=resource,
166
-                valid_values=valid_endpoints)
173
+                parameter="resource",
174
+                value=resource,
175
+                valid_values=valid_endpoints,
176
+            )
167 177
 
168 178
         data = {}
169 179
         if resource is not None:
170
-            data['Resource'] = {'@odata.id': resource}
180
+            data["Resource"] = {"@odata.id": resource}
171 181
 
172 182
         self._conn.post(target_uri, data=data)
173 183
 
@@ -180,72 +190,87 @@ class Node(v2_1_node.Node):
180 190
 
181 191
 
182 192
 class NodeCollection(v2_2_node.NodeCollection):
183
-
184 193
     @property
185 194
     def _resource_type(self):
186 195
         return Node
187 196
 
188
-    def _create_compose_request(self, name=None, description=None,
189
-                                processor_req=None, memory_req=None,
190
-                                remote_drive_req=None, local_drive_req=None,
191
-                                ethernet_interface_req=None,
192
-                                security_req=None, total_system_core_req=None,
193
-                                total_system_memory_req=None):
197
+    def _create_compose_request(
198
+        self,
199
+        name=None,
200
+        description=None,
201
+        processor_req=None,
202
+        memory_req=None,
203
+        remote_drive_req=None,
204
+        local_drive_req=None,
205
+        ethernet_interface_req=None,
206
+        security_req=None,
207
+        total_system_core_req=None,
208
+        total_system_memory_req=None,
209
+    ):
194 210
 
195 211
         request = {}
196 212
 
197 213
         if name is not None:
198
-            request['Name'] = name
214
+            request["Name"] = name
199 215
         if description is not None:
200
-            request['Description'] = description
216
+            request["Description"] = description
201 217
 
202 218
         if processor_req is not None:
203
-            validate(processor_req,
204
-                     node_schemas.processor_req_schema)
205
-            request['Processors'] = processor_req
219
+            validate(processor_req, node_schemas.processor_req_schema)
220
+            request["Processors"] = processor_req
206 221
 
207 222
         if memory_req is not None:
208
-            validate(memory_req,
209
-                     node_schemas.memory_req_schema)
210
-            request['Memory'] = memory_req
223
+            validate(memory_req, node_schemas.memory_req_schema)
224
+            request["Memory"] = memory_req
211 225
 
212 226
         if remote_drive_req is not None:
213
-            validate(remote_drive_req,
214
-                     node_schemas.remote_drive_req_schema)
215
-            request['RemoteDrives'] = remote_drive_req
227
+            validate(remote_drive_req, node_schemas.remote_drive_req_schema)
228
+            request["RemoteDrives"] = remote_drive_req
216 229
 
217 230
         if local_drive_req is not None:
218
-            validate(local_drive_req,
219
-                     node_schemas.local_drive_req_schema)
220
-            request['LocalDrives'] = local_drive_req
231
+            validate(local_drive_req, node_schemas.local_drive_req_schema)
232
+            request["LocalDrives"] = local_drive_req
221 233
 
222 234
         if ethernet_interface_req is not None:
223
-            validate(ethernet_interface_req,
224
-                     node_schemas.ethernet_interface_req_schema)
225
-            request['EthernetInterfaces'] = ethernet_interface_req
235
+            validate(
236
+                ethernet_interface_req,
237
+                node_schemas.ethernet_interface_req_schema,
238
+            )
239
+            request["EthernetInterfaces"] = ethernet_interface_req
226 240
 
227 241
         if security_req is not None:
228
-            validate(security_req,
229
-                     node_schemas.security_req_schema)
230
-            request['Security'] = security_req
242
+            validate(security_req, node_schemas.security_req_schema)
243
+            request["Security"] = security_req
231 244
 
232 245
         if total_system_core_req is not None:
233
-            validate(total_system_core_req,
234
-                     node_schemas.total_system_core_req_schema)
235
-            request['TotalSystemCoreCount'] = total_system_core_req
246
+            validate(
247
+                total_system_core_req,
248
+                node_schemas.total_system_core_req_schema,
249
+            )
250
+            request["TotalSystemCoreCount"] = total_system_core_req
236 251
 
237 252
         if total_system_memory_req is not None:
238
-            validate(total_system_memory_req,
239
-                     node_schemas.total_system_memory_req_schema)
240
-            request['TotalSystemMemoryMiB'] = total_system_memory_req
253
+            validate(
254
+                total_system_memory_req,
255
+                node_schemas.total_system_memory_req_schema,
256
+            )
257
+            request["TotalSystemMemoryMiB"] = total_system_memory_req
241 258
 
242 259
         return request
243 260
 
244
-    def compose_node(self, name=None, description=None,
245
-                     processor_req=None, memory_req=None,
246
-                     remote_drive_req=None, local_drive_req=None,
247
-                     ethernet_interface_req=None, security_req=None,
248
-                     total_system_core_req=None, total_system_memory_req=None):
261
+    def compose_node(
262
+        self,
263
+        name=None,
264
+        description=None,
265
+        processor_req=None,
266
+        memory_req=None,
267
+        remote_drive_req=None,
268
+        local_drive_req=None,
269
+        ethernet_interface_req=None,
270
+        security_req=None,
271
+        total_system_core_req=None,
272
+        total_system_memory_req=None,
273
+    ):
249 274
         """Compose a node from RackScale hardware
250 275
 
251 276
         :param name: Name of node
@@ -275,7 +300,8 @@ class NodeCollection(v2_2_node.NodeCollection):
275 300
         """
276 301
         target_uri = self._get_compose_action_element().target_uri
277 302
         properties = self._create_compose_request(
278
-            name=name, description=description,
303
+            name=name,
304
+            description=description,
279 305
             processor_req=processor_req,
280 306
             memory_req=memory_req,
281 307
             remote_drive_req=remote_drive_req,
@@ -283,8 +309,9 @@ class NodeCollection(v2_2_node.NodeCollection):
283 309
             ethernet_interface_req=ethernet_interface_req,
284 310
             security_req=security_req,
285 311
             total_system_core_req=total_system_core_req,
286
-            total_system_memory_req=total_system_memory_req)
312
+            total_system_memory_req=total_system_memory_req,
313
+        )
287 314
         resp = self._conn.post(target_uri, data=properties)
288
-        LOG.info("Node created at %s", resp.headers['Location'])
289
-        node_url = resp.headers['Location']
315
+        LOG.info("Node created at %s", resp.headers["Location"])
316
+        node_url = resp.headers["Location"]
290 317
         return node_url[node_url.find(self._path):]

+ 204
- 179
rsd_lib/resources/v2_3/node/schemas.py View File

@@ -13,208 +13,233 @@
13 13
 #    under the License.
14 14
 
15 15
 processor_req_schema = {
16
-    'type': 'array',
17
-    'items': [{
18
-        'type': 'object',
19
-        'properties': {
20
-            'Model': {'type': 'string'},
21
-            'TotalCores': {'type': 'number'},
22
-            'AchievableSpeedMHz': {'type': 'number'},
23
-            'InstructionSet': {
24
-                'type': 'string',
25
-                'enum': ['x86', 'x86-64', 'IA-64', 'ARM-A32',
26
-                         'ARM-A64', 'MIPS32', 'MIPS64', 'OEM']
27
-            },
28
-            'Oem': {
29
-                'type': 'object',
30
-                'properties': {
31
-                    'Brand': {
32
-                        'type': 'string',
33
-                        'enum': ['E3', 'E5', 'E7', 'X3', 'X5', 'X7', 'I3',
34
-                                 'I5', 'I7', 'Silver', 'Gold', 'Platinum',
35
-                                 'Unknown']
16
+    "type": "array",
17
+    "items": [
18
+        {
19
+            "type": "object",
20
+            "properties": {
21
+                "Model": {"type": "string"},
22
+                "TotalCores": {"type": "number"},
23
+                "AchievableSpeedMHz": {"type": "number"},
24
+                "InstructionSet": {
25
+                    "type": "string",
26
+                    "enum": [
27
+                        "x86",
28
+                        "x86-64",
29
+                        "IA-64",
30
+                        "ARM-A32",
31
+                        "ARM-A64",
32
+                        "MIPS32",
33
+                        "MIPS64",
34
+                        "OEM",
35
+                    ],
36
+                },
37
+                "Oem": {
38
+                    "type": "object",
39
+                    "properties": {
40
+                        "Brand": {
41
+                            "type": "string",
42
+                            "enum": [
43
+                                "E3",
44
+                                "E5",
45
+                                "E7",
46
+                                "X3",
47
+                                "X5",
48
+                                "X7",
49
+                                "I3",
50
+                                "I5",
51
+                                "I7",
52
+                                "Silver",
53
+                                "Gold",
54
+                                "Platinum",
55
+                                "Unknown",
56
+                            ],
57
+                        },
58
+                        "Capabilities": {
59
+                            "type": "array",
60
+                            "items": [{"type": "string"}],
61
+                        },
36 62
                     },
37
-                    'Capabilities': {
38
-                        'type': 'array',
39
-                        'items': [{'type': 'string'}]
40
-                    }
41
-                }
42
-            },
43
-            'Resource': {
44
-                'type': 'object',
45
-                'properties': {
46
-                    '@odata.id': {'type': 'string'}
47
-                }
48
-            },
49
-            'Chassis': {
50
-                'type': 'object',
51
-                'properties': {
52
-                    '@odata.id': {'type': 'string'}
53
-                }
63
+                },
64
+                "Resource": {
65
+                    "type": "object",
66
+                    "properties": {"@odata.id": {"type": "string"}},
67
+                },
68
+                "Chassis": {
69
+                    "type": "object",
70
+                    "properties": {"@odata.id": {"type": "string"}},
71
+                },
72
+                "ProcessorType": {
73
+                    "type": "string",
74
+                    "enum": [
75
+                        "CPU",
76
+                        "FPGA",
77
+                        "GPU",
78
+                        "DSP",
79
+                        "Accelerator",
80
+                        "OEM",
81
+                    ],
82
+                },
54 83
             },
55
-            'ProcessorType': {
56
-                'type': 'string',
57
-                'enum': ['CPU', 'FPGA', 'GPU', 'DSP', 'Accelerator', 'OEM']
58
-            }
59
-        },
60
-        'additionalProperties': False,
61
-    }]
84
+            "additionalProperties": False,
85
+        }
86
+    ],
62 87
 }
63 88
 
64 89
 memory_req_schema = {
65
-    'type': 'array',
66
-    'items': [{
67
-        'type': 'object',
68
-        'properties': {
69
-            'CapacityMiB': {'type': 'number'},
70
-            'MemoryDeviceType': {
71
-                'type': 'string',
72
-                'enum': ['DDR', 'DDR2', 'DDR3', 'DDR4', 'DDR4_SDRAM',
73
-                         'DDR4E_SDRAM', 'LPDDR4_SDRAM', 'DDR3_SDRAM',
74
-                         'LPDDR3_SDRAM', 'DDR2_SDRAM', 'DDR2_SDRAM_FB_DIMM',
75
-                         'DDR2_SDRAM_FB_DIMM_PROBE', 'DDR_SGRAM',
76
-                         'DDR_SDRAM', 'ROM', 'SDRAM', 'EDO',
77
-                         'FastPageMode', 'PipelinedNibble']
90
+    "type": "array",
91
+    "items": [
92
+        {
93
+            "type": "object",
94
+            "properties": {
95
+                "CapacityMiB": {"type": "number"},
96
+                "MemoryDeviceType": {
97
+                    "type": "string",
98
+                    "enum": [
99
+                        "DDR",
100
+                        "DDR2",
101
+                        "DDR3",
102
+                        "DDR4",
103
+                        "DDR4_SDRAM",
104
+                        "DDR4E_SDRAM",
105
+                        "LPDDR4_SDRAM",
106
+                        "DDR3_SDRAM",
107
+                        "LPDDR3_SDRAM",
108
+                        "DDR2_SDRAM",
109
+                        "DDR2_SDRAM_FB_DIMM",
110
+                        "DDR2_SDRAM_FB_DIMM_PROBE",
111
+                        "DDR_SGRAM",
112
+                        "DDR_SDRAM",
113
+                        "ROM",
114
+                        "SDRAM",
115
+                        "EDO",
116
+                        "FastPageMode",
117
+                        "PipelinedNibble",
118
+                    ],
119
+                },
120
+                "SpeedMHz": {"type": "number"},
121
+                "Manufacturer": {"type": "string"},
122
+                "DataWidthBits": {"type": "number"},
123
+                "Resource": {
124
+                    "type": "object",
125
+                    "properties": {"@odata.id": {"type": "string"}},
126
+                },
127
+                "Chassis": {
128
+                    "type": "object",
129
+                    "properties": {"@odata.id": {"type": "string"}},
130
+                },
78 131
             },
79
-            'SpeedMHz': {'type': 'number'},
80
-            'Manufacturer': {'type': 'string'},
81
-            'DataWidthBits': {'type': 'number'},
82
-            'Resource': {
83
-                'type': 'object',
84
-                'properties': {
85
-                    '@odata.id': {'type': 'string'}
86
-                }
87
-            },
88
-            'Chassis': {
89
-                'type': 'object',
90
-                'properties': {
91
-                    '@odata.id': {'type': 'string'}
92
-                }
93
-            }
94
-        },
95
-        'additionalProperties': False,
96
-    }]
132
+            "additionalProperties": False,
133
+        }
134
+    ],
97 135
 }
98 136
 
99 137
 remote_drive_req_schema = {
100
-    'type': 'array',
101
-    'items': [{
102
-        'type': 'object',
103
-        'properties': {
104
-            'CapacityGiB': {'type': 'number'},
105
-            'Protocol': {
106
-                'type': 'string',
107
-                'enum': ['iSCSI', 'NVMeOverFabrics']
108
-            },
109
-            'Master': {
110
-                'type': 'object',
111
-                'properties': {
112
-                    'Type': {
113
-                        'type': 'string',
114
-                        'enum': ['Snapshot', 'Clone']
138
+    "type": "array",
139
+    "items": [
140
+        {
141
+            "type": "object",
142
+            "properties": {
143
+                "CapacityGiB": {"type": "number"},
144
+                "Protocol": {
145
+                    "type": "string",
146
+                    "enum": ["iSCSI", "NVMeOverFabrics"],
147
+                },
148
+                "Master": {
149
+                    "type": "object",
150
+                    "properties": {
151
+                        "Type": {
152
+                            "type": "string",
153
+                            "enum": ["Snapshot", "Clone"],
154
+                        },
155
+                        "Resource": {
156
+                            "type": "object",
157
+                            "properties": {"@odata.id": {"type": "string"}},
158
+                        },
115 159
                     },
116
-                    'Resource': {
117
-                        'type': 'object',
118
-                        'properties': {
119
-                            '@odata.id': {'type': 'string'}
120
-                        }
121
-                    }
122
-                }
160
+                },
161
+                "Resource": {
162
+                    "type": "object",
163
+                    "properties": {"@odata.id": {"type": "string"}},
164
+                },
123 165
             },
124
-            'Resource': {
125
-                'type': 'object',
126
-                'properties': {
127
-                    '@odata.id': {'type': 'string'}
128
-                }
129
-            }
130
-        },
131
-        'additionalProperties': False,
132
-    }]
166
+            "additionalProperties": False,
167
+        }
168
+    ],
133 169
 }
134 170
 
135 171
 local_drive_req_schema = {
136
-    'type': 'array',
137
-    'items': [{
138
-        'type': 'object',
139
-        'properties': {
140
-            'CapacityGiB': {'type': 'number'},
141
-            'Type': {
142
-                'type': 'string',
143
-                'enum': ['HDD', 'SSD']
144
-            },
145
-            'MinRPM': {'type': 'number'},
146
-            'SerialNumber': {'type': 'string'},
147
-            'Interface': {
148
-                'type': 'string',
149
-                'enum': ['SAS', 'SATA', 'NVMe']
172
+    "type": "array",
173
+    "items": [
174
+        {
175
+            "type": "object",
176
+            "properties": {
177
+                "CapacityGiB": {"type": "number"},
178
+                "Type": {"type": "string", "enum": ["HDD", "SSD"]},
179
+                "MinRPM": {"type": "number"},
180
+                "SerialNumber": {"type": "string"},
181
+                "Interface": {
182
+                    "type": "string",
183
+                    "enum": ["SAS", "SATA", "NVMe"],
184
+                },
185
+                "Resource": {
186
+                    "type": "object",
187
+                    "properties": {"@odata.id": {"type": "string"}},
188
+                },
189
+                "Chassis": {
190
+                    "type": "object",
191
+                    "properties": {"@odata.id": {"type": "string"}},
192
+                },
193
+                "FabricSwitch": {"type": "boolean"},
150 194
             },
151
-            'Resource': {
152
-                'type': 'object',
153
-                'properties': {
154
-                    '@odata.id': {'type': 'string'}
155
-                }
156
-            },
157
-            'Chassis': {
158
-                'type': 'object',
159
-                'properties': {
160
-                    '@odata.id': {'type': 'string'}
161
-                }
162
-            },
163
-            'FabricSwitch': {'type': 'boolean'}
164
-        },
165
-        'additionalProperties': False,
166
-    }]
195
+            "additionalProperties": False,
196
+        }
197
+    ],
167 198
 }
168 199
 
169 200
 ethernet_interface_req_schema = {
170
-    'type': 'array',
171
-    'items': [{
172
-        'type': 'object',
173
-        'properties': {
174
-            'SpeedMbps': {'type': 'number'},
175
-            'PrimaryVLAN': {'type': 'number'},
176
-            'VLANs': {
177
-                'type': 'array',
178
-                'additionalItems': {
179
-                    'type': 'object',
180
-                    'properties': {
181
-                        'VLANId': {'type': 'number'},
182
-                        'Tagged': {'type': 'boolean'}
183
-                    }
184
-                }
185
-            },
186
-            'Resource': {
187
-                'type': 'object',
188
-                'properties': {
189
-                    '@odata.id': {'type': 'string'}
190
-                }
201
+    "type": "array",
202
+    "items": [
203
+        {
204
+            "type": "object",
205
+            "properties": {
206
+                "SpeedMbps": {"type": "number"},
207
+                "PrimaryVLAN": {"type": "number"},
208
+                "VLANs": {
209
+                    "type": "array",
210
+                    "additionalItems": {
211
+                        "type": "object",
212
+                        "properties": {
213
+                            "VLANId": {"type": "number"},
214
+                            "Tagged": {"type": "boolean"},
215
+                        },
216
+                    },
217
+                },
218
+                "Resource": {
219
+                    "type": "object",
220
+                    "properties": {"@odata.id": {"type": "string"}},
221
+                },
222
+                "Chassis": {
223
+                    "type": "object",
224
+                    "properties": {"@odata.id": {"type": "string"}},
225
+                },
191 226
             },
192
-            'Chassis': {
193
-                'type': 'object',
194
-                'properties': {
195
-                    '@odata.id': {'type': 'string'}
196
-                }
197
-            }
198
-        },
199
-        'additionalProperties': False,
200
-    }]
227
+            "additionalProperties": False,
228
+        }
229
+    ],
201 230
 }
202 231
 
203 232
 security_req_schema = {
204
-    'type': 'object',
205
-    'properties': {
206
-        'TpmPresent': {'type': 'boolean'},
207
-        'TpmInterfaceType': {'type': 'string'},
208
-        'TxtEnabled': {'type': 'boolean'},
209
-        'ClearTPMOnDelete': {'type': 'boolean'}
233
+    "type": "object",
234
+    "properties": {
235
+        "TpmPresent": {"type": "boolean"},
236
+        "TpmInterfaceType": {"type": "string"},
237
+        "TxtEnabled": {"type": "boolean"},
238
+        "ClearTPMOnDelete": {"type": "boolean"},
210 239
     },
211
-    'additionalProperties': False,
240
+    "additionalProperties": False,
212 241
 }
213 242
 
214
-total_system_core_req_schema = {
215
-    'type': 'number'
216
-}
243
+total_system_core_req_schema = {"type": "number"}
217 244
 
218
-total_system_memory_req_schema = {
219
-    'type': 'number'
220
-}
245
+total_system_memory_req_schema = {"type": "number"}

+ 56
- 50
rsd_lib/resources/v2_3/storage_service/drive.py View File

@@ -23,124 +23,129 @@ from rsd_lib import utils as rsd_lib_utils
23 23
 
24 24
 
25 25
 class LinksField(base.CompositeField):
26
-    chassis = base.Field('Chassis',
27
-                         adapter=rsd_lib_utils.get_resource_identity)
26
+    chassis = base.Field(
27
+        "Chassis", adapter=rsd_lib_utils.get_resource_identity
28
+    )
28 29
     """Link to related chassis of this drive"""
29 30
 
30
-    volumes = base.Field('Volumes', default=(),
31
-                         adapter=utils.get_members_identities)
31
+    volumes = base.Field(
32
+        "Volumes", default=(), adapter=utils.get_members_identities
33
+    )
32 34
     """Link to related volumes of this drive"""
33 35
 
34
-    endpoints = base.Field('Endpoints', default=(),
35
-                           adapter=utils.get_members_identities)
36
+    endpoints = base.Field(
37
+        "Endpoints", default=(), adapter=utils.get_members_identities
38
+    )
36 39
     """Link to related endpoints of this drive"""
37 40
 
38 41
 
39 42
 class OemField(base.CompositeField):
40
-    erased = base.Field(['Intel_RackScale', 'DriveErased'], adapter=bool,
41
-                        required=True)
42
-    erase_on_detach = base.Field(['Intel_RackScale', 'EraseOnDetach'],
43
-                                 adapter=bool)
44
-    firmware_version = base.Field(['Intel_RackScale', 'FirmwareVersion'])
45
-    storage = base.Field(['Intel_RackScale', 'Storage'])
46
-    pcie_function = base.Field(['Intel_RackScale', 'PCIeFunction'])
43
+    erased = base.Field(
44
+        ["Intel_RackScale", "DriveErased"], adapter=bool, required=True
45
+    )
46
+    erase_on_detach = base.Field(
47
+        ["Intel_RackScale", "EraseOnDetach"], adapter=bool
48
+    )
49
+    firmware_version = base.Field(["Intel_RackScale", "FirmwareVersion"])
50
+    storage = base.Field(["Intel_RackScale", "Storage"])
51
+    pcie_function = base.Field(["Intel_RackScale", "PCIeFunction"])
47 52
 
48 53
 
49 54
 class IdentifiersField(base.ListField):
50
-    durable_name = base.Field('DurableName')
51
-    durable_name_format = base.Field('DurableNameFormat')
55
+    durable_name = base.Field("DurableName")
56
+    durable_name_format = base.Field("DurableNameFormat")
52 57
 
53 58
 
54 59
 class LocationField(base.ListField):
55
-    info = base.Field('Info')
56
-    info_format = base.Field('InfoFormat')
60
+    info = base.Field("Info")
61
+    info_format = base.Field("InfoFormat")
57 62
 
58 63
 
59 64
 class Drive(rsd_lib_base.ResourceBase):
60 65
 
61
-    identity = base.Field('Id', required=True)
66
+    identity = base.Field("Id", required=True)
62 67
     """The drive identity string"""
63 68
 
64
-    name = base.Field('Name')
69
+    name = base.Field("Name")
65 70
     """The drive name string"""
66 71
 
67
-    protocol = base.Field('Protocol')
72
+    protocol = base.Field("Protocol")
68 73
     """The protocol of this drive"""
69 74
 
70
-    drive_type = base.Field('Type')
75
+    drive_type = base.Field("Type")
71 76
     """The protocol of this drive"""
72 77
 
73
-    media_type = base.Field('MediaType')
78
+    media_type = base.Field("MediaType")
74 79
     """The media type of this drive"""
75 80
 
76
-    capacity_bytes = base.Field('CapacityBytes',
77
-                                adapter=rsd_lib_utils.num_or_none)
81
+    capacity_bytes = base.Field(
82
+        "CapacityBytes", adapter=rsd_lib_utils.num_or_none
83
+    )
78 84
     """The capacity in Bytes of this drive"""
79 85
 
80
-    manufacturer = base.Field('Manufacturer')
86
+    manufacturer = base.Field("Manufacturer")
81 87
     """The manufacturer of this drive"""
82 88
 
83
-    model = base.Field('Model')
89
+    model = base.Field("Model")
84 90
     """The drive model"""
85 91
 
86
-    revision = base.Field('Revision')
92
+    revision = base.Field("Revision")
87 93
     """The revision of this drive"""
88 94
 
89
-    sku = base.Field('SKU')
95
+    sku = base.Field("SKU")
90 96
     """The sku of this drive"""
91 97
 
92
-    serial_number = base.Field('SerialNumber')
98
+    serial_number = base.Field("SerialNumber")
93 99
     """The serial number of this drive"""
94 100
 
95
-    part_number = base.Field('PartNumber')
101
+    part_number = base.Field("PartNumber")
96 102
     """The part number of this drive"""
97 103
 
98
-    asset_tag = base.Field('AssetTag')
104
+    asset_tag = base.Field("AssetTag")
99 105
     """The asset tag of this drive"""
100 106
 
101
-    rotation_speed_rpm = base.Field('RotationSpeedRPM')
107
+    rotation_speed_rpm = base.Field("RotationSpeedRPM")
102 108
     """The rotation speed of this drive"""
103 109
 
104
-    identifiers = IdentifiersField('Identifiers')
110
+    identifiers = IdentifiersField("Identifiers")
105 111
     """These identifiers list of this drive"""
106 112
 
107
-    location = LocationField('Location')
113
+    location = LocationField("Location")
108 114
     """The location of this drive"""
109 115
 
110
-    status = rsd_lib_common.StatusField('Status')
116
+    status = rsd_lib_common.StatusField("Status")
111 117
     """The drive status"""
112 118
 
113
-    oem = OemField('Oem')
119
+    oem = OemField("Oem")
114 120
     """The OEM additional info of this drive"""
115 121
 
116
-    status_indicator = base.Field('StatusIndicator')
122
+    status_indicator = base.Field("StatusIndicator")
117 123
     """The status indicator state for the status indicator associated
118 124
        with this drive"""
119 125
 
120
-    indicator_led = base.Field('IndicatorLED')
126
+    indicator_led = base.Field("IndicatorLED")
121 127
     """The indicator light state for the indicator light associated
122 128
        with the drive"""
123 129
 
124
-    capable_speed_gbs = base.Field('CapableSpeedGbs')
130
+    capable_speed_gbs = base.Field("CapableSpeedGbs")
125 131
     """The current bus speed of the associated drive"""
126 132
 
127
-    negotiated_speed_gbs = base.Field('NegotiatedSpeedGbs')
133
+    negotiated_speed_gbs = base.Field("NegotiatedSpeedGbs")
128 134
     """The current bus speed of the associated drive"""
129 135
 
130 136
     predicted_media_life_left_percent = base.Field(
131
-        'PredictedMediaLifeLeftPercent')
137
+        "PredictedMediaLifeLeftPercent"
138
+    )
132 139
     """An indicator of the percentage of life remaining in the drive's media"""
133 140
 
134
-    links = LinksField('Links')
141
+    links = LinksField("Links")
135 142
     """These links to related components of this volume"""
136 143
 
137 144
     def _get_metrics_path(self):
138 145
         """Helper function to find the Metrics path"""
139
-        return utils.get_sub_resource_path_by(self,
140
-                                              ['Links',
141
-                                               'Oem',
142
-                                               'Intel_RackScale',
143
-                                               'Metrics'])
146
+        return utils.get_sub_resource_path_by(
147
+            self, ["Links", "Oem", "Intel_RackScale", "Metrics"]
148
+        )
144 149
 
145 150
     @property
146 151
     @utils.cache_it
@@ -151,12 +156,13 @@ class Drive(rsd_lib_base.ResourceBase):
151 156
         refresh, this property is reset.
152 157
         """
153 158
         return drive_metrics.DriveMetrics(
154
-            self._conn, self._get_metrics_path(),
155
-            redfish_version=self.redfish_version)
159
+            self._conn,
160
+            self._get_metrics_path(),
161
+            redfish_version=self.redfish_version,
162
+        )
156 163
 
157 164
 
158 165
 class DriveCollection(rsd_lib_base.ResourceCollectionBase):
159
-
160 166
     @property
161 167
     def _resource_type(self):
162 168
         return Drive

+ 21
- 19
rsd_lib/resources/v2_3/storage_service/drive_metrics.py View File

@@ -19,63 +19,65 @@ from rsd_lib import utils as rsd_lib_utils
19 19
 
20 20
 
21 21
 class LifeTimeField(base.CompositeField):
22
-    unit_size_bytes = base.Field('UnitSizeBytes',
23
-                                 adapter=rsd_lib_utils.num_or_none)
22
+    unit_size_bytes = base.Field(
23
+        "UnitSizeBytes", adapter=rsd_lib_utils.num_or_none
24
+    )
24 25
     """The size of a unit in bytes used by UnitsRead and UnitsWritten"""
25 26
 
26
-    units_read = base.Field('UnitsRead')
27
+    units_read = base.Field("UnitsRead")
27 28
     """The number of units of a read since reset """
28 29
 
29
-    units_written = base.Field('UnitsWritten')
30
+    units_written = base.Field("UnitsWritten")
30 31
     """The number of units of a written since reset"""
31 32
 
32
-    host_read_commands = base.Field('HostReadCommands')
33
+    host_read_commands = base.Field("HostReadCommands")
33 34
     """The number of read commands completed by the disk controller"""
34 35
 
35
-    host_write_commands = base.Field('HostWriteCommands')
36
+    host_write_commands = base.Field("HostWriteCommands")
36 37
     """The number of write commands completed by the disk controller"""
37 38
 
38
-    power_cycles = base.Field('PowerCycles')
39
+    power_cycles = base.Field("PowerCycles")
39 40
     """The number of power cycels of this drive"""
40 41
 
41
-    power_on_hours = base.Field('PowerOnHours')
42
+    power_on_hours = base.Field("PowerOnHours")
42 43
     """The number of power-on hours of this drive"""
43 44
 
44
-    controller_busy_time_minutes = base.Field('ControllerBusyTimeMinutes')
45
+    controller_busy_time_minutes = base.Field("ControllerBusyTimeMinutes")
45 46
     """The amount of time in minutes the driver controller is busy"""
46 47
 
47 48
 
48 49
 class HealthDataField(base.CompositeField):
49
-    available_spare_percentage = base.Field('AvailableSparePercentage')
50
+    available_spare_percentage = base.Field("AvailableSparePercentage")
50 51
     """The percentage of the remaining spare capacity available"""
51 52
 
52 53
     predicted_media_life_used_percent = base.Field(
53
-        'PredictedMediaLifeUsedPercent')
54
+        "PredictedMediaLifeUsedPercent"
55
+    )
54 56
     """The percentage of life remaining in the driver's media"""
55 57
 
56
-    unsafe_shutdowns = base.Field('UnsafeShutdowns')
58
+    unsafe_shutdowns = base.Field("UnsafeShutdowns")
57 59
     """The number of unsafe shutdowns of this drive"""
58 60
 
59
-    media_errors = base.Field('MediaErrors')
61
+    media_errors = base.Field("MediaErrors")
60 62
     """The number of media and data integrity errors of this drive"""
61 63
 
62 64
 
63 65
 class DriveMetrics(rsd_lib_base.ResourceBase):
64 66
 
65
-    name = base.Field('Name')
67
+    name = base.Field("Name")
66 68
     """Drive metrics name"""
67 69
 
68
-    identity = base.Field('Id')
70
+    identity = base.Field("Id")
69 71
     """Drive metrics id"""
70 72
 
71
-    description = base.Field('Description')
73
+    description = base.Field("Description")
72 74
     """Drive metrics description"""
73 75
 
74
-    life_time = LifeTimeField('LifeTime')
76
+    life_time = LifeTimeField("LifeTime")
75 77
     """The life time metrics for this drive"""
76 78
 
77
-    health_data = HealthDataField('HealthData')
79
+    health_data = HealthDataField("HealthData")
78 80
     """The health data metrics for this drive"""
79 81
 
80
-    temperature_kelvin = base.Field('TemperatureKelvin')
82
+    temperature_kelvin = base.Field("TemperatureKelvin")
81 83
     """The temperature in Kelvin degrees of this drive"""

+ 35
- 27
rsd_lib/resources/v2_3/storage_service/storage_pool.py View File

@@ -28,53 +28,58 @@ LOG = logging.getLogger(__name__)
28 28
 
29 29
 
30 30
 class CapacityField(base.CompositeField):
31
-    allocated_bytes = base.Field(['Data', 'AllocatedBytes'],
32
-                                 adapter=rsd_lib_utils.num_or_none)
33
-    consumed_bytes = base.Field(['Data', 'ConsumedBytes'],
34
-                                adapter=rsd_lib_utils.num_or_none)
35
-    guaranteed_bytes = base.Field(['Data', 'GuaranteedBytes'],
36
-                                  adapter=rsd_lib_utils.num_or_none)
37
-    provisioned_bytes = base.Field(['Data', 'ProvisionedBytes'],
38
-                                   adapter=rsd_lib_utils.num_or_none)
31
+    allocated_bytes = base.Field(
32
+        ["Data", "AllocatedBytes"], adapter=rsd_lib_utils.num_or_none
33
+    )
34
+    consumed_bytes = base.Field(
35
+        ["Data", "ConsumedBytes"], adapter=rsd_lib_utils.num_or_none
36
+    )
37
+    guaranteed_bytes = base.Field(
38
+        ["Data", "GuaranteedBytes"], adapter=rsd_lib_utils.num_or_none
39
+    )
40
+    provisioned_bytes = base.Field(
41
+        ["Data", "ProvisionedBytes"], adapter=rsd_lib_utils.num_or_none
42
+    )
39 43
 
40 44
 
41 45
 class CapacitySourcesField(base.ListField):
42
-    providing_drives = base.Field('ProvidingDrives', default=(),
43
-                                  adapter=utils.get_members_identities)
44
-    provided_capacity = CapacityField('ProvidedCapacity')
46
+    providing_drives = base.Field(
47
+        "ProvidingDrives", default=(), adapter=utils.get_members_identities
48
+    )
49
+    provided_capacity = CapacityField("ProvidedCapacity")
45 50
 
46 51
 
47 52
 class IdentifierField(base.CompositeField):
48
-    durable_name = base.Field('DurableName')
49
-    durable_name_format = base.Field('DurableNameFormat')
53
+    durable_name = base.Field("DurableName")
54
+    durable_name_format = base.Field("DurableNameFormat")
50 55
 
51 56
 
52 57
 class StoragePool(rsd_lib_base.ResourceBase):
53 58
 
54
-    identity = base.Field('Id', required=True)
59
+    identity = base.Field("Id", required=True)
55 60
     """The storage pool  identity string"""
56 61
 
57
-    description = base.Field('Description')
62
+    description = base.Field("Description")
58 63
     """The storage pool  description string"""
59 64
 
60
-    name = base.Field('Name')
65
+    name = base.Field("Name")
61 66
     """The storage pool  name string"""
62 67
 
63
-    status = rsd_lib_common.StatusField('Status')
68
+    status = rsd_lib_common.StatusField("Status")
64 69
     """The storage pool  status"""
65 70
 
66
-    capacity = CapacityField('Capacity')
71
+    capacity = CapacityField("Capacity")
67 72
     """The storage pool capacity info"""
68 73
 
69
-    capacity_sources = CapacitySourcesField('CapacitySources')
74
+    capacity_sources = CapacitySourcesField("CapacitySources")
70 75
     """The storage pool capacity source info"""
71 76
 
72
-    identifier = IdentifierField('Identifier')
77
+    identifier = IdentifierField("Identifier")
73 78
     """These identifiers list of this volume"""
74 79
 
75 80
     def _get_allocated_volumes_path(self):
76 81
         """Helper function to find the AllocatedVolumes path"""
77
-        return utils.get_sub_resource_path_by(self, 'AllocatedVolumes')
82
+        return utils.get_sub_resource_path_by(self, "AllocatedVolumes")
78 83
 
79 84
     @property
80 85
     @utils.cache_it
@@ -85,12 +90,14 @@ class StoragePool(rsd_lib_base.ResourceBase):
85 90
         refresh, this property is reset.
86 91
         """
87 92
         return volume.VolumeCollection(
88
-            self._conn, self._get_allocated_volumes_path(),
89
-            redfish_version=self.redfish_version)
93
+            self._conn,
94
+            self._get_allocated_volumes_path(),
95
+            redfish_version=self.redfish_version,
96
+        )
90 97
 
91 98
     def _get_allocated_pools_path(self):
92 99
         """Helper function to find the AllocatedPools path"""
93
-        return utils.get_sub_resource_path_by(self, 'AllocatedPools')
100
+        return utils.get_sub_resource_path_by(self, "AllocatedPools")
94 101
 
95 102
     @property
96 103
     @utils.cache_it
@@ -101,12 +108,13 @@ class StoragePool(rsd_lib_base.ResourceBase):
101 108
         refresh, this property is reset.
102 109
         """
103 110
         return StoragePoolCollection(
104
-            self._conn, self._get_allocated_pools_path(),
105
-            redfish_version=self.redfish_version)
111
+            self._conn,
112
+            self._get_allocated_pools_path(),
113
+            redfish_version=self.redfish_version,
114
+        )
106 115
 
107 116
 
108 117
 class StoragePoolCollection(rsd_lib_base.ResourceCollectionBase):
109
-
110 118
     @property
111 119
     def _resource_type(self):
112 120
         return StoragePool

+ 24
- 17
rsd_lib/resources/v2_3/storage_service/storage_service.py View File

@@ -30,21 +30,21 @@ LOG = logging.getLogger(__name__)
30 30
 
31 31
 class StorageService(rsd_lib_base.ResourceBase):
32 32
 
33
-    description = base.Field('Description')
33
+    description = base.Field("Description")
34 34
     """The storage service description"""
35 35
 
36
-    identity = base.Field('Id', required=True)
36
+    identity = base.Field("Id", required=True)
37 37
     """The storage service identity string"""
38 38
 
39
-    name = base.Field('Name')
39
+    name = base.Field("Name")
40 40
     """The storage service name"""
41 41
 
42
-    status = rsd_lib_common.StatusField('Status')
42
+    status = rsd_lib_common.StatusField("Status")
43 43
     """The storage service status"""
44 44
 
45 45
     def _get_volume_collection_path(self):
46 46
         """Helper function to find the VolumeCollection path"""
47
-        return utils.get_sub_resource_path_by(self, 'Volumes')
47
+        return utils.get_sub_resource_path_by(self, "Volumes")
48 48
 
49 49
     @property
50 50
     @utils.cache_it
@@ -55,12 +55,14 @@ class StorageService(rsd_lib_base.ResourceBase):
55 55
         refresh, this property is reset.
56 56
         """
57 57
         return volume.VolumeCollection(
58
-            self._conn, self._get_volume_collection_path(),
59
-            redfish_version=self.redfish_version)
58
+            self._conn,
59
+            self._get_volume_collection_path(),
60
+            redfish_version=self.redfish_version,
61
+        )
60 62
 
61 63
     def _get_storage_pool_collection_path(self):
62 64
         """Helper function to find the StoragePoolCollection path"""
63
-        return utils.get_sub_resource_path_by(self, 'StoragePools')
65
+        return utils.get_sub_resource_path_by(self, "StoragePools")
64 66
 
65 67
     @property
66 68
     @utils.cache_it
@@ -71,12 +73,14 @@ class StorageService(rsd_lib_base.ResourceBase):
71 73
         refresh, this property is reset.
72 74
         """
73 75
         return storage_pool.StoragePoolCollection(
74
-            self._conn, self._get_storage_pool_collection_path(),
75
-            redfish_version=self.redfish_version)
76
+            self._conn,
77
+            self._get_storage_pool_collection_path(),
78
+            redfish_version=self.redfish_version,
79
+        )
76 80
 
77 81
     def _get_drive_collection_path(self):
78 82
         """Helper function to find the DriveCollection path"""
79
-        return utils.get_sub_resource_path_by(self, 'Drives')
83
+        return utils.get_sub_resource_path_by(self, "Drives")
80 84
 
81 85
     @property
82 86
     @utils.cache_it
@@ -87,12 +91,14 @@ class StorageService(rsd_lib_base.ResourceBase):
87 91
         refresh, this property is reset.
88 92
         """
89 93
         return drive.DriveCollection(
90
-            self._conn, self._get_drive_collection_path(),
91
-            redfish_version=self.redfish_version)
94
+            self._conn,
95
+            self._get_drive_collection_path(),
96
+            redfish_version=self.redfish_version,
97
+        )
92 98
 
93 99
     def _get_endpoint_collection_path(self):
94 100
         """Helper function to find the EndpointCollection path"""
95
-        return utils.get_sub_resource_path_by(self, 'Endpoints')
101
+        return utils.get_sub_resource_path_by(self, "Endpoints")
96 102
 
97 103
     @property
98 104
     @utils.cache_it
@@ -103,12 +109,13 @@ class StorageService(rsd_lib_base.ResourceBase):
103 109
         refresh, this property is reset.
104 110
         """
105 111
         return endpoint.EndpointCollection(
106
-            self._conn, self._get_endpoint_collection_path(),
107
-            redfish_version=self.redfish_version)
112
+            self._conn,
113
+            self._get_endpoint_collection_path(),
114
+            redfish_version=self.redfish_version,
115
+        )
108 116
 
109 117
 
110 118
 class StorageServiceCollection(rsd_lib_base.ResourceCollectionBase):
111
-
112 119
     @property
113 120
     def _resource_type(self):
114 121
         return StorageService

+ 115
- 84
rsd_lib/resources/v2_3/storage_service/volume.py View File

@@ -30,98 +30,110 @@ LOG = logging.getLogger(__name__)
30 30
 
31 31
 
32 32
 class CapacitySourcesField(base.ListField):
33
-    providing_pools = base.Field('ProvidingPools',
34
-                                 adapter=utils.get_members_identities)
33
+    providing_pools = base.Field(
34
+        "ProvidingPools", adapter=utils.get_members_identities
35
+    )
35 36
     allocated_Bytes = base.Field(
36
-        ['ProvidedCapacity', 'Data', 'AllocatedBytes'],
37
-        adapter=rsd_lib_utils.num_or_none)
37
+        ["ProvidedCapacity", "Data", "AllocatedBytes"],
38
+        adapter=rsd_lib_utils.num_or_none,
39
+    )
38 40
 
39 41
 
40 42
 class LinksField(base.CompositeField):
41
-    endpoints = base.Field(['Oem', 'Intel_RackScale', 'Endpoints'], default=(),
42
-                           adapter=utils.get_members_identities)
43
+    endpoints = base.Field(
44
+        ["Oem", "Intel_RackScale", "Endpoints"],
45
+        default=(),
46
+        adapter=utils.get_members_identities,
47
+    )
43 48
     """Link to related endpoints of this volume"""
44 49
 
45
-    metrics = base.Field(['Oem', 'Intel_RackScale', 'Metrics'],
46
-                         adapter=rsd_lib_utils.get_resource_identity)
50
+    metrics = base.Field(
51
+        ["Oem", "Intel_RackScale", "Metrics"],
52
+        adapter=rsd_lib_utils.get_resource_identity,
53
+    )
47