Skip to main content

Client for Gnetcli GRPC-server

Project description

Python client for Gnetcli GRPC server

Gnetcli provides a universal way to execute arbitrary commands using a CLI, eliminating the need for screen scraping with expect.

See documentation on gnetcli server.

Example:

from gnetclisdk.client import Credentials, Gnetcli
import os, asyncio

async def example():
    api = Gnetcli(insecure_grpc=True)
    dev_creds = Credentials(os.environ.get("LOGIN"), os.environ.get("PASSWORD"))
    res = await api.cmd(hostname="myhost", device="huawei", cmd="dis clock", credentials=dev_creds)
    print("err=%s status=%s out=%s" % (res.error, res.status, res.out))

asyncio.run(example())

Output:

err=b'' status=0 out=b'2023-11-10 09:31:58\nFriday\nTime Zone(UTC) : UTC'

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

gnetclisdk-1.0.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

gnetclisdk-1.0.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file gnetclisdk-1.0.2.tar.gz.

File metadata

  • Download URL: gnetclisdk-1.0.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gnetclisdk-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d2cd057c3e13045c74b906183a87be94504a46a34e43e2863a5cca4b7c3dfde8
MD5 6b22be0040be4f507bf92695cb578572
BLAKE2b-256 ba8d6cf6ca75fcc8e76761e7b943127edcb7e823f3d41979bc79a214e82d40cf

See more details on using hashes here.

File details

Details for the file gnetclisdk-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: gnetclisdk-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gnetclisdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f001c76a2776fb9eb938c4a36907440309ea3b743d7ea347d0d2b99e8528db4
MD5 6247a865b7fde7ae30f2401a609b37d7
BLAKE2b-256 826105d153ac6f5ca7f9683f0a1a9a8dab09c7360084da98ccdec22c212616dc

See more details on using hashes here.

Supported by

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