コード例 #1
0
    def doStuffStart():
        # Do initialisation stuff here
        # no spaces or underscores, this needs to be url-friendly

        commonDataStruct['ec'] = EurekaClient(app_name,
                                              ip_address=app_ip,
                                              eureka_url=eureka_url,
                                              eureka_domain_name="",
                                              data_center="MyOwn",
                                              port=app_port,
                                              secure_port=None,
                                              use_dns=False,
                                              region="none",
                                              prefer_same_zone=False,
                                              context="",
                                              host_name=app_host,
                                              vip_address=app_name,
                                              secure_vip_address=app_name)

        global yourThread
        # Create your thread
        yourThread = threading.Timer(pool_time, doStuff, ())
        yourThread.start()
コード例 #2
0
from eureka.client import EurekaClient
import logging

logging.basicConfig()

ec = EurekaClient(
    "python-service-dev",
    eureka_domain_name="python-service",
    eureka_port=9100,
    data_center="MyOwn",
    eureka_url="http://127.0.0.1:9100/eureka/",
    host_name="PC002746.tfprod.taifook.com:python-service-dev:7001",
    port="7000",
    secure_vip_address="127.0.0.1",
    secure_port="7001")


def register():
    print 'register eurekaClient'
    print ec.get_eureka_urls()
    print ec.register()
    print ec.update_status("UP")
    print 'heartbeat eurekaClient'
    print ec.heartbeat()


def delete():
    print 'delete eurekaClient'
    print ec.delete()
コード例 #3
0
from eureka.client import EurekaClient
import logging

logging.basicConfig()


ec = EurekaClient("Python_Service_Dev",
                  eureka_domain_name="python_client",
                  eureka_port=9000,
                  data_center="MyOwn",
                  eureka_url="http://127.0.0.1:9100/eureka/",                
                  vip_address="127.0.0.1",
                  host_name="PC002746.tfprod.taifook.com:client-server-dev:7000",
                  port="7000",
                  secure_vip_address="127.0.0.1",
                  secure_port="7001"
                
)



if __name__ == '__main__':
      
    print ec.get_eureka_urls()
    print ec.register()
    print ec.update_status("UP")  
    print ec.heartbeat()
    
    
def register():
    print ec.get_eureka_urls()
コード例 #4
0
ファイル: ec.py プロジェクト: HackerVik/KidTube
import logging

from eureka.client import EurekaClient

logging.basicConfig()

ec = EurekaClient("MyApplication",
                  eureka_domain_name="test.yourdomain.net",
                  region="eu-west-1",
                  vip_address="http://app.yourdomain.net/",
                  port=80,
                  secure_vip_address="https://app.yourdomain.net/",
                  secure_port=443)
print(ec.get_zones_from_dns())
print(ec.get_eureka_urls())
print(ec.register())
print(ec.update_status("UP"))  # Or ec.register("UP")
print(ec.heartbeat())
コード例 #5
0
from eureka.client import EurekaClient
import logging

logging.basicConfig()

ec = EurekaClient(
    "Python_Service_Dev",
    eureka_domain_name="python_client",
    eureka_port=9000,
    data_center="MyOwn",
    eureka_url="http://127.0.0.1:9100/eureka/",
    vip_address="127.0.0.1",
    host_name="PC002746.tfprod.taifook.com:client-server-dev:7000",
    port="7000",
    secure_vip_address="127.0.0.1",
    secure_port="7001")

if __name__ == '__main__':

    print 'start eurekaClient'
    print ec.delete()
コード例 #6
0
ファイル: test.py プロジェクト: rschultheis/python-eureka
from eureka.client import EurekaClient
import logging

logging.basicConfig()

print "hello"
ec = EurekaClient(app_name="irrelevant", eureka_url="http://localhost:13350/v2/", use_dns=False, data_center="NotAmazon")
"initialized"

print ec.get_eureka_urls()
print ec.get_app("USER_THRIFT_DEV")