Management Endpoint
Contents
Management Endpoint
Management commands are available at port 4848
, i.e. localhost:4848
if you’re running XP locally
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. |
{
"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
{
"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 |
{
"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 |
{
"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 ( |
{
"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 |
{
"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 ( |
{
"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. |
{
"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. |
{
"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 install applications to the 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 |
{
"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": "http://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 |
{
"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": "http://enonic.com",
"Version": "2.0.0"
}
},
"Failure": ""
}
CMS
Content metadata commands. Currently only one command present here:
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 |
{
"Errors": [],
"UpdatedContent": []
}
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 situation.
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 |
{
"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"
}
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 |
{
"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"
]
}
List
List available repositories.
GET repo/list
{
"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. |
POST system/vacuum
{
{
"TaskResults": [
{
"Deleted": 0,
"Failed": 0,
"InUse": 7,
"Processed": 7,
"TaskName": "UnusedSegmentsCleaner"
},
{
"Deleted": 0,
"Failed": 0,
"InUse": 39,
"Processed": 39,
"TaskName": "UnusedVersionFilesCleaner"
},
{
"Deleted": 0,
"Failed": 0,
"InUse": 2,
"Processed": 2,
"TaskName": "UnusedBinaryFilesCleaner"
},
{
"Deleted": 0,
"Failed": 0,
"InUse": 123,
"Processed": 123,
"TaskName": "UnusedVersionTableEntryCleaner"
}
]
}
}