Comments (6)
请使用新版cli工具 https://github.com/aliyun/aliyun-cli
from aliyun-openapi-python-sdk.
hi @jxyowen ,
目前我们的automation还调用的是python sdk, 请问python sdk是以后都不维护了吗?谢谢!
from aliyun-openapi-python-sdk.
python sdk会继续维护
但是基于python sdk的cli工具不会再继续维护了
from aliyun-openapi-python-sdk.
@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.
BTW, 我尝试使用aliyun online debug工具(https://api.aliyun.com/?#product=Ecs&search=DescribeNet&api=DescribeNetworkInterfaces¶ms={%22RegionId%22:%22us-west-1%22,%22NetworkInterfaceId%22:%22eni-rj9f7rx1lvm8k223ntyn%22}&tab=DEBUG&lang=PYTHON&_=r), 但是也不能得出正确的结果, 同样能查询出TotalCount: 2
from aliyun-openapi-python-sdk.
$ 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)
- aliyun-sdk-core doesn't work with crpythongraphy
- aliyun-python-sdk-core apsara protocol type bug HOT 1
- 我是Python3 安装 缺少 [v20180510] HOT 5
- 云监控 DescribeMetricListRequest 接口超时 HOT 1
- asfdf
- code example运行出错
- Project dependencies. HOT 2
- InvalidNetworkType when executing codes generated from "Preview -> View Open API" HOT 1
- CVE for included urllib3 HOT 3
- Can't override default region for DescribeDBInstancesRequest
- Vendored six package is incompatible with Python 3.12.
- Update aliyun-python-sdk-core.vendored.requests: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 3
- Concerns about new get_uuid() implementation in aliyun-python-sdk-core 2.14.0 HOT 3
- aliyun-python-sdk-core can not install HOT 2
- python3.12 support HOT 6
- Protecode security issue on aliyun-python-sdk-core dependency HOT 1
- python3.12环境,aliyun-python-sdk-core(2.14.0)报错:ModuleNotFoundError,请求支持!
- 调用请求 报 product 找不到 HOT 1
- Cannot import 'aliyunsdkcore.client' on Python 3.13.0a3
- FIPS issue in aliyun-python-sdk-core HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-openapi-python-sdk.