如何在Heroku中使用REST旋转Postgresql凭据?

时间:2015-02-02 22:21:15

标签: heroku heroku-postgres

我有一个Heroku Postgres数据库,我想从REST轮换凭据。它在命令行(source)上是微不足道的:

heroku pg:credentials DATABASE --reset

你如何在纯REST中做同样的事情?我能找到的最接近的是获取附加组件的详细信息:

# The ID was obtained from https://api.heroku.com/apps/myexampleapp/addons
curl -n -X GET https://api.heroku.com/apps/myexampleapp/addons/5ebb9a9e-b340-4a62-afb5-de0c99fd0fad \
-H "Accept: application/vnd.heroku+json; version=3"

{
  "config_vars":[
    "HEROKU_POSTGRESQL_AMBER_URL"
  ],
  "created_at":"2015-02-02T11:09:33Z",
  "id":"5ebb9a9e-b340-4a62-afb5-de0c99fd0fad",
  "name":"heroku-postgresql-amber",
  "addon_service":{
    "id":"6c67493d-8fc2-4cd4-9161-4f1ec11cbe69",
    "name":"Heroku Postgres"
  },
  "plan":{
    "id":"062a1cc7-f79f-404c-9f91-135f70175577",
    "name":"heroku-postgresql:hobby-dev"
  },
  "app":{
    "id":"cccccccc-ffff-4444-bbbb-dddddddddddd",
    "name":"myexampleapp"
  },
  "provider_id":"resource8637857@heroku.com",
  "updated_at":"2015-02-02T11:09:33Z"
}

但我没有成功使用POST https://api.heroku.com/apps/myexampleapp/addons/5ebb9a9e-b340-4a62-afb5-de0c99fd0fad/reset或类似方法重置/轮换凭据。什么是正确的命令?

0 个答案:

没有答案