CfgMgr::CreateSnapshotToFile

Description

Specifies a snapshot path for snapshot creation.

Prototype

uint32_t CfgMgr::CreateSnapshotToFile(const std::string &filePath, const std::string &snapshotNamespace = "/", const bool isSync = true)

Function Security Level

ASIL-D

Parameters

Parameter

Input/Output

Description

filePath

Input

Specified snapshot path, which must be accessible and configured in the initialization trustlist.

snapshotNamespace

Input

Namespace to which the parameter that requires a snapshot belongs.

isSync

Input

Whether to write files synchronously. The default value is true.

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 specified path must be valid and configured in the startup file.
  • If the snapshot content does not contain any parameter, a failure message is returned.