CfgMgr::Load

Description

Loads parameters based on the YAML file and makes the parameters persistent.

Prototype

uint32_t CfgMgr::Load(const std::string &yamlPath, const std::string &yamlNamespace = "", const bool isSync = false, const std::string &group = "")

Function Security Level

ASIL-D

Parameters

Parameter

Input/Output

Description

yamlPath

Input

YAML file path, which must be a full path.

yamlNamespace

Input

Namespace of the YAML file. The namespace and key in the YAML file form a complete key.

isSync

Input

Whether to write persistent files synchronously. The default value is false.

group

Input

Parameter group to which a parameter is to be added. This parameter affects the access permission of subsequent Get/Set operations. It is valid only for new parameters. For existing parameters, retain the original value of group. The default value is "", indicating the global group.

Returns

The return value is of the uint32_t type. If the operation is successful, CFGMGR_SUCCESS is returned. If the operation fails, an error code is returned.

Usage

After SELinux permission control is enabled, non-privileged processes can be called only after the read and write permissions on dp:/res/cfgmgr/mgmt are configured.

Precautions

  • The loaded parameters are persisted.
  • The YAML file is read by the CfgMgr process. Ensure that the CfgMgr process can run properly.