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

Linode_Disk_CreateFromImage() public method

Creates a new disk from a previously imagized disk.
public Linode_Disk_CreateFromImage ( int ImageID, int LinodeID, string Label = null, string rootPass = null, string rootSSHKey = null, int size = null ) : void
ImageID int The ID of the frozen image to deploy from
LinodeID int Specifies the Linode to deploy on to
Label string The label of this new disk image
rootPass string Optionally sets the root password at deployment time. If a password is not provided the existing root password of the frozen image will not be modified
rootSSHKey string Optionally sets this string into /root/.ssh/authorized_keys upon image deployment
size int The size of the disk image to creates. Defaults to the minimum size required for the requested image
return void
        public void Linode_Disk_CreateFromImage(
                int ImageID,
                int LinodeID,
                string Label = null,
                string rootPass = null,
                string rootSSHKey = null,
                int? size = null)
        {
            var myParams = new Dictionary<string, string>();
            myParams.Add("ImageID", ImageID.ToString(CultureInfo.InvariantCulture));
            myParams.Add("LinodeID", LinodeID.ToString(CultureInfo.InvariantCulture));
            if (Label != null)
                myParams.Add("Label", Label);
            if (rootPass != null)
                myParams.Add("rootPass", rootPass);
            if (rootSSHKey != null)
                myParams.Add("rootSSHKey", rootSSHKey);
            if (size != null)
                myParams.Add("size", size.Value.ToString(CultureInfo.InvariantCulture));
            GetResponse<object>("linode.disk.createfromimage", myParams);
        }