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.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3db8a8175bdff5acc1066a86f6363a8e2a911f3266e9c88e9e5a91d14151e27 |
|
MD5 | 11bc40391d9837b2d0d419e03c5c9b48 |
|
BLAKE2b-256 | d072302e442dfbb2185fb9f675603bb79c1266c873477153967d40992387462e |
Close
Hashes for libopenstorage_openstorage-0.42.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 232f086cc0c3b830f84f5edc0734f830cf736707ce398a564060e1a9fe522d99 |
|
MD5 | f9e57467492a1b7daa0b4cd3df6d5ef4 |
|
BLAKE2b-256 | 6902b909daa7f87c9f700b0ce2ac5ba98c5be177659c5f4bec4221663a2639c4 |