heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
213 stars 86 forks source link

Missing get config for addons #42

Closed abtris closed 8 years ago

abtris commented 8 years ago

I try get config from heroku addon.

This is relevant only for some addons for example deploy hooks and I can get url for check if is right.

heroku = PlatformAPI.connect_oauth(ENV['API_KEY'])
APP = 'myapp-uniq-name'
ADDON = 'DEPLOYHOOKS_HTTP'
ADDON_NAME = 'building-softly-5771'

# I try all this things but URL for isn't there
heroku.addon_service.info('deployhooks')
heroku.addon_attachment.list_by_app(APP)
heroku.addon_attachment.info_by_app(APP, ADDON)
heroku.addon.info(ADDON_NAME)

Update: I found some of them in config_vars but doesn't declare in addon info. It's possible get them directly? For example at deploy hooks (http, email) missing DEPLOYHOOKS_HTTP_URL

{
  "config_vars": [

  ],
  "created_at": "2015-04-21T04:39:17Z",
  "id": "<uuid>",
  "name": "<name-id>",
  "addon_service": {
    "id": "<uuid>",
    "name": "deployhooks"
  },
  "plan": {
    "id": "<uuid>",
    "name": "deployhooks:http"
  },
  "app": {
    "id": "<uuid>",
    "name": "myapp"
  },
  "provider_id": "15892",
  "updated_at": "2015-04-21T04:39:17Z",
  "web_url": "https://addons-sso.heroku.com/apps/apiary/addons/<uuid>"
}
geemus commented 8 years ago

There isn't really an explicit way to get back the config passed in at present, but you can see the config set by the add-on via https://devcenter.heroku.com/articles/platform-api-reference#add-on-config. Hope that helps.