Refreshing Linode Spoke for Hacktoberfest - Live Coding Happy Hour for 2020-10-02
[Music] do [Music] hello and welcome to live coding happy hour on this fine october 2nd 2020. i'm your host andrew barnes joined with an awesome crew of folks today and we'll jump right into the intros with brad hey everybody brad tilton i'm a developer advocate with the developer program here at servicenow i've been developing on the platform for about 12 years as a customer partner trainer and employee employee for the last four and i am really excited to be here with uh with our crew today and chris yeah nice to meet everybody i'm chris i actually just hit my ninth uh birthday here at servicenow so i've been here nine years and i am a manager of product management so hoping to have some fun of of what product chris oh yeah so uh i didn't want to steal josh's thunder but we're both on the integration hub product i focus mainly on inbound and spokes awesome and josh nerius no stranger to the show yeah i'm josh uh it's been a while i'm really excited to be back um i'm a product manager as chris still my thunder thanks chris on the integration hub team mostly focused on outbound so this is really the core components chris makes the spokes happen i make the tools happen that make the spokes happen so we work very closely with each other and uh yeah i'm excited to be on this crew today all right and another former dev advocate from this team no stranger at all to the show it's the former duo there with uh josh and dave slusher hey everybody i'm dave slusher i am a software engineer on the integration hub team which uh sounds like i develop software but i do almost exactly the same thing i did when i was in the dev program uh i just do it specifically for integration hub now and josh was too modest to call it out but josh and i were the founders of this program that we pulled out of our ass like four years ago on a thursday and we said let's do this tomorrow and then the history was made all right thanks dave and i'm andrew barnes developer advocate here at servicenow i've been uh developing on the platform for a little over six years i've been at servicenow for two years uh definitely not anywhere near the uh the nine years uh anniversary and and uh six and 12 years on the platform brad's got uh but but i have fun on it um so let's quickly introduce our drinks of choice today brad what do you got all right i i'm really excited about today i found this dragon's milk white so i love the normal dragon's milk i have not tried this yet but it's a barrel aged white stout so hopefully i i'm making a trip to brad's i need some of that what do you have chris so i'm gonna go a little off script here guys i i'm a home brewer so normally it's beer is my drink of choice but today i'm going with just some you know costco version of red wine i i know you can't see it very well but it's uh i can't even say it it's a chianti some italian name but and what'd you bring to the table josh so i have a beguile flannel pajamas oatmeal stout um the guile's a brewery here in chicago it's just like a mile from me and it's been in my fridge since last winter so it's a it's canned aged yeah what did you bring dave i think i'm gonna have this breckenbach which i've never heard of i picked up just because i'd never seen it at aldi's yesterday um which is where practically every beer i've drank on this show for about two years comes from all these because i don't get to a fancy beer store in a solid area with chris i was considering the kirkland brand session ipa but i'm going to go with the breckenbach just so that he's not the only one drinking kirkland brand it was certainly certainly on the table man and so i am i am fully out of beers this is the last beer in the house uh yingling uh it's traditional lager which is a tasty beer i almost went off uh off brand and uh grabbed a whiskey but uh the vote from the crew said drink the beer so i'm drinking the beer uh so there's a case to be made why not both i mean i'm not driving on the show today so uh that very well may happen uh so before we jump into it uh to let you know it's october and that means hacktoberfest so those two fine gentlemen josh and dave previously started our engagement with working with hacktoberfest which is a open source encouragement invent uh hosted by digitalocean um and the way it works is you go to github any of the public repositories there if you submit for pull requests that don't get marked as spam that's a very key point don't go just adding some comments to uh a thing and calling it a pull request because that's spam uh you get some swag from digitalocean there's also some virtual events hosted on the hacktoberfest.com site so you go there register find some events do some queries on github for an open source project that you're willing to contribute to and here at servicenow on the developer site developer.servicenow.com in our blog you'll find we have two focuses for this year last year was spoketoberfest and it was all about spokes this year we're doing half spokes and half now experience so if you want to add to the area of josh dave and chris an integration hub spokes you can go and contribute to some existing spokes and enhance them or build your own then in the now experience land we're also building components and collaborating on those so you'll find two different github orgs that will have repos that you can contribute to or create new repos in and collect contributions from others as well as yourself there and uh with that i'll hand it over to dave who will walk us through what we're gonna do today so how about this even before we do that let's tell the quickly the story of how hacktoberfest was uh absolutely in two was it 2017 josh seemed like it would either it seems like 17. it hadn't been sounds about right we were in github universe we went we both went to github universe uh in dog patch in san francisco it was like october 11th and 12th or something it was well into the month and the second day between the first and the second day we were watching from our airbnb to the event space and josh said i think i figured out a way that we could uh merge update sets from uh github that we could do some we could do some magic to make that a github pull request actually kind of acceptable and like uh vetoable and like do all the sorts of things that are very difficult since servicenow update sets are like versioned uh checksum xml you can't just do your standard github textual merge like you would with java code or anything any other code really and so the second day we really didn't get that much out of uh github universe because we're both coding frantically on our like every session we went to we had our laptops and we're like trying to build this thing because we said if we run into any technical problems we have github engineers right there that we can talk to and in fact we talked to them about the graphql something that wasn't working and uh they talked us through it and so we kind of validated that so we didn't really get much from the sessions but we built the mechanism that allows hacktoberfest to work for servicenow uh that second day at github universe that's how it happened and i'm pretty sure we talked to some of the digital ocean people there too if i remember correctly so it was this combination of how are we here doing this thing and all the people that are related to the thing we're doing are all still here too so that was that was pretty cool all right so hey dave can you check your microphone you seem a little low okay you in the right mic um maybe not uh so actually andrew while i check this why don't you uh he says why don't i do something all right i'll do this why don't you tell us about how spoketoberfest specifically was absolutely so spoketoberfest uh came into fruition because uh dave and i were in india visiting with our great developers there and we were giving some workshops for customers and partners there and we ran into one of chris and josh's peers in the engineering org and over some drinks we were talking about the plan to get a bunch of spokes for 2020 um and his group the his his group was the engineering group in charge of that and uh we said well ah october's coming up we haven't picked a thing for october why don't why don't we do spokes and this was like september 25th something like oh yeah because that's how we roll like this was this was right before uh october happened and we were like hey we could do spokes we could make it oktoberfest and then and then we had spoketoberfest and we even had uh live events because we had live events then and i traveled to minneapolis and went to one of our developer meetups there and we taught some people how to build spokes and we had everyone there submit a pr while they were there at that event and digitalocean sent a whole event package of swag that was great uh as well as some servicenow partners so that was a ton of fun with one of our mvps jase benson who's that meetup organizer so are you ready for a screen share dave i am ready all right so let me it's been so long since i've done this anybody remember how to do the whole deal all right so verify that everything is copacetic and you want it a little bigger probably maybe one bigger something like that i guess i'm probably gonna have to do that page by page so just remind me if it gets too small at any point all right already um so now what i'm gonna do is uh show you guys this is like what's left over from last year this is kind of we did um did the basics for linode and here's why i did linode it's not um it's not particularly enterprisey it's really more of a consumer uh grade cloud so it is doubtful but not impossible that any of our customers use this right typically they would use some of the bigger uh the bigger more robust providers you know at the enterprise scale but the things that make this work is that they have a really really good um open api specification and we found that they they were just so uh super easy to um to use so uh what we originally did and that was the very first time we did this we got and i'm trying to remember how many endpoints there's like a hundred endpoints in this api and it took you know there's a lot we're gonna we're gonna see this because they've revved the uh they've revved this since last year so let me just show you the run down the 10 that we built so a couple of these things are data gathering actions so um get regions for example um let me show this this thing exists if you i did just minimal setup to make sure i had a auth token and everything so that i can hit it so this is a data data gathering action that would be used to drive a dynamic input so when you run this thing you get this uh packet back out which as you can see this format is very important you get this data this chunk of data which is an array of json objects that are name and label so this is what you see in the ui and this is kind of the this is essentially the id of it this name is the value and label is the that what shows up on the ui now here this is a very good um a very good indicator for the value of the dynamic inputs because there is one on here that didn't used to somewhere in here is india this didn't exist when we did this uh last year uh all right so uh the you know this is the whole reason why one uses dynamic inputs is for things that change just a little bit over time um you don't want to have to commit code that changes that or you don't want to have to go into an action and change a choice list and add another thing uh because a new one exists right you if that can be served by an api you get it from the api and then uh then at design time when you're building a flow you now uh will get those choices and so uh when i did the the workshop for knowledge 20 um the example i i used a really goofus example where i showed countries and i showed what czechoslovakia and the ussr and i think the ottoman empire or some you know i mean even like the list of countries in the world changes over time and so this is not a thing you ever want to have to commit code to do something that changes once every three years right just let the api do so we have this kind of thing we have uh you know so there's a very similar one which should be get vm types let me just demonstrate that one right quickly um and this uh this is gonna change more often than uh you know much more often than hosting centers right it's kind of expensive and arduous to set up a new hosting uh a new hosting center however this right here uh these change quite frequently right they may add a new kind of vm type and etc etc so i've got a couple of these data gathering actions and then i've got some basic um uh operations which is create a new vm you can start a vm shut down a vm delete a vm you can uh you know get images and i think images i believe is going to be this is another one of those data gathering actions for uh for a dynamic input and i believe that this is uh like all the distributions that you could do yeah so you can do slackware or mint or arch linux et cetera et cetera so when you want to create one of these things we'll open that and if you mind if i just pipe in real quick so you guys might see in spokes as well we call these just metadata retrieval actions so i know you're you're calling them data retrieval or whatever but uh in case you see it in the spoke that's exactly what we're doing we're you know populating choice list with the api response instead of hard-coding it right and so this like this create you can see now uses all three of those things because that's kind of like the minimum definition of i'm going to start a vm where what machine and then what os am i going to put on this thing right and that's like the very minimum and if you were going to test this thing you'll notice that it's kind of spinning and you know i want to put it in central canada the smallest one with you know whatever centos gentoo i don't care right and so um and in fact let's just go ahead and test this one time just to verify that we haven't bit-rotted this thing in the last year um and if i come over here so i don't know very easily could have happened if the uh if we didn't have those uh dynamic metadata retrievals right oh yeah i could totally be picking a thing that isn't there anymore right right um so where which one of these am i visioning scheduled oh did it yeah it was there it is okay all right victory was had all right everybody go home victoria's head no that's just this is just baseline but brother we haven't even started this is this is remediation so anyway that so that works right so now what we're gonna do is step one of the whole thing and if we look at this it should see probably effectively like the end of this thing and so uh if you really want to be an eagle eye this won't last long enough i think for anyone to grief it but you'll notice like one of the outputs of this thing is like what it's genera i believe that in my um action i just generate a random root password and then that's one of the things you tell it like okay so then the output here is here's the ip address here's the id which is a internal line ode uh here's the label of it so this is like you see that that's the name that you see over here that line node two seven blah blah blah blah and then uh over here is the root password and so given those things these are now you know like if you have a flow those would now be pills that you can use on further things so if for example like the next step was going to be some sort of like an ssh step uh you know an action that does some kind of ssh you can pass the password along to it so when we look at where we are we have get my vms get statistics create stop start run a command get images and to be honest i don't even remember if run a command worked i think maybe that is a thing that we stopped in the middle i think we stopped on it and it yeah it wasn't working when we stopped that's that seems entirely plausible in fact uh it's in published state i probably would i maybe not um out of curiosity um so ip address user yeah well let's not let's not worry about this so now um we have some things to think about which is um the very first the first thing i want to do let me clear some of this out while i talk um is i'm going to re-import the um re-import the open api now this actually is something i have never done we're going to do this on here the first time which is take a take uh an integration that i have in uh that i've imported the open api spec and then re-implement a subsequent revision of the same api so this is a completely untested ground i'm presuming that i'm just going to get another option in the drop down that's um that's that's my least surprise option is that it will create me a second new one and i can just choose from that one right and that they will look i'll give you a quick warning if you try to import the same api you will get an error but if it's different different version then you'll be okay so why what's the definition of same api the same router uh yeah the same the same earl would might do it let's just let's just try it out and see yeah let's try okay so and i'm going to do this from any one of these things [Laughter] this is my it's 10 minutes to quitting time so let's say my calendar the weather oh that's that's correct and then oh it's going to also driven by integration hub yes you'll see the version is on the ap well and then you'll see i i can't really make out the song it is 10 minutes of billy squire alexa stop alexa stop uh now now you're invoking everybody else's alexa stop that's why we have headphones i turned the mic off but i forgot entirely about my uh timed automation all right okay so now what we need to do so this will be interesting i like i said and so we have some this is non non uh slam dunk but let me come over here to the lino'd stuff and um in the api docs i try to have as much of this locked and loaded as i have um where is the open api here it is so josh or chris while he he's loading that why don't you tell us what uh open api is all about yeah i can jump in here uh so it's really the easiest comparison is like comparing it to soap wizal but for rest it's just a definition a contract that most api developers will build describing what their apis do and so we're just using that definition it could be in json yaml i've seen multiple formats of this but we read it in and then we try to populate what those apis do is the best we can right so this one is yaml um here's the deal so you might chris this might be the deal is this is probably identical earl to the previous spec because like what we have in there is i think 4.50 it says it down there i think you'll be okay as long as the version in the open api spec is different than what you did before but let's say so i can show you over here you're saying that this as long as this number is different it will be fine yeah okay all right well let us see i would take a bet but i just don't have a i know you're a gambling guy dave so i'm sure you would i think it's going to work no can't ask this uh oh no that looks like a oh that looks like an error in the import itself do you remember me saying so i was telling earlier uh in the pre-show about how the the open api we used in the uh knowledge lab for uh for dynamic inputs used the um uh or building your first spoke we used open api and it used a local um yaml that you would download from like the doc site that was because i had to edit that thing by hand to make it work for our implementation so if they don't follow the the the definition and how to write those correctly we could have errors trying to import can you yeah paste it instead of download from url maybe that might fix it well i mean i think what i would have to do uh object storage buckets cluster id operation id so i would probably have to go in there and find that thing yeah it looks like you're saying something about something being duplicated like it's yeah so i think what it's gonna and i and i absolutely saw this in the london transit uh authorities um open api spec is that they they literally had a thing in there twice and when he did it made it error out so that um that is not what i'm gonna uh not what i wanna fight today so the way that you would get around this the way that i got around this the last time i saw it is that i did exactly what chris was just saying is i would i took this thing and then just thing by thing um i fixed the open api spec and then so the way that i would make that happen is instead of doing this where you uh import it from an earl you have another option which is manually populate and you can put it in here that's what i that's what he was suggesting and that's what this is completely doable this is what we had to do in the lab for exactly this reason so uh that part failed so we're just going to go with what we already have so what we can do now at this point um remind me not to say this because what we're going to do is just look at what exists in here okay so this is what is from the previous open api spec that we pulled down so you notice that you have a whole lot of operations available up to and including some of these are vm operations some of these are your account operations like you can change the credit card on the account from this thing you can um you can attach a volume so you could create um effectively you could create a second disk hard drive second virtual hard drive and then you could say uh i want to have two disks on there and attach you know essentially mount the like i'm guessing attach is probably different than mount but and you'll notice there are so many that it has to um it has to like you know yeah i don't see them um uh let's see what all is in volume do i have to do a star volume i probably do so attach volume create volume detach list volume update um yeah i'm guessing attach actually probably um is the same as mount but anyway so given this we could let's uh since we're not going to re-import the api and so if there's anything different we're effectively talking to the previous version what would be a thing let's kind of peruse this and let's find some things that we can add to this um boot into rescue mode wouldn't be terrible although we probably want something with enough juice to it that it's not like that one's i think has no real it's like a success fail so let's find something let's find something actually that we could put in there with something else and is there a copy um uh there's a clone yeah is there a clone you can clone the whole thing vm yeah yeah clone line so effectively linode terminology means vm in the context here it get that can actually be a little surprising so when you see the because this is not how i think about it and you'll notice i'm pretty sure that i um you'll notice i don't use their terminology you'll notice we have create vm not create line so i have i have already done that translation for you into what i find more natural so okay so fair enough let's do a clone line ode from there um i'm sure that this thing should be fine up and running in toronto which is where i picked it so let's go ahead and let's just create ourselves a new action and let's call it clone vm we want it in the line node spoke um i don't know if i have categories for the other stuff probably no i do look at that look at that category and everything uh and what's the thing you called uh chris you said is metadata retrieval what was it yeah so if you download spokes and you see metadata retrieval actions it's just like what you said they're just look up values for like our dynamic okay have we so we changed the terminology because i think we rolled it out as data gathering but the metadata retrieval is now the yeah data gathering is fine for this demo no problem okay all right so this one is vm okay i just did i actually was not aware of that one okay so um really the input we would need is if we're gonna clone probably is just um let's call it let's say the id of the well let's not say that let's figure out what the heck this thing needs um so lino's well the uh well if you just do the the rest step on it yeah so this is what i was thinking well this is what i was saying is that yeah it will so line node id so i just uh wanted to do the input first but yeah i totally if i had done that first and come back i totally could have done that so let's say before you do the input dave there might be a there might be a secret sideways thing that shows up just by doing it from the rest step like is that right chris yeah that's what i was trying to say is oh walk me through the magic yeah if you do the rest step because you're pulling it from the open api spec if it has inputs that it has to have those will get declared automatically for your action is what's supposed to happen all right so then what we want to do is so we want to do clone clone line ode which has the node id and look at your input variables over on the data page yeah they got they got defined interesting all right so now um and is there anything i need from this let me go back and look at the dock right quick it's going to return oh you also have to give it region and type um in the request body schema backups enabled so we have some optional stuff uh well i know what id if an existing line ode okay so that's actually you know something weird about this in the body parameters you see this line node id but the required path parameter so what happens if the line node id in the body is different than the one in the path parameter that's very odd to me but uh it seems weird yeah yeah we'll just assume that that's uh an oversight or something i'm going to guess that they're used to not that it used to not be in there and somebody just forgot to take it out or something well actually it's just a target i know scroll down i i think it's a target so okay so this is not the input this is the output yeah option output if you wanted to clone so essentially this is like cloning an instance let's say take one of my existing vms and rewrite it push it over top of an existing vm okay okay that makes so much more sense than what i thought it was all right i should have uh assumed the competence of the fine focus on my node all right so um we for sure have to have a region and a type so we can get those so now let's go back to uh over here um the um so it's doing this request body type object and see if they're in there oh so now there we go um all these things with inputs so the inputs marked as mandatory could you check that because i kind of want to know if these are not so i'm gonna actually have to so it wasn't quite as badass as it needed to be i mean it's pretty darn close the lino i don't think the lino dock required type in region though um it does yeah it does it down here it does in the body the region and type are like minimum specs for this thing so talk to the product manager who uh who owns that feature here's the question is what happens so if i can do that i can do this right i can make a sub piece of this complex object available um you can remove everything here if you want just to let's do this yeah i'm going to leave all the better name and leave all the names the same but let's just say nice label quest parameters i'm not going to bother like changing the cases and everything right now but that would be a thing you what i would do in the fit and finish um yeah you could delete everything out of here you don't want since it's optional leave the recording um i'm actually gonna leave [Music] i might get rid of the discs just because it's a little troublesome to deal with because you get this weird array of stuff and i don't want to deal with that so i'm going to get rid of discs everything else i think is fine actually having backups enabled is like great right that's pretty cool um so what we're gonna do so we now we do have to rewrite two of these guys because we don't want region and type to be the string that it came in as we want it to be uh oh can i not do oh problem can i not do a dynamic input from a sub piece of a complex that is unfortunately true so this is where some of the time when you're using the open api feature is really helpful in identifying here's what the structure could be but then you're also welcome to restructure it so in this case you would end up probably wanting to have two so yeah so here's what we're gonna do we're gonna pull those out of that we will delete both of those things and i'll say region and we'll make that a dynamic object that is one of those things that i just had never because this is uh i had just never been in that situation where i have a child of a larger object that is what i want to be that so get regions and then we'll do the same process for the type and let me just look at what i i called it type okay capital t type and we'll make that a dynamic choice and because i set all this stuff up last year i don't have to build anything because it's all just sitting there waiting to be waiting to be created which is fantastic all right so now we want to get vm types and again you'll notice that i'm using the rest of the world's terminology instead of the company's terminology all right so we'll get rid of type and region from this so i had been wanting to make them mandatory under there and this kind of sort of makes sense right is uh why put in in in retrospect although this wasn't what i was trying to do originally this makes more sense than what i was trying to do because if you got two required parameters why haven't a required parameter embedded in something else where it is required as a child thing they should probably be right up top if they're required yeah that's yeah i think that's a good practice in general i i totally agree with that highlight the things you want and then treat the optional things a little different yeah so i might even have two input complex objects at that point required ones and optional ones yeah which is which is quite reasonable um the um all right so i'm going to leave everything else the same um mark them as mandatory region and type since they are oh yes yes yes thank you for the oversight um i think configs i might get rid of for the same reason that i got rid of the uh discs because i don't want to do i'm not going to send it to it so nuke it partly because and there's another reason for that which is that uh like everything else in here is self-explanatory and those are not and so that's like less of a technical thing and more of a ux type thing which is is the person who is going to be building a flow and looking at this action you have any idea what the heck they're looking at when they look at this thing and so if not you're not like when you're building these actions you're not required to pass everything through in fact you'll notice a lot of actions um severely simplify what's happening under there either by making default choices for you or just hiding the choice altogether or letting the api pick default um certainly i was involved in a spoke that had uh like dozens of options and you didn't have dozens of options from the outside you just had like two or three so those required ones and then the you know two most common optional ones all right so now we've got that we've got the rest step and so in this particular thing with this open api like this uh step up here is doing most of the work for you right because this rest step is uh just passing along this this packet right so it's going to do all the bundling for you um everything where we hope to adjust our request body to include the region and type now oh it oh now how are we going to do that with this i think the easiest way would be to just do inline json and then and then you can just drop the individual pills into it that you want to send all right that might be a way to do it so how does one do that or actually do you know do you have an example of the json structure because you could also use the payload builder and the payload builder will help you deal with the things when it's not there don't actually generate that snippet of json for you let's see yeah that was going to be my suggestion instead of trying to let us build that request body now we build it instead with the how about right here yeah okay so um so now we're gonna add a new step for a uh oh we're gonna add a step okay i got you we're gonna add adjacent steps ahead of that yeah the payload builder payload handles json nowadays up a little bit there you go to the right i'm still okay i missed it alrighty so and then where do i put my clearly i have not used this yet so basically the way this works is you can put up in the top you can't actually really drop a payload in you just have to find all the key value pairs or the name value pairs that you want so okay for yeah okay so let's do so we don't have a we can't i can't paste that example and have it build it for me unfortunately not but that's a great idea it'd be kind of neat for the uh for the json input one to kind of work kind of like the json output one does is provided the example it builds a complex object for me hentai agree please pm's are writing a story even as we speak all right let's do this uh as quickly as i can in fact what i probably won't do is build any of those um uh build any of those optional ones right now yeah we'll just do the three mandatory three mandatories and then we'll take that as an offline action for later do the rest region and then uh when you were saying the um like when you say spend empty like by having not send empty structure if one of these things was empty it wouldn't have the value or wouldn't have the key is that right right well so there's two yeah there's two factors the other is is on each individual name value pair so uh to the very far right you can expand uh the option next to the trash can okay and now you can say omit effect mandatory so i can totally do that on all the optional ones it's just i will every one of those optional ones i'll have a mid fmt exactly because probably like um the one that's uh the boolean uh that would be problematic right if i don't do it now i have invalid json exactly yeah i was wondering why that might be it's a if you send the key and you don't send the value in the key that could actually still mean something so in some cases you just don't want to send the key at all all right so now i've got the line id the region the type all populated from the input and then um i shouldn't you want to do the boolean one too the backup enabled and just um sure let's just do that one for fun just to add one more and we'll call it oh i can't pick what to call it i'm i think they've named the same as their payload structure yeah backups underscore enabled yeah well i couldn't name it whatever i want unless i want them to uh work reject um so let me add one more thing to the input a non-mandatory um let's go ahead and i'm just gonna go ahead and delete this whole thing and we'll add one non-mandatory boolean just backups enabled i don't remember if the second word is supposed to be capitalized or not and not mandatory and then we'll go back to our payload builder drop that in why is it that's weird we'll assume that that's fine backups enabled and we do want to make this omit if empty because obviously we could break the packet if we don't do that all right um and everything else is fine right and then looking good send it to the rest stop let's get rid of what they sent and we'll use just that palette nice now we want some kind of output parsing step absolutely did not exist last year it did not that's a new paris feature hold on a second somebody talk for a second i'm this sure a little attention so here's here's our new pairs feature json parser step so what you do is you um what we were trying to do earlier and we were talking about was you can take the uh the response of one of the test responses and plop it in here under that source data area and then hit generate target and that will generate your complex object from that example payload all right so let's come over here i'm going to take just saves a lot of time so let's do that right now there's the example payload now we'll put that in here oh did i just do okay and then now at the top we should be able to hit generate target once you click out of that box okay generate target generating and then if i come down here there's root and then all the stuff fantastic that looks that looks like what gave it all right and now do i need it is this one of those things where if i drop it it'll automatically i don't have to do any mapping right yeah it's done it's done okay now if you want to provide this as an output from your action you do need to link that up let's do even that will still get auto learned so as long as sure but we still need to connect it here okay so i don't have to define like this is where i can use the magic right i i create this and i say it's a complex object and i say nothing just object okay and i see nothing else about it other than what you want to name it for the consumption results uh i don't know if that's the best name or is it is it a vm or what do you maybe um let's look at this it is it's both a vm but it's also like status status and information about the backup i'd call it a line there you go or like vm details or whatever i know it's good and then we uh hit detailed mode how do i know details i like it um i'll go ahead and call it mandatory i i notice you guys explain to me i don't know like in something like this where we're wiring it up it's sort of it doesn't really matter much if you say mandatory or not mandatory right like what's i don't know if there's a best practice in making these things mandatory for on outputs because you've already wired up the thing so the only situation could possibly uh get into is if you like the transaction fails and you have like no output at all like you have no response body that's like null so other than that you already got worse problems than the mandatory input at that point so someone didn't know what they needed to change the variable name just just because it was bothering them oh okay this is like the one this is like the one place in this ui that does not auto auto change this thanks lauren uh okay so we get rid of that and now i'm gonna drag and drop this and i should get identical now if i go back to edit outputs i should get there you go yep there's the there's the magic there's the magic because what we don't like to do is uh tedious uh busy work so now at this point i believe we have something testable save so now love a good save we're gonna get this id i know brad was over there nervous he was like we've been doing a lot of stuff in flow designer without hitting save i'm save often learn the hard way all right so now let's go ahead and test this joker um i don't know what uh i don't know what this thing is do we have a phantom left over it's not mandatory who cares i think you started creating a uh input when you did the auto generate so you still have that left over okay here's what we're gonna do let's set it up in west india which i believe is mumbai [Laughter] where i have totally been uh those are dynamic that those are right uh and let's go ahead and let's set up that backups enable right we this is like this is like chekhov's uh input if we set it up in act one we need to fire this thing by act three all right uh valid uh doesn't like your id oh i know exactly why and this is the open api spec uh did not was not my friend on this because do you know how it defined it i actually remember seeing that yeah i saw that as a string oh no no actually it did it right i'm doing it wrong which is the id is not the same as the id name i don't think oh so it was an integer it's the integer that's an integer so let's go back to mumbai let's go to the smallest one and let's do backups enabled i was going to say something because you can see the little the the up and down yeah well no i knew that i specified it as an integer or i knew that the ui specified it as an answer but the question is is the number or is the name the thing that it needs there and i'm not 100 sure that this is right but we'll see id so i'm assuming number and this is like not technical this is like conceptual in the this is uh unable to know oh i know what's going on oh i did not cannot help me this is i got to do this authentication step this right here thankfully we're not doing authentication on the show today and this one is uh this one is straightforward because this is not oauth this is a kind of this is a personal access token so it's way more straightforward than oauth and does what it doesn't require is configuring the other end of it which is which is where oauth even like when an oa thing that works pretty well that's kind of like what happens at the other end is like this weird black box did i pick the right scope of these weird choices that i don't know what they mean let's find out i'm doing this i personally i miss it i i miss the oauth episodes i'm just going to say it but you can come to an overall episode anytime you want josh it's so nice scheduled for this special event whenever you're ready we'll do an oauth show all right so jason purser failed what i'm gonna what this implies to me though is if we go back to our dashboard something happened maybe something happened oh it might have it might have failed because the this failed so let's let's look in here and see what we got going on introspect the steps backups enabled so there's the there's the payload bloody we did did we get to 200 how about a 200. method failed invalid 401 authorization token the right connection alias check one of these so we know that create we know that create vm worked earlier right and so it used x and scentsy ah linode so if this is using the same one one would expect it to work that is so one would expect that to work that is unusual that it worked in one and not the other yeah and all of a sudden it's now an off episode [Laughter] that's what i i i deserved that i deserve that let's look right quickly here and see um is the potential uh to look at that execution details and the execution details of the create vm and possibly like you know diff it because uh yeah let's look and see something about this feels like a weird false positive to me i i it yeah it's really weird create vm all right so if we look down at this guy when we did you got quieter dave is your base url the same because i i think my uh base url the same so if you look at create vm what was your base url on the right below the alias okay well i know this is four and then what is it on the line instances line node clone so these are rooted at the same place um let's come down here and so the auth let's look at this right quickly let's jump over to the um docs the where in here the auth is in personal read write which seems pretty no no i mean i'm not using this is you got two choices and i'm using i see i see so it's either use it got it yeah um okay so um if we look at the is there anything else in the header that that might have been different i'm looking to see so the um author is it name authorization bearer blah blah blah sn auth token so um let's see if that's different over here yeah um maybe not oh that's the wrong one um where's the headers they're there the other thing too is is in that integration metadata section up above you guys it doesn't seem to have that yeah oh attributes in that header that will totally do it so i think before we go too far there we go no authorization bearer we didn't have that all right that didn't come in that didn't automatically come in from the open api because that's a choice i guess um yeah how you're all right so this is uh this is not as tricky as it looked at first it is literally do this thing yeah authorization bear and give it the credential and this is cool because this gets to show off a nice feature of the rest step which is that when when you have this kind of weird custom scenario you can still get access to the credential value and then put it in the right place um oh wait copy the whole thing i don't i don't even want that i want this this right here bearer space and let's make sure it should be bearer like a single space that seems like that's right all right step rest step blah blah blah all right i'm feeling good about this i'm feeling better about it significantly andrew's not willing to go out on a on the limb to good but he's feeling better all right uh oh boy um i need our id back we well it's it's uh you know almost to the bottom of the hour so i am actually feeling like success this is success right here it's going to happen that's because you want to feel it you want the thank you good night moment well we got two things which is let's see uh 400 is not a 401 must be scopes type must be of type integer oh crap must be of type boolean backups enabled why so right now the payload builder is really focused on building strings and so you may need to not use it for this particular use case oh because is it surrounding it with surrounding both of those with yeah this is on the on the payload builder thing i definitely need to that's that's a fair one to throw right back at me chris and i appreciate it oh because the payload is this coming out um do i have any way of uh i don't have any way of taking those quotes out in like a template here do i unfortunately not at this time so what what i would do is if you actually were to just copy the preview and then use that in your body instead so yeah and then basically you can take full control all right so i'm just going to drag and drop the um pills into that right exactly so i'm just going to take this thing we're going to do this quickly we can do this in the time allotted um so how do i so how do i oh i don't want to do a payload yeah we just kill the we just go to the rest step and do it directly go back to here and then just put this instead of that we put this in here put this inside quotes region this is my least favorite part of the whole deal type i like to leave my cursor there and use the cannonball that's uh very fair all right let's do that uh type that probably is more sensible this would have shown me exactly what was going on if i had done it this way the first time uh id that was all my fault i was like yeah let's use the payload builder uh that's fine because this is like we say one of the whole things of this program is you show the job and that was all of the all of the job i mean that was like not just the shiny good parts but that was a perfectly sensible um that was a perfectly sensible default place to start in fact you know what i'm going to do i'm going to leave it all right so now this is the what we're going to send it looks like you have a trailing uh synthetic at the very end yeah trailing single quote at the oh nice eye all right let's do that good job all right i'm surprised your ocd dave doesn't move that bracket back to the left but that's okay well i'm mine's going off i've got an eye on the clock a little bit all right all right there it is all right you got my ocd going good is that the last one all right all right i was trying to keep an eye on the clock but for you guys that's fine and to those of you watching who were just as bothered you are welcome all right let's have the thank you good night moment oh no i don't know yet you you put those labels and groups in there i'm not sure if those are are those do you think that's gonna be my undoing it could be my undoing i i just don't know if we're defined in your instance like they are in the example i think those are um yeah if it fails on those then you uh that's a fair cop all right that's right you have to drink if it fails on that date it fails on that i can take them out very very quickly all right let's see return almost output does this imply 400 again all right chris that's exactly right that that require a drink label can only be provided when cloning to a new line ode now wait a second i am cloning to a new line did you specify it can only be provided when cloning to a new type can only be all these things are saying only can be provided when cloning to a new line so go to your go to the api page no no go to the rest step for me um and oh you specified the linode id here here ah so let's leave everything else and get rid of this good eye again so i was actually trying to clone it on top of its own self which is going to be a problem which is going to be problematic all right so that i wonder what it would have done if it hadn't failed well here's the other thing too is to think about this would be you know like assuming that you're actually going to like put this into some kind of production which i'm probably will because i need those sweet pull requests to get that shirt um that uh you'll notice that when the rest step is failing i'm getting uh jason i'm getting a parser uh error and i don't want that to happen i want it to be i want the rest step to be able to fail and not fail the action so we need some we need something a little more graceful in there even even if we don't get a payload because we got an error on this so maybe we want an if status before we do the payload something like that all right now i feel super good about this because how else am i going to be feeling oh completed oh beautiful oh look at that 530.000 like when we started this was almost because we did a lot of talking so it was like we did a lot of talking to the hour so we did this in like 40 minutes including a couple false starts including changing how we built the payload including changing you know multiple aspects of this changing the inputs and still in 40 minutes we got the thing actually uh working so this is why this is why this was my thing last year is because i actually like working with this api so uh and now they did fail me on their 7.53 api open api spec but um then this is a thing that i might even consider is like going through and finding those errors fixing them and like getting that reported for myself and communicating it back to them what i really don't know and this is one of those things that i don't i don't know the underlying stuff well enough is um are we um are other systems that you that consume these open api specs more fault tolerant than we are yeah so if you go to like smart bear or like the swagger dot um whatever i think you do if you just type swagger into google with the main site they let you post open api there as well it'd be i'd be curious to know does it consume it does it like create a yeah that might be a research project that i um that i do offline is to say all right something else to consume like one of the any other tool like a swagger tool if i if i take this will this pull it up and will it you know it's kind of like you remember those of us old enough to remember this when like different browsers would handle bad html different ways yeah you remember that crazy like smiley face test page based on that if you saw the exact smiley face with no streaks or missing pixels you you handled it properly you handle the property and and so this is kind of one of those things i think is that we're being really uh uh like fault intolerant about things that probably are spec violations but that a lot of the tools don't don't uh complain about to our level so we might be the hardest case available so the last thing i'd like you to do dave before you stop your screen share is go over to your github spoke and show everybody this is a public facing get oh uh yeah so you forked this from the public facing service program org let me go to this one spokesperson which other people can contribute to and if that's one of your contributions in october counts towards the four pr's for hacktoberfest right so let's talk a little about well let's say that you uh were were so inspired that you want to add an action to this thing this is what you would do is you would come to the github servicenow dev program spoke toberfest linode or any of the projects that are up there you fork this to yourself so you click fork you fork this to your own repo this is actually super important is that when you set up your uh application and you do import from source control you import from your fork not the main one you import from your fork because then what's going to happen is you're going to commit back to your version so let me go back to my version you commit back to this thing and then you create a pull request do you guys want to take a minute to just commit what i just did and do the pull absolutely let's do this chris do y'all have the time let's do it you have to drop you not a problem but yeah let's do it all right so we'll go over here to studio so we gotta publish um i'm not even gonna publish well yeah let's publish let's just publish it and let's assume that it's good enough and i actually second good enough for this second pull request we'll be fixing that the first one fixing well fixing the input and fixing the uh null payload so let's publish it and someone else could fix it for you even better how about repo i'll leave it broken and if someone else can fix it over the course of the month and if nobody i will call them out on the show i'll fix it at the end of the month if nobody else does it but uh okay so then we're gonna go over here to studio into source control and we're going to commit changes and again you're connected to your fork of this repo now let us make sure the one thing that i want so here's the stuff yes this is to my fork this is not to the uh not to the main thing um and um i don't know if this has been fixed this is but in previous eras um there was a weirdness in um the uh how servicenow would count your um the author of a commit so you'll notice that my local user on this is the identical thing is my github username that's a little that was a little life hack i don't know if this has changed in the last year like when you commit from servicenow is it using the account name of the account that you're committing from or is it using the github name of the credentials you're using so yeah i think it's still using the account name which so make sure your github name yeah to make sure you properly get credit for this in the month of october make sure use a local uh a username set up a local account with admin that is the same as your github username and then for sure you will get your so i just want to make sure that i'm not um committing my api token my okay so this looks good this is just some complex object stuff and the action so we're going to continue let us go forward commit comment uh day lch kicking off spoke fast spoke the hardest thing all day is spilling spooktoberfest all right [Laughter] commit files we will commit it hopefully this doesn't take two if it takes long actually i don't mind because i need some more bach over here um so while you're doing this i'll point out that uh one of the features in paris is delta loading which makes your life so much easier when you're dealing with source control because switching between those branches happens a whole lot speedier when it's just doing delta loading and not uninstalling your whole application and reinstalling it from source how about while we wait for this let's go around the horn and talk about the beers we can do that all right uh starting with brad how was your beer brad yeah i was first i had the dragon's milk white it was a lot different than the other dragon's milk still pretty good but not quite as good as their normal barrel-aged stout uh because of the success timing now we'll go four to five 425 still pretty good beer yeah and how about you chris how was your costco wine you know it was uh pretty standard but i liked it it was definitely i would give it a 5 for the price and about a 3.5 for the taste [Laughter] good good enough sir and you sir josh so the beguile flannel pajamas oatmeal stout that's been in my fridge since last december is delicious actually i think it's a good solid four to five and maybe even higher than that if it was fresher so i'm pretty happy what's again the name final pajamas it gets a solid five for me no that's what i i mean i've been working at home for six months i'm definitely wearing flannel pajamas right i'm gonna guarantee there are a lot of brewers that think of the name first and then fit any kind of beer that will fit that name yes indeed all right all right my breckenbach is uh much like all the all these beers i've ever gotten from all these it's serviceable and nothing to write home about let's give this a three five including the success uh bump and my gingling logger uh was uh you know it's a yingling it's it's a fine beer it's a three five um and then i uh did grab just a little little little whiskey because i'm not driving either the show or anywhere else um and that was um eagle rare and it is it is fine all right that's that's a five all right at this point i'd think we're probably not gonna wait for this to go the rest of the way stop the screen share i think and and we'll just talk through the rest yeah and the the rest would be you would come over here to a commit and you would or you would say create a new uh let me make sure where would i create the new pull request would i do it looking at the commit uh you can do it straight from straight from that first page you can just do uh pull requests right pull request over here add file i would create a new pull request and then i would just pick the commit that would be the ones commit or commits that would be the ones that i want in there yes sir and so that's how you do it and then you would file that pull request and you are on your way to uh getting your t-shirt if i had half a brain i would have wore my t-shirt but i didn't i i i didn't have a chance i had mine out and i didn't have a chance to switch all righty so thanks so much for that dave that was awesome um so we got um the chance to talk about hacktoberfest and spokestoberfest in particular um where you can contribute to this open source event we've got all the details over at our blog which is in the description of the video but developer.servicenow.com blog dot do um and it's a featured post there for all of the month of october all of our shows this this month will be uh featuring us doing some uh code uh contributions to open source even if they're just our own um and we will highlight at the end of the month some of the things that we see that others are contributing uh so get your contributions in uh and if it's to one of our two orgs we'll take a look at them at the end of the month and highlight them and and talk about them and a little secret there is that will be during our creator con event which will be october 27th so we'll have a special time for the show um and it will have a larger than usual audience because it'll be streaming as uh the main thing during creatorcon for its window so get your get your request in and we'll take a look at them and we really look forward to that so i want to thank tremendous thanks to the integration hub team here that came and joined so josh nerius chris malloy and dave slusher i i love these guys we uh you know y'all are always a pleasure to work with and this was a really fun show anything else you want to say before we head off yeah i'll say on hacktoberfest on sn devs there's a hacktoberfest channel if you need you know help with something or need some ideas log in there and then we've got a hacktoberfest blog post also uh on the developer community the the bigcommunity.servicenow.com uh if you want to go in there and ask questions and all those things so yeah let us know what you're doing somehow and we want to hear about it josh did you have something as well i was just saying happy friday happy friday and assuming uh there's a great uh the world gets a little better and we're able to have a knowledge 21. let's all let's pick a day and we'll all wear our shirts i'll wear our shirts we'll have an evening we'll all get our hacktoberfest 2020 uh shirts together even if it's virtual i i will definitely get on a zoom with you dave how about that 2020. if we have knowledge 21 and if it's in vegas which i think it would be uh we'll wear hacktoberfest 20 shirts to karaoke no just for the play this is our default plan i love the defining yeah absolutely all right well have a great weekend everyone and for those joining later have a great day and we'll see you next time you
https://www.youtube.com/watch?v=HxA5I9fPRn4