FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
dnspod-python/example.py at master · DNSPod/dnspod-python · GitHub
DNSPod
/
dnspod-python
Public
Notifications
You must be signed in to change notification settings
Fork
77
Star
140
Code
Issues
1
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
dnspod-python
/
example.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (34 loc) · 1.26 KB
Breadcrumbs
dnspod-python
/
example.py
Copy path
File metadata and controls
49 lines (34 loc) · 1.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from
dnspod
import
apicn
def
main
():
# please refer to:
# https://support.dnspod.cn/Kb/showarticle/tsid/227/
login_token
=
"Your TOKEN here"
domain
=
"Your DOMAIN here"
print
"DomainCreate"
,
domain
api
=
apicn
.
DomainCreate
(
domain
,
login_token
=
login_token
)
domain_id
=
api
().
get
(
"domain"
, {}).
get
(
"id"
)
print
"%s's id is %s"
%
(
domain
,
domain_id
)
print
"DomainList"
api
=
apicn
.
DomainList
(
login_token
=
login_token
)
print
api
().
get
(
"domains"
)
print
"RecordType"
api
=
apicn
.
RecordType
(
"D_Ultra"
,
login_token
=
login_token
)
print
api
().
get
(
"types"
)
print
"RecordLine"
api
=
apicn
.
RecordLine
(
"D_Free"
,
login_token
=
login_token
)
print
api
().
get
(
"lines"
)
print
"RecordCreate"
api
=
apicn
.
RecordCreate
(
"www"
,
"A"
,
u'默认'
.
encode
(
"utf8"
),
'1.1.1.1'
,
600
,
domain_id
=
domain_id
,
login_token
=
login_token
)
record
=
api
().
get
(
"record"
, {})
record_id
=
record
.
get
(
"id"
)
print
"Record id"
,
record_id
print
"RecordList"
api
=
apicn
.
RecordList
(
domain_id
,
login_token
=
login_token
)
print
api
().
get
(
"records"
)
print
"DomainRemove"
api
=
apicn
.
DomainRemove
(
domain_id
,
login_token
=
login_token
)
print
api
()
if
__name__
==
'__main__'
:
main
()
Back
|
FazBrowse Home
|
New Git URL