Giter Club home page Giter Club logo

Comments (6)

jxyowen avatar jxyowen commented on July 20, 2024

请使用新版cli工具 https://github.com/aliyun/aliyun-cli

from aliyun-openapi-python-sdk.

yuxisun1217 avatar yuxisun1217 commented on July 20, 2024

hi @jxyowen ,
目前我们的automation还调用的是python sdk, 请问python sdk是以后都不维护了吗?谢谢!

from aliyun-openapi-python-sdk.

gaort avatar gaort commented on July 20, 2024

python sdk会继续维护
但是基于python sdk的cli工具不会再继续维护了

from aliyun-openapi-python-sdk.

yuxisun1217 avatar yuxisun1217 commented on July 20, 2024

@gaort ,
谢谢! 但是我直接调用sdk的时候也无法查询出正确的结果...可以帮忙看一下吗?谢谢!

cat test.py

#!/usr/bin/env python
#coding=utf-8

from aliyunsdkcore import client
from aliyunsdkecs.request.v20140526 import DescribeNetworkInterfacesRequest

# Init
clt = client.AcsClient('***','***','us-west-1')

# Setting Params
request = DescribeNetworkInterfacesRequest.DescribeNetworkInterfacesRequest()
request.set_accept_format('json')

request.add_query_param('RegionId', 'us-west-1')
request.add_query_param('NetworkInterfaceIds', "['eni-rj9f7rx1lvm8k223ntyn']")
#request.add_query_param('NetworkInterfaceId', 'eni-rj9f7rx1lvm8k223ntyn')

# Sending Request
response = clt.do_action(request)

print request.get_query_params()
print "==========================="
print response

Output:

{'SignatureVersion': '1.0', 'Format': 'json', 'NetworkInterfaceIds': "['eni-rj9f7rx1lvm8k223ntyn']", 'Timestamp': '2018-05-08T06:14:27Z', 'RegionId': 'us-west-1', 'AccessKeyId': '***', 'SignatureMethod': 'HMAC-SHA1', 'Version': '2014-05-26', 'Signature': '***', 'Action': 'DescribeNetworkInterfaces', 'SignatureNonce': '281ed98a-b698-4653-8c28-6ebc3427cc2a', 'SignatureType': ''}
===========================
{"PageNumber":1,"TotalCount":2,"PageSize":10,"RequestId":"6F2E092F-A337-44B7-8CE0-639D2794003C","NetworkInterfaceSets":{"NetworkInterfaceSet":[{"Type":"Secondary","InstanceId":"","PrivateIpSets":{"PrivateIpSet":[{"PrivateIpAddress":"172.20.216.156","Primary":true,"AssociatedPublicIp":{}}]},"ZoneId":"us-west-1b","VSwitchId":"vsw-rj9mxj81k24a3erwqibza","VpcId":"vpc-rj9sfrge64zhe1q1o8qah","AssociatedPublicIp":{},"NetworkInterfaceId":"eni-rj96wbd24ohh7ryvsm4u","CreationTime":"2018-05-08T06:03:56Z","Status":"Available","MacAddress":"00:16:3e:00:ba:35","SecurityGroupIds":{"SecurityGroupId":["sg-rj9f46qhpa7q02u5jl2p"]},"PrivateIpAddress":"172.20.216.156","NetworkInterfaceName":"nic1"},{"Type":"Secondary","InstanceId":"","PrivateIpSets":{"PrivateIpSet":[{"PrivateIpAddress":"172.20.216.155","Primary":true,"AssociatedPublicIp":{}}]},"ZoneId":"us-west-1b","VSwitchId":"vsw-rj9mxj81k24a3erwqibza","VpcId":"vpc-rj9sfrge64zhe1q1o8qah","AssociatedPublicIp":{},"NetworkInterfaceId":"eni-rj9f7rx1lvm8k223ntyn","CreationTime":"2018-05-08T06:02:57Z","Status":"Available","MacAddress":"00:16:3e:00:b6:ea","SecurityGroupIds":{"SecurityGroupId":["sg-rj9f46qhpa7q02u5jl2p"]},"PrivateIpAddress":"172.20.216.155","NetworkInterfaceName":"nic1"}]}}

from aliyun-openapi-python-sdk.

yuxisun1217 avatar yuxisun1217 commented on July 20, 2024

BTW, 我尝试使用aliyun online debug工具(https://api.aliyun.com/?#product=Ecs&search=DescribeNet&api=DescribeNetworkInterfaces&params={%22RegionId%22:%22us-west-1%22,%22NetworkInterfaceId%22:%22eni-rj9f7rx1lvm8k223ntyn%22}&tab=DEBUG&lang=PYTHON&_=r), 但是也不能得出正确的结果, 同样能查询出TotalCount: 2

from aliyun-openapi-python-sdk.

schrht avatar schrht commented on July 20, 2024
$ pip freeze | grep aliyun
aliyun-python-sdk-core==2.13.16
aliyun-python-sdk-ecs==4.19.4

SDK中传入request.add_query_param('NetworkInterfaceIds', "['eni-2zecgyekouc3s4rpcsoq']")后仍然无法得到正确的结果:

{'RegionId': 'cn-beijing', 'NetworkInterfaceId.1': '[', 'SignatureMethod': 'HMAC-SHA1', 'Version': '2014-05-26', 'NetworkInterfaceId.13': 'y', 'NetworkInterfaceId.18': 'c', 'NetworkInterfaceId.19': '3', 'PageSize': '500', 'Format': 'JSON', 'NetworkInterfaceId.14': 'e', 'NetworkInterfaceId.15': 'k', 'NetworkInterfaceId.16': 'o', 'NetworkInterfaceId.17': 'u', 'NetworkInterfaceId.10': 'e', 'NetworkInterfaceId.11': 'c', 'NetworkInterfaceId.12': 'g', 'SignatureType': '', 'NetworkInterfaceId.8': '2', 'NetworkInterfaceId.27': 'q', 'NetworkInterfaceId.6': 'i', 'NetworkInterfaceId.7': '-', 'NetworkInterfaceId.4': 'e', 'NetworkInterfaceId.5': 'n', 'NetworkInterfaceId.2': 'u', 'NetworkInterfaceId.3': '"', 'Signature': 'GTQh2EUXCr5r6MrmwI+T/Z/uaFo=', 'Action': 'DescribeNetworkInterfaces', 'SignatureNonce': '5bf2f592-c9ed-5342-837c-42a4c099c211', 'NetworkInterfaceName': 'cheshi-nic-ac6', 'NetworkInterfaceId.9': 'z', 'NetworkInterfaceId.25': 's', 'NetworkInterfaceId.24': 'c', 'SignatureVersion': '1.0', 'NetworkInterfaceId.26': 'o', 'NetworkInterfaceId.21': '4', 'NetworkInterfaceId.20': 's', 'NetworkInterfaceId.23': 'p', 'NetworkInterfaceId.22': 'r', 'NetworkInterfaceId.29': ']', 'NetworkInterfaceId.28': '"', 'Timestamp': '2020-08-12T01:43:09Z'}

这个问题似乎依然存在,请帮忙看一下,多谢!

from aliyun-openapi-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.