Skip to content

Commit

Permalink
Merge pull request yola#56 from yola/add-delete-custom-hostname
Browse files Browse the repository at this point in the history
Add CloudFlareService.delete_custom_hostname_by_name().
  • Loading branch information
RayeN authored Dec 12, 2022
2 parents 04c0a87 + 1d6560e commit 8e0adc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 4.1.0
* Add `CloudFlareService.delete_custom_hostname_by_name()`.

## 4.0.0
* Rename `CloudFlareService.remove_account_member()` to
`CloudFlareService.delete_account_member()`.
Expand Down
2 changes: 1 addition & 1 deletion pycloudflare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Python client for CloudFlare."""

__version__ = '4.0.0'
__version__ = '4.1.0'
__url__ = 'https://github.com/yola/pycloudflare'
4 changes: 4 additions & 0 deletions pycloudflare/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ def update_custom_hostname(self, zone_id, hostname_id, **data):
'zones/{}/custom_hostnames/{}'.format(zone_id, hostname_id),
json=data)

def delete_custom_hostname_by_name(self, zone_id, hostname):
hostname_id = self.get_custom_hostname_by_name(zone_id, hostname)['id']
return self.delete_custom_hostname(zone_id, hostname_id)

def delete_custom_hostname(self, zone_id, hostname_id):
return self.delete(
'zones/{}/custom_hostnames/{}'.format(zone_id, hostname_id))
Expand Down

0 comments on commit 8e0adc9

Please sign in to comment.