Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

REST Entities

Randgalt edited this page Apr 5, 2012 · 22 revisions

All Exhibitor entities are received/returned as JSON.

Result

Many Exhibitor APIs return a Result to indicate success or failure.

{
    "succeeded": boolean,
    "message": string,  // Any error message if succeeded is false
}

NameAndModifiedDate

Used by the Index APIs.

{
    "name": string,      // the file/index name
    "modifiedDate": long // an epoch
}

State

{
    "version": string,           // Exhibitor version
    "running": boolean,          // is the ZooKeeper instance running
    "config": Config             // Shared Configuration (see the Config entity)
    
    // ... other values as needed ...
}

Config

{
    "rollInProgress": boolean,            // is a rolling config change in progress
    "rollStatus": string,                 // The status of the rolling config change
    "rollPercentDone": int,
    "hostname": string,                   // The hostname of this machine (not really a shared value but still returned here)
    "serverId": int,                      // The ZooKeeper Server Id configured for this instance or -1
    "logIndexDirectory": string,          // Path to store indexed logs
    "zookeeperInstallDirectory": string,
    "zookeeperDataDirectory": string,
    "serversSpec": string,                // List of servers in the ensemble (see below for syntax)
    "backupExtra": string,                // URL encoded values used for backing-up
    "zooCfgExtra": string,                // URL encoded values to add to zoo.cfg file
    "clientPort": int,                    // ZK client port (usually 2181)
    "connectPort": int,                   // ZK connect port (usually 2888)
    "electionPort": int,                  // ZK election port (usually 3888)
    "checkMs": int,                       // How often to poll the ZK instance (in milliseconds)
    "cleanPeriodMs": int,                 // Period in ms to perform log cleanup
    "cleanupMaxFiles": int,               // Value to pass to PurgeTxnLog as max
    "backupMaxStoreMs": int,              // Max age to save backups (in milliseconds)
    "backupPeriodMs": int                 // Period in ms to perform backups
}

“serversSpec” is a comma separated list of servers in the form: <type>:<id>:<hostname>. The type is optional but can be “S” for standard (the default) or “O” for an observer.

Index

{
    "name": string,    // index name
    "from": string,    // from date (formatted)
    "to": string,      // to date (formatted)
    "entryCount": int  // number of entries in the index
}

NewIndexRequest

{
    type: string,      // index type: see below for values
    value: string,     // type->value: see below for values
    backup: NameAndModifiedDate
}

This entity controls backup/restore/etc.

type value
“backup” n/a Starts the indexing of a specified backup. The “backup” parameter specifies the backup to index.
“default” n/a Starts a backup of the current set of ZooKeeper log files
“path” Path to a ZooKeeper log file Starts a backup of the specified log file