Austin.Linode.LinodeClient.Linode_Reboot C# (CSharp) Method

Linode_Reboot() public method

Issues a shutdown, and then boot job for a given LinodeID.
possible errors: NOTFOUND
public Linode_Reboot ( int LinodeID, int ConfigID = null ) : Austin.Linode.JobIdResponse
LinodeID int
ConfigID int
return Austin.Linode.JobIdResponse
        public Austin.Linode.JobIdResponse Linode_Reboot(
                int LinodeID,
                int? ConfigID = null)
        {
            var myParams = new Dictionary<string, string>();
            myParams.Add("LinodeID", LinodeID.ToString(CultureInfo.InvariantCulture));
            if (ConfigID != null)
                myParams.Add("ConfigID", ConfigID.Value.ToString(CultureInfo.InvariantCulture));
            return GetResponse<Austin.Linode.JobIdResponse>("linode.reboot", myParams);
        }

Usage Example

Beispiel #1
0
        static void Main(string[] args)
        {
            var li = new LinodeClient("~~~");

            var id = li.Linode_List()[0].Id;
            int jobId = li.Linode_Reboot(id).JobID;
            while (true)
            {
                var j = li.Linode_Job_List(id, jobId)[0];

                if (j.HostSuccess.HasValue)
                {
                    Console.WriteLine("Finished: {0}", j.HostSuccess.Value);
                    break;
                }

                Console.WriteLine("still waiting");
                System.Threading.Thread.Sleep(5 * 1000);
            }

            Console.WriteLine();
            Console.WriteLine("Press enter to exit.");
            Console.ReadLine();
        }