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.101.28.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 877c4146d68751761f5322422be5da674df99a93fa198b4c00c048b9653a7cad |
|
MD5 | e19b682049f87041f90c8a064525c363 |
|
BLAKE2b-256 | ca1a6ce5ff37fd0abfc7b7f344288cd819c4d7b0790c8bf2ee8d369164613236 |
Close
Hashes for libopenstorage_openstorage-0.101.28.4-py3.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa30d6239994e69b3b37e5bd62fb84ec123f8a9ce6e39496cc4d936d202a08d |
|
MD5 | 2409bce9668966fed34f00dd97156b5a |
|
BLAKE2b-256 | 1f22c9ba42bbd45c131bf5aed0e18de2ca79cdf8ab8b2d4718114c2112fb0b50 |