/// <summary> /// Renames a virtual machine template. /// </summary> /// <param name="template">The target template.</param> /// <param name="newName">The new template name.</param> /// <returns>The modified template.</returns> /// <exception cref="XenException">Thrown if the operation failed.</exception> public XenTemplate Rename(XenTemplate template, string newName) { Covenant.Requires <ArgumentNullException>(template != null, nameof(template)); Covenant.Requires <ArgumentNullException>(!string.IsNullOrEmpty(newName), nameof(newName)); client.SafeInvoke("template-param-set", $"uuid={template.Uuid}", $"name-label={newName}"); return(Find(uuid: template.Uuid)); }
/// <summary> /// Removes a virtual machine template. /// </summary> /// <param name="template">The target template.</param> /// <exception cref="XenException">Thrown if the operation failed.</exception> public void Destroy(XenTemplate template) { Covenant.Requires <ArgumentNullException>(template != null, nameof(template)); client.SafeInvoke("vm-destroy", $"uuid={template.Uuid}"); }