Skip to content

hnuzhoulin/python-cephclient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

python-cephclient

A client library in python for the Ceph REST API.

This is currently a work in progress.

TODO

  • Finish the GET methods
  • Implement POST, PUT and DELETE methods
  • Support plain text, XML AND JSON responses
  • Add CLI support ?
  • Documentation

CLIENT USAGE

The client takes care of sending calls to the API through HTTP and handle the response.

client = CephClient(
    endpoint = 'http://apiserver:5000/api/v0.1/',
)

response, body = client.get('fsid', body = True)
print(json.dumps(body, indent=4, separators=(',', ': ')))

====

{
    "status": "OK",
    "output": {
        "fsid": "d5252e7d-75bc-4083-85ed-fe51fa83f62b"
    }
}

WRAPPER USAGE

The wrapper extends the client and provides helper functions to communicate with the API.

wrapper = CephWrapper(
    endpoint = 'http://apiserver:5000/api/v0.1/',
)

response, body = wrapper.get_fsid(body = True)
print(json.dumps(body, indent=4, separators=(',', ': ')))

====

{
    "status": "OK",
    "output": {
        "fsid": "d5252e7d-75bc-4083-85ed-fe51fa83f62b"
    }
}

About

Client library for the Ceph REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published