aliyun / aliyun-openapi-python-sdk

Alibaba Cloud SDK for Python
Other
1.01k stars 588 forks source link

Have error 'list' object has no attribute 'get' when call aliyun cs DescribeClusters #81

Closed minhtran-agilityio closed 6 years ago

minhtran-agilityio commented 6 years ago

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?

cs-sdk-create-api-error

Note: I use aliyun-python-sdk-core>=2.8.2 and aliyun-python-sdk-cs>=2.2.0

jxyowen commented 6 years ago

Did you use Aliyun CLI? Try the go version CLI please. https://github.com/aliyun/aliyun-cli

minhtran-agilityio commented 6 years ago

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.

huychau commented 6 years ago

/assign @jxyowen

jxyowen commented 6 years ago

Pelase visit https://www.alibabacloud.com/help/doc-detail/71195.htm?spm=a2c63.p38356.b99.266.68273bcdv95bV1

huychau commented 6 years ago

@jxyowen Could you please re-check issue content? Seem @minhtran-asnet followed the link you shared above and got an error.

minhtran-agilityio commented 6 years ago

@jxyowen aliyun-python-sdk-cs have support for region ap-southeast-5?

minhtran-agilityio commented 6 years ago

@Qingtang-SDK Could you help me?

jxyowen commented 6 years ago

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

minhtran-agilityio commented 6 years ago

@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 1__bash__bash_

I don't have any idea about error. Pls help me about this case, thanks.

jxyowen commented 6 years ago

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

huychau commented 6 years ago

How to parse params to the request body? Thanks.

A note that I am focusing to create/delete/describe Kuberetes clusters.

mitjabez commented 5 years ago

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?