Registry / devops / aliyun-python-sdk-cs

aliyun-python-sdk-cs

JSON →
library4.8.1pypypi✓ verified 84d ago

Official Alibaba Cloud SDK for managing Container Service (CS) clusters, including Kubernetes (ACK) and Swarm. Current version 4.8.1, actively maintained with monthly releases.

pip install aliyun-python-sdk-cs
INSTALL
IMPORT
SIG · ALIYUN-PYTHON-SDK-
A
aliyun-python-sdk-cs
devopspythonv4.8.1
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.

AcsClient
from aliyunsdkcore.client import AcsClient
from aliyunsdkcs.client import AcsClient
AcsClient is defined in core, not in the CS module
DescribeClustersRequest
from aliyunsdkcs.request.v20151215 import DescribeClustersRequest

List all CS clusters using DescribeClustersRequest.

from aliyunsdkcore.client import AcsClient from aliyunsdkcs.request.v20151215 import DescribeClustersRequest import json client = AcsClient( os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', ''), os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', ''), 'cn-hangzhou' ) request = DescribeClustersRequest() response = client.do_action_with_exception(request) clusters = json.loads(response) for cluster in clusters: print(cluster['name'])
Debug
Known issues
breakingSDK version 3.x vs 4.x: client initialization changed from `from aliyunsdkcs.client import AcsClient` to `from aliyunsdkcore.client import AcsClient`.
fix
Use aliyunsdkcore.client.AcsClient. Also update all request imports to use versioned paths (e.g., v20151215).
affects: <=3.x
gotchaRegion parameter is mandatory during client creation; it cannot be omitted or set to empty string.
fix
Always specify a valid region ID (e.g., 'cn-hangzhou') when creating AcsClient.
affects: all
gotchaResponse is a bytes object; must be decoded (e.g., json.loads) before accessing fields.
fix
Decode with .decode('utf-8') or use json.loads() directly on the bytes.
affects: all
Errors
Common errors & fixes
AttributeError: module 'aliyunsdkcs' has no attribute 'client'
Attempting to import AcsClient from aliyunsdkcs instead of aliyunsdkcore.
fix
Change to: from aliyunsdkcore.client import AcsClient
aliyunsdkcore.client.InvalidRegionId: InvalidRegionId. Please check your regionId.
Region ID is missing, empty, or invalid.
fix
Provide a valid region ID, e.g., 'cn-hangzhou'. Region IDs are case-sensitive.
TypeError: the JSON object must be str, bytes or bytearray, not 'Response'
Trying to decode the raw response object instead of calling do_action_with_exception.
fix
Call response = client.do_action_with_exception(request) which returns bytes, then json.loads(response).
Upgrade
Version history
4.8.1latest on PyPI · released Sep 23, 2020
Audit
Dependencies
aliyun-python-sdk-corerequiredCore SDK for authentication and HTTP transport
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
aliyun-python-sdk-cs — pip install aliyun-python-sdk-cs · libregistry