Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 22, 2013 4:28 pm 
Offline

Joined: Fri Feb 22, 2013 4:24 pm
Posts: 1
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


Top
   
PostPosted: Fri Feb 22, 2013 4:55 pm 
Offline
Sysop

Joined: Sat Nov 27, 2010 3:32 am
Posts: 180
Website: https://blog.timheckman.net/
Location: San Francisco, CA
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

_________________
'If debugging is the process of removing bugs, then programming must be the process of putting them in.' //Edsger Dijkstra
'Nothing is withheld from us which we have conceived to do.' | 'Do things that have never been done.' //Russell Kirsch


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group