﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VMManager
{
    public class DOInstance : IInstance
    {
        DOAccount doOwner = null;

        public DOInstance(string ip, string mID, string name, DOAccount owner, VMState state)
            : base(ip, mID, name, state, owner)
        {
            doOwner = owner;
        }
        
        public override void Restart()
        {
            doOwner.Client.DropletActions.PowerCycle(Int32.Parse(_machineID));
        }

        public override void Start()
        {
            doOwner.Client.DropletActions.PowerOn(Int32.Parse(_machineID));
        }

        public override void Stop()
        {
            doOwner.Client.DropletActions.PowerOff(Int32.Parse(_machineID));
        }
    }
}
