132 lines
7.4 KiB
Plaintext
132 lines
7.4 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"id": "75e8667f-b8d9-4b1d-a119-9babdfc24947",
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"Looking in indexes: https://mirrors.aliyun.com/pypi/simple/, https://pypi.ngc.nvidia.com\n",
|
||
"Collecting aliyun-python-sdk-core\n",
|
||
" Downloading https://mirrors.aliyun.com/pypi/packages/1e/e3/8623c0305022610466ded2b0010a7221e9585046116263dd27cb2e56df36/aliyun-python-sdk-core-2.14.0.tar.gz (443 kB)\n",
|
||
" -------------------------------------- 443.0/443.0 kB 5.5 MB/s eta 0:00:00\n",
|
||
" Preparing metadata (setup.py): started\n",
|
||
" Preparing metadata (setup.py): finished with status 'done'\n",
|
||
"Collecting jmespath<1.0.0,>=0.9.3\n",
|
||
" Downloading https://mirrors.aliyun.com/pypi/packages/07/cb/5f001272b6faeb23c1c9e0acc04d48eaaf5c862c17709d20e3469c6e0139/jmespath-0.10.0-py2.py3-none-any.whl (24 kB)\n",
|
||
"Requirement already satisfied: cryptography>=2.6.0 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-core) (41.0.7)\n",
|
||
"Requirement already satisfied: cffi>=1.12 in d:\\miniconda3\\lib\\site-packages (from cryptography>=2.6.0->aliyun-python-sdk-core) (1.16.0)\n",
|
||
"Requirement already satisfied: pycparser in d:\\miniconda3\\lib\\site-packages (from cffi>=1.12->cryptography>=2.6.0->aliyun-python-sdk-core) (2.21)\n",
|
||
"Building wheels for collected packages: aliyun-python-sdk-core\n",
|
||
" Building wheel for aliyun-python-sdk-core (setup.py): started\n",
|
||
" Building wheel for aliyun-python-sdk-core (setup.py): finished with status 'done'\n",
|
||
" Created wheel for aliyun-python-sdk-core: filename=aliyun_python_sdk_core-2.14.0-py3-none-any.whl size=535295 sha256=319f4d1ebfbba997c6937d76897cfabf74107f17cf39443b590782bb0767cd05\n",
|
||
" Stored in directory: C:\\Users\\meng\\AppData\\Local\\Temp\\pip-ephem-wheel-cache-1m9gv2st\\wheels\\b7\\c5\\b1\\1864d88c500f3e74759e9a607a3d2274d70b9409337da7df81\n",
|
||
"Successfully built aliyun-python-sdk-core\n",
|
||
"Installing collected packages: jmespath, aliyun-python-sdk-core\n",
|
||
"Successfully installed aliyun-python-sdk-core-2.14.0 jmespath-0.10.0\n",
|
||
"Looking in indexes: https://mirrors.aliyun.com/pypi/simple/, https://pypi.ngc.nvidia.com\n",
|
||
"Collecting aliyun-python-sdk-domain\n",
|
||
" Downloading https://mirrors.aliyun.com/pypi/packages/5b/4e/1c7026804b86a470d890f1cf1d5f0f20f6de9521cab7288d935c6d32a302/aliyun_python_sdk_domain-3.14.9-py2.py3-none-any.whl (134 kB)\n",
|
||
" -------------------------------------- 134.6/134.6 kB 4.0 MB/s eta 0:00:00\n",
|
||
"Requirement already satisfied: aliyun-python-sdk-core>=2.11.5 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-domain) (2.14.0)\n",
|
||
"Requirement already satisfied: cryptography>=2.6.0 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-domain) (41.0.7)\n",
|
||
"Requirement already satisfied: jmespath<1.0.0,>=0.9.3 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-domain) (0.10.0)\n",
|
||
"Requirement already satisfied: cffi>=1.12 in d:\\miniconda3\\lib\\site-packages (from cryptography>=2.6.0->aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-domain) (1.16.0)\n",
|
||
"Requirement already satisfied: pycparser in d:\\miniconda3\\lib\\site-packages (from cffi>=1.12->cryptography>=2.6.0->aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-domain) (2.21)\n",
|
||
"Installing collected packages: aliyun-python-sdk-domain\n",
|
||
"Successfully installed aliyun-python-sdk-domain-3.14.9\n",
|
||
"Looking in indexes: https://mirrors.aliyun.com/pypi/simple/, https://pypi.ngc.nvidia.com\n",
|
||
"Collecting aliyun-python-sdk-alidns\n",
|
||
" Downloading https://mirrors.aliyun.com/pypi/packages/71/f4/2f70945b351cbffae37db518ba46f2936cc22d4d4d3969db7f4b5aac0d21/aliyun_python_sdk_alidns-3.0.7-py2.py3-none-any.whl (177 kB)\n",
|
||
" -------------------------------------- 177.1/177.1 kB 5.2 MB/s eta 0:00:00\n",
|
||
"Requirement already satisfied: aliyun-python-sdk-core>=2.11.5 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-alidns) (2.14.0)\n",
|
||
"Requirement already satisfied: cryptography>=2.6.0 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-alidns) (41.0.7)\n",
|
||
"Requirement already satisfied: jmespath<1.0.0,>=0.9.3 in d:\\miniconda3\\lib\\site-packages (from aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-alidns) (0.10.0)\n",
|
||
"Requirement already satisfied: cffi>=1.12 in d:\\miniconda3\\lib\\site-packages (from cryptography>=2.6.0->aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-alidns) (1.16.0)\n",
|
||
"Requirement already satisfied: pycparser in d:\\miniconda3\\lib\\site-packages (from cffi>=1.12->cryptography>=2.6.0->aliyun-python-sdk-core>=2.11.5->aliyun-python-sdk-alidns) (2.21)\n",
|
||
"Installing collected packages: aliyun-python-sdk-alidns\n",
|
||
"Successfully installed aliyun-python-sdk-alidns-3.0.7\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"!pip3 install aliyun-python-sdk-core\n",
|
||
"!pip3 install aliyun-python-sdk-domain\n",
|
||
"!pip3 install aliyun-python-sdk-alidns"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 32,
|
||
"id": "2b5c4f80-5b91-4366-814b-26af5618c099",
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"域名列表 {\"Domains\":{\"Domain\":[]},\"TotalCount\":0,\"PageSize\":20,\"RequestId\":\"1C6E952B-2DAB-538E-B854-85B82203759B\",\"PageNumber\":1}\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"# 加载核心SDK\n",
|
||
"from aliyunsdkcore.client import AcsClient\n",
|
||
"from aliyunsdkcore.acs_exception.exceptions import ClientException\n",
|
||
"from aliyunsdkcore.acs_exception.exceptions import ServerException\n",
|
||
"# 加载获取 、 新增、 更新、 删除接口\n",
|
||
"from aliyunsdkalidns.request.v20150109 import DescribeDomainsRequest,DescribeSubDomainRecordsRequest, AddDomainRecordRequest, UpdateDomainRecordRequest, DeleteDomainRecordRequest\n",
|
||
"# 加载内置模块\n",
|
||
"import json,urllib\n",
|
||
"\n",
|
||
"# AccessKey 和 Secret 建议使用 RAM 子账户的 KEY 和 SECRET 增加安全性\n",
|
||
"ID = 'LTAI5tJwE7yDqpAgsDSLN5AB'\n",
|
||
"SECRET = 'we5xvM3e27dOKNiGlyhYMFPCClFlfh'\n",
|
||
"# 地区节点 可选地区取决于你的阿里云帐号等级,普通用户只有四个,分别是杭州、上海、深圳、河北,具体参考官网API\n",
|
||
"regionId = 'cn-hangzhou'\n",
|
||
"# 配置认证信息\n",
|
||
"client = AcsClient(ID, SECRET, regionId)\n",
|
||
"request = DescribeDomainsRequest.DescribeDomainsRequest()\n",
|
||
"request.set_accept_format('json')\n",
|
||
"response = client.do_action_with_exception(request)\n",
|
||
"response = str(response, encoding='utf-8')\n",
|
||
"print('域名列表',response)\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "b5d8bb40-db6f-4691-ba43-77128f853d36",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3 (ipykernel)",
|
||
"language": "python",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 3
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython3",
|
||
"version": "3.9.18"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 5
|
||
}
|