├── version
├── _config.yml
├── .gitignore
├── license-template
├── src
├── main
│ ├── resources
│ │ ├── buildInfo.properties
│ │ ├── AvailableBundle.properties
│ │ └── bootstrap.yml
│ └── java
│ │ └── com
│ │ └── dell
│ │ └── isg
│ │ └── smi
│ │ └── service
│ │ └── server
│ │ ├── inventory
│ │ ├── BuildInfo.java
│ │ ├── Application.java
│ │ ├── SimpleCORSFilter.java
│ │ ├── manager
│ │ │ ├── ILogManager.java
│ │ │ ├── ILogManager2_0.java
│ │ │ ├── LogManagerImpl.java
│ │ │ ├── IInventoryManager.java
│ │ │ ├── LogManagerImpl2_0.java
│ │ │ ├── InventoryManagerImpl.java
│ │ │ ├── ServerInventoryCallbackTypeEnum.java
│ │ │ ├── thread
│ │ │ │ ├── ServerInventoryCollectionThread.java
│ │ │ │ └── ServerInventoryCollectionThread2_0.java
│ │ │ ├── IInventoryManager2_0.java
│ │ │ └── InventoryManagerImpl2_0.java
│ │ ├── mock
│ │ │ ├── nics
│ │ │ │ ├── DCIMNICView.java
│ │ │ │ ├── DCIMNICString.java
│ │ │ │ ├── NicsResponse.java
│ │ │ │ └── DCIMNICEnumeration.java
│ │ │ ├── bios
│ │ │ │ ├── BiosResponse.java
│ │ │ │ ├── DCIM_BIOSString.java
│ │ │ │ └── DCIM_BIOSEnumeration.java
│ │ │ ├── boot
│ │ │ │ ├── BootResponse.java
│ │ │ │ ├── DCIM_BIOSEnumeration.java
│ │ │ │ ├── DCIM_BootConfigSetting.java
│ │ │ │ └── DCIM_BootSourceSetting.java
│ │ │ ├── hardware
│ │ │ │ ├── DCIMSensor.java
│ │ │ │ ├── DCIMCPUView.java
│ │ │ │ ├── DCIMFanView.java
│ │ │ │ ├── DCIMMemoryview.java
│ │ │ │ ├── DCIMRAIDInteger.java
│ │ │ │ ├── DCIMSystemView.java
│ │ │ │ ├── DCIMVFlashView.java
│ │ │ │ ├── DCIMEnclosureView.java
│ │ │ │ ├── DCIMNumericSensor.java
│ │ │ │ ├── DCIMSystemString.java
│ │ │ │ ├── HardwareResponse.java
│ │ │ │ ├── DCIMControllerView.java
│ │ │ │ ├── DCIMPowersupplyview.java
│ │ │ │ └── DCIMRAIDEnumeration.java
│ │ │ ├── lclog
│ │ │ │ └── LCLogResponse.java
│ │ │ ├── selog
│ │ │ │ └── SelLogResponse.java
│ │ │ ├── manager
│ │ │ │ ├── ManagerResponse.java
│ │ │ │ ├── DCIMIDRACCardView.java
│ │ │ │ ├── DCIMIDRACCardString.java
│ │ │ │ └── DCIMIDRACCardEnumeration.java
│ │ │ ├── summary
│ │ │ │ └── SummaryResponse.java
│ │ │ ├── software
│ │ │ │ ├── SoftwareResponse.java
│ │ │ │ ├── DCIMSoftwareIdentity.java
│ │ │ │ └── CIMInstalledSoftwareIdentity.java
│ │ │ └── switchconnection
│ │ │ │ └── SwitchConnectionResponse.java
│ │ ├── utilities
│ │ │ ├── PatternUtils.java
│ │ │ ├── ExceptionUtilities.java
│ │ │ └── ValidationUtilities.java
│ │ ├── controller
│ │ │ ├── RootController.java
│ │ │ ├── ServerLogsEnum.java
│ │ │ ├── ServerLogController.java
│ │ │ ├── ServerLogController2_0.java
│ │ │ ├── ServerInventoryController.java
│ │ │ └── ServerInventoryController2_0.java
│ │ └── Transformer
│ │ │ ├── TransformerAssemblerConstants.java
│ │ │ └── TranformerUtil.java
│ │ └── exception
│ │ ├── EnumErrorCode.java
│ │ ├── BadRequestException.java
│ │ └── NotFoundException.java
├── test
│ └── java
│ │ └── com
│ │ └── dell
│ │ └── isg
│ │ └── smi
│ │ └── service
│ │ └── server
│ │ └── inventory
│ │ ├── Swagger2MarkupTest.java
│ │ └── WsmanInventoryControllerTest.java
└── docs
│ └── asciidoc
│ ├── api-server-inventory-v1.adoc
│ ├── api-server-inventory-v2.adoc
│ ├── misc.adoc
│ ├── readme-v1.adoc
│ ├── readme-v2.adoc
│ └── examples-v2.adoc
├── settings.gradle.example
├── Dockerfile
├── pkg
└── dell-server-inventory.service
├── application.yml
├── .project
├── gradle.properties
├── README.md
└── LICENSE
/version:
--------------------------------------------------------------------------------
1 | 1.1.0
2 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /bin/
3 | src/main/lib/
4 | .gradle/
5 | .settings/
6 | .classpath
7 |
--------------------------------------------------------------------------------
/license-template:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/license-template
--------------------------------------------------------------------------------
/src/main/resources/buildInfo.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/resources/buildInfo.properties
--------------------------------------------------------------------------------
/src/main/resources/AvailableBundle.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/resources/AvailableBundle.properties
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/BuildInfo.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/BuildInfo.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/Application.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/Application.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/exception/EnumErrorCode.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/exception/EnumErrorCode.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/SimpleCORSFilter.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/SimpleCORSFilter.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/exception/BadRequestException.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/exception/BadRequestException.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/exception/NotFoundException.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/exception/NotFoundException.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ILogManager.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ILogManager.java
--------------------------------------------------------------------------------
/src/test/java/com/dell/isg/smi/service/server/inventory/Swagger2MarkupTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/test/java/com/dell/isg/smi/service/server/inventory/Swagger2MarkupTest.java
--------------------------------------------------------------------------------
/src/docs/asciidoc/api-server-inventory-v1.adoc:
--------------------------------------------------------------------------------
1 | include::{generated}/V1.0/overview.adoc[]
2 | include::readme-v1.adoc[]
3 | include::{generated}/V1.0/paths.adoc[]
4 | include::{generated}/V1.0/definitions.adoc[]
5 | include::misc.adoc[]
6 |
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ILogManager2_0.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ILogManager2_0.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/LogManagerImpl.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/LogManagerImpl.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/BiosResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/BiosResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/BootResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/BootResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSensor.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSensor.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/lclog/LCLogResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/lclog/LCLogResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICString.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICString.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/NicsResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/NicsResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/PatternUtils.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/PatternUtils.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/RootController.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/controller/RootController.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogsEnum.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogsEnum.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/IInventoryManager.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/IInventoryManager.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/LogManagerImpl2_0.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/LogManagerImpl2_0.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/DCIM_BIOSString.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/DCIM_BIOSString.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMCPUView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMCPUView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMFanView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMFanView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/selog/SelLogResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/selog/SelLogResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/InventoryManagerImpl.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/InventoryManagerImpl.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMMemoryview.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMMemoryview.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMRAIDInteger.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMRAIDInteger.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSystemView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSystemView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMVFlashView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMVFlashView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/ManagerResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/ManagerResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICEnumeration.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/nics/DCIMNICEnumeration.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/summary/SummaryResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/summary/SummaryResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/ExceptionUtilities.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/ExceptionUtilities.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/ValidationUtilities.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/utilities/ValidationUtilities.java
--------------------------------------------------------------------------------
/src/test/java/com/dell/isg/smi/service/server/inventory/WsmanInventoryControllerTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/test/java/com/dell/isg/smi/service/server/inventory/WsmanInventoryControllerTest.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogController.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogController.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/DCIM_BIOSEnumeration.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/bios/DCIM_BIOSEnumeration.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BIOSEnumeration.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BIOSEnumeration.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMEnclosureView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMEnclosureView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMNumericSensor.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMNumericSensor.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSystemString.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMSystemString.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/HardwareResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/HardwareResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/SoftwareResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/SoftwareResponse.java
--------------------------------------------------------------------------------
/src/docs/asciidoc/api-server-inventory-v2.adoc:
--------------------------------------------------------------------------------
1 | include::{generated}/V2.0/overview.adoc[]
2 | include::readme-v2.adoc[]
3 | include::{generated}/V2.0/paths.adoc[]
4 | include::{generated}/V2.0/definitions.adoc[]
5 | include::examples-v2.adoc[]
6 | include::misc.adoc[]
--------------------------------------------------------------------------------
/src/docs/asciidoc/misc.adoc:
--------------------------------------------------------------------------------
1 | Licensing
2 | ---------
3 |
4 | This docker microservice is available under the
5 | http://www.apache.org/licenses/LICENSE-2.0.txt[Apache 2.0 License].
6 |
7 | Support
8 | --------
9 |
10 | Slack Channel: codecommunity.slack.com
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogController2_0.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerLogController2_0.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BootConfigSetting.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BootConfigSetting.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BootSourceSetting.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/boot/DCIM_BootSourceSetting.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMControllerView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMControllerView.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMPowersupplyview.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMPowersupplyview.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMRAIDEnumeration.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/hardware/DCIMRAIDEnumeration.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardString.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardString.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/DCIMSoftwareIdentity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/DCIMSoftwareIdentity.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerInventoryController.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerInventoryController.java
--------------------------------------------------------------------------------
/settings.gradle.example:
--------------------------------------------------------------------------------
1 | include ':smi-lib-adapter-server'
2 | project(':smi-lib-adapter-server').projectDir = new File(settingsDir, '../smi-lib-adapter-server')
3 | //include ':smi-lib-wsman'
4 | //project(':smi-lib-wsman').projectDir = new File (settingsDir, '../smi-lib-wsman')
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ServerInventoryCallbackTypeEnum.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/ServerInventoryCallbackTypeEnum.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardEnumeration.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/manager/DCIMIDRACCardEnumeration.java
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM openjdk:8-jre
2 | VOLUME /tmp
3 | ADD build/libs/service-server-inventory*.jar app.jar
4 | COPY application.yml /application.yml
5 | EXPOSE 46011
6 | RUN sh -c 'touch /app.jar'
7 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
8 |
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/Transformer/TransformerAssemblerConstants.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/Transformer/TransformerAssemblerConstants.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/CIMInstalledSoftwareIdentity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/software/CIMInstalledSoftwareIdentity.java
--------------------------------------------------------------------------------
/pkg/dell-server-inventory.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=dell-server-inventory
3 | After=syslog.target
4 |
5 | [Service]
6 | User=devuser
7 | ExecStart=/opt/dell/smi/service-server-inventory/application.jar
8 | SuccessExitStatus=143
9 |
10 | [Install]
11 | WantedBy=multi-user.target
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/thread/ServerInventoryCollectionThread.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/thread/ServerInventoryCollectionThread.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/mock/switchconnection/SwitchConnectionResponse.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/mock/switchconnection/SwitchConnectionResponse.java
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/thread/ServerInventoryCollectionThread2_0.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RackHD/smi-service-dell-server-inventory/master/src/main/java/com/dell/isg/smi/service/server/inventory/manager/thread/ServerInventoryCollectionThread2_0.java
--------------------------------------------------------------------------------
/application.yml:
--------------------------------------------------------------------------------
1 | #server:
2 | #port: 46011
3 | #ssl:
4 | #keyStore: /security/cacerts/keystore.jks
5 | #keyStorePassword: changeit
6 | #keyPassword: changeit
7 |
8 | logging:
9 | level.root: ERROR
10 | level.com.dell.isg.smi: TRACE
11 | file: /var/log/dell/service-server-inventory.log
12 |
13 | #eureka:
14 | #client:
15 | #serviceUrl:
16 | #defaultZone: http://service-registry:8600/eureka/
17 |
18 | spring:
19 | #application:
20 | #name: SERVER-INVENTORY
21 | jackson:
22 | serialization-inclusion : non_null
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | smi-service-dell-server-inventory
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | version=1.0
2 | dockerTag=devel
3 | buildInfo.licenseControl.runChecks=true
4 | buildInfo.licenseControl.autoDiscover=true
5 | buildInfo.build.name=com.dell.isg.smi:service-server-inventory
6 | systemProp.sonar.host.url=https://sonarqube.com
7 | systemProp.sonar.organization=rackhd-smi
8 | systemProp.sonar.login=##sonarqubeLogin-placeholder##
9 | bintrayRepo=docs
10 | bintrayUserOrg=rackhd
11 | bintrayVcsUrl=https://bintray.com/rackhd/docs/apidoc
12 | bintrayUser=##bintray-user-placeholder##
13 | bintrayApiKey=##bintray-api-key-placeholder##
14 | versionAdapterServer=1.0.81
15 | versionCommonsElm=1.0.82
16 | versionCommonsUtilities=1.0.32
17 | versionCommonsModel=1.0.97
18 |
--------------------------------------------------------------------------------
/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 46011
3 | ---
4 |
5 | spring:
6 | profiles: default
7 | application:
8 | name: SERVER-INVENTORY
9 | cloud:
10 | bus:
11 | enabled: false
12 | consul:
13 | enabled: false
14 | config:
15 | enabled: false
16 | ---
17 |
18 | spring:
19 | profiles: consul
20 | application:
21 | name: SERVER-INVENTORY
22 | cloud:
23 | consul:
24 | discovery:
25 | preferIpAddress: true
26 | enabled: true
27 | host: service-registry
28 | port: 8500
29 | config:
30 | prefix: config
31 | profileSeparator: '::'
32 | format: YAML
33 | data-key: data
34 | fail-fast: true
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/IInventoryManager2_0.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
3 | */
4 | package com.dell.isg.smi.service.server.inventory.manager;
5 |
6 | import java.util.List;
7 | import java.util.Set;
8 |
9 | import com.dell.isg.smi.adapter.server.model.WsmanCredentials;
10 | import com.dell.isg.smi.commons.model.common.InventoryCallbackRequest;
11 | import com.dell.isg.smi.commons.model.common.InventoryInformation;
12 |
13 | public interface IInventoryManager2_0 {
14 |
15 | List inventory(Set ips) throws Exception;
16 |
17 | void processInventoryCallback(InventoryCallbackRequest inventoryCallbackRequest);
18 |
19 | Object collectHardwareInventory(WsmanCredentials wsmanCredentials) throws Exception;
20 |
21 | Object collectSummary(WsmanCredentials wsmanCredentials) throws Exception;
22 |
23 | Object collectSoftware(WsmanCredentials wsmanCredentials) throws Exception;
24 |
25 | Object collectNics(WsmanCredentials wsmanCredentials) throws Exception;
26 |
27 | Object collectBios(WsmanCredentials wsmanCredentials) throws Exception;
28 |
29 | Object collectBoot(WsmanCredentials wsmanCredentials) throws Exception;
30 |
31 | Object collectIdracString(WsmanCredentials wsmanCredentials) throws Exception;
32 |
33 | Object collectIdracCardEnum(WsmanCredentials wsmanCredentials) throws Exception;
34 |
35 | Object collectIdracDetails(WsmanCredentials wsmanCredentials) throws Exception;
36 |
37 | Object collect(WsmanCredentials wsmanCredentials, String dcim) throws Exception;
38 |
39 | Object collectSwitchConnectionsView(WsmanCredentials wsmanCredentials) throws Exception;
40 | }
41 |
--------------------------------------------------------------------------------
/src/docs/asciidoc/readme-v1.adoc:
--------------------------------------------------------------------------------
1 | Purpose
2 | ~~~~~~~
3 |
4 | Connects via the IDRAC on a Dell server and collects a comprehensive inventory.
5 |
6 | The dell-server-inventory container is a stateless spring-boot microservice that exposes a REST API for the purpose of returning a comprehensive JSON formatted inventory of a Dell 11th generation and newer server.
7 |
8 | The service can be called without a callback URL in order to run synchronously. If a callback URL is provided in the payload, the service will return immediately and post to the callback URL when the results
9 | are available.
10 |
11 | How to Use
12 | ~~~~~~~~~~
13 |
14 | A docker container for this service is available at:
15 | https://hub.docker.com/r/rackhd/dell-server-inventory/
16 | ....
17 | docker run --name service-server-inventory -p 0.0.0.0:46011:46011 -d rackhd/dell-server-inventory:latest
18 | ....
19 |
20 | The service can also start up to bootstrap its configuration from consul. More information about registration with and using advanced configuration settings provided by a Consul K/V store can be found in
21 | the online help.
22 |
23 | Example Post (Without Callback)
24 | +++++++++++++++++++++++++++++++
25 |
26 | Syncronous API's
27 | http://deployedIp:46011/api/1.0/server/inventory/hardware
28 | ....
29 | {
30 | "address": "<>",
31 | "password": "calvin",
32 | "userName": "root"
33 | }
34 | ....
35 |
36 | Example Post (With Callback)
37 | ++++++++++++++++++++++++++++
38 |
39 | Asyncronous API's
40 | http://deployedIp:46011/api/1.0/server/inventory/callback
41 | ....
42 | http://deployedIp:46011/api/1.0/server/inventory/callback
43 | {
44 | "credential": {
45 | "address": "<>",
46 | "password": "calvin",
47 | "userName": "root"
48 | },
49 | "callbackUri": "http://callbackIp:port/your/callback/path",
50 | "type": "hardware"
51 | }
52 | ....
--------------------------------------------------------------------------------
/src/docs/asciidoc/readme-v2.adoc:
--------------------------------------------------------------------------------
1 | Purpose
2 | ~~~~~~~
3 |
4 | Connects via the IDRAC on a Dell server and collects a comprehensive inventory.
5 |
6 | The dell-server-inventory container is a stateless spring-boot microservice that exposes a REST API for the purpose of returning a comprehensive JSON formatted inventory of a Dell 11th generation and newer server.
7 |
8 | The service can be called without a callback URL in order to run synchronously. If a callback URL is provided in the payload, the service will return immediately and post to the callback URL when the results
9 | are available.
10 |
11 | How to Use
12 | ~~~~~~~~~~
13 |
14 | A docker container for this service is available at:
15 | https://hub.docker.com/r/rackhd/dell-server-inventory/
16 | ....
17 | docker run --name service-server-inventory -p 0.0.0.0:46011:46011 -d rackhd/dell-server-inventory:latest
18 | ....
19 |
20 | The service can also start up to bootstrap its configuration from consul. More information about registration with and using advanced configuration settings provided by a Consul K/V store can be found in
21 | the online help.
22 |
23 | Example Post (Without Callback)
24 | +++++++++++++++++++++++++++++++
25 |
26 | Syncronous API's
27 | http://deployedIp:46011/api/2.0/server/inventory/hardware
28 | ....
29 | {
30 | "address": "<>",
31 | "password": "calvin",
32 | "userName": "root"
33 | }
34 | ....
35 |
36 | Example Post (With Callback)
37 | ++++++++++++++++++++++++++++
38 |
39 | Asyncronous API's
40 | http://deployedIp:46011/api/2.0/server/inventory/callback
41 | ....
42 | http://deployedIp:46011/api/2.0/server/inventory/callback
43 | {
44 | "credential": {
45 | "address": "<>",
46 | "password": "calvin",
47 | "userName": "root"
48 | },
49 | "callbackUri": "http://callbackIp:port/your/callback/path",
50 | "type": "hardware"
51 | }
52 | ....
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### smi-service-dell-server-inventory
2 |
3 | Connects via the IDRAC on a Dell server and collects a comprehensive inventory.
4 |
5 | Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
6 |
7 | ### Purpose
8 | The dell-server-inventory container is a stateless spring-boot microservice that exposes a REST API for the purpose of returning a comprehensive JSON formatted inventory of a Dell 11th generation and newer server.
9 |
10 | The service can be called without a callback URL in order to run synchronously. If a callback URL is provided in the payload, the service will return immediately and post to the callback URL when the results are available.
11 |
12 | ---
13 |
14 | ### How to Use
15 |
16 | #### Startup
17 | Standalone, with no configuration settings provided:
18 | ```
19 | docker run --name service-server-inventory -p 0.0.0.0:46011:46011 -d rackhd/dell-server-inventory:latest
20 | ```
21 | The service can also start up to bootstrap its configuration from consul. More information about registration with and using advanced configuration settings provided by a Consul K/V store can be found in the online help.
22 |
23 | #### API Definitions
24 |
25 | A swagger UI is provided by the microservice at http://<>:46011/swagger-ui.html
26 |
27 | ##### Syncronous API's
28 | - http://<>:46011/api/1.0/server/inventory/hardware
29 | - http://<>:46011/api/1.0/server/inventory/software
30 | - http://<>:46011/api/1.0/server/inventory/nics
31 | - http://<>:46011/api/1.0/server/inventory/summary
32 | - http://<>:46011/api/1.0/server/inventory/boot
33 | - http://<>:46011/api/1.0/server/inventory/bios
34 | - http://<>:46011/api/1.0/server/inventory/logs/get/SEL
35 | - http://<>:46011/api/1.0/server/inventory/logs/get/LC
36 |
37 | ##### Example Post (Without Callback)
38 | ~~~
39 | http://<>:46011/api/1.0/server/inventory/hardware
40 | {
41 | "address": "<>",
42 | "password": "calvin",
43 | "userName": "root"
44 | }
45 | ~~~
46 |
47 | ##### Asyncronous API's
48 | - http://<>:46011/api/1.0/server/inventory/callback
49 |
50 | ##### Example Post (With Callback)
51 | ~~~
52 | http://<>:46011/api/1.0/server/inventory/callback
53 | {
54 | "credential": {
55 | "address": "<>",
56 | "password": "calvin",
57 | "userName": "root"
58 | },
59 | "callbackUri": "http://<>:<>/your/callback/path",
60 | "type": "hardware"
61 | }
62 | ~~~
63 | - ###### _supported callback types are {hardware, software, nics, summary, boot and bios}_
64 | ---
65 |
66 | ### Licensing
67 | Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
68 |
69 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
70 |
71 | Source code for this microservice is available in repositories at https://github.com/RackHD.
72 |
73 | The microservice makes use of dependent Jar libraries that may be covered by other licenses. In order to comply with the requirements of applicable licenses, the source for dependent libraries used by this microservice is available for download at: https://bintray.com/rackhd/binary/download_file?file_path=smi-service-dell-server-inventory-dependency-sources-devel.zip
74 |
75 | Additionally the binary and source jars for all dependent libraries are available for download on Maven Central.
76 |
77 | RackHD is a Trademark of Dell EMC
78 |
79 | ---
80 |
81 | ### Support
82 | Slack Channel: codecommunity.slack.com
83 |
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/manager/InventoryManagerImpl2_0.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
3 | */
4 | package com.dell.isg.smi.service.server.inventory.manager;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 | import java.util.Set;
9 | import java.util.concurrent.ExecutorService;
10 | import java.util.concurrent.Executors;
11 | import java.util.concurrent.TimeUnit;
12 |
13 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
14 | import org.slf4j.Logger;
15 | import org.slf4j.LoggerFactory;
16 | import org.springframework.beans.factory.annotation.Autowired;
17 | import org.springframework.http.HttpEntity;
18 | import org.springframework.http.HttpHeaders;
19 | import org.springframework.http.MediaType;
20 | import org.springframework.http.ResponseEntity;
21 | import org.springframework.scheduling.annotation.Async;
22 | import org.springframework.stereotype.Component;
23 | import org.springframework.util.StopWatch;
24 | import org.springframework.web.client.RestTemplate;
25 |
26 | import com.dell.isg.smi.adapter.server.inventory.IInventoryAdapter;
27 | import com.dell.isg.smi.adapter.server.model.WsmanCredentials;
28 | import com.dell.isg.smi.commons.elm.exception.RuntimeCoreException;
29 | import com.dell.isg.smi.commons.model.common.Credential;
30 | import com.dell.isg.smi.commons.model.common.Defaults;
31 | import com.dell.isg.smi.commons.model.common.InventoryCallbackRequest;
32 | import com.dell.isg.smi.commons.model.common.InventoryCallbackResponse;
33 | import com.dell.isg.smi.commons.model.common.InventoryInformation;
34 | import com.dell.isg.smi.commons.model.common.Options;
35 | import com.dell.isg.smi.commons.utilities.CustomRecursiveToStringStyle;
36 | import com.dell.isg.smi.service.server.exception.EnumErrorCode;
37 | import com.dell.isg.smi.service.server.inventory.manager.thread.ServerInventoryCollectionThread2_0;
38 | import com.fasterxml.jackson.core.JsonProcessingException;
39 |
40 | @Component
41 | public class InventoryManagerImpl2_0 implements IInventoryManager2_0 {
42 |
43 | @Autowired
44 | IInventoryAdapter inventoryAdapterImpl;
45 |
46 | private static final int SERVER_INVENTORY_THREAD_POOL = 1000;
47 |
48 | private static final Logger logger = LoggerFactory.getLogger(InventoryManagerImpl.class.getName());
49 |
50 |
51 | @Override
52 | public List inventory(Set ips) throws Exception {
53 | List serverInfos = new ArrayList();
54 | for (String validIp : ips) {
55 | InventoryInformation serverInfo = new InventoryInformation();
56 | serverInfo.setIpAddress(validIp);
57 | serverInfo.setCredential(new Credential());
58 | serverInfos.add(serverInfo);
59 | }
60 | return getInventory(serverInfos);
61 | }
62 |
63 |
64 | private List getInventory(List serverInfos) {
65 | logger.trace("Started inventory threads");
66 | logger.trace(" IDRAC Server count for inventory = " + serverInfos.size());
67 | StopWatch watch = new StopWatch();
68 | watch.start();
69 | if (serverInfos.size() > 0) {
70 | ExecutorService executor = Executors.newFixedThreadPool(SERVER_INVENTORY_THREAD_POOL);
71 | for (InventoryInformation serverInfo : serverInfos) {
72 | Runnable serverDiscoverTask = new ServerInventoryCollectionThread2_0(serverInfo, inventoryAdapterImpl);
73 | executor.execute(serverDiscoverTask);
74 | }
75 | executor.shutdown();
76 | try {
77 | executor.awaitTermination(60, TimeUnit.SECONDS);
78 | executor.shutdownNow();
79 | } catch (InterruptedException e) {
80 | e.printStackTrace();
81 | Thread.currentThread().interrupt();
82 | }
83 | }
84 | watch.stop();
85 | logger.trace("Finished server inventory threads.");
86 | logger.trace("Time taken for inventory in seconds: " + watch.getTotalTimeSeconds());
87 | return serverInfos;
88 | }
89 |
90 |
91 | @Override
92 | @Async
93 | public void processInventoryCallback(InventoryCallbackRequest inventoryCallbackRequest) {
94 | String type = inventoryCallbackRequest.getType();
95 | try {
96 | Object dataObject = getInventoryObject(type, inventoryCallbackRequest.getCredential());
97 | InventoryCallbackResponse inventoryCallbackResponse = createCallbackResponse(dataObject, type, inventoryCallbackRequest.getCallbackGraph());
98 | logger.trace("Inventory callback response : ", ReflectionToStringBuilder.toString(dataObject, new CustomRecursiveToStringStyle(99)));
99 | HttpHeaders headers = new HttpHeaders();
100 | headers.setContentType(MediaType.APPLICATION_JSON);
101 | RestTemplate restTemplate = new RestTemplate();
102 | HttpEntity entity = new HttpEntity(inventoryCallbackResponse, headers);
103 | ResponseEntity responseEntity = restTemplate.postForEntity(inventoryCallbackRequest.getCallbackUri(), entity, String.class);
104 | logger.debug("Response recived after posting to URI : " + responseEntity.getBody());
105 | } catch (Exception e) {
106 | logger.error("Exception occured in discovery : ", e);
107 | RuntimeCoreException runtimeCoreException = new RuntimeCoreException(e);
108 | runtimeCoreException.setErrorCode(EnumErrorCode.ENUM_SERVER_ERROR);
109 | throw runtimeCoreException;
110 | }
111 | }
112 |
113 |
114 | private InventoryCallbackResponse createCallbackResponse(Object dataObject, String type, String graphName) throws JsonProcessingException {
115 | InventoryCallbackResponse inventoryCallbackResponse = new InventoryCallbackResponse();
116 | inventoryCallbackResponse.setName(graphName);
117 | Defaults defaults = new Defaults();
118 | defaults.setType(type);
119 | defaults.setData(dataObject);
120 | Options options = new Options();
121 | options.setDefaults(defaults);
122 | inventoryCallbackResponse.setOptions(options);
123 | return inventoryCallbackResponse;
124 | }
125 |
126 |
127 | private Object getInventoryObject(String type, Credential cred) throws Exception {
128 | WsmanCredentials credential = new WsmanCredentials(cred.getAddress(), cred.getUserName(), cred.getPassword());
129 | ServerInventoryCallbackTypeEnum typeEnum = ServerInventoryCallbackTypeEnum.getEnum(type);
130 | if (typeEnum == null) {
131 | RuntimeCoreException runtimeCoreException = new RuntimeCoreException("Not a Valid Enum type.");
132 | runtimeCoreException.setErrorCode(EnumErrorCode.ENUM_SERVER_ERROR);
133 | throw runtimeCoreException;
134 | }
135 |
136 | switch (typeEnum) {
137 | case HARDWARE:
138 | return inventoryAdapterImpl.collectHardwareInventory(credential);
139 | case NICS:
140 | return inventoryAdapterImpl.collectNics(credential);
141 | case SOFTWARE:
142 | return inventoryAdapterImpl.collectSoftware(credential);
143 | case SYSTEM:
144 | return inventoryAdapterImpl.collectSummary(credential);
145 | case BIOS:
146 | return inventoryAdapterImpl.collectBios(credential);
147 | case BOOT:
148 | return inventoryAdapterImpl.collectBoot(credential);
149 | case SELLOG:
150 | return inventoryAdapterImpl.collectSelLogs(credential);
151 | case LCLOG:
152 | return inventoryAdapterImpl.collectLcLogs(credential);
153 | case MANAGER:
154 | return inventoryAdapterImpl.collectIdracDetails(credential);
155 | case SWITCHCONNECTION:
156 | return inventoryAdapterImpl.collectSwitchConnectionsView(credential);
157 | }
158 | return null;
159 | }
160 |
161 |
162 | @Override
163 | public Object collectHardwareInventory(WsmanCredentials wsmanCredentials) throws Exception {
164 | return inventoryAdapterImpl.collectHardwareInventory(wsmanCredentials);
165 | }
166 |
167 |
168 | @Override
169 | public Object collectSummary(WsmanCredentials wsmanCredentials) throws Exception {
170 | return inventoryAdapterImpl.collectSummary(wsmanCredentials);
171 | }
172 |
173 |
174 | @Override
175 | public Object collectSoftware(WsmanCredentials wsmanCredentials) throws Exception {
176 | return inventoryAdapterImpl.collectSoftware(wsmanCredentials);
177 | }
178 |
179 |
180 | @Override
181 | public Object collectNics(WsmanCredentials wsmanCredentials) throws Exception {
182 | return inventoryAdapterImpl.collectNics(wsmanCredentials);
183 | }
184 |
185 |
186 | @Override
187 | public Object collectBios(WsmanCredentials wsmanCredentials) throws Exception {
188 | return inventoryAdapterImpl.collectBios(wsmanCredentials);
189 | }
190 |
191 |
192 | @Override
193 | public Object collectBoot(WsmanCredentials wsmanCredentials) throws Exception {
194 | return inventoryAdapterImpl.collectBoot(wsmanCredentials);
195 | }
196 |
197 | @Override
198 | public Object collectIdracString(WsmanCredentials wsmanCredentials) throws Exception {
199 | return inventoryAdapterImpl.collectIdracString(wsmanCredentials);
200 | }
201 |
202 | @Override
203 | public Object collectIdracCardEnum(WsmanCredentials wsmanCredentials) throws Exception {
204 | return inventoryAdapterImpl.collectIdracCardEnum(wsmanCredentials);
205 | }
206 |
207 | @Override
208 | public Object collectIdracDetails(WsmanCredentials wsmanCredentials) throws Exception {
209 | return inventoryAdapterImpl.collectIdracDetails(wsmanCredentials);
210 | }
211 |
212 | @Override
213 | public Object collect(WsmanCredentials wsmanCredentials, String dcim) throws Exception {
214 | return inventoryAdapterImpl.collect(wsmanCredentials, dcim);
215 | }
216 |
217 | @Override
218 | public Object collectSwitchConnectionsView(WsmanCredentials wsmanCredentials) throws Exception {
219 | return inventoryAdapterImpl.collectSwitchConnectionsView(wsmanCredentials);
220 | }
221 |
222 | }
223 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/controller/ServerInventoryController2_0.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
3 | */
4 | package com.dell.isg.smi.service.server.inventory.controller;
5 |
6 | import java.util.Arrays;
7 | import java.util.List;
8 | import java.util.stream.Collectors;
9 |
10 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
11 | import org.slf4j.Logger;
12 | import org.slf4j.LoggerFactory;
13 | import org.springframework.beans.factory.annotation.Autowired;
14 | import org.springframework.web.bind.annotation.PathVariable;
15 | import org.springframework.web.bind.annotation.RequestBody;
16 | import org.springframework.web.bind.annotation.RequestMapping;
17 | import org.springframework.web.bind.annotation.RequestMethod;
18 | import org.springframework.web.bind.annotation.RestController;
19 |
20 | import com.dell.isg.smi.adapter.server.model.WsmanCredentials;
21 | import com.dell.isg.smi.commons.model.common.Credential;
22 | import com.dell.isg.smi.commons.model.common.DevicesIpsRequest;
23 | import com.dell.isg.smi.commons.model.common.InventoryCallbackRequest;
24 | import com.dell.isg.smi.commons.model.common.InventoryInformation;
25 | import com.dell.isg.smi.commons.model.common.ResponseString;
26 | import com.dell.isg.smi.commons.utilities.CustomRecursiveToStringStyle;
27 | import com.dell.isg.smi.service.server.exception.BadRequestException;
28 | import com.dell.isg.smi.service.server.inventory.manager.IInventoryManager2_0;
29 | import com.dell.isg.smi.service.server.inventory.mock.bios.BiosResponse;
30 | import com.dell.isg.smi.service.server.inventory.mock.boot.BootResponse;
31 | import com.dell.isg.smi.service.server.inventory.mock.hardware.HardwareResponse;
32 | import com.dell.isg.smi.service.server.inventory.mock.manager.ManagerResponse;
33 | import com.dell.isg.smi.service.server.inventory.mock.nics.NicsResponse;
34 | import com.dell.isg.smi.service.server.inventory.mock.switchconnection.SwitchConnectionResponse;
35 | import com.dell.isg.smi.service.server.inventory.mock.software.SoftwareResponse;
36 | import com.dell.isg.smi.service.server.inventory.mock.summary.SummaryResponse;
37 | import com.dell.isg.smi.service.server.inventory.utilities.ValidationUtilities;
38 |
39 | import io.swagger.annotations.ApiOperation;
40 | import io.swagger.annotations.ApiResponse;
41 | import io.swagger.annotations.ApiResponses;
42 |
43 | @RestController
44 | @RequestMapping("/api/2.0/server/inventory")
45 | public class ServerInventoryController2_0 {
46 |
47 | @Autowired
48 | IInventoryManager2_0 inventoryManagerImpl;
49 |
50 | private static final Logger logger = LoggerFactory.getLogger(ServerInventoryController.class.getName());
51 |
52 |
53 | @RequestMapping(value = "/hardware", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
54 | @ApiOperation(value = "/hardware", nickname = "hardware", notes = "This operation allows a user to retrieve the complete server hardware inventory via the iDRAC using the WSMan protocol.", response = Object.class)
55 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = HardwareResponse.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
56 | public Object inventory(@RequestBody Credential payload) {
57 | ValidationUtilities.validateRequestPayload(payload);
58 | logger.trace("Credential for hardware inventory : {} {}", payload.getAddress(), payload.getUserName());
59 | Object result = null;
60 | try {
61 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
62 | result = inventoryManagerImpl.collectHardwareInventory(wsmanCredentials);
63 | } catch (Exception e) {
64 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
65 | BadRequestException badRequestException = new BadRequestException();
66 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
67 | badRequestException.addAttribute(e.getMessage());
68 | throw badRequestException;
69 | }
70 | logger.trace("Hardware inventory Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
71 | return result;
72 | }
73 |
74 |
75 | @RequestMapping(value = "/summary", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
76 | @ApiOperation(value = "/summary", nickname = "summary", notes = "This operation allows a user to retrieve the server system information (System View) via the iDRAC using the WSMan protocol.", response = Object.class)
77 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = SummaryResponse.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
78 | public Object summary(@RequestBody Credential payload) {
79 | ValidationUtilities.validateRequestPayload(payload);
80 | logger.trace("Credential for system inventory : {} {}", payload.getAddress(), payload.getUserName());
81 | Object result = null;
82 | try {
83 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
84 | result = inventoryManagerImpl.collectSummary(wsmanCredentials);
85 |
86 | } catch (Exception e) {
87 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
88 | BadRequestException badRequestException = new BadRequestException();
89 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
90 | badRequestException.addAttribute(e.getMessage());
91 | throw badRequestException;
92 | }
93 | logger.trace("System inventory Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
94 | return result;
95 | }
96 |
97 |
98 | @RequestMapping(value = "/software", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
99 | @ApiOperation(value = "/software", nickname = "software", notes = "This operation allows a user to retrieve the complete server software inventory via the iDRAC using the WSMan protocol.", response = Object.class, responseContainer = "List")
100 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = SoftwareResponse.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
101 | public Object software(@RequestBody Credential payload) {
102 | ValidationUtilities.validateRequestPayload(payload);
103 | logger.trace("Credential for software inventory : {} {}", payload.getAddress(), payload.getUserName());
104 | Object result = null;
105 | try {
106 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
107 | result = inventoryManagerImpl.collectSoftware(wsmanCredentials);
108 | } catch (Exception e) {
109 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
110 | BadRequestException badRequestException = new BadRequestException();
111 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
112 | badRequestException.addAttribute(e.getMessage());
113 | throw badRequestException;
114 | }
115 | logger.trace("Software inventory Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
116 | return result;
117 | }
118 |
119 |
120 | @RequestMapping(value = "/nics", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
121 | @ApiOperation(value = "/nics", nickname = "nics", notes = "This operation allows a user to retrieve the complete server NIC information via the iDRAC using the WSMan protocol.", response = Object.class, responseContainer = "List")
122 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = NicsResponse.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
123 | public Object nics(@RequestBody Credential payload) {
124 | ValidationUtilities.validateRequestPayload(payload);
125 | logger.trace("Credential for NIC inventory : {} {}", payload.getAddress(), payload.getUserName());
126 | Object result = null;
127 | try {
128 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
129 | Object nics = inventoryManagerImpl.collectNics(wsmanCredentials);
130 | result = nics;
131 | } catch (Exception e) {
132 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
133 | BadRequestException badRequestException = new BadRequestException();
134 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
135 | badRequestException.addAttribute(e.getMessage());
136 | throw badRequestException;
137 | }
138 | logger.trace("NIC inventory Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
139 | return result;
140 | }
141 |
142 |
143 | @RequestMapping(value = "/bios", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
144 | @ApiOperation(value = "/bios", nickname = "bios", notes = "This operation allows a user to retrieve the bios details from server via the iDRAC using the WSMan protocol.", response = Object.class)
145 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = BiosResponse.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
146 | public Object collectConfig(@RequestBody Credential payload) {
147 | ValidationUtilities.validateRequestPayload(payload);
148 | logger.trace("Credential for bios data : {} {}", payload.getAddress(), payload.getUserName());
149 | Object result = null;
150 | try {
151 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
152 | result = inventoryManagerImpl.collectBios(wsmanCredentials);
153 | } catch (Exception e) {
154 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
155 | BadRequestException badRequestException = new BadRequestException();
156 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
157 | badRequestException.addAttribute(e.getMessage());
158 | throw badRequestException;
159 | }
160 | logger.trace("Bios Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
161 | return result;
162 | }
163 |
164 |
165 | @RequestMapping(value = "/boot", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
166 | @ApiOperation(value = "/boot", nickname = "boot", notes = "This operation allows a user to retrieve the boot order details from the server via the iDRAC using the WSMan protocol.", response = Object.class)
167 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = BootResponse.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
168 | public Object collectBootOrderDetails(@RequestBody Credential payload) {
169 | ValidationUtilities.validateRequestPayload(payload);
170 | logger.trace("Credential for boot order details : {} {}", payload.getAddress(), payload.getUserName());
171 | Object result = null;
172 | try {
173 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
174 | result = inventoryManagerImpl.collectBoot(wsmanCredentials);
175 | } catch (Exception e) {
176 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
177 | BadRequestException badRequestException = new BadRequestException();
178 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
179 | badRequestException.addAttribute(e.getMessage());
180 | throw badRequestException;
181 | }
182 | logger.trace("Boot Order Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
183 | return result;
184 | }
185 |
186 | public List inventory(@RequestBody DevicesIpsRequest deviceIps) {
187 | ValidationUtilities.validateRequestPayload(deviceIps);
188 | logger.trace("Ips submitted for inventory : ", ReflectionToStringBuilder.toString(deviceIps, new CustomRecursiveToStringStyle(99)));
189 | List response = null;
190 | try {
191 | response = inventoryManagerImpl.inventory(Arrays.stream(deviceIps.getIps()).collect(Collectors.toSet()));
192 | } catch (Exception e) {
193 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
194 | BadRequestException badRequestException = new BadRequestException();
195 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
196 | badRequestException.addAttribute(e.getMessage());
197 | throw badRequestException;
198 | }
199 | logger.trace("Inventory Response : {}", ReflectionToStringBuilder.toString(response, new CustomRecursiveToStringStyle(99)));
200 | return response;
201 | }
202 |
203 |
204 | @RequestMapping(value = "/callback", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
205 | @ApiOperation(value = "/callback", nickname = "callback", notes = "This operation allows a user to retrieve all the server inventory via the iDRAC using the WSMan protocol. It uses callback uri to respond once the inventory is collected. Type could be : hardware :nics :software : manager:boot :bios: summary: sellog: lclog", response = ResponseString.class)
206 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = ResponseString.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
207 | public ResponseString inventoryCallback(@RequestBody InventoryCallbackRequest inventoryCallbackRequest) {
208 | ValidationUtilities.validateRequestPayload(inventoryCallbackRequest);
209 | logger.trace("Inventory submitted for callback : {} : {}", inventoryCallbackRequest.getCredential().getAddress(), inventoryCallbackRequest.getCallbackUri());
210 | ResponseString response = new ResponseString();
211 | String result = "Failed to submit IP range for discovery..";
212 | response.setCallbackUri(inventoryCallbackRequest.getCallbackUri());
213 | result = "Request Submitted ... Result will be posted to call uri : " + response.getCallbackUri();
214 | inventoryManagerImpl.processInventoryCallback(inventoryCallbackRequest);
215 | response.setResponse(result);
216 | return response;
217 | }
218 |
219 |
220 | @RequestMapping(value = "/manager", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
221 | @ApiOperation(value = "/manager", nickname = "manager", notes = "This operation allows a user to retrieve the complete iDRAC information like DCIM_IDRACCardView, DCIM_iDRACCardString and DCIM_iDRACCardEnumeration via the iDRAC using the WSMan protocol.", response = Object.class)
222 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = ManagerResponse.class), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
223 | public Object getIdracDetails(@RequestBody Credential payload) {
224 | ValidationUtilities.validateRequestPayload(payload);
225 | logger.trace("Credential for hardware inventory : {} {}", payload.getAddress(), payload.getUserName());
226 | Object manager = null;
227 | try {
228 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
229 | manager = inventoryManagerImpl.collectIdracDetails(wsmanCredentials);
230 | } catch (Exception e) {
231 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
232 | BadRequestException badRequestException = new BadRequestException();
233 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
234 | badRequestException.addAttribute(e.getMessage());
235 | throw badRequestException;
236 | }
237 | logger.trace("Manager Response : {}", ReflectionToStringBuilder.toString(manager, new CustomRecursiveToStringStyle(99)));
238 | return manager;
239 | }
240 |
241 | @RequestMapping(value = "/dcim/{type}", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
242 | @ApiOperation(value = "/dcim/{type}", nickname = "dcim", notes = "This operation allows a user to retrieve any dcim data based on the passed type via the iDRAC using the WSMan protocol. Type value - DCIM_SystemView:DCIM_ControllerView:DCIM_VirtualDiskView:DCIM_PhysicalDiskView ..etc", response = Object.class, responseContainer = "List")
243 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Object.class, responseContainer = "List"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 404, message = "Not Found"), @ApiResponse(code = 500, message = "Failure") })
244 | public Object collectSelLogs(@RequestBody Credential payload, @PathVariable("type") String type) {
245 | ValidationUtilities.validateRequestPayload(payload);
246 | Object result = null;
247 | try {
248 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
249 | result = inventoryManagerImpl.collect(wsmanCredentials, type);
250 | } catch (Exception e) {
251 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
252 | BadRequestException badRequestException = new BadRequestException();
253 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
254 | badRequestException.addAttribute(e.getMessage());
255 | throw badRequestException;
256 | }
257 | logger.trace("Result Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
258 | return result;
259 | }
260 |
261 | @RequestMapping(value = "/switchconnectionsview", method = RequestMethod.POST, headers = "Accept=application/json", consumes = "application/json", produces = "application/json")
262 | @ApiOperation(value = "/switchconnectionsview", nickname = "switchconnectionsview", notes = "This operation allows a user to retrieve the complete server switch connections view using the WSMan protocol.", response = Object.class, responseContainer = "List")
263 | @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = SwitchConnectionResponse.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 500, message = "Failure") })
264 | public Object switchConnectionsView(@RequestBody Credential payload) {
265 | ValidationUtilities.validateRequestPayload(payload);
266 | logger.trace("Credential for switchConnectionsView : {} {}", payload.getAddress(), payload.getUserName());
267 | Object result = null;
268 | try {
269 | WsmanCredentials wsmanCredentials = new WsmanCredentials(payload.getAddress(), payload.getUserName(), payload.getPassword());
270 | Object switchview = inventoryManagerImpl.collectSwitchConnectionsView(wsmanCredentials);
271 | result = switchview;
272 | } catch (Exception e) {
273 | logger.error("Exception occured in inventory2 : {}", e.getMessage());
274 | BadRequestException badRequestException = new BadRequestException();
275 | badRequestException.setErrorCode(com.dell.isg.smi.commons.elm.model.EnumErrorCode.ENUM_GENERIC_MESSAGE);
276 | badRequestException.addAttribute(e.getMessage());
277 | throw badRequestException;
278 | }
279 | logger.trace("Switchview Response : {}", ReflectionToStringBuilder.toString(result, new CustomRecursiveToStringStyle(99)));
280 | return result;
281 | }
282 |
283 | }
284 |
--------------------------------------------------------------------------------
/src/docs/asciidoc/examples-v2.adoc:
--------------------------------------------------------------------------------
1 | WSMan Response Examples
2 | -----------------------
3 |
4 | BIOS
5 | ~~~~
6 | -----------------
7 | {
8 | "DCIM_BIOSEnumeration": [
9 | {
10 | "DisplayOrder": "310",
11 | "InstanceID": "BIOS.Setup.1-1:MemTest",
12 | "PendingValue": "",
13 | "PossibleValuesDescription": [
14 | "Enabled",
15 | "Disabled"
16 | ],
17 | "CurrentValue": "Disabled",
18 | "FQDD": "BIOS.Setup.1-1",
19 | "GroupDisplayName": "Memory Settings",
20 | "PossibleValues": [
21 | "Enabled",
22 | "Disabled"
23 | ],
24 | "Dependency": "",
25 | "GroupID": "MemSettings",
26 | "AttributeDisplayName": "System Memory Testing",
27 | "AttributeName": "MemTest",
28 | "IsReadOnly": "false"
29 | }
30 | ],
31 | "DCIM_BIOSString": [
32 | {
33 | "DisplayOrder": "201",
34 | "InstanceID": "BIOS.Setup.1-1:SystemModelName",
35 | "PendingValue": "",
36 | "CurrentValue": "PowerEdge FC630",
37 | "MinLength": "0",
38 | "FQDD": "BIOS.Setup.1-1",
39 | "GroupDisplayName": "System Information",
40 | "Dependency": "",
41 | "MaxLength": "40",
42 | "GroupID": "SysInformation",
43 | "AttributeDisplayName": "System Model Name",
44 | "ValueExpression": "",
45 | "AttributeName": "SystemModelName",
46 | "IsReadOnly": "true"
47 | }
48 | ]
49 | }
50 | -----------------
51 |
52 | BOOT
53 | ~~~~
54 |
55 | -----------------
56 | {
57 | "DCIM_BootConfigSetting": [
58 | {
59 | "IsCurrent": "1",
60 | "IsDefault": "0",
61 | "InstanceID": "IPL",
62 | "ElementName": "BootSeq",
63 | "IsNext": "1"
64 | }
65 | ],
66 | "DCIM_BootSourceSetting": [
67 | {
68 | "CurrentEnabledStatus": "1",
69 | "PendingAssignedSequence": "0",
70 | "BIOSBootString": "Unknown Device: USB Floppy BootSeq",
71 | "PendingEnabledStatus": "1",
72 | "InstanceID": "IPL:BIOS.Setup.1-1#BootSeq#Unknown.Unknown.1-1#65115bd4b8ed2b80329381fc705cbc89",
73 | "ElementName": "Unknown Device: USB Floppy BootSeq",
74 | "FailThroughSupported": "1",
75 | "CurrentAssignedSequence": "0",
76 | "BootString": "Unknown Device: USB Floppy BootSeq",
77 | "BootSourceType": "IPL"
78 | }
79 | ],
80 | "DCIM_BIOSEnumeration": [
81 | {
82 | "DisplayOrder": "500",
83 | "InstanceID": "BIOS.Setup.1-1:EmbSata",
84 | "PendingValue": "",
85 | "PossibleValuesDescription": [
86 | "ATA Mode",
87 | "AHCI Mode",
88 | "RAID Mode",
89 | "Off"
90 | ],
91 | "CurrentValue": "AhciMode",
92 | "FQDD": "BIOS.Setup.1-1",
93 | "GroupDisplayName": "SATA Settings",
94 | "PossibleValues": [
95 | "AtaMode",
96 | "AhciMode",
97 | "RaidMode",
98 | "Off"
99 | ],
100 | "Dependency": "",
101 | "GroupID": "SataSettings",
102 | "AttributeDisplayName": "Embedded SATA",
103 | "AttributeName": "EmbSata",
104 | "IsReadOnly": "false"
105 | }
106 | ]
107 | }
108 | -----------------
109 |
110 |
111 | HARDWARE
112 | ~~~~~~~
113 |
114 | -----------------
115 | {
116 | "DCIM_SystemView": {
117 | "DeviceDescription": "System",
118 | "EstimatedExhaustTemperature": "255",
119 | "InstanceID": "System.Embedded.1",
120 | "PSRollupStatus": "1",
121 | "BoardPartNumber": "0JXJPTA00",
122 | "MemoryOperationMode": "OptimizerMode",
123 | "SysMemLocation": "3",
124 | "SystemID": "1563",
125 | "ChassisSystemHeight": "2",
126 | "TempRollupStatus": "1",
127 | "BIOSVersionString": "2.4.2",
128 | "LastUpdateTime": "Tue Sep 12 17:45:18 CDT 2017",
129 | "PlatformGUID": "3234444f-c0b5-3380-4e10-00564c4c4544",
130 | "SysMemTotalSize": "98304",
131 | "Manufacturer": "Dell Inc.",
132 | "BIOSReleaseDate": "01/09/2017",
133 | "UUID": "4c4c4544-0056-4e10-8033-b5c04f443432",
134 | "HostName": "",
135 | "EstimatedSystemAirflow": "255",
136 | "LifecycleControllerVersion": "2.41.40.40",
137 | "PopulatedPCIeSlots": "2",
138 | "PopulatedCPUSockets": "2",
139 | "IntrusionRollupStatus": "",
140 | "StorageRollupStatus": "1",
141 | "BoardSerialNumber": "CN7016352P00A6",
142 | "FQDD": "System.Embedded.1",
143 | "LicensingRollupStatus": "1",
144 | "PowerCap": "423",
145 | "PrimaryStatus": "1",
146 | "AssetTag": "",
147 | "SysMemPrimaryStatus": "1",
148 | "PopulatedDIMMSlots": "6",
149 | "CurrentRollupStatus": "1",
150 | "BaseBoardChassisSlot": "Slot 01",
151 | "MemoryRollupStatus": "1",
152 | "ChassisServiceTag": "5VN2D42",
153 | "BatteryRollupStatus": "1",
154 | "ExpressServiceCode": "12797151266",
155 | "ServiceTag": "5VN3D42",
156 | "SystemGeneration": "13G Modular",
157 | "TempStatisticsRollupStatus": "1",
158 | "RollupStatus": "1",
159 | "IDSDMRollupStatus": "",
160 | "SysMemFailOverState": "NotInUse",
161 | "CMCIP": "100.68.123.36",
162 | "NodeID": "5VN3D42",
163 | "SysMemMaxCapacitySize": "3145728",
164 | "MaxPCIeSlots": "3",
165 | "MaxDIMMSlots": "24",
166 | "PowerState": "2",
167 | "SDCardRollupStatus": "",
168 | "ServerAllocation": "446",
169 | "ChassisName": "CMC-5VN2D42",
170 | "FanRollupStatus": "1",
171 | "CPURollupStatus": "1",
172 | "smbiosGUID": "44454c4c-5600-104e-8033-b5c04f443432",
173 | "PowerCapEnabledState": "3",
174 | "CPLDVersion": "1.0.5",
175 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
176 | "Model": "PowerEdge FC630",
177 | "BladeGeometry": "5",
178 | "SystemRevision": "0",
179 | "SysMemErrorMethodology": "6",
180 | "MaxCPUSockets": "2",
181 | "ChassisModel": "PowerEdge FX2s",
182 | "VoltRollupStatus": "1"
183 | },
184 | "DCIM_Memoryview": [
185 | {
186 | "DeviceDescription": "DIMM A1",
187 | "Speed": "2133",
188 | "PartNumber": "HMA42GR7MFR4N-TF",
189 | "InstanceID": "DIMM.Socket.A1",
190 | "ManufactureDate": "Mon Apr 06 07:00:00 2015 UTC",
191 | "Size": "16384",
192 | "FQDD": "DIMM.Socket.A1",
193 | "Rank": "2",
194 | "PrimaryStatus": "1",
195 | "BankLabel": "A",
196 | "CurrentOperatingSpeed": "1600",
197 | "SerialNumber": "23B70828",
198 | "LastUpdateTime": "Wed May 06 23:54:13 CDT 2015",
199 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
200 | "Manufacturer": "Hynix Semiconductor",
201 | "Model": "DDR4 DIMM",
202 | "MemoryType": "26"
203 | }
204 | ],
205 | "DCIM_Powersupplyview": [
206 | {
207 | "DeviceDescription": "Power Supply 1",
208 | "RedundancyStatus": "0",
209 | "PartNumber": "095HR5A01",
210 | "InstanceID": "PSU.Slot.1",
211 | "TotalOutputPower": "1600",
212 | "DetailedState": "Presence Detected",
213 | "FQDD": "PSU.Slot.1",
214 | "PrimaryStatus": "1",
215 | "FirmwareVersion": "",
216 | "RedMinNumberNeeded": "1",
217 | "Range1MaxInputPower": "1920",
218 | "RedTypeOfSet": "2",
219 | "Type": "0",
220 | "InputVoltage": "0",
221 | "SerialNumber": "CN1797251S02J5",
222 | "LastUpdateTime": "Wed Sep 27 23:53:44 CDT 2017",
223 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
224 | "Manufacturer": "Dell",
225 | "Model": "PWR SPLY,1600W,RDNT,DELTA ",
226 | "PMBusMonitoring": "1"
227 | }
228 | ],
229 | "DCIM_CPUView": [
230 | {
231 | "Cache2SRAMType": "2",
232 | "Cache2WritePolicy": "1",
233 | "DeviceDescription": "CPU 1",
234 | "InstanceID": "CPU.Socket.1",
235 | "Cache3ErrorMethodology": "5",
236 | "LastUpdateTime": "Fri Jan 15 16:26:06 CST 2016",
237 | "VirtualizationTechnologyEnabled": "1",
238 | "Manufacturer": "Intel",
239 | "Cache1Type": "5",
240 | "Cache3Size": "15360",
241 | "VirtualizationTechnologyCapable": "1",
242 | "Cache3Level": "2",
243 | "NumberOfProcessorCores": "6",
244 | "FQDD": "CPU.Socket.1",
245 | "Cache2Location": "0",
246 | "PrimaryStatus": "1",
247 | "NumberOfEnabledThreads": "6",
248 | "Cache1Associativity": "7",
249 | "HyperThreadingEnabled": "0",
250 | "Cache2Associativity": "7",
251 | "Cache2Size": "1536",
252 | "MaxClockSpeed": "4000",
253 | "CPUFamily": "B3",
254 | "Cache3Associativity": "14",
255 | "TurboModeCapable": "0",
256 | "Cache1Level": "0",
257 | "Cache1SRAMType": "2",
258 | "Cache1Size": "384",
259 | "CurrentClockSpeed": "1600",
260 | "ExecuteDisabledCapable": "1",
261 | "ExecuteDisabledEnabled": "1",
262 | "Cache3SRAMType": "2",
263 | "Cache2ErrorMethodology": "5",
264 | "Cache3WritePolicy": "1",
265 | "TurboModeEnabled": "0",
266 | "Voltage": "1.3",
267 | "Cache2PrimaryStatus": "1",
268 | "Cache3PrimaryStatus": "1",
269 | "Cache1PrimaryStatus": "1",
270 | "Cache1Location": "0",
271 | "Cache1WritePolicy": "1",
272 | "Cache2Type": "5",
273 | "NumberOfEnabledCores": "6",
274 | "CPUStatus": "1",
275 | "Cache2Level": "1",
276 | "Cache3Location": "0",
277 | "Characteristics": "4",
278 | "Cache3Type": "5",
279 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
280 | "Model": "Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz",
281 | "Cache1ErrorMethodology": "4",
282 | "HyperThreadingCapable": "0",
283 | "ExternalBusClockSpeed": "6400"
284 | }
285 | ],
286 | "DCIM_VFlashView": {
287 | "DeviceDescription": "vFlash Card",
288 | "InstanceID": "Disk.vFlashCard.1",
289 | "ComponentName": "No SD Card",
290 | "FQDD": "Disk.vFlashCard.1"
291 | },
292 | "DCIM_FanView": [
293 | {
294 | "BaseUnits": "19",
295 | "DeviceDescription": "Fan 1A",
296 | "RedundancyStatus": "6",
297 | "RateUnits": "0",
298 | "InstanceID": "Fan.Embedded.1A",
299 | "ActiveCooling": "true",
300 | "PWM": "255",
301 | "VariableSpeed": "true",
302 | "FQDD": "Fan.Embedded.1A",
303 | "PrimaryStatus": "1",
304 | "LastUpdateTime": "Wed Sep 27 23:53:46 CDT 2017",
305 | "UnitModifier": "0",
306 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
307 | "CurrentReading": "3600"
308 | }
309 | ],
310 | "DCIM_EnclosureView": {
311 | "Connector": "0",
312 | "DeviceDescription": "Backplane 1 on Connector 0 of Integrated RAID Controller 1",
313 | "ProductName": "BP13G+ 0:1",
314 | "InstanceID": "Enclosure.Internal.0-1:RAID.Integrated.1-1",
315 | "ServiceTag": "",
316 | "SlotCount": "2",
317 | "FQDD": "Enclosure.Internal.0-1:RAID.Integrated.1-1",
318 | "TempProbeCount": "0",
319 | "RollupStatus": "1",
320 | "PrimaryStatus": "1",
321 | "PSUCount": "0",
322 | "EMMCount": "0",
323 | "AssetTag": "",
324 | "FanCount": "0",
325 | "LastUpdateTime": "Wed Sep 13 15:07:10 CDT 2017",
326 | "Version": "2.25",
327 | "State": "1",
328 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
329 | "WiredOrder": "1"
330 | },
331 | "DCIM_VirtualDiskView": "",
332 | "DCIM_Sensor": [
333 | {
334 | "SensorType": "3",
335 | "OtherSensorTypeDescription": "",
336 | "DeviceID": "iDRAC.Embedded.1#CPU1VCOREPG",
337 | "SystemCreationClassName": "DCIM_ComputerSystem",
338 | "OperationalStatus": "2",
339 | "PrimaryStatus": "1",
340 | "RequestedState": "12",
341 | "PossibleStates": [
342 | "Unknown",
343 | "Good",
344 | "Non Critical",
345 | "Bad",
346 | "Non Recoverable"
347 | ],
348 | "ElementName": "CPU1 VCORE PG",
349 | "CreationClassName": "DCIM_Sensor",
350 | "CurrentState": "Good",
351 | "SystemName": "system",
352 | "EnabledState": "2",
353 | "HealthState": "5"
354 | }
355 | ],
356 | "DCIM_NumericSensor": [
357 | {
358 | "LowerThresholdNonCritical": "30",
359 | "RateUnits": "0",
360 | "LowerThresholdCritical": "-70",
361 | "SystemCreationClassName": "DCIM_ComputerSystem",
362 | "EnabledDefault": "2",
363 | "RequestedState": "12",
364 | "ValueFormulation": "2",
365 | "ElementName": "System Board Inlet Temp",
366 | "CurrentState": "Normal",
367 | "UnitModifier": "-1",
368 | "CurrentReading": "140",
369 | "SystemName": "system",
370 | "EnabledState": "2",
371 | "BaseUnits": "2",
372 | "TransitioningToState": "12",
373 | "SensorType": "2",
374 | "OtherSensorTypeDescription": "",
375 | "DeviceID": "iDRAC.Embedded.1#SystemBoardInletTemp",
376 | "UpperThresholdCritical": "470",
377 | "OperationalStatus": "2",
378 | "PrimaryStatus": "1",
379 | "PossibleStates": [
380 | "Unknown",
381 | "Fatal",
382 | "Normal",
383 | "Upper Fatal",
384 | "Upper Critical",
385 | "Upper Non-Critical",
386 | "Lower Non-Critical",
387 | "Lower Critical"
388 | ],
389 | "SettableThresholds": [
390 | "0",
391 | "1"
392 | ],
393 | "CreationClassName": "DCIM_NumericSensor",
394 | "SupportedThresholds": [
395 | "0",
396 | "1",
397 | "2",
398 | "3"
399 | ],
400 | "HealthState": "5",
401 | "UpperThresholdNonCritical": "420"
402 | }
403 | ],
404 | "DCIM_SystemString": [
405 | {
406 | "DisplayOrder": "1410",
407 | "InstanceID": "System.Embedded.1#ServerPwr.1#ActivePolicyName",
408 | "PendingValue": "",
409 | "CurrentValue": "iDRAC",
410 | "MinLength": "0",
411 | "FQDD": "System.Embedded.1",
412 | "GroupDisplayName": "Server Power",
413 | "Dependency": "",
414 | "MaxLength": "128",
415 | "GroupID": "ServerPwr.1",
416 | "DefaultValue": "",
417 | "AttributeDisplayName": "Active Power Cap Policy Name",
418 | "AttributeName": "ActivePolicyName",
419 | "IsReadOnly": "true"
420 | }
421 | ],
422 | "DCIM_ControllerView": [
423 | {
424 | "MaxAvailablePCILinkSpeed": "Generation 3",
425 | "DeviceDescription": "Integrated RAID Controller 1",
426 | "ProductName": "PERC H330 Mini",
427 | "SlicedVDCapability": "1",
428 | "InstanceID": "RAID.Integrated.1-1",
429 | "RealtimeCapability": "1",
430 | "KeyID": "",
431 | "SupportEnhancedAutoForeignImport": "1",
432 | "RollupStatus": "1",
433 | "Function": "0",
434 | "LastUpdateTime": "Wed Sep 13 15:07:10 CDT 2017",
435 | "SupportRAID10UnevenSpans": "1",
436 | "SecurityStatus": "0",
437 | "DeviceCardSlotLength": "2",
438 | "PCISubDeviceID": "1F4C",
439 | "MaxPossiblePCILinkSpeed": "Generation 3",
440 | "Bus": "2",
441 | "DeviceCardDataBusWidth": "Unknown",
442 | "PCIVendorID": "1000",
443 | "SupportControllerBootMode": "1",
444 | "PCISubVendorID": "1028",
445 | "DeviceCardManufacturer": "DELL",
446 | "EncryptionCapability": "0",
447 | "Device": "0",
448 | "PCISlot": "0",
449 | "FQDD": "RAID.Integrated.1-1",
450 | "PatrolReadState": "1",
451 | "PCIDeviceID": "5F",
452 | "PrimaryStatus": "1",
453 | "SASAddress": "544A842016E2E600",
454 | "CacheSizeInMB": "0",
455 | "DriverVersion": "",
456 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
457 | "DeviceCardSlotType": "Unknown",
458 | "ControllerFirmwareVersion": "25.5.2.0001",
459 | "CachecadeCapability": "0",
460 | "T10PICapability": "1",
461 | "EncryptionMode": "0"
462 | }
463 | ],
464 | "DCIM_ControllerBatteryView": "",
465 | "DCIM_RAIDEnumeration": [
466 | {
467 | "InstanceID": "RAID.Integrated.1-1:RAIDSupportedRAIDLevels",
468 | "PendingValue": "",
469 | "CurrentValue": [
470 | "2(RAID-0)",
471 | "4(RAID-1)",
472 | "64(RAID-5)",
473 | "2048(RAID-10)",
474 | "8192(RAID-50)"
475 | ],
476 | "AttributeName": "RAIDSupportedRAIDLevels",
477 | "FQDD": "RAID.Integrated.1-1",
478 | "PossibleValues": [
479 | "2(RAID-0)",
480 | "4(RAID-1)",
481 | "64(RAID-5)",
482 | "2048(RAID-10)",
483 | "8192(RAID-50)"
484 | ],
485 | "IsReadOnly": "true"
486 | },
487 | {
488 | "InstanceID": "RAID.Integrated.1-1:RAIDSupportedInitTypes",
489 | "PendingValue": "",
490 | "CurrentValue": "Fast",
491 | "AttributeName": "RAIDSupportedInitTypes",
492 | "FQDD": "RAID.Integrated.1-1",
493 | "PossibleValues": "Fast",
494 | "IsReadOnly": "true"
495 | },
496 | {
497 | "InstanceID": "Enclosure.Internal.0-1:RAID.Integrated.1-1:BackplaneType",
498 | "PendingValue": "",
499 | "CurrentValue": "Not Shared",
500 | "AttributeName": "BackplaneType",
501 | "FQDD": "Enclosure.Internal.0-1:RAID.Integrated.1-1",
502 | "PossibleValues": [
503 | "Not Shared",
504 | "Shared"
505 | ],
506 | "IsReadOnly": "true"
507 | }
508 | ],
509 | "DCIM_RAIDInteger": [
510 | {
511 | "LowerBound": "0",
512 | "InstanceID": "RAID.Integrated.1-1:RAIDmaxSupportedVD",
513 | "UpperBound": "0",
514 | "PendingValue": "",
515 | "CurrentValue": "32",
516 | "AttributeName": "RAIDmaxSupportedVD",
517 | "FQDD": "RAID.Integrated.1-1",
518 | "IsReadOnly": "true"
519 | }
520 | ]
521 | }
522 | -----------------
523 |
524 | MANAGER
525 | ~~~~~~~
526 |
527 | -----------------
528 | {
529 | "DCIM_IDRACCardView": {
530 | "DeviceDescription": "iDRAC",
531 | "LANEnabledState": "1",
532 | "InstanceID": "iDRAC.Embedded.1-1#IDRACinfo",
533 | "DNSDomainName": "",
534 | "GUID": "3234444f-c0b5-3380-4e10-00564c4c4544",
535 | "SOLEnabledState": "1",
536 | "PermanentMACAddress": "44:a8:42:a7:7f:c0",
537 | "FQDD": "iDRAC.Embedded.1-1",
538 | "DNSRacName": "idrac-5VN3D42",
539 | "URLString": "https://100.68.123.39:443",
540 | "FirmwareVersion": "2.41.40.40",
541 | "LastUpdateTime": "Wed Sep 27 23:55:30 CDT 2017",
542 | "IPMIVersion": "2.0",
543 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
544 | "Model": "Enterprise",
545 | "ProductDescription": "This system component provides a complete set of remote management functions for Dell PowerEdge servers"
546 | },
547 | "DCIM_iDRACCardEnumeration": [
548 | {
549 | "DisplayOrder": "6",
550 | "InstanceID": "iDRAC.Embedded.1#Info.1#Type",
551 | "PendingValue": "",
552 | "CurrentValue": "13G Modular",
553 | "FQDD": "iDRAC.Embedded.1",
554 | "GroupDisplayName": "RAC Information",
555 | "PossibleValues": [
556 | "12G/13G",
557 | "12G Monolithic",
558 | "12G Modular",
559 | "13G Monolithic",
560 | "13G Modular",
561 | "12G DCS",
562 | "13G DCS"
563 | ],
564 | "Dependency": "",
565 | "GroupID": "Info.1",
566 | "DefaultValue": "12G/13G",
567 | "AttributeDisplayName": "iDRAC Type",
568 | "AttributeName": "Type",
569 | "IsReadOnly": "true"
570 | }
571 | ],
572 | "DCIM_iDRACCardString": [
573 | {
574 | "DisplayOrder": "1",
575 | "InstanceID": "iDRAC.Embedded.1#Info.1#Product",
576 | "PendingValue": "",
577 | "CurrentValue": "Integrated Dell Remote Access Controller",
578 | "MinLength": "0",
579 | "FQDD": "iDRAC.Embedded.1",
580 | "GroupDisplayName": "RAC Information",
581 | "Dependency": "",
582 | "MaxLength": "63",
583 | "GroupID": "Info.1",
584 | "DefaultValue": "",
585 | "AttributeDisplayName": "iDRAC Product Information",
586 | "AttributeName": "Product",
587 | "IsReadOnly": "true"
588 | }
589 | ]
590 | }
591 | -----------------
592 |
593 | NICS
594 | ~~~~
595 |
596 | -----------------
597 | {
598 | "DCIM_NICView": [
599 | {
600 | "DeviceDescription": "Integrated NIC 1 Port 1 Partition 1",
601 | "NicMode": "2",
602 | "ProductName": "QLogic 577xx/578xx 10 Gb Ethernet BCM57810 - 44:A8:42:A7:7F:C1",
603 | "InstanceID": "NIC.Integrated.1-1-1",
604 | "MaxBandwidth": "100",
605 | "PermanentMACAddress": "54:9F:35:1E:9D:96",
606 | "AutoNegotiation": "2",
607 | "MinBandwidth": "0",
608 | "FunctionNumber": "0",
609 | "VirtWWPN": "20:01:44:A8:42:A7:7F:C3",
610 | "EFIVersion": "7.15.13",
611 | "LastUpdateTime": "Wed Sep 13 13:26:48 CDT 2017",
612 | "MediaType": "KR,KX,BACKPLANE",
613 | "PCISubDeviceID": "1f5f",
614 | "PermanentiSCSIMACAddress": "54:9F:35:1E:9D:97",
615 | "DataBusWidth": "0002",
616 | "Protocol": "NIC,iSCSI,FCoE",
617 | "FCoEWWNN": "54:9f:35:1e:9d:97",
618 | "PCIVendorID": "14e4",
619 | "DeviceNumber": "0",
620 | "PCISubVendorID": "1028",
621 | "VendorName": "QLogic",
622 | "PermanentFCOEMACAddress": "54:9f:35:1e:9d:97",
623 | "iScsiOffloadMode": "3",
624 | "CurrentMACAddress": "44:A8:42:A7:7F:C1",
625 | "FamilyVersion": "10.01.00",
626 | "FQDD": "NIC.Integrated.1-1-1",
627 | "PCIDeviceID": "168E",
628 | "TransmitFlowControl": "3",
629 | "SlotType": "0002",
630 | "WWN": "20:00:54:9F:35:1E:9D:97",
631 | "FCoEOffloadMode": "3",
632 | "BusNumber": "1",
633 | "SlotLength": "0002",
634 | "LinkDuplex": "1",
635 | "ReceiveFlowControl": "3",
636 | "WWPN": "20:01:54:9F:35:1E:9D:97",
637 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
638 | "VirtWWN": "20:00:44:A8:42:A7:7F:C3",
639 | "LinkSpeed": "5",
640 | "ControllerBIOSVersion": "7.14.5"
641 | }
642 | ],
643 | "DCIM_NICEnumeration": [
644 | {
645 | "AttributeDisplayName": "Link Status",
646 | "InstanceID": "NIC.Integrated.1-1-1:LinkStatus",
647 | "PendingValue": "",
648 | "PossibleValuesDescription": [
649 | "Disconnected",
650 | "Connected"
651 | ],
652 | "CurrentValue": "Connected",
653 | "AttributeName": "LinkStatus",
654 | "FQDD": "NIC.Integrated.1-1-1",
655 | "GroupDisplayName": "Main Configuration Page",
656 | "PossibleValues": [
657 | "Disconnected",
658 | "Connected"
659 | ],
660 | "Dependency": "",
661 | "IsReadOnly": "true",
662 | "GroupID": "VndrConfigPage"
663 | },
664 | {
665 | "AttributeDisplayName": "Boot Retry Count",
666 | "InstanceID": "NIC.Integrated.1-1-1:BootRetryCnt",
667 | "PendingValue": "",
668 | "PossibleValuesDescription": [
669 | "No Retry",
670 | "1 Retry",
671 | "2 Retries",
672 | "3 Retries",
673 | "4 Retries",
674 | "5 Retries",
675 | "6 Retries",
676 | "Indefinite Retries"
677 | ],
678 | "CurrentValue": "NoRetry",
679 | "AttributeName": "BootRetryCnt",
680 | "FQDD": "NIC.Integrated.1-1-1",
681 | "GroupDisplayName": "NIC Configuration",
682 | "PossibleValues": [
683 | "NoRetry",
684 | "1Retry",
685 | "2Retries",
686 | "3Retries",
687 | "4Retries",
688 | "5Retries",
689 | "6Retries",
690 | "IndefiniteRetries"
691 | ],
692 | "Dependency": "",
693 | "IsReadOnly": "false",
694 | "GroupID": "NICConfig"
695 | }
696 | ],
697 | "DCIM_NICString": [
698 | {
699 | "InstanceID": "NIC.Integrated.1-1-1:ChipMdl",
700 | "PendingValue": "",
701 | "CurrentValue": "BCM57810 B0",
702 | "MinLength": "0",
703 | "FQDD": "NIC.Integrated.1-1-1",
704 | "GroupDisplayName": "Main Configuration Page",
705 | "Dependency": "",
706 | "MaxLength": "0",
707 | "GroupID": "VndrConfigPage",
708 | "AttributeDisplayName": "Chip Type",
709 | "ValueExpression": "",
710 | "AttributeName": "ChipMdl",
711 | "IsReadOnly": "true"
712 | }
713 | ]
714 | }
715 | -----------------
716 |
717 |
718 | SOFTWARE
719 | ~~~~~~~
720 |
721 | -----------------
722 | {
723 | "DCIM_SoftwareIdentity": [
724 | {
725 | "MajorVersion": "2",
726 | "Status": "Available",
727 | "Classifications": "10",
728 | "ComponentType": "FRMW",
729 | "VersionString": "2.30.30.30",
730 | "InstanceID": "DCIM:PREVIOUS#iDRAC.Embedded.1-1#IDRACinfo",
731 | "DeviceID": "",
732 | "VendorID": "",
733 | "IsEntity": "true",
734 | "MinorVersion": "30",
735 | "RevisionString": "",
736 | "FQDD": "iDRAC.Embedded.1-1",
737 | "IdentityInfoValue": "DCIM:firmware:25227",
738 | "InstallationDate": "NA",
739 | "RevisionNumber": "30",
740 | "SubVendorID": "",
741 | "SubDeviceID": "",
742 | "BuildNumber": "30",
743 | "ElementName": "Integrated Dell Remote Access Controller",
744 | "Updateable": "true",
745 | "IdentityInfoType": "OrgID:ComponentType:ComponentID",
746 | "impactsTPMmeasurements": "false",
747 | "ComponentID": "25227"
748 | }
749 | ],
750 | "CIM_InstalledSoftwareIdentity": {}
751 | }
752 | -----------------
753 |
754 | SUMMARY
755 | ~~~~~~~
756 |
757 | -----------------
758 | {
759 | "DeviceDescription": "System",
760 | "EstimatedExhaustTemperature": "255",
761 | "InstanceID": "System.Embedded.1",
762 | "PSRollupStatus": "1",
763 | "BoardPartNumber": "0JXJPTA00",
764 | "MemoryOperationMode": "OptimizerMode",
765 | "SysMemLocation": "3",
766 | "SystemID": "1563",
767 | "ChassisSystemHeight": "2",
768 | "TempRollupStatus": "1",
769 | "BIOSVersionString": "2.4.2",
770 | "LastUpdateTime": "Tue Sep 12 17:45:18 CDT 2017",
771 | "PlatformGUID": "3234444f-c0b5-3380-4e10-00564c4c4544",
772 | "SysMemTotalSize": "98304",
773 | "Manufacturer": "Dell Inc.",
774 | "BIOSReleaseDate": "01/09/2017",
775 | "UUID": "4c4c4544-0056-4e10-8033-b5c04f443432",
776 | "HostName": "",
777 | "EstimatedSystemAirflow": "255",
778 | "LifecycleControllerVersion": "2.41.40.40",
779 | "PopulatedPCIeSlots": "2",
780 | "PopulatedCPUSockets": "2",
781 | "IntrusionRollupStatus": "",
782 | "StorageRollupStatus": "1",
783 | "BoardSerialNumber": "CN7016352P00A6",
784 | "FQDD": "System.Embedded.1",
785 | "LicensingRollupStatus": "1",
786 | "PowerCap": "423",
787 | "PrimaryStatus": "1",
788 | "AssetTag": "",
789 | "SysMemPrimaryStatus": "1",
790 | "PopulatedDIMMSlots": "6",
791 | "CurrentRollupStatus": "1",
792 | "BaseBoardChassisSlot": "Slot 01",
793 | "MemoryRollupStatus": "1",
794 | "ChassisServiceTag": "5VN2D42",
795 | "BatteryRollupStatus": "1",
796 | "ExpressServiceCode": "12797151266",
797 | "ServiceTag": "5VN3D42",
798 | "SystemGeneration": "13G Modular",
799 | "TempStatisticsRollupStatus": "1",
800 | "RollupStatus": "1",
801 | "IDSDMRollupStatus": "",
802 | "SysMemFailOverState": "NotInUse",
803 | "CMCIP": "100.68.123.36",
804 | "NodeID": "5VN3D42",
805 | "SysMemMaxCapacitySize": "3145728",
806 | "MaxPCIeSlots": "3",
807 | "MaxDIMMSlots": "24",
808 | "PowerState": "2",
809 | "SDCardRollupStatus": "",
810 | "ServerAllocation": "446",
811 | "ChassisName": "CMC-5VN2D42",
812 | "FanRollupStatus": "1",
813 | "CPURollupStatus": "1",
814 | "smbiosGUID": "44454c4c-5600-104e-8033-b5c04f443432",
815 | "PowerCapEnabledState": "3",
816 | "CPLDVersion": "1.0.5",
817 | "LastSystemInventoryTime": "Fri Sep 15 12:54:17 CDT 2017",
818 | "Model": "PowerEdge FC630",
819 | "BladeGeometry": "5",
820 | "SystemRevision": "0",
821 | "SysMemErrorMethodology": "6",
822 | "MaxCPUSockets": "2",
823 | "ChassisModel": "PowerEdge FX2s",
824 | "VoltRollupStatus": "1"
825 | }
826 | -----------------
827 |
828 | LC LOGS
829 | ~~~~~~~
830 |
831 | -----------------
832 | [
833 | {
834 | "RawEventData": "",
835 | "Comment": "[set comment here]",
836 | "Category": "Audit",
837 | "Message": "Successfully logged in using root, from 10.132.250.42 and WS-MAN.",
838 | "InstanceID": "DCIM:LifeCycleLog:5938",
839 | "CreationTimeStamp": "20170927234400.000000-300",
840 | "PerceivedSeverity": "2",
841 | "ConfigResultsAvailable": "false",
842 | "FQDD": "iDRAC.Embedded.1",
843 | "LogInstanceID": "DCIM:LifeCycleLog",
844 | "ElementName": "USR0030",
845 | "MessageArguments": [
846 | "root",
847 | "10.132.250.42",
848 | "WS-MAN"
849 | ],
850 | "OwningEntity": "DCIM",
851 | "SequenceNumber": "5938",
852 | "AgentID": "RACLOG",
853 | "RecordID": "5938",
854 | "LogName": "LifeCycle Log",
855 | "MessageID": "USR0030"
856 | },
857 | {
858 | "RawEventData": "",
859 | "Comment": "[set comment here]",
860 | "Category": "Audit",
861 | "Message": "The session for root from 100.64.23.32 using GUI is logged off.",
862 | "InstanceID": "DCIM:LifeCycleLog:5937",
863 | "CreationTimeStamp": "20170927160525.000000-300",
864 | "PerceivedSeverity": "2",
865 | "ConfigResultsAvailable": "false",
866 | "FQDD": "iDRAC.Embedded.1",
867 | "LogInstanceID": "DCIM:LifeCycleLog",
868 | "ElementName": "USR0032",
869 | "MessageArguments": [
870 | "root",
871 | "100.64.23.32",
872 | "GUI"
873 | ],
874 | "OwningEntity": "DCIM",
875 | "SequenceNumber": "5937",
876 | "AgentID": "RACLOG",
877 | "RecordID": "5937",
878 | "LogName": "LifeCycle Log",
879 | "MessageID": "USR0032"
880 | }
881 | ]
882 | -----------------
883 |
884 | SEL LOGS
885 | ~~~~~~~
886 |
887 | -----------------
888 | [
889 | {
890 | "LogInstanceID": "DCIM:SEL:1",
891 | "RecordData": "The power input for power supply 2 is lost.",
892 | "InstanceID": "DCIM:SEL:Entry:21",
893 | "ElementName": "System Event Log Entry",
894 | "RecordFormat": "string Description",
895 | "CreationTimeStamp": "20160201155737.000000-360",
896 | "PerceivedSeverity": "6",
897 | "RecordID": "21",
898 | "LogName": "System Event Log"
899 | },
900 | {
901 | "LogInstanceID": "DCIM:SEL:1",
902 | "RecordData": "Power supply 2 failed.",
903 | "InstanceID": "DCIM:SEL:Entry:20",
904 | "ElementName": "System Event Log Entry",
905 | "RecordFormat": "string Description",
906 | "CreationTimeStamp": "20160201155737.000000-360",
907 | "PerceivedSeverity": "6",
908 | "RecordID": "20",
909 | "LogName": "System Event Log"
910 | }
911 | ]
912 | -----------------
--------------------------------------------------------------------------------
/src/main/java/com/dell/isg/smi/service/server/inventory/Transformer/TranformerUtil.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright � 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
3 | */
4 | package com.dell.isg.smi.service.server.inventory.Transformer;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | import org.apache.commons.collections.CollectionUtils;
10 | import org.apache.commons.lang3.math.NumberUtils;
11 | import org.slf4j.Logger;
12 | import org.slf4j.LoggerFactory;
13 |
14 | import com.dell.isg.smi.adapter.server.model.HardwareInventory;
15 | import com.dell.isg.smi.adapter.server.model.HeadRoom;
16 | import com.dell.isg.smi.adapter.server.model.PowerMonitoring;
17 | import com.dell.isg.smi.adapter.server.model.PowerStatistics;
18 | import com.dell.isg.smi.adapter.server.model.Storage;
19 | import com.dell.isg.smi.commons.model.manager.IdracCardString;
20 | import com.dell.isg.smi.commons.model.server.inventory.HwBattery;
21 | import com.dell.isg.smi.commons.model.server.inventory.HwController;
22 | import com.dell.isg.smi.commons.model.server.inventory.HwCpu;
23 | import com.dell.isg.smi.commons.model.server.inventory.HwEnclosure;
24 | import com.dell.isg.smi.commons.model.server.inventory.HwFan;
25 | import com.dell.isg.smi.commons.model.server.inventory.HwMemory;
26 | import com.dell.isg.smi.commons.model.server.inventory.HwNic;
27 | import com.dell.isg.smi.commons.model.server.inventory.HwPhysicalDisk;
28 | import com.dell.isg.smi.commons.model.server.inventory.HwPowerMonitoring;
29 | import com.dell.isg.smi.commons.model.server.inventory.HwPsu;
30 | import com.dell.isg.smi.commons.model.server.inventory.HwSDCard;
31 | import com.dell.isg.smi.commons.model.server.inventory.HwStorage;
32 | import com.dell.isg.smi.commons.model.server.inventory.HwSystem;
33 | import com.dell.isg.smi.commons.model.server.inventory.HwTemperature;
34 | import com.dell.isg.smi.commons.model.server.inventory.HwVirtualDisk;
35 | import com.dell.isg.smi.commons.model.server.inventory.HwVoltage;
36 | import com.dell.isg.smi.commons.model.server.inventory.ServerHardwareInventory;
37 | import com.dell.isg.smi.commons.utilities.datetime.DateTimeUtils;
38 | import com.dell.isg.smi.service.server.inventory.utilities.PatternUtils;
39 | import com.dell.isg.smi.wsman.command.entity.CPUView;
40 | import com.dell.isg.smi.wsman.command.entity.ControllerView;
41 | import com.dell.isg.smi.wsman.command.entity.DCIMNICViewType;
42 | import com.dell.isg.smi.wsman.command.entity.DCIMSystemViewType;
43 | import com.dell.isg.smi.wsman.command.entity.EnclosureView;
44 | import com.dell.isg.smi.wsman.command.entity.FanView;
45 | import com.dell.isg.smi.wsman.command.entity.IDRACCardStringView;
46 | import com.dell.isg.smi.wsman.command.entity.MemoryView;
47 | import com.dell.isg.smi.wsman.command.entity.NumericSensorView;
48 | import com.dell.isg.smi.wsman.command.entity.PhysicalDiskView;
49 | import com.dell.isg.smi.wsman.command.entity.PowerSupplyView;
50 | import com.dell.isg.smi.wsman.command.entity.SensorView;
51 | import com.dell.isg.smi.wsman.command.entity.VFlashView;
52 | import com.dell.isg.smi.wsman.command.entity.VirtualDiskView;
53 |
54 | public class TranformerUtil {
55 |
56 | private final static Logger logger = LoggerFactory.getLogger(TranformerUtil.class.getName());
57 |
58 |
59 | public static ServerHardwareInventory transformHardwareInventory(HardwareInventory hardwareInventory, ServerHardwareInventory serverHardwareInventory) throws Exception {
60 | if (hardwareInventory == null) {
61 | return serverHardwareInventory;
62 | }
63 | serverHardwareInventory.setSystem(transformHwSystem(hardwareInventory.getSystem()));
64 | serverHardwareInventory.getBatteries().addAll(transformBattery(hardwareInventory.getBatteryView()));
65 | serverHardwareInventory.getMemories().addAll(transformHwMemory(hardwareInventory.getMemoryView()));
66 | serverHardwareInventory.getNics().addAll(transformHwNic(hardwareInventory.getNicView()));
67 | serverHardwareInventory.getPowerSupplyUnits().addAll(transformHwPowerSupply(hardwareInventory.getPowerSupplyView()));
68 | serverHardwareInventory.getFans().addAll(transformHwFans(hardwareInventory.getFanView()));
69 | serverHardwareInventory.getCpus().addAll(transformHwCpus(hardwareInventory.getCpuView()));
70 | serverHardwareInventory.getSdCards().addAll(transformSdCards(hardwareInventory.getRemovableMedia()));
71 | serverHardwareInventory.setStorage(transformStorage(hardwareInventory.getStorage()));
72 | serverHardwareInventory.getVoltages().addAll(transformVoltage(hardwareInventory.getVoltageView()));
73 | serverHardwareInventory.getTemperatures().addAll(transformTemperatures(hardwareInventory.getTemperatureView()));
74 | serverHardwareInventory.setPowerMonitoring(transformPowerMonitor(hardwareInventory.getPowerMonitoring()));
75 | return serverHardwareInventory;
76 | }
77 |
78 |
79 | private static HwStorage transformStorage(final Storage storage) {
80 | HwStorage hwStorage = new HwStorage();
81 | if (storage == null) {
82 | return hwStorage;
83 | }
84 | if (storage.getControllers() != null) {
85 | hwStorage.getControllers().addAll(transformController(storage.getControllers()));
86 | }
87 | if (storage.getEnclosures() != null) {
88 | hwStorage.getEnclosures().addAll(transformEnclosure(storage.getEnclosures()));
89 | }
90 | if (storage.getPhysicalDisks() != null) {
91 | hwStorage.getPhysicalDisks().addAll(transformPhysicalDisk(storage.getPhysicalDisks()));
92 | }
93 | if (storage.getVirtualDisks() != null) {
94 | hwStorage.getVirtualDisks().addAll(transformVirtualDisk(storage.getVirtualDisks()));
95 | }
96 | return hwStorage;
97 | }
98 |
99 |
100 | private static List transformController(final List controllerViewList) {
101 | List hwControllerList = new ArrayList();
102 | if (CollectionUtils.isEmpty(controllerViewList)) {
103 | return hwControllerList;
104 | }
105 | for (ControllerView controllerView : controllerViewList) {
106 | HwController hwController = new HwController();
107 | hwController.setBus(controllerView.getBus());
108 | hwController.setCacheSizeInMB(controllerView.getCacheSizeInMB());
109 | hwController.setCacheCadeCapability(controllerView.getCacheCadeCapability());
110 | hwController.setControllerFirmwareVersion(controllerView.getControllerFirmwareVersion());
111 | hwController.setDevice(controllerView.getDevice());
112 | hwController.setDeviceCardDataBusWidth(controllerView.getDeviceCardDataBusWidth());
113 | hwController.setDeviceCardManufacturer(controllerView.getDeviceCardManufacturer());
114 | hwController.setDeviceCardSlotLength(controllerView.getDeviceCardSlotLength());
115 | hwController.setDeviceCardSlotType(controllerView.getDeviceCardSlotType());
116 | hwController.setDeviceDescription(controllerView.getDeviceDescription());
117 | hwController.setDriverVersion(controllerView.getDriverVersion());
118 | hwController.setEncryptionCapability(controllerView.getEncryptionCapability());
119 | hwController.setEncryptionMode(controllerView.getEncryptionMode());
120 | hwController.setfQDD(controllerView.getfQDD());
121 | hwController.setFunction(controllerView.getFunction());
122 | hwController.setInstanceID(controllerView.getInstanceID());
123 | hwController.setKeyID(controllerView.getKeyID());
124 | hwController.setLastSystemInventoryTime(controllerView.getLastSystemInventoryTime());
125 | hwController.setLastUpdateTime(controllerView.getLastUpdateTime());
126 | hwController.setMaxAvailablePciLinkSpeed(controllerView.getMaxAvailablePciLinkSpeed());
127 | hwController.setMaxPossiblePciLinkSpeed(controllerView.getMaxPossiblePciLinkSpeed());
128 | hwController.setPCIDeviceID(controllerView.getPCIDeviceID());
129 | hwController.setPCISlot(controllerView.getPCISlot());
130 | hwController.setPCISubDeviceID(controllerView.getPCISubDeviceID());
131 | hwController.setPCISubVendorID(controllerView.getPCISubVendorID());
132 | hwController.setPCIVendorID(controllerView.getPCIVendorID());
133 | hwController.setPatrolReadState(controllerView.getPatrolReadState());
134 | hwController.setPrimaryStatus(controllerView.getPrimaryStatus());
135 | hwController.setProductName(controllerView.getProductName());
136 | hwController.setRealtimeCapability(controllerView.getRealtimeCapability());
137 | hwController.setRollUpStatus(controllerView.getRollUpStatus());
138 | hwController.setSASAddress(controllerView.getSASAddress());
139 | hwController.setSecurityStatus(controllerView.getSecurityStatus());
140 | hwController.setSlicedVDCapability(controllerView.getSlicedVDCapability());
141 | hwController.setSupportControllerBootMode(controllerView.getSupportControllerBootMode());
142 | hwController.setSupportEnhancedAutoForeignImport(controllerView.getSupportEnhancedAutoForeignImport());
143 | hwController.setSupportRaid10UnevenSpans(controllerView.getSupportRaid10UnevenSpans());
144 | hwController.setT10piCapability(controllerView.getT10piCapability());
145 | hwController.setPossibleSpeed(controllerView.getPossibleSpeed());
146 | hwController.setPatrolReadMode(controllerView.getPatrolReadMode());
147 | hwController.setCcMode(controllerView.getCcMode());
148 | hwController.setCcRate(controllerView.getCcRate());
149 | hwController.setCopyBackMode(controllerView.getCopyBackMode());
150 | hwController.setBgiRate(controllerView.getBgiRate());
151 | hwController.setRebuildRate(controllerView.getRebuildRate());
152 | hwController.setBatteryState(controllerView.getBatteryState());
153 | hwController.setPreservedCache(controllerView.getCacheCadeCapability());
154 | hwController.setBatteryStatus(controllerView.getBatteryStatus());
155 | hwControllerList.add(hwController);
156 | }
157 | return hwControllerList;
158 | }
159 |
160 |
161 | private static List transformEnclosure(final List enclosureViewList) {
162 | List hwenclosureList = new ArrayList();
163 | if (CollectionUtils.isEmpty(enclosureViewList)) {
164 | return hwenclosureList;
165 | }
166 | for (EnclosureView enclosureView : enclosureViewList) {
167 | HwEnclosure hwEnclosure = new HwEnclosure();
168 | hwEnclosure.setFqdd(enclosureView.getfQDD());
169 | hwEnclosure.setAssetTag(enclosureView.getAssetTag());
170 | hwEnclosure.setConnector(enclosureView.getConnector());
171 | hwEnclosure.setEmmCount(NumberUtils.toInt(enclosureView.geteMMCount()));
172 | hwEnclosure.setFanCount(NumberUtils.toInt(enclosureView.getFanCount()));
173 | hwEnclosure.setInstanceId(enclosureView.getInstanceID());
174 | hwEnclosure.setLastSystemInventoryTime(getIsoDateString(enclosureView.getLastSystemInventoryTime(), TransformerAssemblerConstants.ENCLOSURE_DATE_FORMAT));
175 | hwEnclosure.setLastUpdateTime(getIsoDateString(enclosureView.getLastUpdateTime(), TransformerAssemblerConstants.ENCLOSURE_DATE_FORMAT));
176 | hwEnclosure.setPrimaryStatus(enclosureView.getPrimaryStatus());
177 | hwEnclosure.setProductName(enclosureView.getProductName());
178 | hwEnclosure.setPsuCount(NumberUtils.toInt(enclosureView.getpSUCount()));
179 | hwEnclosure.setRollupStatus(enclosureView.getRollupStatus());
180 | hwEnclosure.setSlotCount(NumberUtils.toInt(enclosureView.getSlotCount()));
181 | hwEnclosure.setTempProbeCount(NumberUtils.toInt(enclosureView.getTempProbeCount()));
182 | hwEnclosure.setServiceTag(enclosureView.getServiceTag());
183 | hwEnclosure.setVersion(enclosureView.getVersion());
184 | hwEnclosure.setWiredOrder(enclosureView.getWiredOrder());
185 | hwEnclosure.setDeviceDescription(enclosureView.getDeviceDescription());
186 | hwEnclosure.setState(enclosureView.getState());
187 | hwenclosureList.add(hwEnclosure);
188 | }
189 | return hwenclosureList;
190 | }
191 |
192 |
193 | private static List transformVirtualDisk(final List virtualDiskViewList) {
194 | List hWVirtualDiskList = new ArrayList();
195 | if (CollectionUtils.isEmpty(virtualDiskViewList)) {
196 | return hWVirtualDiskList;
197 | }
198 | for (VirtualDiskView virtualDiskView : virtualDiskViewList) {
199 | HwVirtualDisk hwVirtualDisk = new HwVirtualDisk();
200 | hwVirtualDisk.setFqdd(virtualDiskView.getfQDD());
201 | hwVirtualDisk.setBusProtocol(virtualDiskView.getBusProtocol());
202 | hwVirtualDisk.setLockStatus(virtualDiskView.getLockStatus());
203 | hwVirtualDisk.setMediaType(virtualDiskView.getMediaType());
204 | hwVirtualDisk.setName(virtualDiskView.getName());
205 | hwVirtualDisk.setObjectStatus(virtualDiskView.getObjectStatus());
206 | hwVirtualDisk.setPrimaryStatus(virtualDiskView.getPrimaryStatus());
207 | hwVirtualDisk.setRaidStatus(virtualDiskView.getRaidStatus());
208 | hwVirtualDisk.setRaidTypes(virtualDiskView.getRaidTypes());
209 | hwVirtualDisk.setReadCachePolicy(virtualDiskView.getReadCachePolicy());
210 | hwVirtualDisk.setRemainingRedundancy(virtualDiskView.getRemainingRedundancy());
211 | hwVirtualDisk.setSizeInBytes(virtualDiskView.getSizeInBytes());
212 | hwVirtualDisk.setSpanDepth(virtualDiskView.getSpanDepth());
213 | hwVirtualDisk.setSpanLength(virtualDiskView.getSpanLength());
214 | hwVirtualDisk.setStartingLbaInBlocks(virtualDiskView.getStartingLBAInBlocks());
215 | hwVirtualDisk.setStripeSize(virtualDiskView.getStripeSize());
216 | hwVirtualDisk.setVirtualDiskTargetId(virtualDiskView.getVirtualDiskTargetID());
217 | hwVirtualDisk.setWriteCachePolicy(virtualDiskView.getWriteCachePolicy());
218 | hwVirtualDisk.setDiskCachePolicy(virtualDiskView.getDiskCachePolicy());
219 | hwVirtualDisk.setCacheCade(virtualDiskView.getCacheCade());
220 | hwVirtualDisk.setDeviceDescription(virtualDiskView.getDeviceDescription());
221 | hwVirtualDisk.setT10piStatus(virtualDiskView.getT10piStatus());
222 | hwVirtualDisk.setBlockSizeInBytes(virtualDiskView.getBlockSizeInBytes());
223 | hwVirtualDisk.setOperationName(virtualDiskView.getOperationName());
224 | hwVirtualDisk.setOperationPercentComplete(virtualDiskView.getOperationPercentComplete());
225 | hwVirtualDisk.setPendingOperations(virtualDiskView.getPendingOperations());
226 | hwVirtualDisk.setRollupStatus(virtualDiskView.getRollupStatus());
227 | hwVirtualDisk.setInstanceId(virtualDiskView.getInstanceID());
228 | hwVirtualDisk.setLastSystemInventoryTime(virtualDiskView.getLastSystemInventoryTime());
229 | hwVirtualDisk.setLastUpdateTime(virtualDiskView.getLastUpdateTime());
230 | hwVirtualDisk.setPhysicalDiskIds(virtualDiskView.getPhysicalDiskIDs());
231 | hWVirtualDiskList.add(hwVirtualDisk);
232 | }
233 | return hWVirtualDiskList;
234 | }
235 |
236 |
237 | private static List transformPhysicalDisk(final List physicalDiskViewList) {
238 | List hwPhysicalDiskList = new ArrayList();
239 | if (CollectionUtils.isEmpty(physicalDiskViewList)) {
240 | return hwPhysicalDiskList;
241 | }
242 | HwPhysicalDisk hwPhysicalDisk;
243 | for (PhysicalDiskView physicaldiskview : physicalDiskViewList) {
244 | hwPhysicalDisk = new HwPhysicalDisk();
245 | hwPhysicalDisk.setBlockSizeInBytes(physicaldiskview.getBlockSizeInBytes());
246 | hwPhysicalDisk.setBusProtocol(physicaldiskview.getBusProtocol());
247 | hwPhysicalDisk.setConnector(physicaldiskview.getConnector());
248 | hwPhysicalDisk.setDeviceDescription(physicaldiskview.getDeviceDescription());
249 | hwPhysicalDisk.setDriveFormFactor(physicaldiskview.getDriveFormFactor());
250 | hwPhysicalDisk.setFQDD(physicaldiskview.getfQDD());
251 | hwPhysicalDisk.setFreeSizeInBytes(physicaldiskview.getFreeSizeInBytes());
252 | hwPhysicalDisk.setHotSpareStatus(physicaldiskview.getHotSpareStatus());
253 | hwPhysicalDisk.setInstanceID(physicaldiskview.getInstanceID());
254 | hwPhysicalDisk.setLastSystemInventoryTime(physicaldiskview.getLastSystemInventoryTime());
255 | hwPhysicalDisk.setLastUpdateTime(physicaldiskview.getLastUpdateTime());
256 | hwPhysicalDisk.setManufacturer(physicaldiskview.getManufacturer());
257 | hwPhysicalDisk.setManufacturingDay(physicaldiskview.getManufacturingDay());
258 | hwPhysicalDisk.setManufacturingWeek(physicaldiskview.getManufacturingWeek());
259 | hwPhysicalDisk.setManufacturingYear(physicaldiskview.getManufacturingYear());
260 | hwPhysicalDisk.setMaxCapableSpeed(physicaldiskview.getMaxCapableSpeed());
261 | hwPhysicalDisk.setMediaType(physicaldiskview.getMediaType());
262 | hwPhysicalDisk.setModel(physicaldiskview.getModel());
263 | hwPhysicalDisk.setOperationName(physicaldiskview.getOperationName());
264 | hwPhysicalDisk.setOperationPercentComplete(physicaldiskview.getOperationPercentComplete());
265 | hwPhysicalDisk.setPPID(physicaldiskview.getPPID());
266 | hwPhysicalDisk.setPredictiveFailureState(physicaldiskview.getPredictiveFailureState());
267 | hwPhysicalDisk.setPrimaryStatus(physicaldiskview.getPrimaryStatus());
268 | hwPhysicalDisk.setRaidStatus(physicaldiskview.getRaidStatus());
269 | hwPhysicalDisk.setRemainingRatedWriteEndurance(physicaldiskview.getRemainingRatedWriteEndurance());
270 | hwPhysicalDisk.setRevision(physicaldiskview.getRevision());
271 | hwPhysicalDisk.setRollupStatus(physicaldiskview.getRollUpStatus());
272 | hwPhysicalDisk.setSASAddress(physicaldiskview.getSASAddress());
273 | hwPhysicalDisk.setSecurityState(physicaldiskview.getSecurityState());
274 | hwPhysicalDisk.setSerialNumber(physicaldiskview.getSerialNumber());
275 | hwPhysicalDisk.setSizeInBytes(physicaldiskview.getSizeInBytes());
276 | hwPhysicalDisk.setSlot(physicaldiskview.getSlot());
277 | hwPhysicalDisk.setSupportedEncryptionTypes(physicaldiskview.getSupportedEncryptionTypes());
278 | hwPhysicalDisk.setT10PICapability(physicaldiskview.getT10PICapability());
279 | hwPhysicalDisk.setUsedSizeInBytes(physicaldiskview.getUsedSizeInBytes());
280 |
281 | hwPhysicalDiskList.add(hwPhysicalDisk);
282 | }
283 | return hwPhysicalDiskList;
284 | }
285 |
286 |
287 | private static List transformBattery(final List batteries) {
288 | List hwBatteryList = new ArrayList();
289 | if (CollectionUtils.isEmpty(batteries)) {
290 | return hwBatteryList;
291 | }
292 | for (SensorView sensorView : batteries) {
293 | if (sensorView.isBattery()) {
294 | HwBattery hwBattery = new HwBattery();
295 | hwBattery.setProbeName(sensorView.getElementName());
296 | hwBattery.setState(sensorView.getCurrentState());
297 | hwBattery.setStatus(sensorView.getPrimaryStatus());
298 | hwBatteryList.add(hwBattery);
299 | }
300 | }
301 | return hwBatteryList;
302 | }
303 |
304 |
305 | private static List transformVoltage(List voltages) {
306 |
307 | List hwVoltageList = new ArrayList();
308 | if (CollectionUtils.isEmpty(voltages)) {
309 | return hwVoltageList;
310 | }
311 | for (SensorView sensorView : voltages) {
312 | if (sensorView.isVoltage()) {
313 | HwVoltage hwVoltage = new HwVoltage();
314 | hwVoltage.setProbeName(sensorView.getElementName());
315 | hwVoltage.setStatus(sensorView.getPrimaryStatus());
316 | hwVoltage.setReading(sensorView.getCurrentState());
317 | hwVoltageList.add(hwVoltage);
318 | }
319 | }
320 | return hwVoltageList;
321 | }
322 |
323 |
324 | private static List transformTemperatures(List temperatures) {
325 | List hwTemperatureList = new ArrayList();
326 | if (CollectionUtils.isEmpty(temperatures)) {
327 | return hwTemperatureList;
328 | }
329 | for (NumericSensorView sensorView : temperatures) {
330 | HwTemperature hwTemperature = new HwTemperature();
331 | hwTemperature.setProbeName(sensorView.getElementName());
332 | hwTemperature.setStatus(sensorView.getPrimaryStatus());
333 | hwTemperature.setReading(sensorView.getCurrentReading() + " " + sensorView.getBaseUnits());
334 | hwTemperature.setMinWarningThreshold(sensorView.getLowerThresholdNonCritical());
335 | hwTemperature.setMaxWarningThreshold(sensorView.getUpperThresholdNonCritical());
336 | hwTemperature.setMinCriticalThreshold(sensorView.getLowerThresholdCritical());
337 | hwTemperature.setMaxCriticalThreshold(sensorView.getUpperThresholdCritical());
338 | hwTemperatureList.add(hwTemperature);
339 | }
340 | return hwTemperatureList;
341 | }
342 |
343 |
344 | private static HwPowerMonitoring transformPowerMonitor(PowerMonitoring powerMonitoring) {
345 |
346 | HwPowerMonitoring hwPowerMonitoring = new HwPowerMonitoring();
347 | if (powerMonitoring == null) {
348 | return hwPowerMonitoring;
349 | }
350 | hwPowerMonitoring.setPowerCap(powerMonitoring.getPowerCap());
351 | hwPowerMonitoring.setProfile(powerMonitoring.getProfile());
352 | hwPowerMonitoring.setWarningThreshold(powerMonitoring.getWarningThreshold());
353 | hwPowerMonitoring.setFailureThreshold(powerMonitoring.getFailureThreshold());
354 | hwPowerMonitoring.setProbeName(powerMonitoring.getProbeName());
355 | hwPowerMonitoring.setCurrentReading(powerMonitoring.getCurrentReading());
356 |
357 | PowerStatistics powerStatistics = powerMonitoring.getPowerStatistics();
358 | if (powerStatistics != null) {
359 | hwPowerMonitoring.setEnergyConsumption(powerStatistics.getEnergyConsumption());
360 | hwPowerMonitoring.setEnergyConsumptionStartDateTime(getIsoDateString(powerStatistics.getEnergyConsumptionStartDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
361 | hwPowerMonitoring.setEnergyConsumptionEndDateTime(getIsoDateString(powerStatistics.getEnergyConsumptionEndDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
362 |
363 | hwPowerMonitoring.setSystemPeakPower(powerStatistics.getSystemPeakPower());
364 | hwPowerMonitoring.setSystemPeakPowerStartDateTime(getIsoDateString(powerStatistics.getSystemPeakPowerStartDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
365 | hwPowerMonitoring.setSystemPeakPowerEndDateTime(getIsoDateString(powerStatistics.getSystemPeakPowerEndDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
366 |
367 | hwPowerMonitoring.setSystemPeakAmps(powerStatistics.getSystemPeakAmps());
368 | hwPowerMonitoring.setPeakAmpsStartDateTime(getIsoDateString(powerStatistics.getPeakAmpsStartDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
369 | hwPowerMonitoring.setPeakAmpsEndDateTime(getIsoDateString(powerStatistics.getPeakAmpsEndDateTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
370 |
371 | hwPowerMonitoring.setLastHourPeakAverage(powerStatistics.getLastHourPeakAverage());
372 | hwPowerMonitoring.setLastHourPeakTime(getIsoDateString(powerStatistics.getLastHourPeakTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
373 | hwPowerMonitoring.setLastHourPeakMax(powerStatistics.getLastHourPeakMax());
374 | hwPowerMonitoring.setLastHourPeakMaxTime(getIsoDateString(powerStatistics.getLastHourPeakMaxTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
375 | hwPowerMonitoring.setLastHourPeakMin(powerStatistics.getLastHourPeakMin());
376 | hwPowerMonitoring.setLastHourPeakMinTime(getIsoDateString(powerStatistics.getLastHourPeakMinTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
377 |
378 | hwPowerMonitoring.setLastDayPeakAverage(powerStatistics.getLastDayPeakAverage());
379 | hwPowerMonitoring.setLastDayPeakTime(getIsoDateString(powerStatistics.getLastDayPeakTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
380 | hwPowerMonitoring.setLastDayPeakMax(powerStatistics.getLastDayPeakMax());
381 | hwPowerMonitoring.setLastDayPeakMaxTime(getIsoDateString(powerStatistics.getLastDayPeakMaxTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
382 | hwPowerMonitoring.setLastDayPeakMin(powerStatistics.getLastDayPeakMin());
383 | hwPowerMonitoring.setLastDayPeakMinTime(getIsoDateString(powerStatistics.getLastDayPeakMinTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
384 |
385 | hwPowerMonitoring.setLastWeekPeakAverage(powerStatistics.getLastWeekPeakAverage());
386 | hwPowerMonitoring.setLastWeekPeakTime(getIsoDateString(powerStatistics.getLastWeekPeakTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
387 | hwPowerMonitoring.setLastWeekPeakMax(powerStatistics.getLastWeekPeakMax());
388 | hwPowerMonitoring.setLastWeekPeakMaxTime(getIsoDateString(powerStatistics.getLastWeekPeakMaxTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
389 | hwPowerMonitoring.setLastWeekPeakMin(powerStatistics.getLastWeekPeakMin());
390 | hwPowerMonitoring.setLastWeekPeakMinTime(getIsoDateString(powerStatistics.getLastWeekPeakMinTime(), TransformerAssemblerConstants.POWER_MONITORING_DATE_FORMAT));
391 | }
392 |
393 | HeadRoom headRoom = powerMonitoring.getHeadRoom();
394 | if (headRoom != null) {
395 | hwPowerMonitoring.setSystemInstantaneousHeadroom(headRoom.getSystemInstantaneousHeadroom());
396 | hwPowerMonitoring.setSystemPeakHeadroom(headRoom.getSystemPeakHeadroom());
397 | }
398 | return hwPowerMonitoring;
399 | }
400 |
401 | private static String getIsoDateString(String dateString, String dateFormat) {
402 | try{
403 | return DateTimeUtils.getIsoDateString(dateString, dateFormat );
404 | }
405 | catch(Exception e)
406 | {
407 | logger.debug("failed to parse string");
408 | return "";
409 | }
410 | }
411 |
412 |
413 | private static String getIsoDateString(String utcDateString, String[] datePatterns){
414 | try{
415 | return DateTimeUtils.getIsoDateString(utcDateString, datePatterns );
416 | }
417 | catch(Exception e)
418 | {
419 | logger.debug("failed to parse string array");
420 | return "";
421 | }
422 | }
423 |
424 |
425 | private static List transformSdCards(List vflashViews) {
426 | List hwSdCardList = new ArrayList();
427 | if (CollectionUtils.isEmpty(vflashViews)) {
428 | return hwSdCardList;
429 | }
430 | HwSDCard hwSDCard;
431 | for (VFlashView vflashView : vflashViews) {
432 | hwSDCard = new HwSDCard();
433 | hwSDCard.setComponentName(vflashView.getComponentName());
434 | hwSDCard.setDeviceDescription(vflashView.getDeviceDescription());
435 | hwSDCard.setFqdd(vflashView.getFQDD());
436 | hwSDCard.setInstanceID(vflashView.getInstanceID());
437 | hwSDCard.setInitializedState(vflashView.getInitializedState());
438 | hwSDCard.setSize(vflashView.getCapacity());
439 | hwSDCard.setStatus(vflashView.getHealthStatus());
440 | hwSDCard.setSpace(vflashView.getAvailableSize());
441 | hwSDCard.setWriteProctected(vflashView.getWriteProtected());
442 | hwSDCard.setVFlashEnabled(vflashView.getvFlashEnabledState());
443 | hwSDCard.setLicensed(vflashView.getLicensed());
444 | hwSDCard.setLocation("vFlash");
445 | hwSDCard.setOnlineStatus("Present");
446 | hwSdCardList.add(hwSDCard);
447 | }
448 | return hwSdCardList;
449 | }
450 |
451 |
452 | private static List transformHwCpus(List cpus) {
453 | List hwCpuList = new ArrayList();
454 | if (CollectionUtils.isEmpty(cpus)) {
455 | return hwCpuList;
456 | }
457 | HwCpu hwCpu;
458 | for (CPUView cpuView : cpus) {
459 | hwCpu = new HwCpu();
460 | hwCpu.setExternalBusClockSpeed(cpuView.getExternalBusClockSpeed());
461 | hwCpu.setFqdd(cpuView.getfQDD());
462 | hwCpu.setManufacturer(cpuView.getManufacturer());
463 | hwCpu.setMaxClockSpeed(cpuView.getMaxClockSpeed());
464 | hwCpu.setModel(cpuView.getModel());
465 | hwCpu.setNumberOfEnabledCores(cpuView.getNumberOfEnabledCores());
466 | hwCpu.setNumberOfProcessorCores(cpuView.getNumberOfProcessorCores());
467 | hwCpu.setPrimaryStatus(cpuView.getPrimaryStatus());
468 | hwCpu.setVoltage(cpuView.getVoltage());
469 | hwCpu.setCurrentClockSpeed(cpuView.getCurrentClockSpeed());
470 | hwCpu.setCache1Associativity(cpuView.getCache1Associativity());
471 | hwCpu.setCache2Associativity(cpuView.getCache2Associativity());
472 | hwCpu.setCache3Associativity(cpuView.getCache3Associativity());
473 | hwCpu.setCache1WritePolicy(cpuView.getCache1WritePolicy());
474 | hwCpu.setCache2WritePolicy(cpuView.getCache2WritePolicy());
475 | hwCpu.setCache3WritePolicy(cpuView.getCache3WritePolicy());
476 | hwCpu.setCache1ErrorMethodology(cpuView.getCache1ErrorMethodology());
477 | hwCpu.setCache2ErrorMethodology(cpuView.getCache2ErrorMethodology());
478 | hwCpu.setCache3ErrorMethodology(cpuView.getCache3ErrorMethodology());
479 | hwCpu.setCache1Size(cpuView.getCache1Size());
480 | hwCpu.setCache2Size(cpuView.getCache2Size());
481 | hwCpu.setCache3Size(cpuView.getCache3Size());
482 | hwCpu.setCache1Type(cpuView.getCache1Type());
483 | hwCpu.setCache2Type(cpuView.getCache2Type());
484 | hwCpu.setCache3Type(cpuView.getCache3Type());
485 | hwCpu.setCache1Level(cpuView.getCache1Level());
486 | hwCpu.setCache2Level(cpuView.getCache2Level());
487 | hwCpu.setCache3Level(cpuView.getCache3Level());
488 | hwCpu.setCache1PrimaryStatus(cpuView.getCache1PrimaryStatus());
489 | hwCpu.setCache2PrimaryStatus(cpuView.getCache2PrimaryStatus());
490 | hwCpu.setCache3PrimaryStatus(cpuView.getCache3PrimaryStatus());
491 | hwCpu.setCache1Location(cpuView.getCache1Location());
492 | hwCpu.setCache2Location(cpuView.getCache2Location());
493 | hwCpu.setCache3Location(cpuView.getCache3Location());
494 | hwCpu.setCache1SramType(cpuView.getCache1SramType());
495 | hwCpu.setCache2SramType(cpuView.getCache2SramType());
496 | hwCpu.setCache3SramType(cpuView.getCache3SramType());
497 | hwCpu.setDeviceDescription(cpuView.getDeviceDescription());
498 | hwCpu.setExecuteDisabledCapable(cpuView.getExecuteDisabledCapable());
499 | hwCpu.setExecuteDisabledEnabled(cpuView.getExecuteDisabledEnabled());
500 | hwCpu.setHyperThreadingCapable(cpuView.getHyperThreadingCapable());
501 | hwCpu.setHyperThreadingEnabled(cpuView.getHyperThreadingEnabled());
502 | hwCpu.setVirtualizationTechnologyCapable(cpuView.getVirtualizationTechnologyCapable());
503 | hwCpu.setVirtualizationTechnologyEnabled(cpuView.getVirtualizationTechnologyEnabled());
504 | hwCpu.setTurboModeCapable(cpuView.getTurboModeCapable());
505 | hwCpu.setTurboModeEnabled(cpuView.getTurboModeEnabled());
506 | hwCpu.setCpuFamily(cpuView.getCpuFamily());
507 | hwCpu.setCpuStatus(cpuView.getCpuStatus());
508 | hwCpuList.add(hwCpu);
509 | }
510 | return hwCpuList;
511 | }
512 |
513 |
514 | private static List transformHwFans(List fans) {
515 | List hwfanList = new ArrayList();
516 | if (CollectionUtils.isEmpty(fans)) {
517 | return hwfanList;
518 | }
519 | HwFan hwFan;
520 | for (FanView fan : fans) {
521 | hwFan = new HwFan();
522 | hwFan.setActiveCooling(fan.getActiveCooling());
523 | hwFan.setCurrentReading(fan.getCurrentReading());
524 | hwFan.setDeviceDescription(fan.getDeviceDescription());
525 | hwFan.setFqdd(fan.getFQDD());
526 | hwFan.setPrimaryStatus(fan.getPrimaryStatus());
527 | hwFan.setPwm(fan.getPwm());
528 | hwFan.setRedundancyStatus(fan.getRedundancyStatus());
529 | hwFan.setMinWarningThreshold(fan.getLowerThresholdNonCritical());
530 | hwFan.setMinCriticalThreshold(fan.getLowerThresholdCritical());
531 | hwFan.setMaxWarningThreshold(fan.getUpperThresholdNonCritical());
532 | hwFan.setMaxCriticalThreshold(fan.getUpperThresholdCritical());
533 | hwfanList.add(hwFan);
534 | }
535 | return hwfanList;
536 | }
537 |
538 |
539 | private static List transformHwPowerSupply(List powerSupplies) {
540 | List hwPsuList = new ArrayList();
541 | if (CollectionUtils.isEmpty(powerSupplies)) {
542 | return hwPsuList;
543 | }
544 | HwPsu hwPsu;
545 | for (PowerSupplyView powerSupplyView : powerSupplies) {
546 | hwPsu = new HwPsu();
547 | hwPsu.setFirmwareVersion(powerSupplyView.getFirmwareVersion());
548 | hwPsu.setStatus(powerSupplyView.getPrimaryStatus());
549 | hwPsu.setFqdd(powerSupplyView.getfQDD());
550 | hwPsu.setPartNumber(powerSupplyView.getPartNumber());
551 | hwPsu.setType(powerSupplyView.getType());
552 | hwPsu.setManufacturer(powerSupplyView.getManufacturer());
553 | hwPsu.setSerialNumber(powerSupplyView.getSerialNumber());
554 | hwPsu.setName(powerSupplyView.getDeviceDescription());
555 | hwPsu.setRedundancyStatus(powerSupplyView.getRedundancyStatus());
556 | hwPsu.setInputWattage(powerSupplyView.getRange1MaxInputPower());
557 | hwPsu.setOutputWattage(powerSupplyView.getTotalOutputPower());
558 | hwPsu.setInputVoltage(powerSupplyView.getInputVoltage());
559 | // TODO: Mocked until idrac commands are built
560 | hwPsu.setInputAmps("10");
561 | hwPsuList.add(hwPsu);
562 | }
563 |
564 | return hwPsuList;
565 | }
566 |
567 |
568 | public static List transformHwNic(List dcimnicViewTypes) {
569 | List hwNicList = new ArrayList();
570 | if (CollectionUtils.isEmpty(dcimnicViewTypes)) {
571 | return hwNicList;
572 | }
573 | HwNic hwNic;
574 | for (DCIMNICViewType dcimnicViewType : dcimnicViewTypes) {
575 | hwNic = new HwNic();
576 | hwNic.setBusNumber(dcimnicViewType.getBusNumber() != null ? String.valueOf(dcimnicViewType.getBusNumber().getValue()) : null);
577 | hwNic.setCurrentMACAddress(dcimnicViewType.getCurrentMACAddress() != null ? dcimnicViewType.getCurrentMACAddress().getValue() : null);
578 | hwNic.setDataBusWidth(dcimnicViewType.getDataBusWidth() != null ? dcimnicViewType.getDataBusWidth().getValue() : null);
579 | hwNic.setDeviceDescription(dcimnicViewType.getDescription() != null ? dcimnicViewType.getDescription().getValue() : null);
580 | hwNic.setDeviceNumber(dcimnicViewType.getDeviceNumber() != null ? String.valueOf(dcimnicViewType.getDeviceNumber().getValue()) : null);
581 | hwNic.setFqdd(dcimnicViewType.getFqdd() != null ? dcimnicViewType.getFqdd().getValue() : null);
582 | hwNic.setPciDeviceID(dcimnicViewType.getPciDeviceID() != null ? dcimnicViewType.getPciDeviceID().getValue() : null);
583 | hwNic.setPermanentFcoMacAddress(dcimnicViewType.getPermanentMACAddress() != null ? dcimnicViewType.getPermanentMACAddress().getValue() : null);
584 | hwNic.setProductName(dcimnicViewType.getProductName() != null ? dcimnicViewType.getProductName().getValue() : null);
585 | hwNic.setSlotLength(dcimnicViewType.getSlotLength() != null ? dcimnicViewType.getSlotLength().getValue() : null);
586 | hwNic.setSlotType(dcimnicViewType.getSlotType() != null ? dcimnicViewType.getSlotType().getValue() : null);
587 | hwNic.setAutoNegotiation(dcimnicViewType.getAutoNegotiation() != null ? dcimnicViewType.getAutoNegotiation().getValue() : null);
588 | hwNic.setControllerBiosVersion(dcimnicViewType.getControllerBIOSVersion() != null ? dcimnicViewType.getControllerBIOSVersion().getValue() : null);
589 | hwNic.setFamilyVersion(dcimnicViewType.getFamilyVersion() != null ? dcimnicViewType.getFamilyVersion().getValue() : null);
590 | hwNic.setLinkDuplex(dcimnicViewType.getLinkDuplex() != null ? dcimnicViewType.getLinkDuplex().getValue() : null);
591 | hwNic.setLinkSpeed(dcimnicViewType.getLinkSpeed() != null ? dcimnicViewType.getLinkSpeed().getValue() : null);
592 | hwNic.setMaxBandwidth(dcimnicViewType.getMaxBandwidth() != null ? dcimnicViewType.getMaxBandwidth().getValue() : null);
593 | hwNic.setNicMode(dcimnicViewType.getNicMode() != null ? dcimnicViewType.getNicMode().getValue() : null);
594 | hwNic.setPciSubDeviceID(dcimnicViewType.getPciSubVendorID() != null ? dcimnicViewType.getPciSubVendorID().getValue() : null);
595 | hwNic.setPermanentMacAddress(dcimnicViewType.getPermanentMACAddress() != null ? dcimnicViewType.getPermanentMACAddress().getValue() : null);
596 | hwNic.setPermanentiScsiMacAddress(dcimnicViewType.getPermanentiSCSIMACAddress() != null ? dcimnicViewType.getPermanentiSCSIMACAddress().getValue() : null);
597 | hwNic.setTransmitFlowControl(dcimnicViewType.getTransmitFlowControl() != null ? dcimnicViewType.getTransmitFlowControl().getValue() : null);
598 | hwNic.setVendorName(dcimnicViewType.getVendorName() != null ? dcimnicViewType.getVendorName().getValue() : null);
599 | hwNic.setVirtWwn(dcimnicViewType.getVirtWwn() != null ? dcimnicViewType.getVirtWwn().getValue() : null);
600 | hwNic.setVirtWwpn(dcimnicViewType.getVirtWwpn() != null ? dcimnicViewType.getVirtWwpn().getValue() : null);
601 | hwNic.setFCoEOffloadMode(dcimnicViewType.getfCoEOffloadMode() != null ? dcimnicViewType.getfCoEOffloadMode().getValue() : null);
602 | hwNic.setFCoEWwnn(dcimnicViewType.getfCoEWwnn() != null ? dcimnicViewType.getfCoEWwnn().getValue() : null);
603 | hwNic.setIscsiOffloadMode(dcimnicViewType.getiScsiOffloadMode() != null ? dcimnicViewType.getiScsiOffloadMode().getValue() : null);
604 | hwNic.setWwn(dcimnicViewType.getWwn() != null ? dcimnicViewType.getWwn().getValue() : null);
605 | hwNic.setWwpn(dcimnicViewType.getWwpn() != null ? dcimnicViewType.getWwpn().getValue() : null);
606 | hwNic.setMinBandwidth(dcimnicViewType.getMinBandwidth() != null ? dcimnicViewType.getMinBandwidth().getValue() : null);
607 | hwNic.setMediaType(dcimnicViewType.getMediaType() != null ? dcimnicViewType.getMediaType().getValue() : null);
608 | hwNic.setReceiveFlowControl(dcimnicViewType.getReceiveFlowControl() != null ? dcimnicViewType.getReceiveFlowControl().getValue() : null);
609 | hwNic.setLinkStatus(dcimnicViewType.getLinkStatus());
610 | hwNic.setOsDriverState(dcimnicViewType.getOsDriverState());
611 | hwNic.setMacAddress(dcimnicViewType.getMacAddress());
612 | hwNic.setIscsiMacAddress(dcimnicViewType.getIscsiMacAddress());
613 | hwNic.setVirtualMacAddress(dcimnicViewType.getVirtualMacAddress());
614 | hwNic.setVirtualIscsiMacAddress(dcimnicViewType.getVirtualIscsiMacAddress());
615 | hwNic.setFamilyDriverVersion(dcimnicViewType.getFamilyVersion() != null ? dcimnicViewType.getFamilyVersion().getValue() : null);
616 | hwNic.setTeaming("< NIC # > , < NIC # >");
617 | hwNic.setIscsiOffloadSupport(dcimnicViewType.getIscsiOffloadSupport());
618 | hwNic.setToeSupport(dcimnicViewType.getToeSupport());
619 | hwNic.setLegacyBootProtocol(dcimnicViewType.getLegacyBootProtocol());
620 | hwNic.setIscsiBootMode(dcimnicViewType.getIcsciBootMode());
621 | hwNic.setIscsiInitiatorIpAddress(dcimnicViewType.getIscsiInitiatorIpAddress());
622 | hwNic.setIscsiInitiatorSubnet(dcimnicViewType.getIscsiInitiatorSubnet());
623 | hwNic.setIscsiInitiatorGateway(dcimnicViewType.getIscsiInitiatorGateway());
624 | hwNic.setIscsiInitiatorPrimaryDns(dcimnicViewType.getIscsiInitiatorPrimaryDns());
625 | hwNic.setIscsiInitiatorSecondryDns(dcimnicViewType.getIscsiInitiatorSecondryDns());
626 | hwNic.setIscsiInitiatorName(dcimnicViewType.getIscsiInitiatorName());
627 | hwNicList.add(hwNic);
628 | }
629 | return hwNicList;
630 | }
631 |
632 |
633 | private static List transformHwMemory(List memories) throws Exception {
634 | List hwMemoryList = new ArrayList();
635 | if (CollectionUtils.isEmpty(memories)) {
636 | return hwMemoryList;
637 | }
638 | HwMemory hwMemory;
639 | for (MemoryView memoryView : memories) {
640 | hwMemory = new HwMemory();
641 | hwMemory.setBankLabel(memoryView.getBankLabel() != null ? memoryView.getBankLabel() : null);
642 | hwMemory.setCurrentOperatingSpeed(memoryView.getCurrentOperatingSpeed() != null ? memoryView.getCurrentOperatingSpeed() : null);
643 | hwMemory.setFqdd(memoryView.getfQDD() != null ? memoryView.getfQDD() : null);
644 | if (memoryView.getManufactureDate() != null) {
645 | hwMemory.setManufactureDate(DateTimeUtils.getIsoDateString(memoryView.getManufactureDate(), TransformerAssemblerConstants.DATE_PATTERNS));
646 | }
647 | hwMemory.setManufacturer(memoryView.getManufacturer() != null ? memoryView.getManufacturer() : null);
648 | hwMemory.setDeviceDescription(memoryView.getDeviceDescription() != null ? memoryView.getDeviceDescription() : null);
649 | hwMemory.setMemoryType(memoryView.getMemoryType() != null ? memoryView.getMemoryType() : null);
650 | hwMemory.setModel(memoryView.getModel() != null ? memoryView.getModel() : null);
651 | hwMemory.setPartNumber(memoryView.getPartNumber() != null ? memoryView.getPartNumber() : null);
652 | hwMemory.setPrimaryStatus(memoryView.getPrimaryStatus() != null ? memoryView.getPrimaryStatus() : null);
653 | hwMemory.setRank(memoryView.getRank() != null ? memoryView.getRank() : null);
654 | hwMemory.setSerialNumber(memoryView.getSerialNumber() != null ? memoryView.getSerialNumber() : null);
655 | // convert Memory Size and Speed to GB from MB
656 | try {
657 | hwMemory.setSize(memoryView.getSize() != null ? PatternUtils.megaBytesToGigaBytes(Double.parseDouble(memoryView.getSize())) : 0);
658 | hwMemory.setSpeed(memoryView.getSpeed() != null ? PatternUtils.megaBytesToGigaBytes(Double.parseDouble(memoryView.getSpeed())) : 0);
659 | } catch (NumberFormatException e) {
660 | logger.debug("GB conversion failed: double parse of part threw NumberFormatException (memory size not numeric)");
661 | hwMemory.setSize(0);
662 | hwMemory.setSpeed(0);
663 | }
664 | hwMemoryList.add(hwMemory);
665 | }
666 | return hwMemoryList;
667 | }
668 |
669 |
670 | public static HwSystem transformHwSystem(DCIMSystemViewType system) throws Exception {
671 | if (system == null) {
672 | return null;
673 | }
674 | HwSystem hwSystem = new HwSystem();
675 | hwSystem.setAssetTag(system.getAssetTag() != null ? system.getAssetTag().getValue() : null);
676 | hwSystem.setBatteryRollupStatus(system.getBatteryRollupStatus() != null ? String.valueOf(system.getBatteryRollupStatus().getValue()) : null);
677 | if (system.getBiosReleaseDate() != null) {
678 | hwSystem.setBiosReleaseDate(getIsoDateString(system.getBiosReleaseDate().getValue(), TransformerAssemblerConstants.DATE_PATTERNS));
679 | }
680 | hwSystem.setBiosVersionString(system.getBiosVersionString() != null ? system.getBiosVersionString().getValue() : null);
681 | hwSystem.setBoardPartNumber(system.getBoardPartNumber() != null ? system.getBoardPartNumber().getValue() : null);
682 | hwSystem.setBoardSerialNumber(system.getBoardSerialNumber() != null ? system.getBoardSerialNumber().getValue() : null);
683 | hwSystem.setChassisName(system.getChassisName() != null ? system.getChassisName().getValue() : null);
684 | hwSystem.setChassisServiceTag(system.getChassisServiceTag() != null ? system.getChassisServiceTag().getValue() : null);
685 | hwSystem.setChassisSystemHeight(system.getChassisSystemHeight() != null ? String.valueOf(system.getChassisSystemHeight().getValue()) : null);
686 | hwSystem.setCmcip(system.getCmcip() != null ? system.getCmcip().getValue() : null);
687 | hwSystem.setCurrentRollupStatus(system.getCurrentRollupStatus() != null ? String.valueOf(system.getCurrentRollupStatus().getValue()) : null);
688 | hwSystem.setCpldVersion(system.getCpldVersion() != null ? system.getCpldVersion().getValue() : null);
689 | hwSystem.setDeviceDescription(system.getDeviceDescription() != null ? system.getDeviceDescription().getValue() : null);
690 | hwSystem.setFqdd(system.getFqdd() != null ? system.getFqdd().getValue() : null);
691 | hwSystem.setHostName(system.getHostName() != null ? system.getHostName().getValue() : null);
692 | hwSystem.setInstanceID(system.getInstanceID() != null ? system.getInstanceID().getValue() : null);
693 | hwSystem.setLicensingRollupStatus(system.getLicensingRollupStatus() != null ? String.valueOf(system.getLicensingRollupStatus().getValue()) : null);
694 | hwSystem.setLifecycleControllerVersion(system.getLifecycleControllerVersion() != null ? system.getLifecycleControllerVersion().getValue() : null);
695 | hwSystem.setManufacturer(system.getManufacturer() != null ? system.getManufacturer().getValue() : null);
696 | hwSystem.setMaxCpuSockets(system.getMaxCPUSockets() != null ? String.valueOf(system.getMaxCPUSockets().getValue()) : null);
697 | hwSystem.setMaxDimmSlots(system.getMaxDIMMSlots() != null ? String.valueOf(system.getMaxDIMMSlots().getValue()) : null);
698 | hwSystem.setMaxPcieSlots(system.getMaxPCIeSlots() != null ? String.valueOf(system.getMaxPCIeSlots().getValue()) : null);
699 | hwSystem.setMemoryOperationMode(system.getMemoryOperationMode() != null ? system.getMemoryOperationMode().getValue() : null);
700 | hwSystem.setModel(system.getModel() != null ? system.getModel().getValue() : null);
701 | hwSystem.setPlatformGuid(system.getPlatformGUID() != null ? system.getPlatformGUID().getValue() : null);
702 | hwSystem.setPopulatedCpuSockets(system.getPopulatedCPUSockets() != null ? String.valueOf(system.getPopulatedCPUSockets().getValue()) : null);
703 | hwSystem.setPopulatedDimmSlots(system.getPopulatedDIMMSlots() != null ? String.valueOf(system.getPopulatedDIMMSlots().getValue()) : null);
704 | hwSystem.setPopulatedPcieSlots(system.getPopulatedPCIeSlots() != null ? String.valueOf(system.getPopulatedPCIeSlots().getValue()) : null);
705 | hwSystem.setPowerCap(system.getPowerCap() != null ? String.valueOf(system.getPowerCap().getValue()) : null);
706 | hwSystem.setPowerCapEnabledState(system.getPowerCapEnabledState() != null ? String.valueOf(system.getPowerCapEnabledState().getValue()) : null);
707 | hwSystem.setPowerState(system.getPowerState() != null ? String.valueOf(system.getPowerState().getValue()) : null);
708 | hwSystem.setPsRollupStatus(system.getPsRollupStatus() != null ? String.valueOf(system.getPsRollupStatus().getValue()) : null);
709 | hwSystem.setRollupStatus(system.getRollupStatus() != null ? String.valueOf(system.getRollupStatus().getValue()) : null);
710 | hwSystem.setServiceTag(system.getServiceTag() != null ? system.getServiceTag().getValue() : null);
711 | hwSystem.setSysMemLocation(system.getSysMemLocation() != null ? String.valueOf(system.getSysMemLocation().getValue()) : null);
712 | hwSystem.setSysMemErrorInfo(system.getSysMemErrorInfo() != null ? String.valueOf(system.getSysMemErrorInfo().getValue()) : null);
713 | hwSystem.setSysMemErrorMethodology(system.getSysMemErrorMethodology() != null ? String.valueOf(system.getSysMemErrorMethodology().getValue()) : null);
714 | hwSystem.setSysMemPrimaryStatus(system.getSysMemPrimaryStatus() != null ? String.valueOf(system.getSysMemPrimaryStatus().getValue()) : null);
715 | // convert Installed Capacity to GB from MB
716 | hwSystem.setSysMemTotalSize(system.getSysMemTotalSize() != null ? PatternUtils.megaBytesToGigaBytes(system.getSysMemTotalSize().getValue()) : 0);
717 | hwSystem.setSystemGeneration(system.getSystemGeneration() != null ? String.valueOf(system.getSystemGeneration().getValue()) : null);
718 | hwSystem.setSystemID(system.getSystemID() != null ? String.valueOf(system.getSystemID().getValue()) : null);
719 | hwSystem.setSysMemMaxCapacitySize(system.getSysMemMaxCapacitySize() != null ? String.valueOf(system.getSysMemMaxCapacitySize().getValue()) : null);
720 | hwSystem.setUuid(system.getUuid() != null ? system.getUuid().getValue() : null);
721 | hwSystem.setChassisModel(system.getChassisModel() != null ? system.getChassisModel().getValue() : null);
722 | hwSystem.setBaseBoardChassisSlot(system.getBaseBoardChassisSlot() != null ? system.getBaseBoardChassisSlot().getValue() : null);
723 | hwSystem.setBladeGeometry(system.getBladeGeometry() != null ? String.valueOf(system.getBladeGeometry().getValue()) : null);
724 | hwSystem.setCpuRollupStatus(system.getCpuRollupStatus() != null ? String.valueOf(system.getCpuRollupStatus().getValue()) : null);
725 | hwSystem.setCaption(system.getCaption() != null ? system.getCaption().getValue() : null);
726 | hwSystem.setExpressServiceCode(system.getExpressServiceCode() != null ? system.getExpressServiceCode().getValue() : null);
727 | hwSystem.setElementName(system.getElementName() != null ? system.getElementName().getValue() : null);
728 | hwSystem.setFanRollupStatus(system.getFanRollupStatus() != null ? String.valueOf(system.getFanRollupStatus().getValue()) : null);
729 | hwSystem.setGeneration(system.getGeneration() != null ? String.valueOf(system.getGeneration().getValue()) : null);
730 | hwSystem.setLastSystemInventoryTime(system.getLastSystemInventoryTime() != null ? system.getLastSystemInventoryTime().getValue() : null);
731 | hwSystem.setLastUpdateTime(system.getLastUpdateTime() != null ? system.getLastUpdateTime().getValue() : null);
732 | hwSystem.setPrimaryStatus(system.getPrimaryStatus() != null ? String.valueOf(system.getPrimaryStatus().getValue()) : null);
733 | hwSystem.setStorageRollupStatus(system.getStorageRollupStatus() != null ? String.valueOf(system.getStorageRollupStatus().getValue()) : null);
734 | hwSystem.setSysMemFailOverState(system.getSysMemFailOverState() != null ? system.getSysMemFailOverState().getValue() : null);
735 | hwSystem.setSystemRevision(system.getSystemRevision() != null ? String.valueOf(system.getSystemRevision().getValue()) : null);
736 | hwSystem.setTempRollupStatus(system.getTempRollupStatus() != null ? String.valueOf(system.getTempRollupStatus().getValue()) : null);
737 | hwSystem.setVoltRollupStatus(system.getVoltRollupStatus() != null ? String.valueOf(system.getVoltRollupStatus().getValue()) : null);
738 | hwSystem.setSmbiosGUID(system.getSmbiosGUID() != null ? system.getSmbiosGUID().getValue() : null);
739 | hwSystem.setNodeId(system.getNodeId() != null ? system.getNodeId().getValue() : null);
740 | hwSystem.setEstimatedExhaustTemperature(system.getEstimatedExhaustTemperature() != null ? String.valueOf(system.getEstimatedExhaustTemperature().getValue()) : null);
741 | hwSystem.setEstimatedSystemAirflow(system.getEstimatedSystemAirflow() != null ? String.valueOf(system.getEstimatedSystemAirflow().getValue()) : null);
742 | hwSystem.setServerAllocation(system.getServerAllocation() != null ? String.valueOf(system.getServerAllocation().getValue()) : null);
743 | hwSystem.setTempStatisticsRollupStatus(system.getTempStatisticsRollupStatus() != null ? String.valueOf(system.getTempStatisticsRollupStatus().getValue()) : null);
744 | hwSystem.setIdsdmRollupStatus(system.getIdsdmRollupStatus() != null ? String.valueOf(system.getIdsdmRollupStatus().getValue()) : null);
745 | hwSystem.setMemoryRollupStatus(system.getMemoryRollupStatus() != null ? String.valueOf(system.getMemoryRollupStatus().getValue()) : null);
746 |
747 | return hwSystem;
748 | }
749 |
750 | public static List transformIdracString(List isvList) throws Exception {
751 | List icsList= new ArrayList<>();
752 | if (CollectionUtils.isEmpty(isvList)) {
753 | return icsList;
754 | }
755 |
756 | for (IDRACCardStringView icsv : isvList) {
757 | IdracCardString ics = new IdracCardString();
758 | ics.setAttributeDisplayName(icsv.getAttributeDisplayName());
759 | ics.setAttributeName(icsv.getAttributeName());
760 | ics.setCurrentValue(icsv.getCurrentValue());
761 | ics.setDefaultValue(icsv.getDefaultValue());
762 | ics.setDependency(icsv.getDependency());
763 | ics.setDisplayOrder(icsv.getDisplayOrder());
764 | ics.setFqdd(icsv.getfQDD());
765 | ics.setGroupDisplayName(icsv.getGroupDisplayName());
766 | ics.setGroupId(icsv.getGroupID());
767 | ics.setInstanceId(icsv.getInstanceID());
768 | ics.setIsReadOnly(icsv.getIsReadOnly());
769 | ics.setMaxLength(icsv.getMaxLength());
770 | ics.setMinLength(icsv.getMinLength());
771 | ics.setPendingValue(icsv.getPendingValue());
772 | icsList.add(ics);
773 | }
774 | return icsList;
775 | }
776 |
777 | }
778 |
--------------------------------------------------------------------------------