Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
enhancement: cdn sites targets retrieving (#41)
Browse files Browse the repository at this point in the history
* cdn sites: targets retrieving

* refactoring
  • Loading branch information
nitr0man authored and sandromodarelli committed Dec 12, 2019
1 parent 54b9fe2 commit 2e3abe7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pystackpath/stacks/cdnsites/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,13 @@ def assign_certificate(self, certificate: Certificates):
certificate = Certificates(self._client, f"{self._base_api}/certificates")
return certificate.loaddict(response.json()["siteCertificate"]["certificate"])

def targets(self):
"""
Get CNAME targets for site
:return: list of CNAME targets
"""
response = self._client.get(f"{self._base_api}/sites/{self.id}/dns/targets")
return response.json()["addresses"]

def scopes(self):
return Scopes(self._client, f"{self._base_api}/sites/{self.id}")

0 comments on commit 2e3abe7

Please sign in to comment.