Python第43天 阿里云API简单使用

2019-1-24 11:38:29

阿里云api简单使用

使用

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

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest
client = AcsClient('此次填写ID', '此处填写Key Secret', 'default')
request = CommonRequest()
request.set_accept_format('json')
request.set_domain('domain.aliyuncs.com')
request.set_method('POST')
request.set_version('2018-01-29')
request.set_action_name('QueryDomainList')
request.add_query_param('PageNum', '1')
request.add_query_param('PageSize', '102400')
response = client.do_action(request)
##Python2版本
print(response)
##Python3版本
#print(str(response, encoding = 'utf-8'))
----------------结果-------------------------
{"Data":{"Domain":[{"RegistrationDateLong":1506059362000,"InstanceId":"S20177D12AP59648","DomainStatus":"3","ExpirationDateStatus":"1","DomainAuditStatus":"SUCCEED","ExpirationDateLong":1569131362000,"Premium":false,"ProductId":"2a","ExpirationDate":"2019-09-22 13:49:22","RegistrantType":"1","RegistrationDate":"2017-09-22 13:49:22","DomainName":"xiaoqying.com","DomainType":"gTLD","ExpirationCurrDateDiff":241}]},"TotalItemNum":1,"PageSize":1000,"CurrentPageNum":1,"RequestId":"9AEFE619-AB4A-4FF9-83CF-850726F8636C","PrePage":false,"TotalPageNum":1,"NextPage":false}

给TA打赏
共{{data.count}}人
人已打赏
开发

Python第54天 Celery介绍

2023-9-11 18:33:08

开发

Python第八天 11月22任务

2023-9-11 18:33:22

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索