Rackspace服务注册表的Python客户端。
项目描述
# Python Rackspace Service Registry客户端
A Python client for Rackspace Service Registry.
# 许可协议
此库遵循[Apache License](https://apache.ac.cn/licenses/LICENSE-2.0.html)分发。
# 使用方法
```Python
from service_registry import Client
RACKSPACE_USERNAME = 'username'
RACKSPACE_KEY = 'api key'
client = Client(RACKSPACE_USERNAME, RACKSPACE_KEY)
```
## 服务
创建一个心跳超时为10的服务
```Python
service_id = 'my-service-1'
payload = {'metadata': {'key': 'value'}}
heartbeat_timeout = 10
client.services.create(service_id, heartbeat_timeout, payload)
```
心跳一个服务
```Python
service_id = 'my-service-1'
token = '返回的心跳令牌'
client.services.heartbeat(service_id, token)
```
A Python client for Rackspace Service Registry.
# 许可协议
此库遵循[Apache License](https://apache.ac.cn/licenses/LICENSE-2.0.html)分发。
# 使用方法
```Python
from service_registry import Client
RACKSPACE_USERNAME = 'username'
RACKSPACE_KEY = 'api key'
client = Client(RACKSPACE_USERNAME, RACKSPACE_KEY)
```
## 服务
创建一个心跳超时为10的服务
```Python
service_id = 'my-service-1'
payload = {'metadata': {'key': 'value'}}
heartbeat_timeout = 10
client.services.create(service_id, heartbeat_timeout, payload)
```
心跳一个服务
```Python
service_id = 'my-service-1'
token = '返回的心跳令牌'
client.services.heartbeat(service_id, token)
```