Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python xmlrpclib.Fault在使用NetDNA';s API_Python_Api_Xml Rpc_Netdna Api - Fatal编程技术网

Python xmlrpclib.Fault在使用NetDNA';s API

Python xmlrpclib.Fault在使用NetDNA';s API,python,api,xml-rpc,netdna-api,Python,Api,Xml Rpc,Netdna Api,我正在尝试编写一个Python脚本,它将列出我的所有拉区。每次运行脚本时,都会出现以下错误: xmlrpclib.Fault: <Fault 620: 'Method "pullzone.list" does not exist'> 我错过了什么?提前谢谢免责声明:我为NetDNA工作,但我知道这里有一个人知道Python 提前感谢。该方法的名称错误-应该是 sp.pullzone.listZones(apiUserId、authString、日期) 有关api名称,请参阅。该方法

我正在尝试编写一个Python脚本,它将列出我的所有拉区。每次运行脚本时,都会出现以下错误:

xmlrpclib.Fault: <Fault 620: 'Method "pullzone.list" does not exist'>
我错过了什么?提前谢谢免责声明:我为NetDNA工作,但我知道这里有一个人知道Python


提前感谢。

该方法的名称错误-应该是

sp.pullzone.listZones(apiUserId、authString、日期)


有关api名称,请参阅。

该方法的名称错误-应该是

sp.pullzone.listZones(apiUserId、authString、日期)


有关api名称,请参阅。

Perfect。谢谢你,我真的很感谢你的帮助。祝你过得愉快。谢谢你,我真的很感谢你的帮助。祝你过得愉快。
#! /usr/bin/python

from xmlrpclib import ServerProxy
from hashlib import sha256
from datetime import datetime, timedelta
from pytz import timezone

apiKey = 'sldjlskdjf'
apiUserId = '0000'

def pullzoneListZones():
    global apiKey, apiUserId
    date = datetime.now(timezone('America/Los_Angeles')).replace(microsecond=0).isoformat() # Must be 'America/Los_Angeles' always!
    authString = sha256(date + ":" + apiKey + ":listZones").hexdigest()
    sp = ServerProxy('http://api.netdna.com/xmlrpc/pullzone')
    return sp.pullzone.list(apiUserId, authString, date)

print pullzoneListZones()