Repositories

/api/admin/repositories

Show All

GET /api/admin/repositories

Lists all of the repositories in the metabase

GET /api/admin/repositories HTTP/1.1
Accept: application/json

The response will be a Standard Response.

The columns displayed for each repository are:

Human Name Column Name Description
Name name The name of the Repository
Built _built Has the repository been built?
Public Cache Size _cache Public cache size in megabytes
Private Cache Size _private_cache Private cache size in megabytes
Default Pattern _pattern_id Default Pattern
Sort Locale _sort_locale Sort Locale
Created By CREATED_BY Created by user
Created Date _created_date Date Created
Edited By EDITED_BY Edited by user
Edited Date _edited_date Date Edited

The rows array will contain one element for each repository:

{
    "dataRow": [
        "jupiter",
        "Built",
        "256",
        "16",
        "default",
        "Original",
        "bob",
        "2015/02/12 13:57:17",
        "bob",
        "2015/02/26 15:36:33"
    ],
    "metadata": {
        "url": "/api/admin/repositories/jupiter"
    }
}

The URL in the metadata is for management of the repository (not for accessing entities or business rules).

Commands

POST /api/admin/repositories/

Execute repository management commands

The request requires a Standard Request packet. Available commands are:

Command Description
get Get a filtered list of repositories
add Add a new repository
edit Edit an existing repository
delete Delete one or more repositories

The request must contain the command and options elements. The data element is not required.

The response for each command may be:

Response Code Reason
204 Success
400 Server error

Get

The request to get a list of repositories looks like:

POST /api/admin/repositories HTTP/1.1
Content-Type: application/json

{
    "command": "get",
    "options": {
        "where": "'Public Cache Size' = 64"
    }
}

The request packet must contain the command element.

Add

The request to add a new repository looks like:

POST /api/admin/repositories HTTP/1.1
Content-Type: application/json

{
    "command": "add",
    "options": {
        "name": "saturn",
        "cacheSize": 128,
        "pattern": 1,
        "locale": "en_GB"
    }
}

The options are as follows:

Field Type Description
name String The name of the new repository
cacheSize Integer The size of the public cache; must be greater than 0
pattern Integer The default pattern for the repository; the pattern is selected from Pattern Encodings
locale String The short code for the repository’s locale; should be selected from Supported Locales

All fields are required.

Edit

The request to edit an existing repository looks like:

POST /api/admin/repositories HTTP/1.1
Content-Type: application/json

{
    "command": "edit",
    "options": {
        "name": "saturn",
        "cacheSize": 128,
        "pattern": 1
    }
}

The options are as follows:

Field Type Description
name String The name of the new repository
cacheSize Integer The size of the public cache; must be greater than 0
pattern Integer The default pattern for the repository; the pattern is selected from Pattern Encodings

All fields are required.

Delete

To delete a repository, the request should be formatted as follows:

POST /api/admin/repositories HTTP/1.1
Content-Type: application/json

{
    "command": "delete",
    "options": {
        "names": ["saturn"]
    }
}

The options are as follows:

Field Type Description
names Array An array containing the names of repositories to be deleted