** this document is intended to be a proposal for the final interface between the Add-ons Engine and a Platform. We can make these changes while maintaining the same interface to our providers and intend to do so. This will allow us to change provisioning without providers ever knowing and allow us to treat changing that API as another project. **
#Platform API
this is the API the Heroku Platform will use to provision an add-on instance.
POST /resources from a Platform (ie, Heroku)
{
"addon" : "memcache",
"plan" : "1GB",
"consumer_id" : "app123@heroku.com",
"options" : {
"backups" : "false",
"logplex_token" : null,
"callback_url" : "https://foo.heroku.com/vendor/apps/app123@heroku.com",
}
}
201 Response to Heroku
{
"resource_id" : "ALKFSDHFO-AKSFJH-ASFDLGKAJHS",
"config" : {"MYADDON_URL": "http://foo.com"},
"message" : "OMG i Love add-ons",
"provider_id" : "ASFD"
}
- Resource ID is the UUID that the Add-Ons Engine has assigned to the resource. The provider id is the id that the provider assigned to the resource during provisioning which, although we (add ons and core) want to deprecate, needs to be provided for backwards compatibility in the /vendor/apps interface. *
Response Codes 201 - Resource Created 503 - unavailable - could not deprovision with provider
DELETE /resources/<resource_id> No body
Response Codes 202 - accepted deprovision request 503 - unavailable - could not deprovision with provider 404 - resource not found
PUT /resources/<resource_id>
{ "plan": "5GB" }
200 Response
{
"config": { "MEMCACHE_URL": "http://addon.com/106410987" },
"message" : "Nice job!"
}
Response Codes:
200 - OK! Plan changed 503 - unavailable - could not change plan with provider 404 - resource not found