/go-ceph-rest-api

Ceph Rest API in Go

Primary LanguageGoGNU General Public License v2.0GPL-2.0

go-ceph-rest-api

Join the chat at https://gitter.im/darkcrux/go-ceph-rest-api

Our pathetic attempt to port the Ceph API to go.

Initialize submodule ceph-ansible

After cloning, run

$ git submodule init
$ git submodule update

Setup Workspace

We need access to ceph and the ceph-dev libraries to work with this. Boot up the vagrant box to start the workspace.

$ vagrant up

The workspace should be mounted on /vagrant/workspace. This is set as the $GOPATH to work on inside the VM.

Build Project

Building the binary is done inside the VM.

$ vagrant ssh
$ cd /vagrant/workspace/src/github.com/darkcrux/go-ceph-rest-api
$ go get
$ go build

Running the API

At the moment, the binary will use the default ceph configuration. This needs to be updated in the future, but for now, run the app as su:

$ sudo ./go-ceph-rest-api

Once running, the API should be accessible via port 9000 (Needs to be updated).

$ curl http://200.200.200.200:9000/api/v0.1/fsid

Notes

Plenty of things to do:

  • Create Makefile for the project
  • Cross-compilation support
  • Configuration options
  • ???