dpetzel/python-ccuapi

Any particular reason why purging by CP Code isn't supported?

Closed this issue · 9 comments

Any particular reason why purging by CP Code isn't supported?

I'm sure it would be simple enough to add. I don't have access to the API docs at this point. If you can share them I'm happy to take a crack at it, or feel free to fork the repo and patch it. I'd be more than happy to merge that in.

I'll email you the sample code that Akamai offers. They don't have a detailed description of their API but their sample code offers insight. I would try to do it myself but I'm running out of time with what I'm doing now and have very little experience with the Python language, that it would take me a while to add the necessary changes. Thanks.

Check out this new branch https://github.com/dryan/python-ccuapi/tree/cp-code-support and see if that does it for you.

$ ccu_purge -s --type=cpcode -u ../cpcodes.txt
There was an error making the purge request: You are not authorized to purge this ARL:
Traceback (most recent call last):
File "/Users/dfuentes/Documents/working/lnlabs/python-ccuapi/bin/ccu_purge", line 8, in
load_entry_point('ccuapi==0.4.0', 'console_scripts', 'ccu_purge')()
File "/Users/dfuentes/Documents/working/lnlabs/python-ccuapi/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 318, in load_entry_point
File "/Users/dfuentes/Documents/working/lnlabs/python-ccuapi/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2221, in load_entry_point
File "/Users/dfuentes/Documents/working/lnlabs/python-ccuapi/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1959, in load
ImportError: <module 'ccuapi.ccu_purge' from '/Users/dfuentes/Documents/working/lnlabs/python-ccuapi/lib/python2.7/site-packages/ccuapi/ccu_purge.pyc'> has no 'main' attribute

its still thinking its an ARL

Well since I'm unable to test it myself to debug I'm afraid it will have to stay as is. 

dryan

On Thu, Sep 12, 2013 at 6:18 PM, dfuentes77 notifications@github.com
wrote:

its still thinking its an ARL

Reply to this email directly or view it on GitHub:
#3 (comment)

I've submitted a PR for the changes needed to get it to work. Thanks for the initial config changes. There was just a couple of lines that needed to be added. I also found out that it was always using the "production" domain, so I removed the "--production" and "--staging" param options and just made a "--domain" that you can pass either "staging" or "production", which now works. With the help of a colleague, I also fixed the traceback that would always output with the error "ccuapi/ccu_purge.pyc'> has no 'main' attribute". Now it outputs cleaning with:

$ ccu_purge -d staging -t cpcode -u ../cpcodes.txt
1 URL or CPcode[s] will be purged within 7 minutes

Thanks!

Are there plans to implement clearing by CP code? It seems the solution never got merged back into the project