martyzz1 / heroku3.py

This is the updated Python wrapper for the Heroku API V3. https://devcenter.heroku.com/articles/platform-api-reference The Heroku REST API allows Heroku users to manage their accounts, applications, addons, and other aspects related to Heroku. It allows you to easily utilize the Heroku platform from your applications.
Other
118 stars 73 forks source link

Can't get the domain info #57

Closed Alir3z4 closed 6 years ago

Alir3z4 commented 6 years ago

heroku3.py version: v3.2.2

How can I get the the hostname/domain info ?

As Heroku Official Docs says https://devcenter.heroku.com/articles/platform-api-reference#domain-info the request should be constructed as:

$ curl -n https://api.heroku.com/apps/$APP_ID_OR_NAME/domains/$DOMAIN_ID_OR_HOSTNAME \
  -H "Accept: application/vnd.heroku+json; version=3"

On heroku3.py I only find App.domain which accepts a **kwargs and even though I pass hostname=somedomain.com to it, it just returns the list of the domains on the app.

for instance:


In [9]: app.domains()
Out[9]: [<domain '*.draft.gonevis.com'>, <domain 'draft.gonevis.com'>, <domain 'gonevis-draft.herokuapp.com'>]

# When passing hostname
In [25]: app.domains(hostname='helooooo')
Out[25]: [<domain 'helooooo'>, <domain 'helooooo'>, <domain 'helooooo'>]

# When passing a valid existing domain
In [26]: app.domains(hostname='draft.gonevis.com')
Out[26]: [<domain 'draft.gonevis.com'>, <domain 'draft.gonevis.com'>, <domain 'draft.gonevis.com'>]

That behavior seems to be bug. Or am I doing something wrong ?