ceph-agent

0.6.0 • Public • Published

ceph-agent

Simple UI for CEPH storage

total downloads of ceph-agent ceph-agent's License latest version of ceph-agent

Languages / 简体中文

Description

Start a web server as an agent of remote CEPH storage.

logo

ToC

Get Started

Firstly, create a JSON file and put into your CEPH storage connection configurations. Only SWIFT style connection config is acceptable now.

// swift.json
{
    "endPoint"   : "http://storage.example.com/",
    "subuser"    : "userName:subUserName",
    "key"        : "380289ba59473a368c593c1f1de6efb0380289ba5",
    "container"  : "containerName"
}

ATTENTION: All above options but container are necessary.

Then, run ceph-agent passing path of the JSON file.

# Install globally. 
npm install -g ceph-agent
 
# Start agent (an HTTP proxy to CEPH storage service). 
ceph-agent swift.json

By default, an HTTP service listening on port 7000 will be started. You may access the CEPH storage via http://localhost:7000/.

ceph-agent homepage

Manual

# Display help info. 
ceph-agent -h | --help
 
# Start the agent (proxy server) and listen the specified port. 
ceph-agent -p | --port <port>
 
# Specify the connection config file. 
# By default, ceph-agent will try the "ceph.json" or "swift.json" in current 
# working directory. 
ceph-agent -C | --connection <path/to/connection-config.json>

API

const CephAgent = require('ceph-agent');
 
const conn = {
    "endPoint"   : "http://storage.example.com/",
    "subuser"    : "userName:subUserName",
    "key"        : "380289ba59473a368c593c1f1de6efb0380289ba5",
    "container"  : "containerName", /* OPTIONAL */
};
 
const agent = new CephAgent(conn, { basepath: '/myceph/' });
 
// -----------------------------------------------------------------------------
// -- CASE 1: Start HTTP server directly.
agent.start();
 
// -----------------------------------------------------------------------------
// -- CASE 2: Return a listener.
conset handler = agent.getHandler();
 
// In express.
app.use('/myceph/*', handler);

Recommendations

Package Sidebar

Install

npm i ceph-agent

Weekly Downloads

15

Version

0.6.0

License

none

Unpacked Size

206 kB

Total Files

27

Last publish

Collaborators

  • youngoat
  • youngoat.elite