Mongo Conduction

_images/conduction.jpg

Wire Protocol frontend server to Mongo Orchestration.

Follow Installation instructions, then:

$ mongo-conduction
listening on mongodb://localhost:27017

Connect with the mongo shell:

$ mongo
Server has startup warnings:
hello from Conduction!
Conduction:PRIMARY>

Conduction translates Mongo Orchestration’s REST API to MongoDB Wire Protocol commands straightforwardly:

Conduction:PRIMARY> var info = db.runCommand({
...    post:'/servers',
...    body: {id: "my_id", preset: "basic.json"}
... })
Conduction:PRIMARY> info
{
    "links" : [
        {
            "href" : "/v1/servers/my_id",
            "method" : "DELETE",
            "rel" : "delete-server"
        },
        {
            "href" : "/v1/servers/my_id",
            "method" : "GET",
            "rel" : "get-server-info"
        }
    ],
    // ... lots more info ...
    "mongodb_uri" : "mongodb://127.0.0.1:1027",
}

The “/v1” path prefix is optional. Get server info:

Conduction:PRIMARY> db.runCommand({get: "/servers/my_id"})
{
    // ... lots of info ...
}

Shut a server down:

Conduction:PRIMARY> db.runCommand({delete: "/servers/my_id"})
{ "ok" : 1 }

Contents:

Indices and tables

Image Credit: Ed Ouimette

Table Of Contents

Next topic

Mongo Conduction

This Page