Management Endpoint
Contents
Management commands are available at port 4848
, i.e. localhost:4848
if you’re running XP locally
Authorization
All endpoints here allow basic authorization. Most clients provide an option for authorization, but in case you need to do it manually: basic auth is simply a string of the username and password separated by a colon that is base64 encoded.
Make a source string:
myusername:mysecretpassword
Encode it to base64:
bXl1c2VybmFtZTpteXNlY3JldHBhc3N3b3Jk
Add a header to your request:
Key | Value |
---|---|
|
|
Read the documentation of the client you use for more info on how to add basic authorization header to your request. |
Snapshots
Commands for manipulating repository snapshots
Create
Create a snapshot of all or a single repository while running. NOTE: The first snapshot only stores markers in the repository for the current state. Subsequent snapshots stores the changes since the last snapshot.
For a clustered installation, the snapshot-location must be on a shared file-system. |
POST repo/snapshot
Param | Type | Description |
---|---|---|
|
String |
the name of the repository to snapshot. |
Read about authorization here |
{
"Name": "2019-06-13t13-10-51.973z",
"Reason": "",
"State": "SUCCESS",
"Timestamp": "2019-06-13T13:10:52.575Z",
"Indices": [
"search-com.enonic.cms.default",
"storage-com.enonic.cms.default",
"search-system-repo",
"storage-system-repo"
]
}
List
List all the snapshots for the installation.
GET repo/snapshot/list
Read about authorization here |
{
"Results": [
{
"Name": "2019-06-13t13-10-51.973z",
"Reason": "",
"State": "SUCCESS",
"Timestamp": "2019-06-13T13:10:52.575Z",
"Indices": [
"search-com.enonic.cms.default",
"storage-com.enonic.cms.default",
"search-system-repo",
"storage-system-repo"
]
},
{
"Name": "2019-06-13t13-36-35.407z",
"Reason": "",
"State": "SUCCESS",
"Timestamp": "2019-06-13T13:36:35.488Z",
"Indices": [
"search-com.enonic.cms.default",
"storage-com.enonic.cms.default",
"search-system-repo",
"storage-system-repo"
]
}
]
}
Restore
POST repo/snapshot/restore
Param | Type | Description |
---|---|---|
|
String |
snapshot name to restore |
|
String |
the name of the repository to restore |
|
Boolean |
if that parameter has value |
|
Boolean |
If |
Read about authorization here |
{
"Message": "Restore successfull, 4 shards restored",
"Name": "2019-06-13t13-10-51.973z",
"Failed": false,
"Indices": [
"search-com.enonic.cms.default",
"storage-com.enonic.cms.default",
"search-system-repo",
"storage-system-repo"
]
}
Delete
Deletes a snapshot by name or date:
POST repo/snapshot/delete
Param | Type | Description |
---|---|---|
|
Date |
date to delete snapshots up to |
|
String[] |
List of snapshot names to delete |
Read about authorization here |
{
"DeletedSnapshots": [
"2019-06-13t13-36-35.407z"
]
}
Dumps
List of command for manipulating all repositories
Create
Export data from every repository. The result will be stored in the $XP_HOME/data/dump
directory.
POST system/dump
Param | Type | Description |
---|---|---|
|
String |
dump name |
|
Boolean |
dump version-history along with current versions |
|
Number |
max age of versions to include, in days, in addition to current version |
|
Number |
max number of versions to dump in addition to current version |
|
Boolean |
outputs dump output to an archive ( |
Read about authorization here |
{
"taskId": "f8565e19-3960-4bf0-8daa-f4ca77ef338f"
}
Task info can be fetched with task request. |
{
"Repositories": [
{
"RepositoryId": "com.enonic.cms.default",
"Versions": 0,
"Branches": [
{
"Branch": "master",
"Successful": 3,
"Errors": []
},
{
"Branch": "draft",
"Successful": 3,
"Errors": []
}
]
},
{
"RepositoryId": "system-repo",
"Versions": 0,
"Branches": [
{
"Branch": "master",
"Successful": 22,
"Errors": []
}
]
}
]
}
Upgrade
Upgrade a data dump from a previous version to the current version. The output of the upgrade will be placed alongside the dump that is being upgraded and will have the name <dump-name>_upgraded_<new-version>
.
The current version XP installation must be running with the upgraded app deployed. |
Upgrade does not work with archived dumps. |
POST system/upgrade
Param | Type | Description |
---|---|---|
|
String |
dump name |
Read about authorization here |
{
"taskId": "549c38ac-e20a-4851-8536-3fd2b937e328"
}
Task info can be fetched with task request. |
{
"InitialVersion": "8.0.0",
"UpgradedVersion": "8.0.0"
}
Load
Load data from a named system dump into Enonic XP. The dump read has to be stored in the $XP_HOME/data/dump
directory.
Upgrade does not work with archived dumps. |
A load will delete all existing repositories before loading the repositories present in the system-dump |
POST system/load
Param | Type | Description |
---|---|---|
|
String |
dump name to load |
|
Boolean |
upgrade the dump if necessary (default is |
|
Boolean |
loads dump form an archive ( |
Read about authorization here |
{
"taskId": "a0b774dd-03f1-48fd-b500-b76a93c6b6fe"
}
Task info can be fetched with task request. |
{
"Repositories": [
{
"Repository": "system-repo",
"Versions": {
"Errors": [],
"Successful": 0
},
"Branches": [
{
"Branch": "master",
"Successful": 22,
"Errors": []
}
]
},
{
"Repository": "com.enonic.cms.default",
"Versions": {
"Errors": [],
"Successful": 0
},
"Branches": [
{
"Branch": "draft",
"Successful": 3,
"Errors": []
},
{
"Branch": "master",
"Successful": 3,
"Errors": []
}
]
}
]
}
Export
Export and import data from a given repository, branch and content path.
Create
Extract data from a given repository, branch and content path. The result will be stored in the $XP_HOME/data/export
directory. This is useful to move a part of a site from one installation to another.
Exporting content will not include the version history of the content, just the current version. |
POST repo/export
Param | Type | Description |
---|---|---|
|
String |
target name to save export |
|
String |
path of data to export. Format: |
|
Boolean |
Flag to include or skip ids in data when exporting. |
|
Boolean |
Flag to include or skip versions in data when exporting. |
|
Boolean |
Show the result without making actual changes. |
Read about authorization here |
{
"taskId": "2003993f-cf52-4aa0-aca8-66c3911e6b31"
}
Task info can be fetched with task request. |
{
"DryRun": false,
"ExportedBinaries": [],
"ExportedNodes": [
"/",
"/content",
"/issues"
],
"Errors": null
}
Import
Import data from a named export into Enonic XP at the desired content path. The export read has to be stored in the $XP_HOME/data/export
directory.
POST repo/import
Param | Type | Description |
---|---|---|
|
String |
a named export to import |
|
String |
target path for import. Format: |
|
String |
path to xsl file (relative to |
|
JSON |
parameters to pass to the XSL transformations before importing nodes. Format: |
|
Boolean |
flag to include or skip ids when importing |
|
Boolean |
flag to include or skip permissions when importing |
|
Boolean |
show the result without making actual changes. |
Read about authorization here |
{
"taskId": "767dad91-eecd-442b-a9f8-d3a892e1e8c4"
}
Task info can be fetched with task request. |
{
"AddedNodes": [],
"UpdateNodes": [
"/",
"/content",
"/issues"
],
"ImportedBinaries": [],
"ImportErrors": [],
"DryRun": false
}
An XSL file and a set of name=value parameters can be optionally passed for applying transformations to each node.xml file, before importing it. This option could for example be used for renaming types or fields. The .xsl file must be located in the |
Applications
Commands to manage applications in a running Enonic XP instance.
Install from file
Installs an application from file on all nodes.
POST app/install
Param | Type | Description |
---|---|---|
|
File |
File of the application |
Read about authorization here |
{
"ApplicationInstalledJson": {
"Application": {
"DisplayName": "Content Studio",
"Key": "com.enonic.app.contentstudio",
"Deletable": false,
"Editable": false,
"Local": false,
"MaxSystemVersion": "8.0.0",
"MinSystemVersion": "7.0.0",
"ModifiedTime": "2019-06-13T14:48:30.314Z",
"State": "started",
"Url": "",
"VendorName": "Enonic AS",
"VendorUrl": "https://enonic.com",
"Version": "1.0.0.SNAPSHOT"
}
},
"Failure": ""
}
Install from URL
Installs an application from url on all nodes.
POST app/installUrl
Param | Type | Description |
---|---|---|
|
String |
application URL |
|
String |
application file SHA-512 checksum. Optional. If provided, and checksum does not match, installation will fail. |
Read about authorization here |
{
"ApplicationInstalledJson": {
"Application": {
"DisplayName": "Content Studio",
"Key": "com.enonic.app.contentstudio",
"Deletable": false,
"Editable": false,
"Local": false,
"MaxSystemVersion": "8.0.0",
"MinSystemVersion": "7.0.0",
"ModifiedTime": "2019-06-13T14:50:53.917Z",
"State": "started",
"Url": "",
"VendorName": "Enonic AS",
"VendorUrl": "https://enonic.com",
"Version": "2.0.0"
}
},
"Failure": ""
}
Start
Starts an application with specific application key.
POST app/start
Param | Type | Description |
---|---|---|
|
String |
Application key, for instance, |
Read about authorization here |
No response body
Stop
Stops an application with specific application key.
POST app/stop
Param | Type | Description |
---|---|---|
|
String |
Application key, for instance, |
Read about authorization here |
No response body
Uninstall
Uninstalls an application with specific application key.
POST app/uninstall
Param | Type | Description |
---|---|---|
|
String |
Application key, for instance, |
Read about authorization here |
No response body
Server-Sent Events
The client initiates the SSE connection by using the media type text/event-stream
in the Accept
header. Then it gets updates automatically without requesting the server.
GET app/events
This API supports the following events:
-
list
- returns the details of applications which are already installed -
installed
- returns the details of the last applications that was installed -
state
- returns the details of the application that was just started or stopped -
uninstalled
- returns the key of the application that was just removed
Once a client is subscribed, he will receive the first event list
.
list
event
event: list
id: b0d64cac-811d-4f6b-9aff-50fd4d4a5ae9
data: {"applications":[{"displayName":"Content Studio","key":"com.enonic.app.contentstudio","local":false,"maxSystemVersion":"8.0.0","minSystemVersion":"7.6.0","modifiedTime":"2020-11-11T08:22:14.080Z","state":"started","url": "", "vendorName": "Enonic AS", "vendorUrl": "https://enonic.com", "version": "2.0.0"}]}
installed
or state
events
event: installed | state
id: f84d11ba-88cd-4cd2-9cb3-39dd181eb7e2
data: {"displayName":"Content Studio","key":"com.enonic.app.contentstudio","local":false,"maxSystemVersion":"8.0.0","minSystemVersion":"7.6.0","modifiedTime":"2020-11-11T08:22:14.080Z","state":"started","url": "", "vendorName": "Enonic AS", "vendorUrl": "https://enonic.com", "version": "2.0.0"}
uninstalled
event
event: uninstalled
id: b7a0f608-631f-4a1d-bda0-5459b87a99a6
data: {"key":"com.enonic.app.contentstudio"}
CMS
Content metadata commands.
Reprocess
Reprocesses content in the repository and regenerates metadata for the media attachments. Only content of a media type (super-type = base:media) are processed. Unless the skipChildren
flag is specified, it processes all descendants of the specified content path.
This command should be used after migrating content from Enonic CMS using the cms2xp tool. |
POST content/reprocess
Param | Type | Description |
---|---|---|
|
String |
target content path to be reprocessed. Format: |
|
Boolean |
flag to skip processing of content children |
Read about authorization here |
{
"Errors": [],
"UpdatedContent": []
}
Reprocess Task
Calls reprocess endpoint as a task.
This command should be used after migrating content from Enonic CMS using the cms2xp tool. |
POST content/reprocessTask
Param | Type | Description |
---|---|---|
|
String |
target content path to be reprocessed. Format: |
|
Boolean |
flag to skip processing of content children |
{
"taskId": "07500a00-8d60-4084-9657-af6725dc587d"
}
Task info can be fetched with task request. |
Projects
Project related commands.
List
Lists all projects together with their sites.
GET content/projects/list
[
{
"description" : "Testing features for Enonic XP",
"displayName" : "Features",
"name" : "features",
"parent" : "default",
"branches" : [
{
"name" : "draft",
"sites" : [
{
"displayName" : "Features",
"language" : "en",
"path" : "/features"
},
{
"displayName" : "AuditLogsDemo",
"language" : null,
"path" : "/features/js-libraries/audit-logs"
}
]
},
{
"name" : "master",
"sites" : [
{
"name": "master",
"sites": [
{
"displayName": "Features",
"language": null,
"path": "/features"
}
]
}
]
}
]
},
{
"description" : null,
"displayName" : "Default",
"name" : "default",
"parent" : null,
"branches" : [
{
"name" : "draft",
"sites" : []
},
{
"name" : "master",
"sites" : []
}
]
}
]
ID Providers
Id providers related commands.
List
Lists all the id providers.
GET idproviders/list
[
{
"description" : null,
"displayName" : "Auth ID Provider",
"key" : "auth-id-provider"
},
{
"description" : "Azure connection",
"displayName" : "Azure ID Provider",
"key" : "azure-id-provider"
},
{
"description" : null,
"displayName" : "System Id Provider",
"key" : "system"
}
]
Webapps
Web apps related commands.
List
Lists all the web apps.
GET webapps/list
[
{
"name": "com.enonic.cloud.console"
},
{
"name": "com.enonic.cloud.api"
}
]
Repository
Commands for configuring and managing repositories.
Reindex
Reindex the content in the search indices for the given repository and branches. This is usually required after upgrades and may be useful in many other cases.
POST repo/index/reindex
Param | Type | Description |
---|---|---|
|
String |
a comma-separated list of branches to be reindexed |
|
String |
the name of the repository to reindex |
|
Boolean |
if true, the indices will be deleted before recreated |
Read about authorization here |
{
"RepositoryId": "com.enonic.cms.default",
"Branches": [
"draft",
"master"
],
"NumberReindexed": 3,
"StartTime": "2019-06-14T07:58:38.663Z",
"EndTime": "2019-06-14T07:58:38.719Z",
"Duration": "PT-0.056S"
}
Reindex Task
Calls reindex endpoint as a task.
POST repo/index/reindex
Param | Type | Description |
---|---|---|
|
String |
a comma-separated list of branches to be reindexed |
|
String |
the name of the repository to reindex |
|
Boolean |
if true, the indices will be deleted before recreated |
{
"taskId": "cb1b4e06-22ad-4235-8876-a443c88c290b"
}
Task info can be fetched with task request. |
Settings
Update settings for a specified repository.
POST repo/index/updateSettings
Param | Type | Description |
---|---|---|
|
String |
single repository to toggle read-only mode for |
|
JSON |
settings object, see below |
Read about authorization here |
{
"index": {
"blocks.write": true, (1)
"number_of_replicas": 3 (2)
}
}
1 | Toggle read-only mode. |
2 | Set the number of replicas in the cluster. |
{
"UpdatedIndexes": [
"search-com.enonic.cms.default",
"storage-com.enonic.cms.default",
"search-system-repo",
"storage-system-repo"
]
}
Repository List
List available repositories.
GET repo/list
Read about authorization here |
{
"Repositories": [
{
"Branches": [
"master",
"draft"
],
"Id": "com.enonic.cms.default"
},
{
"Branches": [
"master"
],
"Id": "system-repo"
}
]
}
Vacuum
Deletes unused blobs and binaries from blobstore.
Make sure you have a backup of the installation available before doing a vacuum. |
Read about authorization here |
POST system/vacuum
Param | Type | Description |
---|---|---|
|
String |
Age of data to be removed. The format is based on the ISO-8601 duration format PnDTnHnMn.nS with days considered to be exactly 24 hours. Default is defined by |
|
String[] |
List of vacuum task to be run. Default : ["SegmentVacuumTask", "VersionTableVacuumTask"] |
This API supports the following tasks:
SegmentVacuumTask - removes unused repositories.
VersionTableVacuumTask - removes unused and non-commited versions together with it’s blobs.
BinaryBlobVacuumTask - checks all binary blobs and removes unused.
NodeBlobVacuumTask - checks all node blobs and removes unused.
Read about authorization here |
{
"taskId": "cb1b4e06-22ad-4235-8876-a443c88c290b"
}
Task info can be fetched with task request. |
{
"TaskResults": [
{
"Deleted": 0,
"Failed": 0,
"InUse": 13,
"Processed": 13,
"TaskName": "SegmentVacuumTask"
},
{
"Deleted": 4,
"Failed": 0,
"InUse": 96,
"Processed": 100,
"TaskName": "VersionTableVacuumTask"
}
]
}
Clean Up Audit Log
Deletes records from audit log repository.
Make sure you have a backup of the installation available before running a cleanup. |
POST auditlog/cleanup
Param | Type | Description |
---|---|---|
|
String |
Age of records to be removed. The format based on the ISO-8601 duration format PnDTnHnMn.nS with days considered to be exactly 24 hours. |
{
"ageThreshold" : "PT10H" //all records older than 10 hours will be removed
}
{
"taskId": "cb1b4e06-22ad-4235-8876-a443c88c290b"
}
Scheduled Jobs List
List scheduled jobs.
Read about authorization here |
GET scheduler/list
[
{
"calendar": {
"cronValue": "* * * * *",
"timeZone": "GMT+03:00",
"type": "CRON"
},
"config": [
{
"name": "string",
"type": "String",
"values": [
{
"v": "value"
}
]
}
],
"createdTime": "2010-01-01T00:00:00Z",
"creator": "user:system:creator",
"description": "description",
"descriptor": "com.enonic.app.features:landing",
"enabled": true,
"lastRun": "2012-01-01T00:00:00Z",
"lastTaskId": "task-id",
"modifiedTime": "2011-02-01T00:00:00Z",
"modifier": "user:system:creator",
"name": "test1",
"user": "user:system:user"
},
{
"calendar": {
"type": "ONE_TIME",
"value": "2016-11-02T10:36:00Z"
},
"config": [],
"createdTime": "2010-01-01T00:00:00Z",
"creator": "user:system:creator",
"description": null,
"descriptor": "com.enonic.app.features:landing",
"enabled": false,
"lastRun": null,
"lastTaskId": null,
"modifiedTime": "2011-02-01T00:00:00Z",
"modifier": "user:system:creator",
"name": "test2",
"user": null
}
]