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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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