本文整理汇总了Python中host.Host.get_endpoint方法的典型用法代码示例。如果您正苦于以下问题:Python Host.get_endpoint方法的具体用法?Python Host.get_endpoint怎么用?Python Host.get_endpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类host.Host
的用法示例。
在下文中一共展示了Host.get_endpoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: name
# 需要导入模块: from host import Host [as 别名]
# 或者: from host.Host import get_endpoint [as 别名]
name = os.environ['REDIS_NAME'].strip()
zone_name = os.environ['HOSTED_ZONE_NAME'].rstrip('.')
zone_id = os.environ['HOSTED_ZONE_ID']
# the name (and identity) of the cluster (the master)
cluster = "{0}.{1}".format(name, zone_name)
# get/create the cluster environment
cluster = Cluster(key, access, cluster)
r53_zone = Route53Zone(key, access, zone_id)
ec2 = EC2(key, access)
events = Events(key, access, cluster.name())
host = Host(cluster.name(), events)
node = host.get_node()
endpoint = host.get_endpoint()
component = os.path.basename(sys.argv[0])
def log(message, logging='info'):
events.log(node, component, message, logging)
if __name__ == '__main__':
log('leaving the cluster', 'info')
#try:
# do not remove the tag, we might want to work on this later
# delete all there is to us
#log('unset the tag', 'info')
#ec2.unset_tag()
#except Exception as e:
#log(e, 'error')