Python3 client for Nacos.
Project description
python-nacos
声明
参考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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for python_nacos-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d43a064f395bec0ca7b52b55ac4116f0d0e3820cea04ca3208f0665f00d65af |
|
MD5 | b468ccf32998afcba9b2d5a93fee030a |
|
BLAKE2b-256 | 0b0861972c50d51b35b10624fffc24bc54fa74d62433f7444c39fe70fccf3d87 |