PATCH example
Modify the Configuration API using the HTTP PATCH method.
The PATCH request body is a JSON object formatted according to the System for Cross-domain Identity Management (SCIM) patch request. The Configuration API supports a subset of possible values for the path attribute that indicates the configuration attribute to modify.
Modify the configuration object’s attributes according to the information in the following table, which details the comparable dsconfig modify-[object]
options to each PATCH request.
Operation | PATCH request | Comparabledsconfig modify-[object]options |
---|---|---|
Set the single-valued |
|
|
Add a new value to the multi-valued |
|
|
Remove a value from a multi-valued property. In this case, path specifies a SCIM filter identifying the value to remove. |
|
|
Second operation to remove a value from a multi-valued property, where the |
|
|
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. |
|
|
Example
The following is the full 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
The API responds with the entire modified configuration object, which can include a SCIM extension attribute urn:unboundid:schemas:configuration:messages
containing additional instructions. The following is an 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."
}
]
}
}