Registry / devops / alibabacloud-gateway-sls

alibabacloud-gateway-sls

JSON →
library0.4.2pypypi✓ verified 84d ago

The Alibaba Cloud SLS Gateway Library for Python provides a gateway client for interacting with Alibaba Cloud Log Service (SLS). This library is part of the Alibaba Cloud SDK ecosystem and handles low-level gateway communication, including authentication and request signing, before delegating to service clients. Current version is 0.4.2, with a mature release cadence.

pip install alibabacloud-gateway-sls
INSTALL
IMPORT
SIG · ALIBABACLOUD-GATEW
A
alibabacloud-gateway-sls
devopspythonv0.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from alibabacloud_gateway_sls.client import Client
Correct import path for the gateway client.

Creates an SLS gateway client using environment variables for credentials.

from alibabacloud_gateway_sls.client import Client import os client = Client( endpoint='cn-hangzhou.log.aliyuncs.com', access_key_id=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', ''), access_key_secret=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', ''), security_token=os.environ.get('ALIBABA_CLOUD_SECURITY_TOKEN', '') ) print('Client instance created successfully')
Debug
Known issues
gotchaDo not confuse 'alibabacloud-gateway-sls' with higher-level service SDKs like 'aliyun-log-python-sdk'. This library is a low-level gateway client, not a high-level SLS service client. Use it only if you need custom gateway-level operations.
fix
For standard SLS operations (e.g., log ingestion, query), use 'aliyun-log-python-sdk' instead.
affects: all
deprecatedThe constructor parameters 'access_key_id' and 'access_key_secret' may be deprecated in favour of using the Alibaba Cloud credential provider chain. Check the latest SDK documentation.
fix
Use CredentialClient or environment variables; refer to the Alibaba Cloud SDK guide.
affects: >=0.4.0
gotchaThe 'endpoint' parameter must include the specific region and service suffix (e.g., cn-hangzhou.log.aliyuncs.com). Using a generic or incorrect endpoint will cause connection errors.
fix
Verify the correct endpoint for your region and SLS service.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Client' from 'alibabacloud_gateway_sls'
Incorrect import path or the library version does not expose a Client class.
fix
Use 'from alibabacloud_gateway_sls.client import Client'
alibabacloud_gateway_sls.exceptions.ClientException: InvalidAccessKeyId.NotFound
Access key ID or secret is incorrect or not set.
fix
Ensure ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are correctly set.
alibabacloud_gateway_sls.exceptions.ClientException: endpoint is not set
The 'endpoint' parameter was not provided or is empty.
fix
Provide a valid endpoint like 'cn-hangzhou.log.aliyuncs.com'.
Upgrade
Version history
0.4.2latest on PyPI · released Apr 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
20
OpenAI (training)
2
Resources
alibabacloud-gateway-sls — pip install alibabacloud-gateway-sls · libregistry