Skip to main content

Python3 client for Nacos.

Project description

python-nacos

声明

参考nacos-sdk-python项目改造

https://github.com/nacos-group/nacos-sdk-python

Usage

from nacos import NacosUsage

SERVER_ADDRESSES = "127.0.0.1:8848"
NAMESPACE = "44b27ac4-60c1-43e7-8ac3-ed34108ca1aa"

params = {
    "servers": SERVER_ADDRESSES,
    "namespace": NAMESPACE,
    "service_name": "test.service",
    # "ip": "127.0.0.1",
    "port": 8080,
    "cluster_name": "testCluster",
    "weight": 1.0,
    "metadata": {},
    "enable": True,
    "healthy": True,
    "ephemeral": True,
}

usage = NacosUsage(debug=False, daemon=False, **params)

# 获取配置
conf = usage.get_config(data_id="test")
print("config: {}".format(conf))

# 注册实例
usage.register_instance()

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

python-nacos-0.1.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

python_nacos-0.1.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file python-nacos-0.1.1.tar.gz.

File metadata

  • Download URL: python-nacos-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for python-nacos-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a92619d955b9fe0e48a52e6ecd23df1e784e2dde87b9b869a14b108659df7d26
MD5 8180cdac727ee32ca8035e37a0c9dadc
BLAKE2b-256 1a17a679c6de0b5ce204faefd5c33fdbf8a3195b84a3381989e7eb9e0c3956f5

See more details on using hashes here.

File details

Details for the file python_nacos-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_nacos-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for python_nacos-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d43a064f395bec0ca7b52b55ac4116f0d0e3820cea04ca3208f0665f00d65af
MD5 b468ccf32998afcba9b2d5a93fee030a
BLAKE2b-256 0b0861972c50d51b35b10624fffc24bc54fa74d62433f7444c39fe70fccf3d87

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