Management resources
Contents
Resource-oriented management APIs on the management endpoint (port 4848), with per-resource, per-verb exposure control from virtual host configuration.
Overview
Every management operation is exposed as a resource with a fixed set of verbs: list, get, create, delete, load, restore, prune, watch. A resource is an API on the management endpoint, addressed by its descriptor key at the root of the port:
http://localhost:4848/server:snapshot
The legacy REST API (repo/snapshot/list, system/dump, …) is unchanged. A virtual host selects which resources and verbs it exposes, and can switch the legacy paths off.
Authorization
Same as the rest of the management endpoint: an authenticated user with the system.admin role, by service account JWT or basic authentication. See Authorization.
Conventions
-
Queries are
GETand take no body. A collection is read at the resource root (GET /server:repo), an item by name (GET /server:repo/{repo}). -
Commands are
POSTwith a JSON body (orPUTwhen they replace the state of an item,DELETEwhen they remove one). A command naming an existing item puts the name in the path:POST /server:dump/{name}/load. -
Long-running commands return
202 Acceptedwith the id of a task to poll throughserver:task. Except forserver:contentsync, every such command is a cluster task of the system application (com.enonic.xp.app.system:dump,:export,:reindex, …) and runs on any node of the cluster. In a cluster,$XP_HOME/dataand the snapshot location must be on a file system shared by all nodes:{"taskId": "d9f3b1e4-..."} -
Errors are JSON with the status and a message:
{"status": 403, "message": "Verb [restore] of API [server:snapshot] is not exposed on this virtual host"}404for an unknown path or item,405for a wrong method,400for an invalid body,403when the virtual host does not expose the verb. -
Some paths have an alias, the name the operation had before. An alias behaves exactly like the path it aliases and belongs to the same verb: a virtual host that exposes
pruneonserver:systemexposes both/server:system/pruneand/server:system/vacuum, and one that does not exposes neither.
Resources
| Resource | Verbs | Purpose |
|---|---|---|
|
|
Installed applications. |
|
|
|
The search and storage indices of a repository: replica counts, and rebuilding the search index. |
|
|
|
Repository inventory. |
|
|
|
Node exports under |
|
|
|
System dumps under |
|
|
|
Repository snapshots. |
|
|
|
Installation-wide maintenance (vacuum). |
|
|
|
Audit log retention. |
|
|
|
Content projects with their sites. |
|
|
|
Syncing inherited content from parent projects into child projects. |
|
|
|
The tasks the commands above hand out ids for. |
|
|
|
Scheduled jobs. |
|
|
|
ID providers, as virtual hosts refer to them. |
Universal APIs of installed applications with mount: "management" sit beside these, at /<application>:<api>, and are subject to the same virtual host policy if they choose to honour it - see Universal APIs on the management endpoint.
server:app
Installed applications.
| Verb | Request | Description |
|---|---|---|
|
|
|
All installed applications with state and version: |
|
|
|
Installs the uploaded application bundle. Returns the application. |
|
|
|
Fetches and installs an application from |
|
|
|
Uninstalls the applications named in |
|
|
|
Starts or stops the applications named in |
|
|
|
Server-sent events: a |
POST /server:app/pull
{
"URL": "https://repo.enonic.com/public/com/enonic/app/contentstudio/6.0.0/contentstudio-6.0.0.jar",
"sha512": "5b3c..."
}
server:index
The two Elasticsearch indices of a repository: search, holding the searchable representation, and storage, holding versions, branches and commits. The API exposes their replica settings.
| Verb | Request | Description |
|---|---|---|
|
|
|
Replica settings of both indices. |
|
|
|
Replaces the replica settings of both indices. Both keys are required. A value is either a number of replicas as a string ( |
|
|
|
Rebuilds the search index from storage. |
GET /server:index/com.enonic.cms.default
{"replicas": {"search": "1", "storage": "0-all"}}
POST /server:index/com.enonic.cms.default/reindex
{"branches": ["master"], "initialize": false}
| Index settings other than replicas are not exposed. |
server:repo
| Verb | Request | Description |
|---|---|---|
|
|
|
Every repository with its branches: |
|
|
|
One repository. |
server:export
Exports of a repository path, written to and read from $XP_HOME/data/export/<name>.zip. The API names an export without the .zip suffix; an archive copied into the directory under that name is what load reads.
| Verb | Request | Description |
|---|---|---|
|
|
|
The exports on disk: |
|
|
|
Exports |
|
|
|
Imports the export into |
POST /server:export
{"sourceRepoPath": "com.enonic.cms.default:draft:/content/mysite", "exportName": "mysite"}
POST /server:export/mysite/load
{"targetRepoPath": "com.enonic.cms.staging:draft:/content", "importWithIds": true}
server:dump
System dumps under $XP_HOME/data/dump/<name>.
| Verb | Request | Description |
|---|---|---|
|
|
|
The dumps on disk with timestamp, version and size. |
|
|
|
Dumps all repositories (or |
|
|
|
Loads the dump, replacing the current data. Optional body: |
|
|
|
Upgrades the dump on disk to the current model version. Returns a task. |
server:snapshot
| Verb | Request | Description |
|---|---|---|
|
|
|
Every snapshot in the snapshot repository. |
|
|
|
Snapshots all repositories, or |
|
|
|
Restores a snapshot, replacing the current data. Optional |
|
|
|
Deletes one snapshot, or every snapshot taken before an instant. |
server:system
| Verb | Request | Description |
|---|---|---|
|
|
|
Removes unused blobs and old versions. Optional |
server:auditlog
| Verb | Request | Description |
|---|---|---|
|
|
|
Deletes audit log records older than |
server:project
| Verb | Request | Description |
|---|---|---|
|
|
|
Every content project with its |
server:content
| Verb | Request | Description |
|---|---|---|
|
|
|
Syncs inherited content from parent projects into child projects, parents first. Optional |
POST /server:content/sync
{"projects": ["intranet", "intranet-no"]}
server:task
| Verb | Request | Description |
|---|---|---|
|
|
|
All tasks on the cluster, or only the running ones. |
|
|
|
State, progress and description of one task - the id every |
|
|
|
Server-sent events. Without an id: a |
GET /server:task/d9f3b1e4-.../watch
Accept: text/event-stream
event: task
data: {"id":"d9f3b1e4-...","state":"RUNNING","progress":{"current":3,"total":10,"info":""},...}
event: finished
data: {"id":"d9f3b1e4-...","state":"FINISHED",...}
server:scheduler
| Verb | Request | Description |
|---|---|---|
|
|
|
Every scheduled job: |
|
|
|
One scheduled job. |
|
|
|
Creates a job. |
|
|
|
Deletes the job. |
POST /server:scheduler
{
"name": "nightly-dump",
"descriptor": "com.enonic.xp.app.system:dump",
"schedule": {"type": "CRON", "value": "0 3 * * *", "timeZone": "Europe/Oslo"},
"config": {"name": "nightly", "includeVersions": true},
"user": "user:system:su"
}
server:idprovider
| Verb | Request | Description |
|---|---|---|
|
|
|
Every id provider: |
Legacy REST API
The legacy endpoints are unchanged. They map to the resources as follows:
| Legacy | Resource | Note |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
- |
Deprecated. Synchronous; use |
|
|
|
Deprecated. Only replicas are exposed through |
|
|
|
|
|
|
|
Listing exports is new. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Listing and watching tasks are new. |
|
|
|
|
|
|
|
|
|
|
- |
Not migrated; installed applications are node state. |