Skip to main content

Python client for the Bluemix Service Discovery service

Project description

# Overview

[![Build Status](https://travis-ci.org/IBM-Bluemix/service-discovery-client-python.svg?branch=master)](https://travis-ci.org/IBM-Bluemix/service-discovery-client-python)

This is the source code for bluemix-service-discovery, a pip package that serves as a client to Python apps attempting to interact with the Bluemix Service Discovery service.

## How To Use

1. Open a terminal and run

```bash
pip install bluemix-service-discovery
```
2. Import the package wherever you want to register your service or lookup a service in the registry.

```python
from bluemix_service_discovery.service_publisher import ServicePublisher
publisher = ServicePublisher('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')
```



## Example app

To see how to use this client in your app please check out the [Logistics Wizard](https://github.com/IBM-Bluemix/logistics-wizard) demo. You will want to pay attention to [server/web/\_\_init\_\_.py](https://github.com/IBM-Bluemix/logistics-wizard/blob/master/server/web/__init__.py) for a service registration and [server/utils.py](https://github.com/IBM-Bluemix/logistics-wizard/blob/master/server/utils.py) for a service lookup example.

## More Info
[Service Discovery](https://console.ng.bluemix.net/catalog/services/service-discovery/)
[Documentation](https://console.ng.bluemix.net/docs/services/ServiceDiscovery/index.html)


## License

See [License.txt](License.txt) for license information.

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

bluemix-service-discovery-0.0.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file bluemix-service-discovery-0.0.1.tar.gz.

File metadata

File hashes

Hashes for bluemix-service-discovery-0.0.1.tar.gz
Algorithm Hash digest
SHA256 62db6924cbe2e32571a8e546bc543f4162fd9570db46e1b22bdc05468b76e97e
MD5 c860ac1cd61d18d18544fd7b95344129
BLAKE2b-256 c3d1fee8e7e0cc3cd376c7684ca7bce7d420fa997c6b77a795115a07316daaa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page