Need help with Linode API

I need to do the equivalent of "Rebuild" + "Deploying using StackScripts", select a StackScript to rebuild a server, and then boot.

There is no linode.rebuild.usingstackscript API call so what are all the calls I need to make to be able to do this operation programmatically?

Any information / sample code in Python or Ruby will be greatly appreciated.

Thanks

1 Reply

You would just delete every config profile and disk image.

So linode.disk.list(), iterate over disk images and linode.disk.delete() each. Then do a linode.config.list(), iterate over each and run linode.config.delete().

You would then do linode.disk.createfromstackscript() as well as linode.disk.create() to create your swap image. Then you'd want to create your configuration profile using linode.config.create().

I don't have any example code to show as this would depend which library you use to interact with the Linode API. You could either use the Linode binding, or something like 'requests' to make the HTTPS requests and handle the responses on your own.

-Tim

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct