new SystemSettings()
- Source:
Handles communication with the systemSettings endpoint. Can be used to get or save systemSettings.
Requires:
- module:lib/check
- module:api/Api
Requires
- module:lib/check
- module:api/Api
Methods
all() → {Promise}
- Source:
Loads all the system settings in the system and returns them as an object from the promise.
Example
d2.system.settings.all()
.then(systemSettings => {
console.log('Analytics was last updated on: ' + systemSettings.keyLastSuccessfulResourceTablesUpdate);
});
Returns:
Promise that resolves with the systemsettings object from the api.
- Type
- Promise
get(systemSettingsKey) → {Promise}
- Source:
Get a single systemSetting for the given key.
This will use the cached value of the key if it has been previously loaded.
Example
d2.system.settings.get('keyLastSuccessfulResourceTablesUpdate')
.then(systemSettingsValue => {
console.log('Analytics was last updated on: ' + systemSettingsValue);
});
Parameters:
Name | Type | Description |
---|---|---|
systemSettingsKey |
String | The identifier of the system setting that should be retrieved. |
Returns:
A promise that resolves with the value or will fail if the value is not available.
- Type
- Promise