### Led Object Configuration Guide Source: https://www.openubmc.cn/docs/zh/development/api/app_api/chassis This guide details the configuration attributes for the Led object, including their types, required status, example values, and descriptions. ```APIDOC ## Led Object Configuration Guide ### Description This guide details the configuration attributes for the Led object, including their types, required status, example values, and descriptions. The color values have specific meanings ranging from Reserved to White. ### Attributes | Attribute Name | Type | Required | Example Value | Description | |---|---|---|---|---| | Id | U8 | ✅ | 4 | LED唯一标识符 | | SystemId | U8 | ✅ | 1 | 系统ID | | Name | String | ✅ | "UIDLed" | LED名称 | | CtrlValue | U8 | ❌ | - | 控制值,可引用Accessor | | Capability | U8 | ❌ | 1 | LED能力 | | Mode | U8 | ❌ | 0 | LED模式 | | ColorCapabilities | U8 | ❌ | 2 | LED支持的颜色能力 | | DefaultOSColor | U8 | ❌ | 1 | 默认超驰颜色 | | DefaultLCSColor | U8 | ❌ | 1 | 默认本地控制颜色 | | LCSColor | U8 | ❌ | 1 | 本地控制状态颜色 | | LCSState | U8 | ❌ | 0 | 本地控制状态 | | OSColor | U8 | ❌ | 1 | 超驰状态颜色 | | OSState | U8 | ❌ | 0 | 超驰状态 | | LampTestColor | U8 | ❌ | 1 | 灯测试颜色 | | LampTestDuration | U8 | ❌ | 0 | 灯测试持续时间 | ### Configuration Notes - ✅ indicates a required attribute, ❌ indicates an optional attribute. - Color values: 0=Reserved, 1=BLUE, 2=RED, 3=GREEN, 4=AMBER, 5=ORANGE, 6=WHITE. - Examples can be referenced from the vpd repository configuration. ``` -------------------------------- ### Parameter Prompt Configuration Example - Shell and JSON Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide Shows how to configure parameter prompts for a CLI command using the 'Usage', 'Description', 'ReqBody', and 'Example' fields in the JSON configuration. This guides users on correct parameter usage. ```shell Usage: ipmcset -d fanmode -v [timeout] mode: 0 auto regulate fan speed, without parameter [timeout] 1 manual regulate fan speed without parameter [timeout], default timeout(30 seconds) with parameter [timeout], timeout range <0-100000000>,(0 means max timeout) Example: ipmcset -d fanmode -v 0 ipmcset -d fanmode -v 1 ipmcset -d fanmode -v 1 100 ``` ```json { "Uri": "/cli/v1/_/fanmode", "Interfaces": [ { "Type": "PATCH", "Description": "Set fan mode,you can choose manual or auto", "Usage": "ipmcset -d fanmode -v [timeout]", "ReqBody": { "Type": "object", "Required": false, "Properties": { "mode": { "Required": false, "Type": "integer", "Validator": [ { "Type": "Enum", "Formula": [0, 1, 2] } ] }, "timeout": { "Type": "integer", "Required": false } } } } ] } ``` -------------------------------- ### JSON Configuration Structure Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/product_development/app_profile_import_export This JSON snippet demonstrates the structure of an exported configuration file. It includes sections for GeneralInfo and Components, with nested objects for specific configurations like IAM and BIOS. The example shows various data types and attribute settings for different configuration parameters. ```json { "GeneralInfo": { "ProductName": "S920X20", "ProductSN": "1234567890", "TimeStamp": "2025-02-11 10:04:49" }, "Components": { "iam": { "Description": "Configurations of Identity and Access Management", "ConfigData": { "Accounts": [ { "Id": { "Value": 2, "AttributeType": "ExportOnly", "Import": false }, "UserName": { "Value": "******", "AttributeType": "ImportAndExport", "Import": false }, "Privilege": { "Value": "Administrator", "AttributeType": "ImportAndExport", "Import": false }, "UserRoleId": { "Value": "Administrator", "AttributeType": "ImportAndExport", "Import": true }, "PermitRuleIds": { "Value": 1, "AttributeType": "ImportAndExport", "Import": true }, "LoginInterface": { "Value": ["SSH", "SNMP", "Local", "Redfish", "SFTP", "Web", "IPMI"], "AttributeType": "ExportOnly", "Import": false }, "IsUserEnable": { "Value": true, "AttributeType": "ExportOnly", "Import": false }, "IsUserLocked": { "Value": false, "AttributeType": "ExportOnly", "Import": false } } ], "LDAPController": [] } }, "bios": { "Description": "Configurations of Bios", "ConfigData": { "BiosConfig": { "BootTypeOrder0": { "Value": "DVDROMDrive", "AttributeType": "ImportAndExport", "Import": true }, "BootTypeOrder1": { "Value": "PXE", "AttributeType": "ImportAndExport", "Import": true }, "BootTypeOrder2": { "Value": "HardDiskDrive", "AttributeType": "ImportAndExport", "Import": true }, "BootTypeOrder3": { "Value": "Others", "AttributeType": "ImportAndExport", "Import": true }, "DDRDebugLevel": { "Value": "Minimum", "AttributeType": "ImportAndExport", "Import": true }, "DDRFreqLimit": { "Value": "Auto", "AttributeType": "ImportAndExport", "Import": true }, "DdrRefreshSupport": { "Value": true, "AttributeType": "ImportAndExport", "Import": true } } } }, "storage": { "Description": "Configurations of Storage", "ConfigData": { "RAIDConfig": [ { "Id": { "Value": 802, "AttributeType": "ExportOnly", "Import": false }, "Type": { "Value": "SAS3508", "AttributeType": "ExportOnly", "Import": false } } ] } } } } ``` -------------------------------- ### SNMP Simple Interface Configuration Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/SNMP_mapping_guide Configuration example for a simple SNMP interface, showing GET and PATCH operations. This includes the URI, RspBody for GET requests, ReqBody for PATCH requests, and ProcessingFlow details for property mapping. ```json { "Resources": [ { "Uri": "/snmp/1.3.6.1.4.1.{{SnmpOemIdentifier}}.0.0.1/Systems/Readwrite", "Interfaces": [ { "Type": "GET", "RspBody": { "Name": "${ProcessingFlow[1]/Destination/Name}" }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/System", "Interface": "bmc.kepler.System", "Destination": { "Name": "Name" } } ] }, { "Type": "PATCH", "ReqBody": { "Type": "object", "Required": true, "Properties": { "UserName": { "Type": "string", "Required": true } } }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/System", "Interface": "bmc.kepler.System", "Source": { "Name": "${ReqBody/Name}" } } ] } ] } ] } ``` -------------------------------- ### CLI Interface Output Example (Text) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/north_interface_mapper_adaptation_guideline This is an example of the expected output after configuring the CLI interface to display the 'WelcomeMessage'. It shows the 'Hello' value retrieved for the 'WelcomeMessage' attribute. ```text MYAPP INFO Version: Hello ``` -------------------------------- ### FRU Configuration Example (JSON) Source: https://www.openubmc.cn/docs/zh/development/api/app_api/frudata Demonstrates a JSON configuration structure for FRU (Field Replaceable Unit) devices, including EEPROM settings, accessor configurations, and detailed FRU definitions. This configuration allows for specifying storage types, relationships between components, and hardware attributes. ```json "Eeprom_EXU": { "OffsetWidth": 2, "AddrWidth": 1, "Address": 174, "WriteTmout": 100, "ReadTmout": 100, "RwBlockSize": 32, "WriteInterval": 20, "HealthStatus": 0 }, "Accessor_EXUWP": { "Chip": "#/Smc_ExpBoardSMC", "Size": 1, "Offset": 11776, "Mask": 255, "Type": 0, "Value": 0 }, "FruData_Expander": { "FruId": 1, "FruDev": "#/Eeprom_EXU", -- 关联eeprom "EepromWp": "#/Accessor_EXUWP.Value", -- 关联写保护寄存器 "StorageType": "TianChi" -- 存储介质类型 }, "Fru_Expander": { "PcbId": 1, -- 需要关联到硬件, 从硬件读取Id "PcbVersion": ".A", -- PCB版本 "FruId": 1, "FruName": "ExpBoard{Slot}", "PowerState": 1, "Health": 0, "EepStatus": "<=/Eeprom_EXU.HealthStatus", "Type": 50, "FruDataId": "#/FruData_Expander", -- EEPROM状态, 当此属性关联到Accessor时进行EEPROM的监控 "ConnectorGroupId": "{GroupId}", -- 关联Anchor的GroupId "BoardId": 65535, -- 非天池:组件单板BoardID "UniqueId": "00000001010302023922" -- 天池:组件唯一标识,Vendor + ComponentID } ``` -------------------------------- ### GET Interface Configuration Example (JSON) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Example of a GET interface configuration in JSON format for openUBMC's Redfish implementation. It includes essential fields like Uri, Type, ResourceExist, Query, RspBody, Statements, and ProcessingFlow. This structure allows defining how GET requests are mapped and handled. ```json { "Uri": "/redfish/v1/Managers/:managerid/DiagnosticService/WorkRecord", "Interfaces": [ { "Type": "GET", "ResourceExist": { }, "Query": { }, "RspBody": { }, "Statements": { }, "ProcessingFlow": [ ] } ] } ``` -------------------------------- ### GET Interface ResourceExist Check Example (JSON) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Example configuration for 'ResourceExist', a non-mandatory field used in GET interfaces. It's employed when the URI contains variable segments, such as ':managerid', to validate the existence of these resources, using statements like 'IsValidManagersId()'. ```json "ResourceExist": { "${Statements/IsValidManagersId()}": true } ``` -------------------------------- ### 初始化并启动 ORM 对象管理 (Lua) Source: https://www.openubmc.cn/docs/zh/development/design_reference/key_feature/hardware_discovery 在 `app.lua` 中初始化 `orm.object_manage`。通过 `c_object_manage.new` 创建实例,并设置数据库连接和总线,然后调用 `start()` 方法开启 ORM 对象的自动发现和分发。 ```lua local c_object_manage = require 'mc.orm.object_manage' function app:init() ... self.object_manage = c_object_manage.new(self.db, self.bus) self.objcet_mage.app = app self.object_manage.per_db = self.db ... self.object_manage:start() -- 开启orm自发现对象分发 end ``` -------------------------------- ### Simple SNMP Interface Configuration Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/SNMP_mapping_guide Provides a configuration example for a simple SNMP interface, demonstrating GET and PATCH operations with request and response body structures. ```APIDOC ## Simple SNMP Interface Configuration Example ### Description Simple interfaces are used for querying and setting individual attributes. This example shows the configuration for both reading and writing a system property via SNMP. ### Request Example (GET Operation) ```json { "Resources": [ { "Uri": "/snmp/1.3.6.1.4.1.{{SnmpOemIdentifier}}.0.0.1/Systems/Readwrite", "Interfaces": [ { "Type": "GET", "RspBody": { "Name": "${ProcessingFlow[1]/Destination/Name}" }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/System", "Interface": "bmc.kepler.System", "Destination": { "Name": "Name" } } ] } ] } ] } ``` ### Request Example (PATCH Operation) ```json { "Resources": [ { "Uri": "/snmp/1.3.6.1.4.1.{{SnmpOemIdentifier}}.0.0.1/Systems/Readwrite", "Interfaces": [ { "Type": "PATCH", "ReqBody": { "Type": "object", "Required": true, "Properties": { "UserName": { "Type": "string", "Required": true } } }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/System", "Interface": "bmc.kepler.System", "Source": { "Name": "${ReqBody/Name}" } } ] } ] } ] } ``` ### Response Example (Success) *Details of success response depend on the specific attribute being set or retrieved.* ``` -------------------------------- ### POST /UI/Rest/System/MyApp (Web Interface Configuration) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/north_interface_mapper_adaptation_guideline This section describes how to add a new web interface configuration for a 'WelcomeMessage' property of an existing 'my_app'. It involves creating a JSON mapping file and provides an example of the request and response. ```APIDOC ## POST /UI/Rest/System/MyApp ### Description Adds a new web interface configuration to expose the 'WelcomeMessage' property of 'my_app'. This is achieved by creating a JSON mapping file in the `interface_config/web_backend/mapping_config/System` directory. ### Method POST ### Endpoint `/UI/Rest/System/MyApp` ### Parameters #### Request Body This endpoint does not strictly require a request body for configuration but uses a JSON structure to define the interface. ```json { "Resources": [ { "Uri": "/UI/Rest/System/MyApp", "Interfaces": [ { "Type": "GET", "Authentication": { "Condition": false }, "RspBody": { "WelcomeMessage": "${ProcessingFlow[1]/Destination/WelcomeMessage}" }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/demo/MyMDSModel/1", "Interface": "bmc.demo.OpenUBMC.Community", "Destination": { "WelcomeMessage": "WelcomeMessage" } } ] } ] } ] } ``` ### Request Example To access the configured interface, use a tool like Postman and send a GET request to `https:///UI/Rest/System/MyApp`. Ensure you include the necessary cookie in the request headers, which can be obtained from browser developer tools. ### Response #### Success Response (200) - **WelcomeMessage** (string) - The welcome message retrieved from the specified D-Bus property. #### Response Example ```json { "WelcomeMessage": "Hello" } ``` ``` -------------------------------- ### GET Interface Query Parameter Configuration Example (JSON) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Configuration for the 'Query' field in GET interfaces, used to set default query parameters like Skip and Top. This is beneficial when accessing resources without explicit query parameters, providing default values for pagination or filtering. ```json "Query": { "$skip": 0, "$top": 32 } ``` -------------------------------- ### Switch Configuration Example for Data Replacement Source: https://www.openubmc.cn/docs/zh/development/api/app_api/rackmount Illustrates a Switch configuration for data replacement, mimicking C/Java switch statements. It allows defining cases and their corresponding replacement values, with an optional default case. ```json { "Type": "Switch", "Formula": [ { "Case": "Administrator", "To": 1 }, { "Case": "root", "To": 2 }, { "Case": null, "To": 3 }, { "To": 0 } ] } ``` -------------------------------- ### Resource Configuration Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/SNMP_mapping_guide Defines a resource with its URI, sequence properties (including primary keys), and interfaces for GET and PATCH operations. The sequence field specifies the name, type, access level, and primary key status for each attribute of a sub-resource. ```json { "Resources": [ { "Uri": "/snmp/1.3.6.1.4.1.{{SnmpOemIdentifier}}.0.0.2/Devices/Readwrite", "Sequence": [ { "Name": "Id", "Type": "integer", "Access": "Readonly", "Primary": true }, { "Name": "Enabled", "Type": "integer", "Access": "Readwrite" } ], "Interfaces": [ { "Type": "GET", "RspBody": { "Devices": "${Statements/Devices()}" }, "Statements": { "Devices": { "Input": "${ProcessingFlow[1]/Destination/Devices}", "Steps": [ { "Type": "Expand", "Formula": "1" } ] } }, "ProcessingFlow": [ { "Type": "List", "Path": "/bmc/kepler/Devices", "Destination": { "Members": "Devices" } } ] }, { "Type": "PATCH", "ReqBody": { "Type": "object", "Required": true, "Properties": { "Id": { "Type": "integer", "Required": true }, "Enabled": { "Type": "integer" } } }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/Devices/${ReqBody/Id}", "Interface": "bmc.kepler.Device", "Source": { "Enabled": "${ReqBody/Enabled}" } } ] } ] }, { "Uri": "/bmc/kepler/Devices/:id", "Interfaces": [ { "Type": "GET", "RspBody": { "Id": "${Uri/id}", "Enabled": "${ProcessingFlow[1]/Destination/Enabled}" }, "ProcessingFlow": [ { "Type": "Property", "Path": "/bmc/kepler/Devices/${Uri/Id}", "Interface": "bmc.kepler.Device", "Destination": { "Enabled": "Enabled" } } ] } ] } ] } ``` -------------------------------- ### GET Endpoint Configuration Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Configuration details for GET requests, including Query and RspBody. ```APIDOC ## GET Endpoint Configuration ### Description Configuration details for GET requests, including Query and RspBody. ### Method GET ### Endpoint /redfish/v1/Managers/:managerid/LogServices/OperateLog/Entries ### Parameters #### Query Parameters - **Skip** (integer) - Optional - Specifies the number of records to skip. Default is 0. - **Top** (integer) - Optional - Specifies the maximum number of records to return. Default is 32. ### Request Example ```json { "Type": "GET" } ``` ### Response #### Success Response (200) - **odata.context** (string) - Metadata context. - **Name** (string) - Name of the resource, e.g., "User Account". - **UserName** (string) - The username. - **Oem** (object) - OEM specific information. - **openUBMC** (object) - OpenUBMC specific information. - **LoginRule** (any) - Login rule details. #### Response Example ```json { "odata.context": "/redfish/v1/$metedata#AccountService/Accounts/Members/$entity", "Name": "User Account", "UserName": "Administrator", "Oem": { "openUBMC": { "LoginRule": null } } } ``` ### ResourceExist (Optional) Used to check for variable slot IDs in the URI. ```json "ResourceExist": { "${Statements/IsValidManagersId()}": true } ``` ### Query (Optional) Configures default values for query parameters like Skip and Top. ```json "Query": { "Skip": 0, "Top": 32 } ``` ### RspBody (Required) Defines the response body for GET requests. ```json { "odata.context": "/redfish/v1/$metedata#AccountService/Accounts/Members/$entity", "Name": "User Account", "UserName": "${ProcessingFlow[1]/Destination/UserName}", "Oem": { "{{OemIentifier}}": { "LoginRule": null } } } ``` ### Statements (Optional) Used for data processing after receiving data. ```json "Statements": { "Prop": { "Input": "${var}", "Step": [ { "Type": "xxxx", "Formula": "xxxx" }, { "Type": "xxxx", "Formula": "xxxx" } ] } } ``` ### ProcessingFlow (Optional) Used for resource tree mapping when accessing resources. ```json "ProcessingFlow": [ { "Type": "Property/Method/List/Task/Paging", "Path": "xx", "Interface": "xxx", "Name" : "xxx", "Params": [xxx], "Destination": {xxx}, "Source": {xxx}, "CallIf": {xxx}, "Foreach": "xxx" } ] ``` ``` -------------------------------- ### Example Busctl Command for Method Call (Shell) Source: https://www.openubmc.cn/docs/zh/development/design_reference/key_feature/interface_mapping Shows a sample command-line invocation using 'busctl' to call a method on a resource collaboration interface. This demonstrates how the method is executed and the initial raw output format. ```shell > busctl --user call bmc.kepler.event /bmc/kepler/Systems/Events bmc.kepler.Systems.Events GetSelInfo a{ss} 0 suu "1.0.0" 0 10000 ``` -------------------------------- ### Basic Configuration File Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/product_development/white_label_branding_customization_guide This INI-style configuration file section defines basic project settings and lists files to be included in a package. ```ini [Basic] Version=2.02 [Filelist] FileNum=9 [File0] Name=code1.png Path=/data/opt/pme/web/htdocs/theme/custom/img [File1] Name=favicon.ico Path=/data/opt/pme/web/htdocs [File2] Name=web_custom.xml Path=/data/opt/pme/web/conf [File3] Name=CLEAR_ALL Path=/data/opt/pme/web/custom [File4] Name=CLEAR_ALL Path=/data/opt/pme/web/custom [File5] Name=CLEAR_ALL Path=/data/opt/pme/web/custom [File6] Name=CLEAR_ALL Path=/data/opt/pme/web/custom [File7] Name=img_02.png Path=/data/opt/pme/web/custom [File8] Name=img_03.png Path=/data/opt/pme/web/custom ``` -------------------------------- ### JSON Configuration Examples for DeviceChip Source: https://www.openubmc.cn/docs/zh/development/specifications/csr_conf_dict/object/DeviceChip Provides JSON examples for configuring the DeviceChip class. These examples illustrate standard VGA switching, multi-slot configurations, and configurations for different device types. Each example shows the structure required to set the Slot, DeviceType, and Chip attributes. ```json { "DeviceChip": { "Slot": 0, "DeviceType": 1, "Chip": "#/Accessor_VGADftSwitch.Value" } } ``` ```json { "DeviceChip": { "Slot": 1, "DeviceType": 1, "Chip": "#/Accessor_VGADftSwitch.Value" } } ``` ```json { "DeviceChip": { "Slot": 2, "DeviceType": 2, "Chip": "#/Accessor_VGADftSwitch.Value" } } ``` -------------------------------- ### Regular Command Example: Get Version Information Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide This JSON configuration defines a 'regular command' for retrieving version information using `ipmcget -d version`. It specifies the URI, request type, and a processing flow that maps backend properties to the response body, which is then used with an echo template for displaying the output. ```json { "Uri": "/cli/v1/_/version", "Interfaces": [ { "Type": "GET", "Description": "Get openUBMC version", "Usage": "ipmcget -d version", "RspBody": { "ActiveVersion": "${ProcessingFlow[1]/Destination/ActiveVersion}", "ActiveBuildNum": "${ProcessingFlow[1]/Destination/ActiveBuildNum}", "ActiveReleaseDate": "${ProcessingFlow[1]/Destination/ActiveReleaseDate}", "BackupVersion": "${ProcessingFlow[2]/Destination/BackupVersion}", "AvailableVersion": "${ProcessingFlow[3]/Destination/AvailableVersion}", "AvailableBuildNum": "${ProcessingFlow[3]/Destination/AvailableBuildNum}" }, "ProcessingFlow": [ { { "Type": "Property", "Path": "/bmc/kepler/UpdateService/FirmwareInventory/ActiveBMC", "Interface": "bmc.kepler.UpdateService.FirmwareInfo", "Destination": { "Version": "ActiveVersion", "BuildNum": "ActiveBuildNum", "ReleaseDate": "ActiveReleaseDate" } }, { "Type": "Property", "Path": "/bmc/kepler/UpdateService/FirmwareInventory/BackupBMC", "Interface": "bmc.kepler.UpdateService.FirmwareInfo", "Destination": { "Version": "BackupVersion" } }, { "Type": "Property", "Path": "/bmc/kepler/UpdateService/FirmwareInventory/AvailableBMC", "Interface": "bmc.kepler.UpdateService.FirmwareInfo", "Destination": { "Version": "AvailableVersion", "BuildNum": "AvailableBuildNum" } } } ], "Echoes": [ "ipmcget/_version", "" ] } ] } ``` -------------------------------- ### GET Interface Type Configuration (JSON) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Configuration snippet for the 'Type' field within a GET interface configuration. This field is mandatory and specifically denotes that the configuration pertains to a GET request. ```json "Type": "GET" ``` -------------------------------- ### BIOS Boot Options Management Source: https://www.openubmc.cn/docs/zh/development/api/app_api/bios APIs for configuring BIOS boot mode, order, and startup options. ```APIDOC ## PUT /bmc/kepler/Systems/${SystemId}/BootOptions - SetBootMode ### Description Sets the BIOS boot mode. Currently only supports UEFI. ### Method PUT ### Endpoint `/bmc/kepler/Systems/${SystemId}/BootOptions` ### Parameters #### Path Parameters - **SystemId** (string) - Required - The unique identifier for the system. #### Query Parameters None #### Request Body - **bootMode** (string) - Required - The desired boot mode. Example: "UEFI". ### Request Example ```json { "bootMode": "UEFI" } ``` ### Response #### Success Response (200) - **i** (integer) - Indicates the result of the operation (e.g., 0 for success). #### Response Example ```json { "result": 0 } ``` ``` ```APIDOC ## PUT /bmc/kepler/Systems/${SystemId}/BootOptions - SetBootOrder ### Description Sets the BIOS boot order. The order must comply with BIOS reporting rules. ### Method PUT ### Endpoint `/bmc/kepler/Systems/${SystemId}/BootOptions` ### Parameters #### Path Parameters - **SystemId** (string) - Required - The unique identifier for the system. #### Query Parameters None #### Request Body - **bootOrder** (array of strings) - Required - An array of strings representing the desired boot order (e.g., ["Pxe", "Hdd", "Cd"]). ### Request Example ```json { "bootOrder": ["Pxe", "Hdd", "Cd"] } ``` ### Response #### Success Response (200) - **iss** (string) - Indicates the result of the operation. (Format and meaning might be specific, assumed string). #### Response Example ```json { "status_message": "iss" } ``` ``` ```APIDOC ## PUT /bmc/kepler/Systems/${SystemId}/BootOptions - SetStartOption ### Description Sets the BIOS startup option. Possible options: None, Pxe, Floppy, Cd, Hdd, BiosSetup. ### Method PUT ### Endpoint `/bmc/kepler/Systems/${SystemId}/BootOptions` ### Parameters #### Path Parameters - **SystemId** (string) - Required - The unique identifier for the system. #### Query Parameters None #### Request Body - **startOption** (string) - Required - The desired startup option (e.g., "Hdd"). ### Request Example ```json { "startOption": "Hdd" } ``` ### Response #### Success Response (200) - **i** (integer) - Indicates the result of the operation (e.g., 0 for success). #### Response Example ```json { "result": 0 } ``` ``` -------------------------------- ### GET Interface Configuration Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Configuration details for GET requests, including Type, ResourceExist, Query, RspBody, Statements, and ProcessingFlow. ```APIDOC ## GET /redfish/v1/Managers/:managerid/DiagnosticService/WorkRecord ### Description Configures a GET request for retrieving diagnostic work record information. ### Method GET ### Endpoint /redfish/v1/Managers/:managerid/DiagnosticService/WorkRecord ### Parameters #### Path Parameters - **managerid** (string) - Required - The ID of the manager. #### Query Parameters - **$skip** (integer) - Optional - Number of records to skip. Defaults to 0. - **$top** (integer) - Optional - Maximum number of records to return. Defaults to 32. #### Request Body This endpoint does not typically accept a request body. ### Request Example ```json { "Uri": "/redfish/v1/Managers/:managerid/DiagnosticService/WorkRecord", "Interfaces": [ { "Type": "GET", "ResourceExist": { "${Statements/IsValidManagersId()}": true }, "Query": { "$skip": 0, "$top": 32 }, "RspBody": {}, "Statements": {}, "ProcessingFlow": [] } ] } ``` ### Response #### Success Response (200) - **Members** (array) - List of work record entries. - **@odata.nextLink** (string) - Link to the next set of results if pagination is used. #### Response Example ```json { "@odata.context": "/redfish/v1/$metadata#WorkRecord.WorkRecord", "@odata.etag": "W/\"65208237a5a425d6b88469c465725a4e\"", "@odata.id": "/redfish/v1/Managers/1/DiagnosticService/WorkRecord", "Name": "WorkRecord", "Description": "Work Record Collection", "Members": [ { "@odata.id": "/redfish/v1/Managers/1/DiagnosticService/WorkRecord/1", "Name": "WorkRecord 1", "Description": "Diagnostic Work Record Entry 1" } ], "@odata.nextLink": "/redfish/v1/Managers/1/DiagnosticService/WorkRecord?$skip=32" } ``` ``` -------------------------------- ### CLI Interface Configuration String (Text) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/north_interface_mapper_adaptation_guideline This text configuration is added to the 'ipmcget_version' file to display the 'WelcomeMessage' information in the CLI output, formatted as 'MYAPP INFO Version:'. ```text MYAPP INFO Version: {* WelcomeMessage *} ``` -------------------------------- ### Get PCIe Card Number Source: https://www.openubmc.cn/docs/zh/development/specifications/SDK Retrieves the total number of PCIe cards installed in the system. ```APIDOC ## GET /websites/openubmc_cn_zh_development/bmc/kepler/Systems/PCIeDevices/GetPCIeCardNum ### Description Retrieves the total number of PCIe cards installed in the system. ### Method GET ### Endpoint /websites/openubmc_cn_zh_development/bmc/kepler/Systems/PCIeDevices/GetPCIeCardNum ### Parameters None ### Response #### Success Response (200) - **PCIeCardNum** (U32) - The total number of PCIe cards. #### Response Example ```json { "PCIeCardNum": 5 } ``` ``` -------------------------------- ### Web Interface Response Example (Postman) Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/north_interface_mapper_adaptation_guideline This is an example of a successful response when testing the configured Web interface endpoint using Postman. It demonstrates the expected JSON output for the 'WelcomeMessage' attribute. ```json { "WelcomeMessage": "Hello" } ``` -------------------------------- ### GET /cli/v1/_/version Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide Retrieves the OpenUBMC version information. ```APIDOC ## GET /cli/v1/_/version ### Description This endpoint retrieves the version information of the OpenUBMC system. The response includes details about the active and backup versions, build numbers, and release dates. ### Method GET ### Endpoint /cli/v1/_/version ### Parameters #### None ### Request Example ``` N/A ``` ### Response #### Success Response (200) - **ActiveVersion** (string) - The active version. - **ActiveBuildNum** (string) - The active build number. - **ActiveReleaseDate** (string) - The active release date. - **BackupVersion** (string) - The backup version. - **AvailableVersion** (string) - The available version. - **AvailableBuildNum** (string) - The available build number. #### Response Example ```json { "ActiveVersion": "1.0", "ActiveBuildNum": "123", "ActiveReleaseDate": "2024-01-01", "BackupVersion": "1.0", "AvailableVersion": "1.1", "AvailableBuildNum": "456" } ``` ``` -------------------------------- ### Command Hint Configuration Example - JSON Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide Illustrates the JSON configuration for providing command hints when a command is partially matched. It maps command descriptions to specific interface entries. ```json { "Uri": "/cli/v1/service", "Interfaces": [ { "Type": "PATCH", "Description": "Operate with service" } ] } ``` -------------------------------- ### 编写custom_app服务主入口脚本 - Lua Source: https://www.openubmc.cn/docs/zh/development/develop_guide/app_development/app_creation 此Lua脚本是定制组件`custom_app`的服务主入口。它使用`skynet.manager`和`skynet`库来启动服务,注册服务名为`custom_app`,并处理来自`lua`命令的调度。脚本还包含一个`exit`命令用于服务退出。 ```lua require 'skynet.manager' local skynet = require 'skynet' local logging = require 'mc.logging' local custom_app = require 'custom_app' local CMD = {} function CMD.exit() logging:notice('custom_app service exit') end skynet.start(function() skynet.uniqueservice('sd_bus') skynet.register('custom_app') local ok, err = pcall(custom_app.new) if not ok then logging:error('custom_app start failed, err: %s', err) end skynet.dispatch('lua', function(_, _, cmd, ...) local f = assert(CMD[cmd]) skynet.ret(skynet.pack(f(...))) end) end) ``` -------------------------------- ### Paginated Command Example: Get Operation Log Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide This JSON configuration defines a 'paginated command' for retrieving operation logs using `ipmcget -d operatelog`. It includes query parameters for skipping and topping records, and a processing flow with 'Paging' type to handle multi-page data retrieval. The `RspBody` maps the total count and log entries from the processed data. ```json { "Uri": "/cli/v1/_/operatelog", "Interfaces": [ { "Type": "GET", "Usage": "ipmcget -d operatelog", "Query": { "Skip": 0, "Top": 20 }, "Description": "Print operation log", "RspBody": { "Count": "${ProcessingFlow[1]/Destination/Count}", "Log": "${ProcessingFlow[1]/Destination/Log}" }, "ProcessingFlow": [ { "Type": "Paging", "Path": "/bmc/kepler/Managers/1/LogServices/OperateLog", "Interface": "bmc.kepler.Managers.LogService", "Name": "GetItems", "Params": [ "${Query/Skip}", "${Query/Top}" ], "Destination": { "Count": "Count", "Log": "Log" } } ], "Echoes": [ "ipmcget/_operatelog", "" ] } ] } ``` -------------------------------- ### JSON Configuration Examples for EnergyMetric Source: https://www.openubmc.cn/docs/zh/development/specifications/csr_conf_dict/object/EnergyMetric Provides various JSON examples for configuring the EnergyMetric class, including basic, full, high-power server, and energy-saving optimized configurations. These examples illustrate how to set different power-related attributes. ```json { "EnergyMetric_Basic": { "SystemPower": 144, "SystemOutputPower": 144, "HighPowerThresholdWatts": 300.5, "EnergySavedPercent": 10, "FanTotalPowerWatts": 50 } } ``` ```json { "EnergyMetric_Full": { "SystemPower": 144, "SystemOutputPower": 144, "HighPowerThresholdWatts": 300.5, "EnergySavedPercent": 10, "FanTotalPowerWatts": 50, "MinPowerWatts": 100, "MaxPowerWatts": 1000, "MaxEDPWatts": 18800 } } ``` ```json { "EnergyMetric_HighPower": { "SystemPower": 800, "SystemOutputPower": 750, "HighPowerThresholdWatts": 1000.0, "EnergySavedPercent": 5, "FanTotalPowerWatts": 120, "MinPowerWatts": 200, "MaxPowerWatts": 1200, "MaxEDPWatts": 18800 } } ``` ```json { "EnergyMetric_EnergySaving": { "SystemPower": 200, "SystemOutputPower": 180, "HighPowerThresholdWatts": 400.0, "EnergySavedPercent": 25, "FanTotalPowerWatts": 30, "MinPowerWatts": 50, "MaxPowerWatts": 500, "MaxEDPWatts": 18800 } } ``` -------------------------------- ### RspBody Configuration for GET Interfaces Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/redfish_mapping_guide Mandatory configuration that defines the structure and content of the response body for GET requests. This allows for a 'what you see is what you get' approach to defining the output. Values can be static strings or dynamically fetched from the resource tree using placeholders. ```json { "odata.context": "/redfish/v1/$metedata#AccountService/Accounts/Members/$entity", "Name": "User Account", "UserName": "${ProcessingFlow[1]/Destination/UserName}", "Oem": { "{{OemIentifier}}": { "LoginRule": null } } } ``` -------------------------------- ### Web Rest Interface Mapping Configuration Example Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/web_rest_mapping_guide An example JSON configuration for mapping Web Rest interfaces, including request and response body definitions, and processing steps. ```APIDOC ## POST /UI/Rest/BMCSettings/Language/OpenLanuage ### Description This is an example of a Web Rest interface mapping configuration. It demonstrates how to define request and response bodies, and processing steps for an interface. ### Method POST ### Endpoint /UI/Rest/BMCSettings/Language/OpenLanuage ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **LanguageSetStr** (String) - Required - The language setting to be applied. ### Request Example ```json { "LanguageSetStr": "en_US" } ``` ### Response #### Success Response (200) - **LanguageSet** (String) - Description of the current language setting. #### Response Example ```json { "LanguageSet": "en_US" } ``` ``` -------------------------------- ### Manage User Accounts and Passwords Source: https://www.openubmc.cn/docs/zh/development/specifications/server_factory_customization/server_factory_customization_items Commands to create, delete, and set passwords for users based on OEM configurations. It handles user existence checks and password complexity. ```pseudocode for(i=1; i<15; i++) if(BMCSet_OEMName${i} == "") DeleteUserId=i user else CreateUserId=i user SetUserId=i login interface if (BMCSet_OEMNamePassword${i} != "") SetUserId=i user password to BMCSet_OEMNamePassword${i} Also pass BMCSet_OEMNamePasswordType for encrypted type if(BMCSet_OEMNameAccess${i} is not empty) SetUserId=i user permissions to BMCSet_OEMNameAccess${i} if(BMCSet_OEMNameFirstLoginPolicy${i} is not empty) SetUserId=i user permissions to BMCSet_OEMNameFirstLoginPolicy${i} ``` -------------------------------- ### Plugin Configuration for Reusable Function Calls Source: https://www.openubmc.cn/docs/zh/development/api/app_api/rackmount An example of a Plugin configuration, which calls a specific function with optional parameters. Plugins are designed for reusable business logic and should be used judiciously. ```json { "Type": "Plugin", "Formula": "orchestrator.bios.get_registry_version(Uri.systemid)" } ``` -------------------------------- ### GET /cli/v1/_/operatelog Source: https://www.openubmc.cn/docs/zh/development/develop_guide/feature_development/CLI_mapping_guide Retrieves operation logs, supporting pagination for large datasets. ```APIDOC ## GET /cli/v1/_/operatelog ### Description This endpoint retrieves operation logs, supporting pagination. It allows fetching logs in chunks, preventing the display of excessive data at once. The default page size is 20 items. Uses 'Skip' and 'Top' query parameters for pagination. ### Method GET ### Endpoint /cli/v1/_/operatelog ### Parameters #### Query Parameters - **Skip** (integer) - Optional - The number of items to skip for pagination. Default is 0. - **Top** (integer) - Optional - The maximum number of items to retrieve per page. Default is 20. ### Request Example ``` N/A ``` ### Response #### Success Response (200) - **Count** (integer) - The total number of logs. - **Log** (array) - An array of log entries. #### Response Example ```json { "Count": 100, "Log": [ { "timestamp": "2024-01-01T10:00:00Z", "message": "Operation completed successfully" }, { "timestamp": "2024-01-01T10:01:00Z", "message": "Another operation" } ] } ``` ```