Observed since 21 Oct, 11:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python client for ACM with asyncio support.
Python SDK for ACM with asyncio support.
For Python 3.5 and above:
pip install aioacm-sdk-python
import aioacm
ENDPOINT = "acm.aliyun.com:8080"
NAMESPACE = "**********"
AK = "**********"
SK = "**********"
# get config
client = aioacm.ACMClient(ENDPOINT, NAMESPACE, AK, SK)
data_id = "com.alibaba.cloud.acm:sample-app.properties"
group = "group"
print(asyncio.get_event_loop()
.run_until_complete(client.get(data_id, group)))
# add watch
import time
client.add_watcher(
data_id,
group,
lambda x:print("config change detected: " + x)
)
asyncio.get_event_loop().run_until_complete(asyncio.sleep(5)) # wait for config changes
client = ACMClient(endpoint, namespace, ak, sk)
DEFAULT_TENANTNoneNoneExtra option can be set by set_options, as following:
client.set_options({key}={value})
Configurable options are:
ACMClient.get(data_id, group, timeout, no_snapshot)
param data_id Data id.
param group Group, use DEFAULT_GROUP if no group specified.
param timeout Timeout for requesting server in seconds.
param no_snapshot Whether to use local snapshot while server is unavailable.
return
W
Get value of one config item following priority:
Step 1 - Get from local failover dir(default: ${cwd}/acm/data).
${cwd}/acm/snapshot) in advance.Step 2 - Get from one server until value is got or all servers tried.
Step 3 - Get from snapshot dir.
ACMClient.add_watchers(data_id, group, cb_list)
param data_id Data id.param group Group, use DEFAULT_GROUP if no group specified.param cb_list List of callback functions to add.returnAdd watchers to a specified config item.
threading.Thread.
ACMClient.remove_watcher(data_id, group, cb, remove_all)
param data_id Data id.param group Group, use "DEFAULT_GROUP" if no group specified.param cb Callback function to delete.param remove_all Whether to remove all occurrence of the callback or just once.returnRemove watcher from specified key.
ACMClient.list_all(group, prefix)
param group Only dataIds with group match shall be returned, default is None.param group only dataIds startswith prefix shall be returned, default is None Case sensitive.return List of data items.Get all config items of current namespace, with dataId and group information only.
ACMClient.publish(data_id, group, content, timeout)
param data_id Data id.param group Group, use "DEFAULT_GROUP" if no group specified.param content Config value.param timeout Timeout for requesting server in seconds.return True if success or an exception will be raised.Publish one data item to ACM.
ACMClient.remove_watcher(data_id, group, cb, remove_all)
param data_id Data id.param group Group, use "DEFAULT_GROUP" if no group specified.param timeout Timeout for requesting server in seconds.return True if success or an exception will be raised.Remove one data item from ACM.
Debugging mode if useful for getting more detailed log on console.
Debugging mode can be set by:
ACMClient.set_debugging()
# only effective within the current process
A CLI Tool is along with python SDK to make convenient access and management of config items in ACM server.
You can use acm {subcommand} directly after installation, sub commands available are as following:
add add a namespace
use switch to a namespace
current show current endpoint and namespace
show show all endpoints and namespaces
list get list of dataIds
pull get one config content
push push one config
export export dataIds to local files
import import files to ACM server
Use acm -h to see the detailed manual.
ACM allows you to encrypt data along with Key Management Service, service provided by Alibaba Cloud (also known as KMS).
To use this feature, you can follow these steps:
pip install aliyun-python-sdk-kms.cipher- prefix.ACMClient, info needed are: region_id, kms_ak, kms_secret, key_id.Example:
c = acm.ACMClient(ENDPOINT, NAMESPACE, AK, SK)
c.set_options(kms_enabled=True, kms_ak=KMS_AK, kms_secret=KMS_SECRET, region_id=REGION_ID, key_id=KEY_ID)
# publish an encrypted config item.
await c.publish("cipher-dataId", None, "plainText")
# get the content of an encrypted config item.
await c.get("cipher-dataId", None)
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.13 | 16 Jun 2018 | 3 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7a9a768507f47caf4d5f87fd630e5ae51dcec198008a3b9040337b4a921e8482