Skip to main content

携程 Apollo(阿波罗) 配置客户端

说明

这是一个携程 Apollo(阿波罗) 配置客户端。

链接

安装

pip install py-apollo-client

依赖

pip install requests

使用

环境变量获取客户端:

import os

from ApolloClient import ApolloClient

os.environ.setdefault('ENV_PREFIX_APOLLO', 'apollo')
os.environ.setdefault('APOLLO_URI', 'http://192.168.68.251:8080')
os.environ.setdefault('APOLLO_APPID', 'equipment-services')

client = ApolloClient.env()

拉取配置:

print(client.pull())

获取配置(缓存):

print(client.get('debug'))

获取配置:

print(client.get('debug', cache=False))

属性

属性 默认值 说明
uri None 服务地址
appid None 应用编号
ip None 客户端地址,为 True 则自动获取
cluster default 集群别名
namespace application 空间别名
release None 最后版本
last 0 最后获取配置时间戳
rate 5 速率限制,几秒内只请求一次接口
setting {} 获取到的配置

Metadata

Release files for py-apollo-client 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-apollo-client 0.0.2
File Size Uploaded Provenance Actions
py-apollo-client-0.0.2.tar.gz 3.5 kB Without provenance Details for py-apollo-client-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-apollo-client 0.0.2
File Interpreter ABI Platform Actions
py_apollo_client-0.0.2-py3-none-any.whl Python 3 none any Details for py_apollo_client-0.0.2-py3-none-any.whl

Total release size: 7.2 kB

Release files / py-apollo-client-0.0.2.tar.gz

Download URL py-apollo-client-0.0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5d2a2540a80d7ecfd889f082acc083b69f81ad741437eec3749a9053f3bdd353
BLAKE2b-256 checksum
How to use checksums
ade6aec8870f129399bf444a177e2bed84bc711c9626b0a5271674062478613a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / py_apollo_client-0.0.2-py3-none-any.whl

Download URL py_apollo_client-0.0.2-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0ee3f0caa6569973791e468b4f44f2b34bec9d950ac6a54f7506cf2e64ab8f9
BLAKE2b-256 checksum
How to use checksums
a1faea88f1fae19d2f6ce15a04755f52d87785c9fc9b5b45d9cc8262d4656a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Security for py-apollo-client 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page