English | 简体中文
Alibaba Cloud EventBridge SDK for Python
Requirements
- Python >= 3.4
Installation
- Install with pip
Python SDK uses a common package management tool named pip. If pip is not installed, see the pip user guide to install pip.
# Install the alibabacloud_eventbridge
pip install alibabacloud_eventbridge
Usage
from alibabacloud_eventbridge.models import Config, CloudEvent
from alibabacloud_eventbridge.client import Client
config = Config(
access_key_id='<access key id>',
access_key_secret='<access key secret>',
endpoint='<endpoint>'
)
client = Client(config)
request = CloudEvent(
datacontenttype='application/json',
data=b'test',
id='id',
source='source',
time='2020-08-24T13:54:05.965Asia/Shanghai',
subject='1.0',
type='type',
extensions={
'aliyuneventbusname': 'BusName'
}
)
resp = client.put_events([request])
print(resp)
print('request id:', resp.request_id)
print('failed entry count:', resp.failed_entry_count)
for entry in resp.entry_list:
print('entry id:', entry.event_id)
print('trace id:', entry.trace_id)
Parameter Specification
'''Config'''
class Config(TeaModel):
def __init__(self):
self.access_key_id = access_key_id # access key id
self.access_key_secret = access_key_secret # access key secret
self.security_token = security_token # Security Token
self.protocol = protocol # http|https
self.region_id = region_id # region id
self.read_timeout = read_timeout # read timeout
self.connect_timeout = connect_timeout # connect timeout
self.http_proxy = http_proxy # http proxy
self.https_proxy = https_proxy # https proxy
self.endpoint = endpoint # endpoint
self.no_proxy = no_proxy # agent whitelist
self.max_idle_conns = max_idle_conns # maximum number of connections
self.user_agent = user_agent # User-Agent
self.socks_5proxy = socks_5proxy # socks5 proxy
self.socks_5net_work = socks_5net_work # ocks5 agency agreement
self.endpoint_type = endpoint_type # ednpoint type:internal,accelerate or null
self.open_platform_endpoint = open_platform_endpoint # endpoint used when the file is uploaded(Not at the moment)
self.type = type # credential type,If you have any questions, please refer to it https://github.com/aliyun/credentials-python/blob/master/README-CN.md
'''RuntimeOptions'''
class RuntimeOptions(TeaModel):
def __init__(self):
self.autoretry = autoretry # whether to enable retry
self.ignore_ssl = ignore_ssl # whether SSL validation is ignored
self.max_attempts = max_attempts # maximum number of retries
self.backoff_policy = backoff_policy # retry the sleep strategy
self.backoff_period = backoff_period # retry the sleep time
self.read_timeout = read_timeout # read timeout
self.connect_timeout = connect_timeout # connect timeout
self.local_addr = local_addr # the local network adapter ip
self.http_proxy = http_proxy # http proxy
self.https_proxy = https_proxy # httpsproxy
self.no_proxy = no_proxy # agent whitelist
self.max_idle_conns = max_idle_conns # maximum number of connections
self.socks_5proxy = socks_5proxy # socks5 proxy
self.socks_5net_work = socks_5net_work # socks5 proxy
Issues
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Changelog
Detailed changes for each release are documented in the release notes.
References
License
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
Metadata
Release files for alibabacloud-eventbridge 1.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| alibabacloud_eventbridge-1.3.8.tar.gz | 28.0 kB | Details |
Release files / alibabacloud_eventbridge-1.3.8.tar.gz
| Download URL | alibabacloud_eventbridge-1.3.8.tar.gz |
|---|---|
| Size | 28.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e82c04365cd83574c0e66e4072a06b5472e8262c0194b999cfef33f873c71a87
|
|
BLAKE2b-256 checksum How to use checksums |
17f1dfe00a9f0d41601b31feb149d67a148a7bbe2b8c8490af2203b601fd8ed5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.2
|