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.24.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0acd366f259a062692cf5279c548ffc7c8a33dbe8a71359cee81f38f5643df7d |
|
MD5 | 259cbd892d8b3339e70c3f97a5836d0f |
|
BLAKE2b-256 | 51d6e3ba3e6c6487f56e93042c877850ad280bc00f4df26004db535b60ae9efc |
Close
Hashes for libopenstorage_openstorage-0.42.24.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cdd24207b610d05b0ee65a85c263e64b47a6e6d7e9157551780751229e9f35d |
|
MD5 | 46c12e7720106e1362c2fa940f33a443 |
|
BLAKE2b-256 | b4a4ae1932dfd1bb2fb6fc686f350af16c6aa06bcf97637abe28b75b99bfcbb2 |