CfgMgr::BatchReset

Description

Deletes persistent data in batches.

Prototype

  • Deleting persistent data in batches based on the key specified in the YAML file

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

  • Deleting persistent data in batches based on WNP attributes

    uint32_t CfgMgr::BatchReset(const uint32_t paramType = WNP, const bool isSync = false)

Function Security Level

ASIL-D

Parameters

  • Deleting persistent data in batches based on the key specified in the YAML file

    Parameter

    Input/Output

    Description

    yamlPath

    Input

    YAML file path, which must be a full path.

    yamlNamespace

    Input

    Namespace of the YAML file, which corresponds to the namespace that loads the YAML file. By default, this parameter is left blank.

    isSync

    Input

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

  • Deleting persistent data in batches based on WNP attributes

    Parameter

    Input/Output

    Description

    paramType

    Input

    Type of the parameter to be reset in batches. Currently, only WNP is supported. Otherwise, an error is returned.

    isSync

    Input

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

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

Deletes persistent data in batches based on the key specified in the YAML file.

  • If the key in the basic YAML file matches that in the YAML file specified by yamlPath, use the default key in the basic YAML file (It will be modified in the memory as it is not persistent). Otherwise, the key is deleted.
  • If all persistent data is deleted after the reset, persistent files are deleted. If no persistent data is available during the restart, the system attempts to inherit persistent data by version. If the inheritance fails, an alarm is generated.
  • If the key in the YAML file specified by yamlPath does not exist in the environment, a success message is returned.