1

I am trying to write a Python script that will list all of my Pull Zones. Everytime I run the script I get the following error:

xmlrpclib.Fault: <Fault 620: 'Method "pullzone.list" does not exist'>

The documentation for List Zones is here: http://support.netdna.com/api/#pullzone.listZones

Here is the script:

#! /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()

What am I missing? Thanks in advance. Disclaimer: I work for NetDNA but know one here knows Python.

Thanks in advance.

1 Answer 1

1

The method is wrongly named - it should be

sp.pullzone.listZones(apiUserId, authString, date)

See http://support.netdna.com/api/#Python for api names.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect. Thank you, I really appreciate your help. Have a good one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.