Skip to content

Commit

Permalink
added Cloudflare workers
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Feb 15, 2018
1 parent 1477dda commit c7f6759
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions CloudFlare/api_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def api_v4(self):
user_load_balancers(self)
user_load_balancing_analytics(self)
user_virtual_dns(self)
user_workers(self)

# The API commands for /zones/
zones(self)
Expand All @@ -23,6 +24,7 @@ def api_v4(self):
zones_rate_limits(self)
zones_settings(self)
zones_ssl(self)
zones_workers(self)

# The API commands for /railguns/
railguns(self)
Expand All @@ -31,6 +33,7 @@ def api_v4(self):
organizations(self)
organizations_audit_logs(self)
organizations_virtual_dns(self)
organizations_workers(self)

# The API commands for /certificates/
certificates(self)
Expand Down Expand Up @@ -409,6 +412,21 @@ def zones_ssl(self):
setattr(branch, "settings",
self._add_with_auth(base, "zones", "ssl/universal/settings"))

def zones_workers(self):
""" API core commands for Cloudflare API"""

base = self._base
branch = self.zones
setattr(branch, "workers",
self._add_unused(base, "zones", "workers"))
branch = self.zones.workers
setattr(branch, "filters",
self._add_with_auth(base, "zones", "workers/filters"))
setattr(branch, "routes",
self._add_with_auth(base, "zones", "workers/routes"))
setattr(branch, "scripts",
self._add_with_auth(base, "zones", "workers/scripts"))

def zones_load_balancers(self):
""" API core commands for Cloudflare API"""

Expand Down Expand Up @@ -447,6 +465,17 @@ def user_virtual_dns(self):
setattr(branch, "bytime",
self._add_with_auth(base, "user/virtual_dns", "dns_analytics/report/bytime"))

def user_workers(self):
""" API core commands for Cloudflare API"""

base = self._base
branch = self.user
setattr(branch, "workers",
self._add_unused(base, "user/workers"))
branch = self.user.workers
setattr(branch, "scripts",
self._add_with_auth(base, "user/workers/scripts"))

def organizations_virtual_dns(self):
""" API core commands for Cloudflare API"""

Expand Down Expand Up @@ -493,6 +522,17 @@ def organizations_audit_logs(self):
setattr(branch, "audit_logs",
self._add_with_auth(base, "organizations", "audit_logs"))

def organizations_workers(self):
""" API core commands for Cloudflare API"""

base = self._base
branch = self.organizations
setattr(branch, "workers",
self._add_unused(base, "organizations", "workers"))
branch = self.organizations.workers
setattr(branch, "scripts",
self._add_with_auth(base, "organizations", "workers/scripts"))

def account(self):
""" API core commands for Cloudflare API"""

Expand Down

0 comments on commit c7f6759

Please sign in to comment.