GithubHelp home page GithubHelp logo

gluster / gluster-block-restapi Goto Github PK

View Code? Open in Web Editor NEW
4.0 8.0 3.0 57 KB

ReST APIs for managing Gluster Block Volumes

License: GNU Lesser General Public License v2.1

Makefile 4.25% Shell 19.58% Go 76.17%

gluster-block-restapi's Introduction

ReST APIs for Gluster Block Volumes

Build Status

Install

mkdir -p $GOPATH/src/github.com/gluster
cd $GOPATH/src/github.com/gluster
git clone https://github.com/gluster/gluster-block-restapi.git
cd gluster-block-restapi
PREFIX=/usr make
PREFIX=/usr make install

Setup

Enable and run glusterblockrestd by running,

systemctl enable glusterblockrestd
systemctl start glusterblockrestd

Server port and other settings can be configured by updating the following config file.

/etc/gluster-block-restapi/config.toml

Usage

Curl example to create a gluster block volume

curl -i -XPOST http://localhost:8081/v1/blockvolumes/block-test/sample-block \
    -d '{"ha": 3, "size": 1073741824, "hosts": ["192.168.1.11", "192.168.1.12", "192.168.1.13"]}'

Python example to create a gluster block volume

import requests

req = {
    "ha": 3,
    "hosts": ["192.168.1.11", "192.168.1.12", "192.168.1.13"],
    "size": 1073741824
}

resp = requests.post("http://localhost:8081/v1/blockvolumes/block-test/sample-block",
                     data=req)

if resp.status_code == 200:
    print("[   OK] Block volume created successfully")
    print(resp.content)
else:
    print("[ERROR] Block volume create failed")
    print(resp.content)

API documentation

Create Gluster block volume

POST /v1/blockvolumes/{hostvolume}/{blockname}

List all Gluster block volumes

GET /v1/blockvolumes/{hostvolume}

View a Gluster block Volume

GET /v1/blockvolumes/{hostvolume}/{blockname}

Delete a Gluster block volume

DELETE /v1/blockvolumes/{hostvolume}/{blockname}

gluster-block-restapi's People

Contributors

aravindavk avatar madhu-1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.