Quantcast
Channel: OSCHINA 社区最新新闻
Viewing all articles
Browse latest Browse all 59427

CloudXNS API Python SDK V0.3发布,增加对DDNS的支持

$
0
0

大家期待已久的智能DNS产品CloudXNS API 原生的支持了DDNS的API,Python SDK V0.3发布增加对DDNS的支持。

使用方法参考下面的代码:

from cloudxns.api import *
try:
    import json
except ImportError:
    import simplejson as json

if __name__ == '__main__':

    print 'CloudXNS API Version: ', Api.vsersion()
    api_key = '替换自己的API key'
    secret_key = '替换自己的secret key'
    api = Api(api_key=api_key, secret_key=secret_key)

    """
        功能  DDNS快速修改解析记录值
        HTTP请求方式    POST
        URL https://www.cloudxns.net/api2/ddns
        domain:(必选)已存在的完整域名(如主机记录为@时domain是cloudxns.net,为www时domain是www.cloudxns.net)
        ip:(可选)记录IP值(8.8.8.8)或者多个IP值中间用|分割(8.8.8.8|1.1.1.1);为空时IP值由API自动获取客户端IP
        line_id:(可选)线路id(通过API获取),默认值1(全网默认)
    """
    result = api.ddns('ddns.a.com')
    print result

    result = api.ddns('ddns.a.com',ip='8.8.8.8|1.1.1.1',line_id=3)
    print result

Viewing all articles
Browse latest Browse all 59427

Trending Articles