Interface IDeviceConfig
interface IDeviceConfig
Extends com.amazon.apmf.IStandard
Interface for getting and setting device-wide configuration values.
Methods
get()
Gets value of the requested device configuration. This method is access-controlled and require the privilege respective to the configuration key and group. For retrieving the configuration in the formatstringget(stringconfig)
com.amazon.devconf/system/{group}/{key},
the method caller MUST have the privilege com.amazon.devconf.privilege.{group}.{key}.
The privilege com.amazon.devconf.privilege.{group} MAY also be used to retrieve the values of all the
device configurations which belongs to the group {group}.
Parameters
config
string — Required
The device configuration.
Returns
string
The device configuration value.
Throws
com.amazon.apmf.IoError— On errors communicating with the DeviceConfig service;com.amazon.apmf.InvalidArgumentError— On invalid input;com.amazon.apmf.SecurityError— On access-control errors;com.amazon.kepler.device_config.DeviceConfigNotFoundError— if the device configuration being queried is not found.
getArray()
Gets values of the requested list of device configurations. If querying any device configurations fails, the method populates the right error for that device configuration. This method is access-controlled and require the privilege respective to the configuration key and group. For retrieving the configuration in the formatDeviceConfigResult[]getArray(string[]configs)
com.amazon.devconf/system/{group}/{key},
the method caller MUST have the privilege com.amazon.devconf.privilege.{group}.{key}.
The privilege com.amazon.devconf.privilege.{group} MAY also be used to retrieve the values of all the
device configurations which belongs to the group {group}.
Parameters
configs
string[] — Required
An array of device configurations.
Returns
DeviceConfigResult[]
An array of device configuration structs containing the original config queried and either
a value or Error. This array is in the same order as configurations that appear in the
configs parameter. If querying the configuration succeeds then the value is populated;
otherwise, one of the following errors will be populated:
com.amazon.apmf.InvalidArgumentError On invalid input;
com.amazon.apmf.SecurityError On access-control errors;
com.amazon.kepler.device_config.DeviceConfigNotFoundError if the device configuration being
queried is not found, this is a non-fatal exception.
Throws
com.amazon.apmf.IoError— On errors communicating with the DeviceConfig service.
set()
Persistently sets the device configurationvoidset(stringconfig,stringvalue)
config parameter with the value parameter.
This method is access-controlled and require the privilege respective to the configuration key and group.
For modifying the configuration in the format com.amazon.devconf/system/{group}/{key},
the method caller MUST have the privilege com.amazon.devconf.privilege.{group}.{key}.write.
The privilege com.amazon.devconf.privilege.{group}.write MAY also be used to modify the values of all the
device configurations which belongs to the group {group}.
Parameters
config
string — Required
The device configuration string.
value
string — Required
The device configuration value string.
Throws
com.amazon.apmf.IoError— On errors communicating with the DeviceConfig service.com.amazon.apmf.OutOfBoundsError— When the value being set exceeds the maximum device configuration value size.com.amazon.apmf.InvalidArgumentError— On invalid input.com.amazon.apmf.SecurityError— On access-control errors.com.amazon.apmf.NotSupportedError— When attempting to set a read-only device configuration.
remove()
Persistently removes a config from the device configuration system. This method is access-controlled and require the privilege respective to the configuration key and group. For modifying the configuration in the formatvoidremove(stringconfig)
com.amazon.devconf/system/{group}/{key},
the method caller MUST have the privilege com.amazon.devconf.privilege.{group}.{key}.write.
Subsequent get() calls to this device configuration throw a ‘DeviceConfigNotFoundError’ error.
Parameters
config
string — Required
The device configuration string.
Throws
com.amazon.apmf.IoError— On errors communicating with the DeviceConfig service.com.amazon.apmf.InvalidArgumentError— On invalid input.com.amazon.apmf.SecurityError— On access-control errors.com.amazon.apmf.NotSupportedError— When attempting to set a read-only device configuration.

