Skip to main content

Client for Gnetcli GRPC-server

Project description

python client for Gnetcli server

Install Gnetcli GRPC-server.

  • Download latest release from https://github.com/annetutil/gnetcli/releases/
  • tar -xzvf gnetcli_server-v1.0.0-darwin-amd64.tar.gz (If see 'cannot be opened because the developer cannot be verified', then call sudo xattr -d com.apple.quarantine gnetcli_server)
  • ./gnetcli_server -debug

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())
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.1.tar.gz (11.0 kB view hashes)

Uploaded Source

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