reorganize scripts
This commit is contained in:
parent
60b1f37576
commit
57358a56df
8 changed files with 47 additions and 58 deletions
13
bin/purge_key
Normal file
13
bin/purge_key
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys, fastly
|
||||||
|
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
print "not enough arguments!"
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
_, auth_key, svc_key, purge_key = sys.argv
|
||||||
|
|
||||||
|
api = fastly.API()
|
||||||
|
api.authenticate_by_key(auth_key)
|
||||||
|
api.purge_key(svc_key, purge_key)
|
13
bin/purge_service
Normal file
13
bin/purge_service
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys, fastly
|
||||||
|
|
||||||
|
if len(sys.argv) < 3:
|
||||||
|
print "not enough arguments!"
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
_, auth_key, svc_key = sys.argv
|
||||||
|
|
||||||
|
api = fastly.API()
|
||||||
|
api.authenticate_by_key(auth_key)
|
||||||
|
api.purge_service(svc_key)
|
13
bin/purge_url
Normal file
13
bin/purge_url
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys, fastly
|
||||||
|
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
print "not enough arguments!"
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
_, auth_key, url_host, url_path = sys.argv
|
||||||
|
|
||||||
|
api = fastly.API()
|
||||||
|
api.authenticate_by_key(auth_key)
|
||||||
|
api.purge_url(url_host, url_path)
|
|
@ -1,15 +0,0 @@
|
||||||
import sys, fastly
|
|
||||||
|
|
||||||
def purge_key():
|
|
||||||
if len(sys.argv) < 4:
|
|
||||||
print "not enough arguments!"
|
|
||||||
exit()
|
|
||||||
else:
|
|
||||||
auth_key = sys.argv[1]
|
|
||||||
svc_key = sys.argv[2]
|
|
||||||
purge_key = sys.argv[3]
|
|
||||||
|
|
||||||
api = fastly.API()
|
|
||||||
api.authenticate_by_key(auth_key)
|
|
||||||
api.purge_key(svc_key, purge_key)
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import sys, fastly
|
|
||||||
|
|
||||||
def purge_service():
|
|
||||||
if len(sys.argv) < 3:
|
|
||||||
print "not enough arguments!"
|
|
||||||
exit()
|
|
||||||
else:
|
|
||||||
auth_key = sys.argv[1]
|
|
||||||
svc_key = sys.argv[2]
|
|
||||||
|
|
||||||
api = fastly.API()
|
|
||||||
api.authenticate_by_key(auth_key)
|
|
||||||
api.purge_service(svc_key)
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
import sys, fastly
|
|
||||||
|
|
||||||
def purge_url():
|
|
||||||
if len(sys.argv) < 4:
|
|
||||||
print "not enough arguments!"
|
|
||||||
exit()
|
|
||||||
else:
|
|
||||||
auth_key = sys.argv[1]
|
|
||||||
url_host = sys.argv[2]
|
|
||||||
url_path = sys.argv[3]
|
|
||||||
|
|
||||||
api = fastly.API()
|
|
||||||
api.authenticate_by_key(auth_key)
|
|
||||||
api.purge_url(url_host,url_path)
|
|
||||||
|
|
22
setup.py
22
setup.py
|
@ -1,8 +1,4 @@
|
||||||
import os
|
from setuptools import setup
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
def read(fname):
|
|
||||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="fastly",
|
name="fastly",
|
||||||
|
@ -12,8 +8,8 @@ setup(
|
||||||
description="Fastly python API",
|
description="Fastly python API",
|
||||||
keywords="fastly api",
|
keywords="fastly api",
|
||||||
url="https://github.com/fastly/fastly-py",
|
url="https://github.com/fastly/fastly-py",
|
||||||
packages=find_packages(),
|
packages=['fastly'],
|
||||||
long_description=read('README'),
|
long_description=open('README').read(),
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
|
@ -21,11 +17,9 @@ setup(
|
||||||
"Development Status :: 3 - Alpha",
|
"Development Status :: 3 - Alpha",
|
||||||
"Topic :: Utilities"
|
"Topic :: Utilities"
|
||||||
],
|
],
|
||||||
entry_points={
|
scripts=[
|
||||||
'console_scripts': [
|
"bin/purge_service",
|
||||||
'purge_service = fastly.scripts.purge_service:purge_service',
|
"bin/purge_key",
|
||||||
'purge_key = fastly.scripts.purge_key:purge_key',
|
"bin/purge_url"
|
||||||
'purge_url = fastly.scripts.purge_url:purge_url',
|
]
|
||||||
]
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
Reference in a new issue