addons icon indicating copy to clipboard operation
addons copied to clipboard

Improve the example payload from Netlify for creating a new instance

Open keiko713 opened this issue 5 years ago • 2 comments

https://github.com/netlify/addons#payload-from-netlify-1 this example payload from Netlify is the following:

{
  // Unique ID generated by Netlify
  uuid: '2e65dd70-523d-48d8-8826-a93229d7ec01',
  account: '5902622bcf321c7359e97e52',
  config: {
    site_url: 'https://calling-site-from-netlify.netlify.com',
    jwt: {
      secret: 'xyz-netlify-secret'
    },
    // User defined configuration values
    config: {
      name: 'woooooo'
    },
    // Netlify Site id
    site_id: '2e65dd70-523d-48d8-8826-a93229d7ec01',
    // Your service ID slug
    service_id: 'express-example',
    service_instance: {
      config: { name: 'woooooo' }
    },
    // If your add-on needs to trigger site rebuilds we will send a build hook
    incoming_hook_url: 'https://api.netlify.com/build_hooks/123xyz'
  }
}

this is unclear what is actually coming and what is just an example. in fact, by default, we don't pass most of them.

also, it's worth to mention that uuid is actually site_id of the netlify, that'd be a useful information for some providers.

cc/ @rybit

keiko713 avatar Jul 05 '19 22:07 keiko713

I think that the uuid should be tied to the instance itself (e.g. it's oid) and then we add site_id right next to the account.

rybit avatar Jul 05 '19 22:07 rybit

I'm +1 fo making site_id for the top level of POST payload (e.g. uuid, account_id, site_id are guaranteed to be there), but I'd like to be careful about the uuid being the different value as some existing addons might be relying on that being a site_id and/or uuid type (oid is not uuid type).

keiko713 avatar Jul 06 '19 21:07 keiko713