Component Configuration Import and Export Guide
更新时间: 2025/10/21
在AtomGit上查看源码

As a user-oriented interface, the component configuration import and export function carries the interface data models of components through schemas. It uses a standard JSON Schema and custom extensions to implement the configuration import and export description and validation mechanism. All components must pass schema validation during configuration import and export to ensure the correctness of configuration data on both the service and user sides.

The configuration schema is stored in the profile_schema component repository. For details, see profile_schema.

Overall Process

The oms component implements the configuration import and export function:

  1. During the import, it serializes the configuration of the component according to the component name in the configuration file, and calls the Import interface under bmc.kepler.MicroComponent.ConfigManage to trigger the component import.
  2. During the export, it obtains the names of all components from the MACA service. The specific interface is the GetServiceNames method of bmc.kepler.Mdb. Then, it calls the Export interface of each component respectively, collects the export data from each component, and returns the aggregated data to the user.

Resource collaboration interface information is as follows:

shell
# 1. oms import and export interface
busctl --user introspect bmc.kepler.oms /bmc/kepler/Managers/1/Configurations
NAME                                TYPE      SIGNATURE RESULT/VALUE       FLAGS
bmc.kepler.Managers.Configurations  interface -         -                  -
.Export                             method    a{ss}s    u                  -
.Import                             method    a{ss}s    u                  -

# 2. Component import and export interface
busctl --user introspect bmc.kepler.license /bmc/kepler/license/MicroComponent
NAME                                   TYPE      SIGNATURE RESULT/VALUE    FLAGS
bmc.kepler.MicroComponent.ConfigManage interface -         -               -
.Export                                method    a{ss}     s               -
.Import                                method    a{ss}s    -               -

Configuration Fields

Standard Schema Keywords

  • type: JSON Schema data type
  • properties: key-value pairs of JSON Schema object properties

Properties with Fixed Names

  • Description: component description
  • ConfigData: component configuration data

Custom Data Collection Names

  • Accounts (example): data collection instance for importing and exporting custom component configurations

Extended Keywords

  • AttributeType: type of the property corresponding to the configuration data instance

    Values:

    • ExportOnly: export only
    • ImportAndExport: import and export
  • HideValue: whether to hide value when the component exports data (defaults to false)

    Description:

    • If this keyword is set to true, the property value is hidden and displayed as "******".
    • If this keyword is not set in the component schema, value is not hidden in the exported file by default.
  • Import: default import behavior for exported data (defaults to true)

    Description:

    • This keyword can be set only when AttributeType is set to ImportAndExport. The value true indicates that the property needs to be imported, and the value false indicates that the property does not need to be imported.
    • This function is similar to the comment function in XML. Setting it to false comments out the imported property so that it does not take effect after import.
    • The Import field must be verified in the Import method on the component side. Otherwise, the field does not take effect.

Component Schema Configuration Example

json
{
    "type": "object",
    "properties": {
        "Description": {
            "const": "Configurations of Identity and Access Management"
        },
        "ConfigData": {
            "type": "object",
            "properties": {
                "Accounts": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "Id": {
                                "type": "number",
                                "AttributeType": "ExportOnly"
                            },
                            "UserName": {
                                "type": "string",
                                "HideValue": true,
                                "AttributeType": "ImportAndExport"
                            },
                            "Privilege": {
                                "type": "string",
                                "Import": false,
                                "AttributeType": "ImportAndExport"
                            },
                            "UserRoleId": {
                                "type": "string",
                                "AttributeType": "ImportAndExport"
                            },
                            "PermitRuleIds": {
                                "type": "number",
                                "AttributeType": "ImportAndExport"
                            },
                            "LoginInterface": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "enum": ["SSH", "SNMP", "Local", "Redfish", "SFTP", "Web", "IPMI"]
                                },
                                "AttributeType": "ExportOnly"
                            },
                            "IsUserEnable": {
                                "type": "boolean",
                                "AttributeType": "ExportOnly"
                            },
                            "IsUserLocked": {
                                "type": "boolean",
                                "AttributeType": "ExportOnly"
                            }
                        },
                        "required": ["Id", "UserName", "Privilege"]
                    }
                },
                "LDAPController": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "Id": {
                                "type": "number",
                                "AttributeType": "ExportOnly"
                            },
                            "BindDN": {
                                "type": "string",
                                "AttributeType": "ImportAndExport"
                            },
                            "CertVerifyEnabled": {
                                "type": "boolean",
                                "AttributeType": "ImportAndExport"
                            },
                            "CertVerifyLevel": {
                                "type": "number",
                                "AttributeType": "ImportAndExport"
                            },
                            "Enabled": {
                                "type": "boolean",
                                "AttributeType": "ImportAndExport"
                            },
                            "Folder": {
                                "type": "string",
                                "AttributeType": "ImportAndExport"
                            },
                            "HostAddr": {
                                "type": "string",
                                "AttributeType": "ImportAndExport"
                            },
                            "Port": {
                                "type": "number",
                                "AttributeType": "ImportAndExport"
                            },
                            "UserDomain": {
                                "type": "string",
                                "AttributeType": "ImportAndExport"
                            }
                        }
                    }
                }
            }
        }
    }
}

Exported Configuration File Fields

  • GeneralInfo: general information

    • ProductName: product name
    • ProductSN: product serial number
    • Version: software version
    • TimeStamp: timestamp information
  • Components: full configuration information of components

    • Description: component description
    • ConfigData: component configuration data
    • Value: value of the property corresponding to the configuration data instance
    • AttributeType: type of the property corresponding to the configuration data instance

    Values: - ExportOnly: export only - ImportAndExport: import and export

    • Import: whether the property needs to be imported

    Description: - This keyword can be set only when AttributeType is set to ImportAndExport. The value true indicates that the property needs to be imported, and the value false indicates that the property does not need to be imported. - Add Import field verification to the import method. When importing configurations, you can choose whether to import a property by modifying its Import keyword.

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
                        },
                        "Mode": {
                            "Value": 1,
                            "AttributeType": "ImportAndExport",
                            "Import": true
                        },
                        "CopybackEnabled": {
                            "Value": 1,
                            "AttributeType": "ImportAndExport",
                            "Import": true
                        },
                        "SMARTerCopybackEnabled": {
                            "Value": 0,
                            "AttributeType": "ImportAndExport",
                            "Import": true
                        },
                        "JBODEnabled": {
                            "Value": 0,
                            "AttributeType": "ImportAndExport",
                            "Import": true
                        },
                        "NoBatteryWriteCache": {
                            "Value": 255,
                            "AttributeType": "ImportAndExport",
                            "Import": true
                        },
                        "ReadCachePercent": {
                            "Value": 2,
                            "Import": 255,
                            "AttributeType": "ImportAndExport"
                        }
                    }
                ]
            }
        }
    }
}