python sdk for nacos
Project description
xadnacos
xadnacos是一个用来调用naccos的sdk, 基于KcangNacos进行修改
参考: * https://github.com/KcangYan/nacos-python-sdk.git
Free software: MIT license
文档
导入dkimageapp库:
from xadnacos import xadnacos as nacos
创建nacos连接对象:
nacosServer = nacos.nacos(ip=nacosIp,port=nacosPort)
将本地配置注入到nacos对象中即可获取远程配置:
GlobalConfig={} nacosServer.config(dataId="demo-python.json",group="dev",tenant="python",myConfig=GlobalConfig)
注册nacos服务:
serverHost = socket.gethostbyname(socket.gethostname()) metadata = { "tier": "backend", "projectid": "THID89782455-HJ45678963" } clusterName = myConfig.region nacosServer.registerService(serviceIp=serverHost,servicePort=myConfig.port,serviceName="python-provider", namespaceId="python",groupName="dev",clusterName=clusterName,metadata=metadata)
开启监听配置线程和服务注册心跳进程的健康检查进程:
nacosServer.healthyCheck()
Features
TODO
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2023-02-04)
First release on PyPI.
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
xadnacos-0.1.3.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for xadnacos-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 031bcb5e8a9af98abafb5a2de84b99284322484585a463477b29a3e13a927535 |
|
MD5 | ee7b055edf3bd0174e6fba9d26c939a6 |
|
BLAKE2b-256 | da31a284a4761385fea780aa0179e637732c4f0b13dd6bd0ec44ee80e762fe8d |