BlueMix服务发现服务的Python客户端
bluemix-service-discover的Python项目详细描述
#概述
[![构建状态](https://travis-ci.org/ibm-bluemix/service-discovery-client-python.svg?branch=master)(https://travis ci.org/ibm bluemix/service discovery client python)
打开终端并运行
``bash
pip install bluemix service discovery
```
2。将包导入到要在注册表中注册服务或查找服务的任何位置。
``python
来自bluemix服务发现。service\u publisher导入servicebissor
publisher=servicebissor('test-service',300,'up',
'https://test service.mybluemix.net','http',
tags=['test'])
````
``python
import json
from bluemix_service_discovery.service_locator import servicelocator
services=json.loads(locator.get_services()).get('instances')
```
应用程序请查看[物流向导](https://github.com/ibm-bluemix/logistics-wizard)演示。对于服务注册和服务查找示例,您需要注意[server/web/\\u init\\.py](https://github.com/ibm bluemix/logistics wizard/blob/master/server/web/\u init\.py)和[server/utils.py](https://github.com/ibm-bluemix/logistics-wizard/blob/master/server/utils.py)。
发现](https://console.ng.bluemix.net/catalog/services/service-discovery/)
[文档](https://console.ng.bluemix.net/docs/services/servicediscovery/index.html)
[![构建状态](https://travis-ci.org/ibm-bluemix/service-discovery-client-python.svg?branch=master)(https://travis ci.org/ibm bluemix/service discovery client python)
打开终端并运行
``bash
pip install bluemix service discovery
```
2。将包导入到要在注册表中注册服务或查找服务的任何位置。
``python
来自bluemix服务发现。service\u publisher导入servicebissor
publisher=servicebissor('test-service',300,'up',
'https://test service.mybluemix.net','http',
tags=['test'])
````
``python
import json
from bluemix_service_discovery.service_locator import servicelocator
services=json.loads(locator.get_services()).get('instances')
```
应用程序请查看[物流向导](https://github.com/ibm-bluemix/logistics-wizard)演示。对于服务注册和服务查找示例,您需要注意[server/web/\\u init\\.py](https://github.com/ibm bluemix/logistics wizard/blob/master/server/web/\u init\.py)和[server/utils.py](https://github.com/ibm-bluemix/logistics-wizard/blob/master/server/utils.py)。
发现](https://console.ng.bluemix.net/catalog/services/service-discovery/)
[文档](https://console.ng.bluemix.net/docs/services/servicediscovery/index.html)