Model editing API

Jamie Davidson · Friday Demos · November 8, 2024 · 6:20
Try it yourselfThe full week on docsadministrationapimodeling

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. I know we're wildly over but I'll do a quick demo uh too so if folks want to drop please feel free uh I'm going to share my screen um one of the nice things about our representation of a model uh I can move this stuff over um is We have basically it's not just arbitrary text and code it is actually in fact objects so we can actually we have you know internal apis right now that uh augment the model um and I'm just taking a pass that basically uh externalizing some of those those apis too so let me gosh I have to find my terminal can you guys see the terminal too also um so basically what we have is uh and this is gonna

  2. be reviewed hopefully pretty pretty soon um I think it's almost ready but uh Bas crud apis on uh so create update and delete actually no read but but uh uh create update delete for models for topics for views and for fields and individual properties within that just as an example to show you I've written a little script and actually we've got a python SDK that uh hits our query API today but now actually to adding a bunch of endpoints for it uh for for this uh sort of for this new set of apis um and also these new apis will be behind a feature flag to a model model API feature flag just for for folks uh to you know as as we want to

  3. sort of refine it and it's just just as a note too um we're still calling this uh behind like an unstable version of API but you know here we got a model I'm just going to run this this where we're going to update a you know Des the description on the full name field inside this this users's um view it'll run I come back and refresh and it's not super exciting but it's the description that that was just programmatically changed via command line exting yeah and it's it's integrated into the uh like the full system too so like it will be right now our apis are tied to the user that created the API but you can see it's like versioned and and all of

  4. the changes would basically be be as if they were you know done in either the IDE or in the the UI from from a Jamie how does this um interact Vis V get uh it it basically you can't do the changes if you have get uh enabled or pull request required right now we will basically it'll error for the end user um but you should be able to Target a branch right you can Target a branch and it basically it basically respects effectively all of the permissions we've got for our internal apis today um so like you if you have a branch that would allow it you you would want to basically basically push all the changes to a given bran and then merge that

  5. in directly maybe from the UI so so the vision is essentially stack changes by hitting an API to put it in the branch and then do something on the git side to take the branch and actually merge it yeah or or something in rui or something like that too and eventually we could have apis for even merging too if you had certain permissions to be able to go and and do that but but uh you know we I've not exposed that I'm exposing sort of the yeah yeah I get that uh one one place that my mind zooms immediately with this is um like entity attribute value data and um you know creating all of the fields that exist within a key Val table um

  6. we should probably be careful with it to begin with yeah but you AB you absolutely could do it basically this would allow for programmatic the the other uh sort of motivating um piece to is we've had some Partners uh want to write like migration tooling themselves for for it and so like if you go parse say like for example a lookl project you know and go in and understand all of those objects too you can basically go in and programmatically generate stuff or or potentially to uh programmatically generate stuff on a like a per customer basis based on a schema you have an eav or you know you have uh some some measures or some Dimensions that are applicable only for C certain things where

  7. you want to have sort of programmatic configuration of of your owni instance there's a bunch of really cool use cases though Jamie I G have miss this uh is that just for updating like existing Fields I know you said like we have create update delete can we do like full View files for every object so you can create a model you can create a topic you can create a view and you can create a field so like basically the full IDE ideally should should be exposed to but this will be we we've built a lot of these apis to interact with our front end so like there's sort of some implicit uh assumptions B based on that context to I tried to unwind them and

  8. make them a little bit more kind of clean clean but uh but I would not be surpris if there's some uh kind of Quirk quirks there so we just want to it's still unstable behind a feature flag we'll want to work you know work through those Jamie definitely thank you yeah you were referring to sort of like the essentially exposing the API that the workbook hits did you also expose an API for just like slamming yaml or Json in or is that not done yet not not yet I thought I thought about to and I like kind of like that maybe even for the like the migration use case would be probably easier yeah exactly but but today it really is just like you know

  9. we've got a bunch of these Zod schemas that are like for you know the create or update for given object I'm just reusing those not I think those are really useful and interesting in a lot of different ways so yeah I think we're gonna eventually need both yeah definitely and then maybe it's a note to for like the engineers there's a few apis we don't have like for example we can't create or we can't update topics actually period except for in uh in the IDE today uh so like building very simple versions of those to just externalize them too but but uh you know those those will also be need need to be tested