Closed minhtran-agilityio closed 6 years ago
Did you use Aliyun CLI? Try the go version CLI please. https://github.com/aliyun/aliyun-cli
Yes, I tried use aliyun cli with DescribeClusters
but still have the same error above 'list' object has no attribute 'get'
. With other methods still work well.
/assign @jxyowen
@jxyowen Could you please re-check issue content? Seem @minhtran-asnet followed the link you shared above and got an error.
@jxyowen aliyun-python-sdk-cs
have support for region ap-southeast-5
?
@Qingtang-SDK Could you help me?
CS sdk is not supported well, because CS have restful api. We recommend to use CommonRequest. Please visit https://www.alibabacloud.com/help/doc-detail/61476.htm?spm=a2c63.p38356.b99.19.c88c874bVnwJzW
@jxyowen I tried with code below
access_key_id = 'xxx'
access_key_secret = 'xxx'
region_id = 'xxx'
client = AcsClient(access_key_id, access_key_secret , region_id )
request = CommonRequest()
request.set_domain('cs.aliyuncs.com')
request.set_version('2015-12-15')
request.set_uri_pattern('/clusters')
response = client.do_action_with_exception(request)
print('---> response', response)
and have error
I don't have any idea about error. Pls help me about this case, thanks.
Please update your python aliyunsdkcore to 2.8.8 for python3, and 2.8.4 for python2. Visit https://pypi.org/search/?q=+aliyun+python+sdk+core+v3
aliyuncli cs DescribeClusters
, I got and error 'list' object has no attribute 'get'
.
Then I tried to remove this line https://github.com/aliyun/aliyun-openapi-python-sdk/blob/master/aliyun-python-sdk-core/aliyunsdkcore/client.py#L261, it worked.aliyuncli cs CreateCluster
, I got an error { "Message": "{\"code\":\"ErrorJsonDecode\",\"message\":\"code=400, message=Request body can't be empty\",\"requestId\":\"B53E7ED8-55F8-4A29-B2D1-D7A7F3B50F3B\",\"status\":400}", "Code": "SDK.UnknownServerError" }
How to parse params to the request body? Thanks.
A note that I am focusing to create/delete/describe Kuberetes clusters.
Problem is that client.py wants to read RequestId from the body, but there is no request id there. RequestId for cs responses is in the HTTP header: x-acs-request-id
. client.py should be able to handle this.
Workaround is to use client.do_action()
, but that is deprecated.
Why was the issue closed?
When I call
aliyun cs DescribeClusters
have error'list' object has no attribute 'get'
. I'm using python 2.7.5.With call api
aliyun cs GET /clusters
, it shows list[cs] valid operations
. How can I call api?Note: I use aliyun-python-sdk-core>=2.8.2 and aliyun-python-sdk-cs>=2.2.0