Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libopenstorage-openstorage-0.42.22.tar.gz (69.8 kB view details)

Uploaded Source

Built Distribution

libopenstorage_openstorage-0.42.22-py3-none-any.whl (19.0 MB view details)

Uploaded Python 3

File details

Details for the file libopenstorage-openstorage-0.42.22.tar.gz.

File metadata

  • Download URL: libopenstorage-openstorage-0.42.22.tar.gz
  • Upload date:
  • Size: 69.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for libopenstorage-openstorage-0.42.22.tar.gz
Algorithm Hash digest
SHA256 10afdbbf5adce1efe8b00cbc19497255ed7f298889379a8e47b15f8d0a843e2a
MD5 c23595642cbcf7b2f5af00c0b171f82e
BLAKE2b-256 502501b6c5a9233f1ba103368a7f3eca3e0edc451f3abc59043e5cd1e3d911a1

See more details on using hashes here.

File details

Details for the file libopenstorage_openstorage-0.42.22-py3-none-any.whl.

File metadata

  • Download URL: libopenstorage_openstorage-0.42.22-py3-none-any.whl
  • Upload date:
  • Size: 19.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for libopenstorage_openstorage-0.42.22-py3-none-any.whl
Algorithm Hash digest
SHA256 12edcb87291a6312f0377ef47cb9d78021d9b4f2672ffaee664fb09a98963bd5
MD5 c8574d148ca798e35cf8bbcdb2d6a560
BLAKE2b-256 14bee23cdde29a76da96239baaf583c3ddbdb9e9d60f0f7da64ab0d51d9d16b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page