OpenStorage SDK Python gRPC Client Library
Project description
Python gRPC Client Library for OpenStorage SDK
For more information please see https://libopenstorage.github.io
Example
import grpc
from openstorage import api_pb2
from openstorage import api_pb2_grpc
from openstorage import connector
c = connector.Connector(endpoint='localhost:9100')
channel = c.connect()
try:
# Cluster connection
clusters = api_pb2_grpc.OpenStorageClusterStub(channel)
ic_resp = clusters.InspectCurrent(api_pb2.SdkClusterInspectCurrentRequest())
print('Conntected to {0} with status {1}'.format(ic_resp.cluster.id, api_pb2.Status.Name(ic_resp.cluster.status)))
# Create a volume
volumes = api_pb2_grpc.OpenStorageVolumeStub(channel)
v_resp = volumes.Create(api_pb2.SdkVolumeCreateRequest(
name="myvol",
spec=api_pb2.VolumeSpec(
size=10*1024*1024*1024,
ha_level=3,
)
))
print('Volume id is {0}'.format(v_resp.volume_id))
except grpc.RpcError as e:
print('Failed: code={0} msg={1}'.format(e.code(), e.details()))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for libopenstorage-openstorage-0.42.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10afdbbf5adce1efe8b00cbc19497255ed7f298889379a8e47b15f8d0a843e2a |
|
MD5 | c23595642cbcf7b2f5af00c0b171f82e |
|
BLAKE2b-256 | 502501b6c5a9233f1ba103368a7f3eca3e0edc451f3abc59043e5cd1e3d911a1 |
Close
Hashes for libopenstorage_openstorage-0.42.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12edcb87291a6312f0377ef47cb9d78021d9b4f2672ffaee664fb09a98963bd5 |
|
MD5 | c8574d148ca798e35cf8bbcdb2d6a560 |
|
BLAKE2b-256 | 14bee23cdde29a76da96239baaf583c3ddbdb9e9d60f0f7da64ab0d51d9d16b3 |