PATCH example
Configuration can be modified using the HTTP PATCH method.
The PATCH request body is a JSON object formatted according to the SCIM patch request. The Configuration API, supports a subset of possible values for the path attribute, used to indicate the configuration attribute to modify.
The configuration object’s attributes can be modified in the following ways. These operations are analogous to the dsconfig modify-[object]
options.
Example
-
An operation to set the single-valued
description
attribute to a new value:{ "op" : "replace", "path" : "description", "value" : "A new backend." }
is analogous to:
$ dsconfig set-backend-prop --backend-name userRoot \ --set "description:A new backend"
-
An operation to add a new value to the multi-valued
jeProperty
attribute:{ "op" : "add", "path" : "jeProperty", "value" : "je.env.backgroundReadLimit=0" }
is analogous to:
$ dsconfig set-backend-prop --backend-name userRoot \ --add je-property:je.env.backgroundReadLimit=0
-
An operation to remove a value from a multi-valued property. In this case,
path
specifies a SCIM filter identifying the value to remove:{ "op" : "remove", "path" : "[jeProperty eq \"je.cleaner.adjustUtilization=false\"]" }
is analogous to:
$ dsconfig set-backend-prop --backend-name userRoot \ --remove je-property:je.cleaner.adjustUtilization=false
-
A second operation to remove a value from a multi-valued property, where the
path
specifies both an attribute to modify, and a SCIM filter whose attribute isvalue
:{ "op" : "remove", "path" : "jeProperty[value eq \"je.nodeMaxEntries=32\"]" }
is analogous to:
$ dsconfig set-backend-prop --backend-name userRoot \ --remove je-property:je.nodeMaxEntries=32
-
An option to remove one or more values of a multi-valued attribute. This has the effect of restoring the attribute’s value to its default value:
{ "op" : "remove", "path" : "id2childrenIndexEntryLimit" }
is analogous to:
$ dsconfig set-backend-prop --backend-name userRoot \ --reset id2childrenIndexEntryLimit
The following is the full example request. The API responds with the entire modified configuration object, which can include a SCIM extension attribute urn:unboundid:schemas:configuration:messages
containing additional instructions.
Example
Example request:
PATCH /config/backends/userRoot Host: example.com:5033 Accept: application/scim+json { "schemas" : [ "urn:ietf:params:scim:api:messages:2.0:PatchOp" ], "Operations" : [ { "op" : "replace", "path" : "description", "value" : "A new backend." }, { "op" : "add", "path" : "jeProperty", "value" : "je.env.backgroundReadLimit=0" }, { "op" : "remove", "path" : "[jeProperty eq \"je.cleaner.adjustUtilization=false\"]" }, { "op" : "remove", "path" : "jeProperty[value eq \"je.nodeMaxEntries=32\"]" }, { "op" : "remove", "path" : "id2childrenIndexEntryLimit" } ] }
Example response:
{
"schemas": [
"urn:unboundid:schemas:configuration:2.0:backend:local-db"
],
"id": "userRoot2",
"meta": {
"resourceType": "Local DB Backend",
"location": "http://example.com:5033/config/backends/userRoot2"
},
"backendID": "userRoot2",
"backgroundPrime": "false",
"backupFilePermissions": "700",
"baseDN": [
"dc=example2,dc=com"
],
"checkpointOnCloseCount": "2",
"cleanerThreadWaitTime": "120000",
"compressEntries": "false",
"continuePrimeAfterCacheFull": "false",
"dbBackgroundSyncInterval": "1 s",
"dbCachePercent": "10",
"dbCacheSize": "0 b",
"dbCheckpointerBytesInterval": "20 mb",
"dbCheckpointerHighPriority": "false",
"dbCheckpointerWakeupInterval": "1 m",
"dbCleanOnExplicitGC": "false",
"dbCleanerMinUtilization": "75",
"dbCompactKeyPrefixes": "true",
"dbDirectory": "db",
"dbDirectoryPermissions": "700",
"dbEvictorCriticalPercentage": "0",
"dbEvictorLruOnly": "false",
"dbEvictorNodesPerScan": "10",
"dbFileCacheSize": "1000",
"dbImportCachePercent": "60",
"dbLogFileMax": "50 mb",
"dbLoggingFileHandlerOn": "true",
"dbLoggingLevel": "CONFIG",
"dbNumCleanerThreads": "0",
"dbNumLockTables": "0",
"dbRunCleaner": "true",
"dbTxnNoSync": "false",
"dbTxnWriteNoSync": "true",
"dbUseThreadLocalHandles": "true",
"deadlockRetryLimit": "10",
"defaultCacheMode": "cache-keys-and-values",
"defaultTxnMaxLockTimeout": "10 s",
"defaultTxnMinLockTimeout": "10 s",
"description": "123",
"enabled": "false",
"explodedIndexEntryThreshold": "4000",
"exportThreadCount": "0",
"externalTxnDefaultBackendLockBehavior": "acquire-before-retries",
"externalTxnDefaultMaxLockTimeout": "100 ms",
"externalTxnDefaultMinLockTimeout": "100 ms",
"externalTxnDefaultRetryAttempts": "2",
"hashEntries": "false",
"importTempDirectory": "import-tmp",
"importThreadCount": "16",
"indexEntryLimit": "4000",
"isPrivateBackend": "false",
"javaClass": "com.unboundid.directory.server.backends.jeb.BackendImpl",
"jeProperty": [
"\"je.env.backgroundReadLimit=0\""
],
"numRecentChanges": "50000",
"offlineProcessDatabaseOpenTimeout": "1 h",
"primeAllIndexes": "true",
"primeMethod": [
"none"
],
"primeThreadCount": "2",
"primeTimeLimit": "0 ms",
"processFiltersWithUndefinedAttributeTypes": "false",
"returnUnavailableForUntrustedIndex": "true",
"returnUnavailableWhenDisabled": "true",
"setDegradedAlertForUntrustedIndex": "true",
"setDegradedAlertWhenDisabled": "true",
"subtreeDeleteBatchSize": "5000",
"subtreeDeleteSizeLimit": "5000",
"uncachedId2entryCacheMode": "cache-keys-only",
"writabilityMode": "enabled",
"urn:unboundid:schemas:configuration:messages:2.0": {
"requiredActions": [
{
"property": "jeProperty",
"type": "componentRestart",
"synopsis": "In order for this modification to take effect,
the component must be restarted, either by disabling and
re-enabling it, or by restarting the server"
},
{
"property": "id2childrenIndexEntryLimit",
"type": "other",
"synopsis": "If this limit is increased, then the contents
of the backend must be exported to LDIF and re-imported to
allow the new limit to be used for any id2children keys
that had already hit the previous limit."
}
]
}
}