Skip to content

IBM-Cloud/service-discovery-client-python

Repository files navigation

Overview

Build Status

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

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

    from bluemix_service_discovery.service_publisher import ServicePublisher
    publisher = ServicePublisher('test-service', 300, 'UP',
                                 'https://test-service.mybluemix.net', 'http',
                                 tags=['test'])
    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 demo. You will want to pay attention to server/web/__init__.py for a service registration and server/utils.py for a service lookup example.

More Info

Service Discovery
Documentation

License

See License.txt for license information.

About

A Python client for the Bluemix Service Discovery service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages