From a2c86c82a11d722e425e7e2493a24a389a8683aa Mon Sep 17 00:00:00 2001 From: Ricardo Galeno Date: Tue, 30 Oct 2018 21:44:06 -0300 Subject: [PATCH] Bugfix: Requesting /Systems is listing systems that are not found Now, we are getting all server profiles and filtering them by valid serverHardwareUri attribute --- .../api/computer_system_collection.py | 19 +- .../blueprints/computer_system_collection.py | 9 +- .../handler_multiple_oneview.py | 1 + ...rHardwareListWithServerProfileApplied.json | 1165 ----------------- .../mockups/oneview/ServerProfileList.json | 856 ++++++++++++ .../redfish/ComputerSystemCollection.json | 12 +- ...son => ComputerSystemCollectionEmpty.json} | 0 .../api/test_computer_system_collection.py | 6 +- .../test_computer_system_collection.py | 18 +- 9 files changed, 885 insertions(+), 1201 deletions(-) delete mode 100644 oneview_redfish_toolkit/mockups/oneview/ServerHardwareListWithServerProfileApplied.json create mode 100644 oneview_redfish_toolkit/mockups/oneview/ServerProfileList.json rename oneview_redfish_toolkit/mockups/redfish/{ServerProfilesAppliedCollectionEmpty.json => ComputerSystemCollectionEmpty.json} (100%) diff --git a/oneview_redfish_toolkit/api/computer_system_collection.py b/oneview_redfish_toolkit/api/computer_system_collection.py index 163fa0a5..dc46b291 100644 --- a/oneview_redfish_toolkit/api/computer_system_collection.py +++ b/oneview_redfish_toolkit/api/computer_system_collection.py @@ -35,7 +35,7 @@ class ComputerSystemCollection(RedfishJsonValidator): SCHEMA_NAME = 'ComputerSystemCollection' def __init__(self, - sh_with_profile_applied, + server_profile_list, server_profile_templates, zone_ids): """ComputerSystemCollection constructor @@ -45,8 +45,7 @@ def __init__(self, Server Profile applied and all server profile templates. Args: - sh_with_profile_applied: A list of dicts of server hardware - with profile applied. + server_profile_list: A list of dicts of Server Profile applied server_profile_templates: A list of dicts of server profile templates zone_ids: A list of Zone Ids @@ -56,7 +55,7 @@ def __init__(self, self.redfish["@odata.type"] = self.get_odata_type() self.redfish["Name"] = "Computer System Collection" server_profile_members_list = \ - self._get_server_profile_members_list(sh_with_profile_applied) + self._get_server_profile_members_list(server_profile_list) self.redfish["Members@odata.count"] = \ len(server_profile_members_list) self.redfish["Members"] = server_profile_members_list @@ -70,7 +69,7 @@ def __init__(self, self._validate() - def _get_server_profile_members_list(self, server_hardware_list): + def _get_server_profile_members_list(self, server_profile_list): """Returns a redfish members list with all server profiles applied Iterate over the server hardware list, filter the @@ -78,19 +77,17 @@ def _get_server_profile_members_list(self, server_hardware_list): the member item to be filled on Redfish Members. Args: - server_hardware_list: list of Oneview's server - hardwares information. + server_profile_list: list of Oneview's Server + Profiles information. Returns: list: list of computer system members to be filled on Redfish Members. """ members = list() - for server_hardware in server_hardware_list: - server_profile_uuid = \ - server_hardware["serverProfileUri"].split("/")[-1] + for server_profile in server_profile_list: members.append({ - "@odata.id": "/redfish/v1/Systems/" + server_profile_uuid + "@odata.id": "/redfish/v1/Systems/" + server_profile["uuid"] }) return members diff --git a/oneview_redfish_toolkit/blueprints/computer_system_collection.py b/oneview_redfish_toolkit/blueprints/computer_system_collection.py index c5fc1174..71a8ada9 100644 --- a/oneview_redfish_toolkit/blueprints/computer_system_collection.py +++ b/oneview_redfish_toolkit/blueprints/computer_system_collection.py @@ -36,9 +36,10 @@ def get_computer_system_collection(): Returns: JSON: JSON with ComputerSystemCollection. """ - server_hardware_list = g.oneview_client.server_hardware.get_all( - filter="NOT 'serverProfileUri' = NULL" - ) + + server_profile_list = g.oneview_client.server_profiles.get_all() + server_profile_list = list(filter(lambda i: i.get('serverHardwareUri'), + server_profile_list)) server_profile_tmpls = \ g.oneview_client.server_profile_templates.get_all() @@ -46,7 +47,7 @@ def get_computer_system_collection(): zone_service = ZoneService(g.oneview_client) zone_ids = zone_service.get_zone_ids_by_templates(server_profile_tmpls) - csc = ComputerSystemCollection(server_hardware_list, + csc = ComputerSystemCollection(server_profile_list, server_profile_tmpls, zone_ids) diff --git a/oneview_redfish_toolkit/handler_multiple_oneview.py b/oneview_redfish_toolkit/handler_multiple_oneview.py index edb0fdd4..33d5bbb7 100644 --- a/oneview_redfish_toolkit/handler_multiple_oneview.py +++ b/oneview_redfish_toolkit/handler_multiple_oneview.py @@ -73,6 +73,7 @@ "server_profiles": { "delete": st.delete_server_profile, "get": st.first_parameter_resource, + "get_all": st.all_oneviews_resource, "get_available_targets": st.first_parameter_resource, }, "server_profile_templates": { diff --git a/oneview_redfish_toolkit/mockups/oneview/ServerHardwareListWithServerProfileApplied.json b/oneview_redfish_toolkit/mockups/oneview/ServerHardwareListWithServerProfileApplied.json deleted file mode 100644 index f1c7af39..00000000 --- a/oneview_redfish_toolkit/mockups/oneview/ServerHardwareListWithServerProfileApplied.json +++ /dev/null @@ -1,1165 +0,0 @@ -[{"processorSpeedMhz":2400, - "uidState":"Unsupported", - "formFactor":"HalfHeight", - "stateReason":"NotApplicable", - "processorCount":2, - "shortModel":"SY 480 Gen9", - "name":"0000A66103, bay 5", - "memoryMb":524288, - "supportDataCollectionType":"", - "intelligentProvisioningVersion":"2.30", - "eTag":"1530056566573", - "serverFirmwareInventoryUri":"/rest/server-hardware/30303437-3034-4D32-3230-313132344752/firmware", - "migrationState":"NotApplicable", - "serverSettings":"", - "portMap":{ - "deviceSlots":[ - { - "slotNumber":1, - "location":"Mezz", - "deviceName":"Smart Array P542D Controller", - "deviceNumber":1, - "physicalPorts":[ - { - "wwn":"50:01:00:00:00:00:00:00", - "physicalInterconnectPort":5, - "interconnectPort":5, - "physicalInterconnectUri":"/rest/sas-interconnects/2M220104SL", - "portNumber":1, - "interconnectUri":"/rest/sas-interconnects/2M220104SL", - "virtualPorts":[ - - ], - "mac":"", - "type":"SAS" - }, - { - "wwn":"50:01:00:00:00:00:00:04", - "physicalInterconnectPort":5, - "interconnectPort":5, - "physicalInterconnectUri":"/rest/sas-interconnects/2M220105SL", - "portNumber":2, - "interconnectUri":"/rest/sas-interconnects/2M220105SL", - "virtualPorts":[ - - ], - "mac":"", - "type":"SAS" - } - ] - }, - { - "slotNumber":2, - "location":"Mezz", - "deviceName":"", - "deviceNumber":2, - "physicalPorts":[ - - ] - }, - { - "slotNumber":3, - "location":"Mezz", - "deviceName":"HPE Synergy 3820C 10/20Gb Converged Network Adapter", - "deviceNumber":3, - "physicalPorts":[ - { - "wwn":"", - "physicalInterconnectPort":5, - "interconnectPort":29, - "physicalInterconnectUri":"/rest/interconnects/ef505a29-3650-4a97-a897-38ca9770f5fe", - "portNumber":1, - "interconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "virtualPorts":[ - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"a", - "portNumber":1, - "mac":"9A:A0:22:90:00:03", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"20:00:02:23:13:25:23:AA", - "portFunction":"b", - "portNumber":2, - "mac":"02:23:13:25:23:AA", - "wwnn":"10:00:02:23:13:25:23:AA" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"c", - "portNumber":3, - "mac":"02:23:13:25:23:AB", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"d", - "portNumber":4, - "mac":"02:23:13:25:23:AC", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"e", - "portNumber":5, - "mac":"02:23:13:25:23:AD", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"f", - "portNumber":6, - "mac":"02:23:13:25:23:AE", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"g", - "portNumber":7, - "mac":"02:23:13:25:23:AF", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"h", - "portNumber":8, - "mac":"02:23:13:25:23:B0", - "wwnn":"" - } - ], - "mac":"02:23:13:25:23:A8", - "type":"Ethernet" - }, - { - "wwn":"", - "physicalInterconnectPort":5, - "interconnectPort":29, - "physicalInterconnectUri":"/rest/interconnects/bb106f16-d42a-4068-aaac-85044a893799", - "portNumber":2, - "interconnectUri":"/rest/interconnects/35db51bf-457d-4f16-a71d-cca928e43885", - "virtualPorts":[ - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"a", - "portNumber":1, - "mac":"02:23:13:25:23:B2", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"20:00:02:23:13:25:23:B3", - "portFunction":"b", - "portNumber":2, - "mac":"02:23:13:25:23:B3", - "wwnn":"10:00:02:23:13:25:23:B3" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"c", - "portNumber":3, - "mac":"02:23:13:25:23:B4", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"d", - "portNumber":4, - "mac":"02:23:13:25:23:B5", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"e", - "portNumber":5, - "mac":"02:23:13:25:23:B6", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"f", - "portNumber":6, - "mac":"02:23:13:25:23:B7", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"g", - "portNumber":7, - "mac":"02:23:13:25:23:B8", - "wwnn":"" - }, - { - "currentAllocatedVirtualFunctionCount":0, - "wwpn":"", - "portFunction":"h", - "portNumber":8, - "mac":"02:23:13:25:23:B9", - "wwnn":"" - } - ], - "mac":"02:23:13:25:23:B1", - "type":"Ethernet" - } - ] - } - ] - }, - "model":"HPE Synergy 480 Gen9 Compute Module", - "signature":{ - "personalityChecksum":2146962196, - "serverHwChecksum":1805351517 - }, - "status":"OK", - "uri":"/rest/server-hardware/30303437-3034-4D32-3230-313132344752", - "mpHostInfo":{ - "mpHostName":"172.18.6.19", - "mpIpAddresses":[ - { - "address":"fe80:0:0:0:2:ff:fe03:13", - "type":"LinkLocal" - }, - { - "address":"172.18.6.19", - "type":"Static" - } - ] - }, - "partNumber":"740040-001", - "scopeUris":"", - "powerState":"Off", - "category":"server-hardware", - "modified":"2018-06-26T23:42:46.573Z", - "supportDataCollectionsUri":"/rest/support/data-collections?deviceID=30303437-3034-4D32-3230-313132344752&category=server-hardware", - "processorCoreCount":4, - "remoteSupportUri":"/rest/support/server-hardware/30303437-3034-4D32-3230-313132344752", - "description":"", - "uuid":"30303437-3034-4D32-3230-313132344752", - "powerLock":false, - "virtualUuid":"0443b64c-7f20-4005-8ded-152774a52b99", - "position":5, - "virtualSerialNumber":"VCGU6DA004", - "assetTag":"", - "supportDataCollectionState":"", - "romVersion":"I37 v1.30 08/26/2014", - "processorType":"Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", - "serverProfileUri":"/rest/server-profiles/0443b64c-7f20-4005-8ded-152774a52b99", - "mpState":"OK", - "remoteSupportSettings":{ - "remoteSupportCurrentState":"Unregistered", - "destination":"" - }, - "refreshState":"NotRefreshing", - "created":"2018-04-10T19:49:01.962Z", - "serialNumber":"2M201124GR", - "mpFirmwareVersion":"2.30 Jul 23 2015", - "state":"ProfileApplied", - "mpModel":"iLO4", - "locationUri":"/rest/enclosures/0000000000A66103", - "serverHardwareTypeUri":"/rest/server-hardware-types/0AB36CC2-D424-4C88-9CA5-25DF0B1A2A87", - "supportState":"NotSupported", - "licensingIntent":"NotApplicable", - "serverGroupUri":"/rest/enclosure-groups/bc41f38d-e8ce-4241-acd1-00b2d8c5d0fa", - "type":"server-hardware-5" - }, - { - "mpModel":"iLO5", - "uidState":"Unsupported", - "assetTag":"", - "virtualSerialNumber":"VCGU6DA00G", - "formFactor":"HalfHeight", - "powerLock":false, - "processorCoreCount":4, - "mpFirmwareVersion":"1.10 Sep 14 2016", - "type":"server-hardware-5", - "serverProfileUri":"/rest/server-profiles/a598880b-02e9-439a-a23b-17802181e4db", - "model":"Synergy 480 Gen10", - "memoryMb":1048576, - "state":"ProfileError", - "supportDataCollectionType":"", - "serverFirmwareInventoryUri":"/rest/server-hardware/33343538-3435-4A32-3230-313130384752/firmware", - "stateReason":"NotApplicable", - "serverSettings":"", - "virtualUuid":"a598880b-02e9-439a-a23b-17802181e4db", - "migrationState":"NotApplicable", - "name":"0000A66103, bay 11", - "serialNumber":"2J201108GR", - "scopeUris":"", - "eTag":"1530056568172", - "uuid":"33343538-3435-4A32-3230-313130384752", - "remoteSupportUri":"/rest/support/server-hardware/33343538-3435-4A32-3230-313130384752", - "serverGroupUri":"/rest/enclosure-groups/bc41f38d-e8ce-4241-acd1-00b2d8c5d0fa", - "supportDataCollectionState":"", - "mpState":"OK", - "licensingIntent":"NotApplicable", - "position":11, - "uri":"/rest/server-hardware/33343538-3435-4A32-3230-313130384752", - "mpHostInfo":{ - "mpIpAddresses":[ - { - "type":"LinkLocal", - "address":"fe80:0:0:0:2:0:3:9104" - }, - { - "type":"Static", - "address":"172.18.31.5" - } - ], - "mpHostName":"172.18.31.5" - }, - "status":"OK", - "intelligentProvisioningVersion":"3.00.227", - "portMap":{ - "deviceSlots":[ - { - "deviceName":"HPE Smart Array P416ie-m SR Gen10 Controller", - "slotNumber":1, - "location":"Mezz", - "deviceNumber":1, - "physicalPorts":[ - { - "wwn":"50:01:43:80:40:AA:BB:60", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220104SL", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/sas-interconnects/2M220104SL", - "virtualPorts":[ - - ], - "type":"SAS" - }, - { - "wwn":"50:01:43:80:40:AA:BB:64", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220105SL", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/sas-interconnects/2M220105SL", - "virtualPorts":[ - - ], - "type":"SAS" - } - ] - }, - { - "deviceName":"HPE Synergy 3830C 16G Fibre Channel Host Bus Adapter", - "slotNumber":2, - "location":"Mezz", - "deviceNumber":2, - "physicalPorts":[ - { - "wwn":"29:00:7A:2B:21:E0:00:15", - "physicalInterconnectUri":"/rest/interconnects/e6fb8353-6383-483f-8c99-b15d4fd8034a", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/interconnects/e6fb8353-6383-483f-8c99-b15d4fd8034a", - "virtualPorts":[ - - ], - "type":"FibreChannel" - }, - { - "wwn":"29:00:7A:2B:21:E0:00:17", - "physicalInterconnectUri":"/rest/interconnects/cc9b9605-63dc-4456-9faa-f778fab3d71a", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/interconnects/cc9b9605-63dc-4456-9faa-f778fab3d71a", - "virtualPorts":[ - - ], - "type":"FibreChannel" - } - ] - }, - { - "deviceName":"HPE Synergy 3820C 10/20Gb Converged Network Adapter", - "slotNumber":3, - "location":"Mezz", - "deviceNumber":3, - "physicalPorts":[ - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/ef505a29-3650-4a97-a897-38ca9770f5fe", - "mac":"02:23:13:25:22:EA", - "interconnectPort":35, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "virtualPorts":[ - { - "wwpn":"", - "mac":"9A:A0:22:90:00:0D", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:22:EC", - "mac":"02:23:13:25:22:EC", - "wwnn":"10:00:02:23:13:25:22:EC", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:ED", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:EE", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:EF", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F0", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F1", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F2", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - }, - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/bb106f16-d42a-4068-aaac-85044a893799", - "mac":"02:23:13:25:22:F3", - "interconnectPort":35, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/interconnects/35db51bf-457d-4f16-a71d-cca928e43885", - "virtualPorts":[ - { - "wwpn":"", - "mac":"02:23:13:25:22:F4", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:22:F5", - "mac":"02:23:13:25:22:F5", - "wwnn":"10:00:02:23:13:25:22:F5", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F6", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F7", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F8", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:F9", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:FA", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:FB", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - } - ] - } - ] - }, - "signature":{ - "serverHwChecksum":-771745827, - "personalityChecksum":2146962196 - }, - "refreshState":"NotRefreshing", - "processorSpeedMhz":2400, - "created":"2018-04-10T19:49:18.607Z", - "serverHardwareTypeUri":"/rest/server-hardware-types/61B7D4BA-3B37-4BBB-9D97-3D2607E9BBA0", - "romVersion":"I42 v1.00 (06/20/2016)", - "modified":"2018-06-26T23:42:48.172Z", - "processorCount":2, - "description":"", - "supportDataCollectionsUri":"/rest/support/data-collections?deviceID=33343538-3435-4A32-3230-313130384752&category=server-hardware", - "remoteSupportSettings":{ - "destination":"", - "remoteSupportCurrentState":"Unregistered" - }, - "partNumber":"854354-001", - "supportState":"NotSupported", - "locationUri":"/rest/enclosures/0000000000A66103", - "powerState":"Off", - "category":"server-hardware", - "shortModel":"SY 480 Gen10", - "processorType":"Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" - }, - { - "mpModel":"iLO4", - "uidState":"Unsupported", - "assetTag":"", - "virtualSerialNumber":"VCGU6DA002", - "formFactor":"HalfHeight", - "powerLock":false, - "processorCoreCount":4, - "mpFirmwareVersion":"2.30 Jul 23 2015", - "type":"server-hardware-5", - "serverProfileUri":"/rest/server-profiles/b425802b-a6a5-4941-8885-aab68dfa2ee2", - "model":"HPE Synergy 480 Gen9 Compute Module", - "memoryMb":524288, - "state":"ProfileApplied", - "supportDataCollectionType":"", - "serverFirmwareInventoryUri":"/rest/server-hardware/30303437-3034-4D32-3230-313130304752/firmware", - "stateReason":"NotApplicable", - "serverSettings":"", - "virtualUuid":"b425802b-a6a5-4941-8885-aab68dfa2ee2", - "migrationState":"NotApplicable", - "name":"0000A66101, bay 5", - "serialNumber":"2M201100GR", - "scopeUris":"", - "eTag":"1530056511713", - "uuid":"30303437-3034-4D32-3230-313130304752", - "remoteSupportUri":"/rest/support/server-hardware/30303437-3034-4D32-3230-313130304752", - "serverGroupUri":"/rest/enclosure-groups/bc41f38d-e8ce-4241-acd1-00b2d8c5d0fa", - "supportDataCollectionState":"", - "mpState":"OK", - "licensingIntent":"NotApplicable", - "position":5, - "uri":"/rest/server-hardware/30303437-3034-4D32-3230-313130304752", - "mpHostInfo":{ - "mpIpAddresses":[ - { - "type":"LinkLocal", - "address":"fe80:0:0:0:2:ff:fe03:2" - }, - { - "type":"Static", - "address":"172.18.6.2" - } - ], - "mpHostName":"172.18.6.2" - }, - "status":"Warning", - "intelligentProvisioningVersion":"2.30", - "portMap":{ - "deviceSlots":[ - { - "deviceName":"Smart Array P542D Controller", - "slotNumber":1, - "location":"Mezz", - "deviceNumber":1, - "physicalPorts":[ - { - "wwn":"50:01:00:00:00:00:00:00", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220100SL", - "mac":"", - "interconnectPort":5, - "physicalInterconnectPort":5, - "portNumber":1, - "interconnectUri":"/rest/sas-interconnects/2M220100SL", - "virtualPorts":[ - - ], - "type":"SAS" - }, - { - "wwn":"50:01:00:00:00:00:00:04", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220101SL", - "mac":"", - "interconnectPort":5, - "physicalInterconnectPort":5, - "portNumber":2, - "interconnectUri":"/rest/sas-interconnects/2M220101SL", - "virtualPorts":[ - - ], - "type":"SAS" - } - ] - }, - { - "deviceName":"", - "slotNumber":2, - "location":"Mezz", - "deviceNumber":2, - "physicalPorts":[ - - ] - }, - { - "deviceName":"HPE Synergy 3820C 10/20Gb Converged Network Adapter", - "slotNumber":3, - "location":"Mezz", - "deviceNumber":3, - "physicalPorts":[ - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "mac":"02:23:13:25:23:10", - "interconnectPort":5, - "physicalInterconnectPort":5, - "portNumber":1, - "interconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "virtualPorts":[ - { - "wwpn":"", - "mac":"9A:A0:22:90:00:01", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:23:12", - "mac":"02:23:13:25:23:12", - "wwnn":"10:00:02:23:13:25:23:12", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:13", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:14", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:15", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:16", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:17", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:18", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - }, - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/69343adc-42df-485a-b2de-b90993f2f658", - "mac":"02:23:13:25:23:19", - "interconnectPort":17, - "physicalInterconnectPort":5, - "portNumber":2, - "interconnectUri":"/rest/interconnects/35db51bf-457d-4f16-a71d-cca928e43885", - "virtualPorts":[ - { - "wwpn":"", - "mac":"02:23:13:25:23:1A", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:23:1B", - "mac":"02:23:13:25:23:1B", - "wwnn":"10:00:02:23:13:25:23:1B", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:1C", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:1D", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:1E", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:1F", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:20", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:23:21", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - } - ] - } - ] - }, - "signature":{ - "serverHwChecksum":1805351517, - "personalityChecksum":663766789 - }, - "refreshState":"NotRefreshing", - "processorSpeedMhz":2400, - "created":"2018-04-10T19:49:42.042Z", - "serverHardwareTypeUri":"/rest/server-hardware-types/0AB36CC2-D424-4C88-9CA5-25DF0B1A2A87", - "romVersion":"I37 v1.30 08/26/2014", - "modified":"2018-06-26T23:41:51.713Z", - "processorCount":2, - "description":"", - "supportDataCollectionsUri":"/rest/support/data-collections?deviceID=30303437-3034-4D32-3230-313130304752&category=server-hardware", - "remoteSupportSettings":{ - "destination":"", - "remoteSupportCurrentState":"Unregistered" - }, - "partNumber":"740040-001", - "supportState":"NotSupported", - "locationUri":"/rest/enclosures/0000000000A66101", - "powerState":"On", - "category":"server-hardware", - "shortModel":"SY 480 Gen9", - "processorType":"Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" - }, - { - "mpModel":"iLO5", - "uidState":"Unsupported", - "assetTag":"", - "virtualSerialNumber":"VCGU6DA00U", - "formFactor":"HalfHeight", - "powerLock":false, - "processorCoreCount":4, - "mpFirmwareVersion":"1.10 Sep 14 2016", - "type":"server-hardware-5", - "serverProfileUri":"/rest/server-profiles/ad04475c-94aa-4843-b8fc-3c78f4e6c2e8", - "model":"Synergy 480 Gen10", - "memoryMb":1048576, - "state":"ProfileError", - "supportDataCollectionType":"", - "serverFirmwareInventoryUri":"/rest/server-hardware/33343538-3435-4A32-3230-313130304752/firmware", - "stateReason":"NotApplicable", - "serverSettings":"", - "virtualUuid":"ad04475c-94aa-4843-b8fc-3c78f4e6c2e8", - "migrationState":"NotApplicable", - "name":"0000A66101, bay 11", - "serialNumber":"2J201100GR", - "scopeUris":"", - "eTag":"1530056513800", - "uuid":"33343538-3435-4A32-3230-313130304752", - "remoteSupportUri":"/rest/support/server-hardware/33343538-3435-4A32-3230-313130304752", - "serverGroupUri":"/rest/enclosure-groups/bc41f38d-e8ce-4241-acd1-00b2d8c5d0fa", - "supportDataCollectionState":"", - "mpState":"OK", - "licensingIntent":"NotApplicable", - "position":11, - "uri":"/rest/server-hardware/33343538-3435-4A32-3230-313130304752", - "mpHostInfo":{ - "mpIpAddresses":[ - { - "type":"LinkLocal", - "address":"fe80:0:0:0:2:0:3:9100" - }, - { - "type":"Static", - "address":"172.18.31.1" - } - ], - "mpHostName":"172.18.31.1" - }, - "status":"OK", - "intelligentProvisioningVersion":"3.00.227", - "portMap":{ - "deviceSlots":[ - { - "deviceName":"HPE Smart Array P416ie-m SR Gen10 Controller", - "slotNumber":1, - "location":"Mezz", - "deviceNumber":1, - "physicalPorts":[ - { - "wwn":"50:01:43:80:40:AA:BB:60", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220100SL", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/sas-interconnects/2M220100SL", - "virtualPorts":[ - - ], - "type":"SAS" - }, - { - "wwn":"50:01:43:80:40:AA:BB:64", - "physicalInterconnectUri":"/rest/sas-interconnects/2M220101SL", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/sas-interconnects/2M220101SL", - "virtualPorts":[ - - ], - "type":"SAS" - } - ] - }, - { - "deviceName":"HPE Synergy 3830C 16G Fibre Channel Host Bus Adapter", - "slotNumber":2, - "location":"Mezz", - "deviceNumber":2, - "physicalPorts":[ - { - "wwn":"29:00:7A:2B:21:E0:00:0D", - "physicalInterconnectUri":"/rest/interconnects/34e661f9-06eb-465b-859b-282c3a7cb88f", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/interconnects/34e661f9-06eb-465b-859b-282c3a7cb88f", - "virtualPorts":[ - - ], - "type":"FibreChannel" - }, - { - "wwn":"29:00:7A:2B:21:E0:00:0F", - "physicalInterconnectUri":"/rest/interconnects/8cb3c588-6f85-4197-b015-692807101c55", - "mac":"", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/interconnects/8cb3c588-6f85-4197-b015-692807101c55", - "virtualPorts":[ - - ], - "type":"FibreChannel" - } - ] - }, - { - "deviceName":"HPE Synergy 3820C 10/20Gb Converged Network Adapter", - "slotNumber":3, - "location":"Mezz", - "deviceNumber":3, - "physicalPorts":[ - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "mac":"02:23:13:25:22:C2", - "interconnectPort":11, - "physicalInterconnectPort":11, - "portNumber":1, - "interconnectUri":"/rest/interconnects/f3b2b71e-4f7d-41d1-abc7-5f621459c87b", - "virtualPorts":[ - { - "wwpn":"", - "mac":"9A:A0:22:90:00:17", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:22:C4", - "mac":"02:23:13:25:22:C4", - "wwnn":"10:00:02:23:13:25:22:C4", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:C5", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:C6", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:C7", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:C8", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:C9", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:CA", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - }, - { - "wwn":"", - "physicalInterconnectUri":"/rest/interconnects/69343adc-42df-485a-b2de-b90993f2f658", - "mac":"02:23:13:25:22:CB", - "interconnectPort":23, - "physicalInterconnectPort":11, - "portNumber":2, - "interconnectUri":"/rest/interconnects/35db51bf-457d-4f16-a71d-cca928e43885", - "virtualPorts":[ - { - "wwpn":"", - "mac":"02:23:13:25:22:CC", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":1, - "portFunction":"a" - }, - { - "wwpn":"20:00:02:23:13:25:22:CD", - "mac":"02:23:13:25:22:CD", - "wwnn":"10:00:02:23:13:25:22:CD", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":2, - "portFunction":"b" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:CE", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":3, - "portFunction":"c" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:CF", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":4, - "portFunction":"d" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:D0", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":5, - "portFunction":"e" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:D1", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":6, - "portFunction":"f" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:D2", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":7, - "portFunction":"g" - }, - { - "wwpn":"", - "mac":"02:23:13:25:22:D3", - "wwnn":"", - "currentAllocatedVirtualFunctionCount":0, - "portNumber":8, - "portFunction":"h" - } - ], - "type":"Ethernet" - } - ] - } - ] - }, - "signature":{ - "serverHwChecksum":-771745827, - "personalityChecksum":2065902849 - }, - "refreshState":"NotRefreshing", - "processorSpeedMhz":2400, - "created":"2018-04-10T19:49:51.529Z", - "serverHardwareTypeUri":"/rest/server-hardware-types/61B7D4BA-3B37-4BBB-9D97-3D2607E9BBA0", - "romVersion":"I42 v1.00 (06/20/2016)", - "modified":"2018-06-26T23:41:53.800Z", - "processorCount":2, - "description":"", - "supportDataCollectionsUri":"/rest/support/data-collections?deviceID=33343538-3435-4A32-3230-313130304752&category=server-hardware", - "remoteSupportSettings":{ - "destination":"", - "remoteSupportCurrentState":"Unregistered" - }, - "partNumber":"854354-001", - "supportState":"NotSupported", - "locationUri":"/rest/enclosures/0000000000A66101", - "powerState":"Off", - "category":"server-hardware", - "shortModel":"SY 480 Gen10", - "processorType":"Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" - }] \ No newline at end of file diff --git a/oneview_redfish_toolkit/mockups/oneview/ServerProfileList.json b/oneview_redfish_toolkit/mockups/oneview/ServerProfileList.json new file mode 100644 index 00000000..5c416825 --- /dev/null +++ b/oneview_redfish_toolkit/mockups/oneview/ServerProfileList.json @@ -0,0 +1,856 @@ +[ + { + "type": "ServerProfileV8", + "uri": "/rest/server-profiles/592bedb3-a6e0-4381-a8ba-6206c613c455", + "name": "Composed System using Redfish", + "description": "Description for Composed System", + "serialNumber": "VCGP38O01Y", + "uuid": "592bedb3-a6e0-4381-a8ba-6206c613c455", + "iscsiInitiatorName": "iqn.2015-02.com.hpe:oneview-vcgp38o01y", + "iscsiInitiatorNameType": "AutoGenerated", + "serverProfileTemplateUri": null, + "templateCompliance": "Unknown", + "serverHardwareUri": "/rest/server-hardware/30303437-3034-4D32-3230-313131324752", + "serverHardwareTypeUri": "/rest/server-hardware-types/14CD2E82-3F70-4971-BFC3-41E54A032229", + "enclosureGroupUri": "/rest/enclosure-groups/e8cdfc99-3e4b-4886-82d3-af1a6767e7d1", + "enclosureUri": "/rest/enclosures/0000000000A66102", + "enclosureBay": 5, + "affinity": "Bay", + "associatedServer": null, + "hideUnusedFlexNics": true, + "firmware": { + "firmwareBaselineUri": null, + "manageFirmware": false, + "forceInstallFirmware": false, + "firmwareInstallType": null, + "firmwareScheduleDateTime": null, + "firmwareActivationType": null, + "reapplyState": "NotApplying" + }, + "macType": "Virtual", + "wwnType": "Virtual", + "serialNumberType": "Virtual", + "category": "server-profiles", + "created": "2018-10-29T15:19:24.391Z", + "modified": "2018-10-29T15:26:11.753Z", + "status": "OK", + "state": "Normal", + "serverHardwareReapplyState": "NotApplying", + "inProgress": false, + "taskUri": "/rest/tasks/DD392445-DF21-4087-9D89-1FA7FC59F3C4", + "connectionSettings": { + "reapplyState": "NotApplying", + "connections": [] + }, + "bootMode": { + "manageMode": true, + "mode": "UEFI", + "pxeBootPolicy": "Auto", + "secureBoot": "Unmanaged" + }, + "boot": { + "manageBoot": true, + "order": [ + "HardDisk" + ] + }, + "bios": { + "manageBios": false, + "overriddenSettings": [], + "reapplyState": "NotApplying" + }, + "localStorage": { + "sasLogicalJBODs": [ + { + "id": 1, + "deviceSlot": "Mezz 1", + "name": "Storage 1", + "numPhysicalDrives": 1, + "driveMinSizeGB": 200, + "driveMaxSizeGB": 200, + "driveTechnology": "SataSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/352e381d-ca9a-46d5-bd36-5a298791eb29", + "eraseData": false, + "status": "OK" + } + ], + "controllers": [ + { + "deviceSlot": "Mezz 1", + "mode": "HBA", + "initialize": false, + "importConfiguration": false, + "logicalDrives": [] + }, + { + "deviceSlot": "Embedded", + "mode": "HBA", + "initialize": false, + "importConfiguration": false, + "logicalDrives": [] + } + ], + "reapplyState": "NotApplying" + }, + "sanStorage": { + "manageSanStorage": false, + "volumeAttachments": [], + "sanSystemCredentials": [], + "reapplyState": "NotApplying" + }, + "osDeploymentSettings": null, + "scopesUri": "/rest/scopes/resources/rest/server-profiles/592bedb3-a6e0-4381-a8ba-6206c613c455", + "eTag": "1540826374523/5", + "refreshState": "NotRefreshing" + }, + { + "type": "ServerProfileV8", + "uri": "/rest/server-profiles/7f5a1cd6-cce3-4d6e-bd25-6fdff7ccefb3", + "name": "Composed System Using Redfish 2", + "description": "", + "serialNumber": "VCGP38O01P", + "uuid": "7f5a1cd6-cce3-4d6e-bd25-6fdff7ccefb3", + "iscsiInitiatorName": "iqn.2015-02.com.hpe:oneview-vcgp38o01p", + "iscsiInitiatorNameType": "AutoGenerated", + "serverProfileTemplateUri": null, + "templateCompliance": "Unknown", + "serverHardwareUri": "/rest/server-hardware/30303437-3034-4D32-3230-313132344752", + "serverHardwareTypeUri": "/rest/server-hardware-types/14CD2E82-3F70-4971-BFC3-41E54A032229", + "enclosureGroupUri": "/rest/enclosure-groups/e8cdfc99-3e4b-4886-82d3-af1a6767e7d1", + "enclosureUri": "/rest/enclosures/0000000000A66103", + "enclosureBay": 5, + "affinity": "Bay", + "associatedServer": null, + "hideUnusedFlexNics": true, + "firmware": { + "firmwareBaselineUri": null, + "manageFirmware": false, + "forceInstallFirmware": false, + "firmwareInstallType": null, + "firmwareScheduleDateTime": null, + "firmwareActivationType": null, + "reapplyState": "NotApplying" + }, + "macType": "Virtual", + "wwnType": "Virtual", + "serialNumberType": "Virtual", + "category": "server-profiles", + "created": "2018-10-17T13:40:40.743Z", + "modified": "2018-10-17T14:15:42.359Z", + "status": "OK", + "state": "Normal", + "serverHardwareReapplyState": "NotApplying", + "inProgress": false, + "taskUri": "/rest/tasks/87FA8731-EBB3-4BDF-8483-9201F46D91A7", + "connectionSettings": { + "reapplyState": "NotApplying", + "connections": [ + { + "id": 1, + "name": "conn_1", + "functionType": "Ethernet", + "networkUri": "/rest/ethernet-networks/8149551f-9bc0-45b7-9f62-bd930e1ac735", + "portId": "Mezz 3:1-a", + "requestedVFs": "0", + "allocatedVFs": 0, + "interconnectUri": "/rest/interconnects/cc8a4283-0e47-4775-8cef-7a71cab8dde5", + "macType": "Virtual", + "wwpnType": "Virtual", + "mac": "52:08:E0:40:00:2E", + "wwnn": null, + "wwpn": null, + "requestedMbps": "2500", + "allocatedMbps": 2500, + "maximumMbps": 20000, + "ipv4": null, + "boot": { + "priority": "Primary", + "ethernetBootType": "PXE" + }, + "state": "Deployed", + "status": "OK", + "networkName": null, + "lagName": null + } + ] + }, + "bootMode": { + "manageMode": true, + "mode": "BIOS", + "pxeBootPolicy": null, + "secureBoot": "Disabled" + }, + "boot": { + "manageBoot": true, + "order": [ + "CD", + "USB", + "HardDisk", + "PXE" + ] + }, + "bios": { + "manageBios": false, + "overriddenSettings": [], + "reapplyState": "NotApplying" + }, + "localStorage": { + "sasLogicalJBODs": [ + { + "id": 7, + "deviceSlot": "Mezz 1", + "name": "Storage 7", + "numPhysicalDrives": 1, + "driveMinSizeGB": 600, + "driveMaxSizeGB": 600, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/84d6174a-3160-4ccd-b35c-dbb423ddb0a5", + "eraseData": false, + "status": "OK" + }, + { + "id": 8, + "deviceSlot": "Mezz 1", + "name": "Storage 8", + "numPhysicalDrives": 1, + "driveMinSizeGB": 600, + "driveMaxSizeGB": 600, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/104685a3-3744-4f00-89bf-88d78c5d932f", + "eraseData": false, + "status": "OK" + }, + { + "id": 9, + "deviceSlot": "Mezz 1", + "name": "Storage 9", + "numPhysicalDrives": 1, + "driveMinSizeGB": 600, + "driveMaxSizeGB": 600, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/381fc016-ef62-43ba-b1fc-066949436deb", + "eraseData": false, + "status": "OK" + }, + { + "id": 10, + "deviceSlot": "Mezz 1", + "name": "Storage 10", + "numPhysicalDrives": 1, + "driveMinSizeGB": 800, + "driveMaxSizeGB": 800, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/d272fba2-3efd-4772-b40d-f30548541c6d", + "eraseData": false, + "status": "OK" + }, + { + "id": 11, + "deviceSlot": "Mezz 1", + "name": "Storage 11", + "numPhysicalDrives": 1, + "driveMinSizeGB": 800, + "driveMaxSizeGB": 800, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/8784d9a4-7f42-48d3-a40d-6e00d3873dcd", + "eraseData": false, + "status": "OK" + }, + { + "id": 12, + "deviceSlot": "Mezz 1", + "name": "Storage 12", + "numPhysicalDrives": 1, + "driveMinSizeGB": 800, + "driveMaxSizeGB": 800, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/3eca5d0e-c61a-4532-b502-df804875f1cf", + "eraseData": false, + "status": "OK" + }, + { + "id": 1, + "deviceSlot": "Mezz 1", + "name": "Storage 1", + "numPhysicalDrives": 1, + "driveMinSizeGB": 100, + "driveMaxSizeGB": 100, + "driveTechnology": "SataSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/929e351d-85e1-418d-81b7-dbf8976cf701", + "eraseData": false, + "status": "OK" + }, + { + "id": 2, + "deviceSlot": "Mezz 1", + "name": "Storage 2", + "numPhysicalDrives": 1, + "driveMinSizeGB": 200, + "driveMaxSizeGB": 200, + "driveTechnology": "SataSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/9373ae56-85e7-45e4-aa6b-c43d2bab4228", + "eraseData": false, + "status": "OK" + }, + { + "id": 3, + "deviceSlot": "Mezz 1", + "name": "Storage 3", + "numPhysicalDrives": 1, + "driveMinSizeGB": 400, + "driveMaxSizeGB": 400, + "driveTechnology": "SataSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/06656c38-db6e-4370-8aa3-a30b46d49599", + "eraseData": false, + "status": "OK" + }, + { + "id": 4, + "deviceSlot": "Mezz 1", + "name": "Storage 4", + "numPhysicalDrives": 1, + "driveMinSizeGB": 500, + "driveMaxSizeGB": 500, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/b5ee7ebb-c49c-4c9e-9b83-a8074cbcf954", + "eraseData": false, + "status": "OK" + }, + { + "id": 5, + "deviceSlot": "Mezz 1", + "name": "Storage 5", + "numPhysicalDrives": 1, + "driveMinSizeGB": 500, + "driveMaxSizeGB": 500, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/85d2546c-3124-4993-b578-2666f49956b2", + "eraseData": false, + "status": "OK" + }, + { + "id": 6, + "deviceSlot": "Mezz 1", + "name": "Storage 6", + "numPhysicalDrives": 1, + "driveMinSizeGB": 500, + "driveMaxSizeGB": 500, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/10add67d-e0b1-4cad-9a5a-32173fc3b05c", + "eraseData": false, + "status": "OK" + }, + { + "id": 23, + "deviceSlot": "Mezz 1", + "name": "Storage 23", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1662, + "driveMaxSizeGB": 1662, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/a5632dbc-57da-43ef-a2ec-c3ea66a27bb9", + "eraseData": false, + "status": "OK" + }, + { + "id": 24, + "deviceSlot": "Mezz 1", + "name": "Storage 24", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1662, + "driveMaxSizeGB": 1662, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/66130bcb-d029-45fd-b7b2-4773eaff67d9", + "eraseData": false, + "status": "OK" + }, + { + "id": 25, + "deviceSlot": "Mezz 1", + "name": "Storage 25", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1864, + "driveMaxSizeGB": 1864, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/a9d03036-853b-44c9-a553-1a12e73997e9", + "eraseData": false, + "status": "OK" + }, + { + "id": 13, + "deviceSlot": "Mezz 1", + "name": "Storage 13", + "numPhysicalDrives": 1, + "driveMinSizeGB": 900, + "driveMaxSizeGB": 900, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/407525a5-5da6-479a-8f4c-240ea9a2b23e", + "eraseData": false, + "status": "OK" + }, + { + "id": 14, + "deviceSlot": "Mezz 1", + "name": "Storage 14", + "numPhysicalDrives": 1, + "driveMinSizeGB": 900, + "driveMaxSizeGB": 900, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/cd86ac03-d72a-44d7-b539-0308998fadef", + "eraseData": false, + "status": "OK" + }, + { + "id": 15, + "deviceSlot": "Mezz 1", + "name": "Storage 15", + "numPhysicalDrives": 1, + "driveMinSizeGB": 900, + "driveMaxSizeGB": 900, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/e090b037-9356-48d3-8773-1a83e9b3ea03", + "eraseData": false, + "status": "OK" + }, + { + "id": 16, + "deviceSlot": "Mezz 1", + "name": "Storage 16", + "numPhysicalDrives": 1, + "driveMinSizeGB": 971, + "driveMaxSizeGB": 971, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/0df90093-0858-48c0-949a-24598d7d4f92", + "eraseData": false, + "status": "OK" + }, + { + "id": 17, + "deviceSlot": "Mezz 1", + "name": "Storage 17", + "numPhysicalDrives": 1, + "driveMinSizeGB": 971, + "driveMaxSizeGB": 971, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/4dc42ca7-be3a-4cb5-aaf3-f61f9b95957f", + "eraseData": false, + "status": "OK" + }, + { + "id": 18, + "deviceSlot": "Mezz 1", + "name": "Storage 18", + "numPhysicalDrives": 1, + "driveMinSizeGB": 971, + "driveMaxSizeGB": 971, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/c5079ef1-a55f-4c6c-9def-c80d62cc7ca8", + "eraseData": false, + "status": "OK" + }, + { + "id": 19, + "deviceSlot": "Mezz 1", + "name": "Storage 19", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1200, + "driveMaxSizeGB": 1200, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/6b3f8365-f889-45af-9492-31fcd67ac7d2", + "eraseData": false, + "status": "OK" + }, + { + "id": 20, + "deviceSlot": "Mezz 1", + "name": "Storage 20", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1200, + "driveMaxSizeGB": 1200, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/c1aa5587-3fa5-4806-83cf-9cc74f5b8cd4", + "eraseData": false, + "status": "OK" + }, + { + "id": 26, + "deviceSlot": "Mezz 1", + "name": "Storage 26", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1864, + "driveMaxSizeGB": 1864, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/b4d20fbc-6d7d-4e87-b535-fb12d6cff09b", + "eraseData": false, + "status": "OK" + }, + { + "id": 21, + "deviceSlot": "Mezz 1", + "name": "Storage 21", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1200, + "driveMaxSizeGB": 1200, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/cd083767-5623-4c6b-b3b4-7f140b203215", + "eraseData": false, + "status": "OK" + }, + { + "id": 22, + "deviceSlot": "Mezz 1", + "name": "Storage 22", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1662, + "driveMaxSizeGB": 1662, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/be069678-7439-42d4-a2d0-d9ea7fc98925", + "eraseData": false, + "status": "OK" + }, + { + "id": 27, + "deviceSlot": "Mezz 1", + "name": "Storage 27", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1864, + "driveMaxSizeGB": 1864, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/d3a18d36-263b-41b8-b006-7ad197867920", + "eraseData": false, + "status": "OK" + }, + { + "id": 28, + "deviceSlot": "Mezz 1", + "name": "Storage 28", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1864, + "driveMaxSizeGB": 1864, + "driveTechnology": "SasHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/c3bbef42-cc84-485c-80e1-d46ee6e240b6", + "eraseData": false, + "status": "OK" + }, + { + "id": 29, + "deviceSlot": "Mezz 1", + "name": "Storage 29", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1988, + "driveMaxSizeGB": 1988, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/3f65eedf-34b3-4a06-ae4c-a35835b93316", + "eraseData": false, + "status": "OK" + }, + { + "id": 30, + "deviceSlot": "Mezz 1", + "name": "Storage 30", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1988, + "driveMaxSizeGB": 1988, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/bfadf329-cd47-4b62-a093-ba5d746664f9", + "eraseData": false, + "status": "OK" + }, + { + "id": 31, + "deviceSlot": "Mezz 1", + "name": "Storage 31", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1988, + "driveMaxSizeGB": 1988, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/44ae5914-68c6-4a73-ac1a-118e06c2e90b", + "eraseData": false, + "status": "OK" + }, + { + "id": 32, + "deviceSlot": "Mezz 1", + "name": "Storage 32", + "numPhysicalDrives": 1, + "driveMinSizeGB": 1988, + "driveMaxSizeGB": 1988, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/fe20acd9-c368-4da5-8810-622d4444552c", + "eraseData": false, + "status": "OK" + }, + { + "id": 33, + "deviceSlot": "Mezz 1", + "name": "Storage 33", + "numPhysicalDrives": 1, + "driveMinSizeGB": 2048, + "driveMaxSizeGB": 2048, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/867d9953-7078-4354-9611-0cc37ea751fc", + "eraseData": false, + "status": "OK" + }, + { + "id": 34, + "deviceSlot": "Mezz 1", + "name": "Storage 34", + "numPhysicalDrives": 1, + "driveMinSizeGB": 2048, + "driveMaxSizeGB": 2048, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/e8c240a2-3de8-4597-bc5e-956743511f22", + "eraseData": false, + "status": "OK" + }, + { + "id": 35, + "deviceSlot": "Mezz 1", + "name": "Storage 35", + "numPhysicalDrives": 1, + "driveMinSizeGB": 2048, + "driveMaxSizeGB": 2048, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/29143ddc-2300-49d4-974d-5a14f394110c", + "eraseData": false, + "status": "OK" + }, + { + "id": 36, + "deviceSlot": "Mezz 1", + "name": "Storage 36", + "numPhysicalDrives": 1, + "driveMinSizeGB": 2048, + "driveMaxSizeGB": 2048, + "driveTechnology": "SataHdd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/04108919-869a-4d4f-92dd-254042d4f677", + "eraseData": false, + "status": "OK" + }, + { + "id": 37, + "deviceSlot": "Mezz 1", + "name": "Storage 37", + "numPhysicalDrives": 1, + "driveMinSizeGB": 3276, + "driveMaxSizeGB": 3276, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/8c278a9e-95d2-4618-b404-efca8ea1ad8b", + "eraseData": false, + "status": "OK" + }, + { + "id": 38, + "deviceSlot": "Mezz 1", + "name": "Storage 38", + "numPhysicalDrives": 1, + "driveMinSizeGB": 3276, + "driveMaxSizeGB": 3276, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/c4ad5fa9-9150-4a25-934d-1e48493e62fc", + "eraseData": false, + "status": "OK" + }, + { + "id": 39, + "deviceSlot": "Mezz 1", + "name": "Storage 39", + "numPhysicalDrives": 1, + "driveMinSizeGB": 3276, + "driveMaxSizeGB": 3276, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/5a907cb9-1a80-471c-a593-a7a28fc347bf", + "eraseData": false, + "status": "OK" + }, + { + "id": 40, + "deviceSlot": "Mezz 1", + "name": "Storage 40", + "numPhysicalDrives": 1, + "driveMinSizeGB": 3276, + "driveMaxSizeGB": 3276, + "driveTechnology": "SasSsd", + "sasLogicalJBODUri": "/rest/sas-logical-jbods/d61290d0-6c82-417f-93e3-f695fefd47a2", + "eraseData": false, + "status": "OK" + } + ], + "controllers": [ + { + "deviceSlot": "Mezz 1", + "mode": "HBA", + "initialize": false, + "importConfiguration": false, + "logicalDrives": [] + }, + { + "deviceSlot": "Embedded", + "mode": "HBA", + "initialize": false, + "importConfiguration": false, + "logicalDrives": [] + } + ], + "reapplyState": "NotApplying" + }, + "sanStorage": { + "manageSanStorage": false, + "volumeAttachments": [], + "sanSystemCredentials": [], + "reapplyState": "NotApplying" + }, + "osDeploymentSettings": null, + "scopesUri": "/rest/scopes/resources/rest/server-profiles/7f5a1cd6-cce3-4d6e-bd25-6fdff7ccefb3", + "eTag": "1539785381252/8", + "refreshState": "NotRefreshing" + }, + { + "type": "ServerProfileV8", + "name": "test", + "uri": "/rest/server-profiles/22b73a80-2e61-4b3a-b00f-deea92c6dbcb", + "description": "", + "serialNumber": "VCGU6DA02P", + "uuid": "22b73a80-2e61-4b3a-b00f-deea92c6dbcb", + "iscsiInitiatorName": "iqn.2015-02.com.hpe:oneview-vcgu6da02p", + "iscsiInitiatorNameType": "AutoGenerated", + "serverProfileTemplateUri": "/rest/server-profile-templates/13d6739e-2856-4744-8a10-63ccbda0268e", + "templateCompliance": "Compliant", + "serverHardwareUri": null, + "serverHardwareTypeUri": "/rest/server-hardware-types/0AB36CC2-D424-4C88-9CA5-25DF0B1A2A87", + "enclosureGroupUri": "/rest/enclosure-groups/bc41f38d-e8ce-4241-acd1-00b2d8c5d0fa", + "enclosureUri": null, + "enclosureBay": null, + "affinity": "Bay", + "associatedServer": null, + "hideUnusedFlexNics": true, + "firmware": { + "firmwareBaselineUri": null, + "manageFirmware": false, + "forceInstallFirmware": false, + "firmwareInstallType": null, + "firmwareScheduleDateTime": null, + "firmwareActivationType": null, + "reapplyState": "NotApplying" + }, + "macType": "Virtual", + "wwnType": "Virtual", + "serialNumberType": "Virtual", + "category": "server-profiles", + "created": "2018-10-29T21:22:25.629Z", + "modified": "2018-10-29T21:22:39.292Z", + "status": "OK", + "state": "Normal", + "serverHardwareReapplyState": "NotApplying", + "inProgress": false, + "taskUri": "/rest/tasks/4F57E1C5-D42F-4B70-9570-4351C1171CA7", + "connectionSettings": { + "reapplyState": "NotApplying", + "connections": [ + { + "id": 1, + "name": "production", + "functionType": "Ethernet", + "networkUri": "/rest/ethernet-networks/19638712-679d-4232-9743-c7cb6c7bf718", + "portId": "Mezz 3:1-a", + "requestedVFs": "0", + "allocatedVFs": 0, + "interconnectUri": null, + "macType": "Virtual", + "wwpnType": "Virtual", + "mac": "9A:A0:22:90:00:69", + "wwnn": null, + "wwpn": null, + "requestedMbps": "2500", + "allocatedMbps": 2500, + "maximumMbps": 20000, + "ipv4": null, + "boot": { + "priority": "NotBootable" + }, + "state": "Reserved", + "status": "Disabled", + "networkName": null, + "lagName": null + }, + { + "id": 2, + "name": "production_set", + "functionType": "Ethernet", + "networkUri": "/rest/network-sets/76f584da-1f9d-40b8-9b9d-5ccb09810142", + "portId": "Mezz 3:2-a", + "requestedVFs": "0", + "allocatedVFs": 0, + "interconnectUri": null, + "macType": "Virtual", + "wwpnType": "Virtual", + "mac": "9A:A0:22:90:00:6A", + "wwnn": null, + "wwpn": null, + "requestedMbps": "5000", + "allocatedMbps": 5000, + "maximumMbps": 20000, + "ipv4": null, + "boot": { + "priority": "NotBootable" + }, + "state": "Reserved", + "status": "Disabled", + "networkName": null, + "lagName": null + } + ] + }, + "bootMode": { + "manageMode": true, + "mode": "BIOS", + "pxeBootPolicy": null, + "secureBoot": "Unmanaged" + }, + "boot": { + "manageBoot": true, + "order": [ + "CD", + "USB", + "HardDisk", + "PXE" + ] + }, + "bios": { + "manageBios": false, + "overriddenSettings": [], + "reapplyState": "NotApplying" + }, + "localStorage": { + "sasLogicalJBODs": [], + "controllers": [ + { + "deviceSlot": "Embedded", + "mode": "HBA", + "initialize": true, + "importConfiguration": false, + "logicalDrives": [] + }, + { + "deviceSlot": "Mezz 1", + "mode": "HBA", + "initialize": true, + "importConfiguration": false, + "logicalDrives": [] + } + ], + "reapplyState": "NotApplying" + }, + "sanStorage": { + "manageSanStorage": false, + "volumeAttachments": [], + "sanSystemCredentials": [], + "reapplyState": "NotApplying" + }, + "osDeploymentSettings": null, + "scopesUri": "/rest/scopes/resources/rest/server-profiles/22b73a80-2e61-4b3a-b00f-deea92c6dbcb", + "eTag": "1540848158296/2", + "refreshState": "NotRefreshing" + } +] \ No newline at end of file diff --git a/oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollection.json b/oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollection.json index c966ebb9..0fcc5f6f 100644 --- a/oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollection.json +++ b/oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollection.json @@ -1,19 +1,13 @@ { "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection", "Name": "Computer System Collection", - "Members@odata.count": 4, + "Members@odata.count": 2, "Members": [ { - "@odata.id": "/redfish/v1/Systems/0443b64c-7f20-4005-8ded-152774a52b99" + "@odata.id": "/redfish/v1/Systems/592bedb3-a6e0-4381-a8ba-6206c613c455" }, { - "@odata.id": "/redfish/v1/Systems/a598880b-02e9-439a-a23b-17802181e4db" - }, - { - "@odata.id": "/redfish/v1/Systems/b425802b-a6a5-4941-8885-aab68dfa2ee2" - }, - { - "@odata.id": "/redfish/v1/Systems/ad04475c-94aa-4843-b8fc-3c78f4e6c2e8" + "@odata.id": "/redfish/v1/Systems/7f5a1cd6-cce3-4d6e-bd25-6fdff7ccefb3" } ], "@Redfish.CollectionCapabilities": { diff --git a/oneview_redfish_toolkit/mockups/redfish/ServerProfilesAppliedCollectionEmpty.json b/oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollectionEmpty.json similarity index 100% rename from oneview_redfish_toolkit/mockups/redfish/ServerProfilesAppliedCollectionEmpty.json rename to oneview_redfish_toolkit/mockups/redfish/ComputerSystemCollectionEmpty.json diff --git a/oneview_redfish_toolkit/tests/api/test_computer_system_collection.py b/oneview_redfish_toolkit/tests/api/test_computer_system_collection.py index 4237a0da..3da2b561 100644 --- a/oneview_redfish_toolkit/tests/api/test_computer_system_collection.py +++ b/oneview_redfish_toolkit/tests/api/test_computer_system_collection.py @@ -34,9 +34,9 @@ def setUp(self): # Loading ServerHardware list mockup value with open( 'oneview_redfish_toolkit/mockups/oneview/' - 'ServerHardwareListWithServerProfileApplied.json' + 'ServerProfileList.json' ) as f: - self.server_hardware_list = json.load(f) + self.server_profile_list = json.load(f)[0:2] # only valid profiles # Loading ComputerSystemCollection result mockup with open( @@ -62,7 +62,7 @@ def test_serialize(self): ] computer_system_collection = ComputerSystemCollection( - self.server_hardware_list, + self.server_profile_list, self.server_profile_template_list, zone_ids ) diff --git a/oneview_redfish_toolkit/tests/blueprints/test_computer_system_collection.py b/oneview_redfish_toolkit/tests/blueprints/test_computer_system_collection.py index 76457764..5dc96fee 100644 --- a/oneview_redfish_toolkit/tests/blueprints/test_computer_system_collection.py +++ b/oneview_redfish_toolkit/tests/blueprints/test_computer_system_collection.py @@ -35,7 +35,7 @@ def setUpClass(self): def test_get_computer_system_collection_empty(self): """Tests ComputerSystemCollection with an empty list""" - self.oneview_client.server_hardware.get_all.return_value = [] + self.oneview_client.server_profiles.get_all.return_value = [] self.oneview_client.server_profile_templates.get_all.return_value = [] response = self.client.get("/redfish/v1/Systems/") @@ -45,7 +45,7 @@ def test_get_computer_system_collection_empty(self): with open( 'oneview_redfish_toolkit/mockups/redfish/' - 'ServerProfilesAppliedCollectionEmpty.json' + 'ComputerSystemCollectionEmpty.json' ) as f: expected_result = json.load(f) @@ -56,7 +56,7 @@ def test_get_computer_system_collection_empty(self): def test_get_computer_system_collection_fail(self): """Tests ComputerSystemCollection with an error""" - self.oneview_client.server_hardware.get_all.side_effect = \ + self.oneview_client.server_profiles.get_all.side_effect = \ Exception("An exception has occurred") with open( @@ -81,9 +81,10 @@ def test_get_computer_system_collection(self): with open( 'oneview_redfish_toolkit/mockups/oneview/' - 'ServerHardwareListWithServerProfileApplied.json' + 'ServerProfileList.json' ) as f: - server_hardware_list = json.load(f) + # all server profiles, including the one invalid + server_profile_list = json.load(f) with open( 'oneview_redfish_toolkit/mockups/oneview/' @@ -107,8 +108,8 @@ def test_get_computer_system_collection(self): 'DriveEnclosureList.json' ) as f: drive_enclosure = json.load(f) - self.oneview_client.server_hardware.get_all.return_value = \ - server_hardware_list + self.oneview_client.server_profiles.get_all.return_value = \ + server_profile_list self.oneview_client.server_profile_templates.get_all.return_value = \ server_profile_template_list @@ -126,8 +127,7 @@ def test_get_computer_system_collection(self): self.assertEqual("application/json", response.mimetype) self.assertEqualMockup(computer_system_collection_mockup, result) - self.oneview_client.server_hardware.get_all.assert_called_with( - filter="NOT 'serverProfileUri' = NULL") + self.oneview_client.server_profiles.get_all.assert_called_with() self.oneview_client.\ server_profile_templates.get_all.assert_called_with()