keycloak-scim/server_installation/topics/config-subsystem/cli-recipes.adoc
andymunro cb730556a7
KEYCLOAK-15291 Addressing review comments. (#1201)
Co-authored-by: Stian Thorgersen <stianst@gmail.com>
2021-11-10 12:39:43 +01:00

62 lines
No EOL
1.7 KiB
Text

[[_cli_recipes]]
=== CLI recipes
Here are some configuration tasks and how to perform them with CLI commands.
Note that in all but the first example, we use the wildcard path `**` to mean
you should substitute or the path to the keycloak-server subsystem.
For standalone, this just means:
`**` = `/subsystem=keycloak-server`
For domain mode, this would mean something like:
`**` = `/profile=auth-server-clustered/subsystem=keycloak-server`
==== Changing the web context of the server
[source]
----
/subsystem=keycloak-server/:write-attribute(name=web-context,value=myContext)
----
==== Setting the global default theme
[source]
----
**/theme=defaults/:write-attribute(name=default,value=myTheme)
----
==== Adding a new SPI and a provider
[source]
----
**/spi=mySPI/:add
**/spi=mySPI/provider=myProvider/:add(enabled=true)
----
==== Disabling a provider
[source]
----
**/spi=mySPI/provider=myProvider/:write-attribute(name=enabled,value=false)
----
==== Changing the default provider for an SPI
[source]
----
**/spi=mySPI/:write-attribute(name=default-provider,value=myProvider)
----
==== Configuring the dblock SPI
[source]
----
**/spi=dblock/:add(default-provider=jpa)
**/spi=dblock/provider=jpa/:add(properties={lockWaitTimeout => "900"},enabled=true)
----
==== Adding or changing a single property value for a provider
[source]
----
**/spi=dblock/provider=jpa/:map-put(name=properties,key=lockWaitTimeout,value=3)
----
==== Remove a single property from a provider
[source]
----
**/spi=dblock/provider=jpa/:map-remove(name=properties,key=lockRecheckTime)
----
==== Setting values on a provider property of type `List`
[source]
----
**/spi=eventsStore/provider=jpa/:map-put(name=properties,key=exclude-events,value=[EVENT1,EVENT2])
----