python sdk for nacos
Project description
xadnacos
xadnacos是一个用来调用naccos的sdk
参考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.2.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for xadnacos-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b56d18b6a65aa7fc79fe5c2e5fe5d7bad19823dea08cfd855cfc78dcfb0aea |
|
MD5 | 6ef8b9a1daed89e52ab661b465a7de4c |
|
BLAKE2b-256 | 11efc0e7e0853bbee056f5fc3fa31d388cef181a9f1f935a772e16bddf258ad9 |