示例:
curl -X POST https://dnsapi.cn/Monitor.Listsubdomain -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 20:14:31" }, "domain": { "id": 2317346, "name": "testapi.com", "punycode": "testapi.com", "grade": "D_Plus", "owner": "api@dnspod.com" }, "subdomain": [ "@" ] }
示例:
curl -X POST https://dnsapi.cn/Monitor.Listsubvalue -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346&subdomain=@'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 20:19:05" }, "domain": { "id": 2317346, "name": "testapi.com", "punycode": "testapi.com", "grade": "D_Plus" }, "points": { "max": 999, "list": { "ctc": "电信", "cuc": "联通", "cmc": "移动" } }, "records": [ { "id": "16909160", "area": "默认", "value": "119.180.24.194" } ] }
示例:
curl -X POST https://dnsapi.cn/Monitor.List -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 20:48:02" }, "info": { "total_count": 1, "down_count": 0 }, "monitors": [ { "monitor_id": "281ecb9e-3635-11e2-bab7-0819a6248970", "domain": "testapi.com", "domain_id": "2317346", "domain_grade": "D_Plus", "record_id": "16909160", "sub_domain": "@", "record_line": "默认", "ip": "119.180.24.194", "now_ip": "119.180.24.194", "host": "testapi.com", "port": "80", "monitor_type": "http", "monitor_path": "/", "monitor_interval": "360", "points": "ctc,cuc,cmc", "bak_ip": "auto", "status": "Ok", "status_code": "200", "sms_notice": "me", "email_notice": "me", "less_notice": "yes", "callback_url": "", "callback_key": "", "monitor_status": "enabled", "created_on": "2012-11-24 20:47:51", "updated_on": "2012-11-24 20:47:51", "bak_ip_status": [ ] } ] }
公共参数
domain_id 域名编号,必选
record_id 记录编号,必选
port 监控端口,比如80,必选
monitor_interval 监控间隔,支持{60|180|360|},必选
host 监控主机头,比如 www.dnspod.cn,必选
monitor_type 监控类型,支持{http|https},必选
monitor_path 监控路径,比如/,必选
points 监控节点,用,分隔多个,只能选择列表中的节点,并且有数量限制,必选
keep_ttl {yes|no} 宕机切换后是否修改ttl,可选,默认为 no
sms_notice 短信通知,me域名所有者,share共享用户,用,分隔多选择,比如me,share, 可选
email_notice 邮件通知,me域名所有者,share共享用户,用,分隔多选择,比如me,share,可选
less_notice {yes|no}是否一个小时内只发一次通知,可选
callback_url 可选,回调URL,宕机了会将相关的参数提交到此设置的URL,具体参考回调URL说明,可选
callback_key 可选,回调密钥,如果设置了回调URL请设置此参数以保证安全,可选
示例:
curl -X POST https://dnsapi.cn/Monitor.Create -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346&record_id=16909160&port=80&monitor_type=http&monitor_path=/&monitor_interval=360&points=ctc,cuc,cmc&bak_ip=pass&host=testapi.com'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 21:25:30" }, "monitor": { "monitor_id": "6aac176e-363a-11e2-bab7-0819a6248970", "record_id": 16909160 } }
公共参数
monitor_id 监控编号,必选
port 监控端口,比如80,必选
monitor_interval 监控间隔,支持{60|180|360|},必选
monitor_type 监控类型,支持{http|https},必选
monitor_path 监控路径,比如/,必选
points 监控节点,用,分隔多个,只能选择列表中的节点,并且有数量限制,必选
host 监控主机头,比如 www.dnspod.cn,可选
keep_ttl {yes|no} 宕机切换后是否修改ttl,可选,默认为 no
sms_notice 短信通知,me域名所有者,share共享用户,用,分隔多选择,比如me,share, 可选
email_notice 邮件通知,me域名所有者,share共享用户,用,分隔多选择,比如me,share,可选
less_notice {yes|no}是否一个小时内只发一次通知,可选
callback_url 可选,回调URL,宕机了会将相关的参数提交到此设置的URL,具体参考回调URL说明,可选
callback_key 可选,回调密钥,如果设置了回调URL请设置此参数以保证安全,可选
示例:
curl -X POST https://dnsapi.cn/Monitor.Modify -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346&monitor_id=51fc9a20-363c-11e2-bab7-0819a6248970&port=80&monitor_type=http&monitor_path=/&monitor_interval=360&points=ctc,cuc,cmc&bak_ip=pass'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 21:41:31" } }
示例:
curl -X POST https://dnsapi.cn/Monitor.Modify -d 'login_token=LOGIN_TOKEN&format=json&monitor_id=51fc9a20-363c-11e2-bab7-0819a6248970'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 21:51:49" } }
示例:
curl -X POST https://dnsapi.cn/Monitor.Info -d 'login_token=LOGIN_TOKEN&format=json&monitor_id=e91997aa-3641-11e2-bab7-0819a6248970'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 22:19:58" }, "info": { "monitor_id": "e91997aa-3641-11e2-bab7-0819a6248970", "domain": "testapi.com", "domain_id": "2317346", "domain_grade": "D_Plus", "record_id": "16909160", "sub_domain": "@", "record_line": "默认", "ip": "119.180.24.194", "now_ip": "119.180.24.194", "host": "testapi.com", "port": "80", "monitor_type": "http", "monitor_path": "/", "monitor_interval": "180", "points": "ctc,cuc,cmc", "bak_ip": "pass", "status": "Ok", "status_code": "200", "sms_notice": "me", "email_notice": "me", "less_notice": "no", "callback_url": "", "callback_key": "", "monitor_status": "enabled", "created_on": "2012-11-24 22:19:09", "updated_on": "2012-11-24 22:19:09", "bak_ip_status": [ ] } }
示例:
curl -X POST https://dnsapi.cn/Monitor.Setstatus -d 'login_token=LOGIN_TOKEN&format=json&monitor_id=03e3b268-3643-11e2-bab7-0819a6248970&status=disable'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 22:33:20" } }
示例:
curl -X POST https://dnsapi.cn/Monitor.Gethistory -d 'login_token=LOGIN_TOKEN&format=json&monitor_id=03e3b268-3643-11e2-bab7-0819a6248970&hours=1'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 22:40:02" }, "domain": { "id": "2317346", "domain": "testapi.com", "domain_grade": "D_Plus" }, "record": { "id": "16909160", "sub_domain": "@", "ip": "119.180.24.194" }, "monitor_history": [ { "data": { "message": "ok", "code": 200, "data": [ { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:28:31", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:31:31", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:34:31", "responsetime": 999 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:37:31", "responsetime": 1 } ] }, "point": "ctc" }, { "data": { "message": "ok", "code": 200, "data": [ { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:28:52", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:31:52", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:34:52", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:37:52", "responsetime": 0 } ] }, "point": "cuc" }, { "data": { "message": "ok", "code": 200, "data": [ { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:30:07", "responsetime": 1 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:33:05", "responsetime": 0 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:36:06", "responsetime": 1 }, { "status": "Down", "status_code": -3, "createtime": "2012-11-24 22:39:06", "responsetime": 1 } ] }, "point": "cmc" } ] }
示例:
curl -X POST https://dnsapi.cn/Monitor.Userdesc -d 'login_token=LOGIN_TOKEN&format=json'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 22:50:14" }, "desc": { "unmoniting_count": 3, "moniting_count": 1, "down_count": 1 }, "user": { "max_count": 28, "use_count": 1 } }
示例:
curl -X POST https://dnsapi.cn/Monitor.Getdowns -d 'login_token=LOGIN_TOKEN&format=json&offset=0&length=10'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2012-11-24 22:54:03" }, "info": { "total_count": "1" }, "monitor_downs": [ { "monitor_id": "03e3b268-3643-11e2-bab7-0819a6248970", "host": "testapi.com", "record_line": "默认", "ip": "119.180.24.194", "warn_reason": "连接超时|访问您主机时连接超时,并且重试了5次后依然超时,建议您检查下你的服务器是否有网络不稳定的情况移动:timed out网通:timed out电信:timed out", "switch_log": [ ], "created_on": "2012-11-24 22:30:06", "updated_on": "0000-00-00 00:00:00" } ] }