Skip to content

Commit

Permalink
wip: delete templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aschlackman committed Aug 20, 2024
1 parent 431be90 commit 9a6c223
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/TopoMojo.Hypervisor/Proxmox/ProxmoxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,16 @@ public async Task<Vm> Stop(string id)
return vm;
}

public async Task<Vm> DeleteTemplate(string templateName)
{
Vm vm = _vmCache.Where(x => x.Value.Name == templateName).FirstOrDefault().Value;

if (vm == null)
return null;

return await Delete(vm.Id);
}

public async Task<Vm> Delete(string id)
{
Result task;
Expand Down
4 changes: 2 additions & 2 deletions src/TopoMojo.Hypervisor/Proxmox/ProxmoxHypervisorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ public Task<int[]> VerifyDisks(VmTemplate template)
throw new NotImplementedException();
}

public Task DeleteDisks(VmTemplate template)
public async Task DeleteDisks(VmTemplate template)
{
return Task.CompletedTask;
await _pveClient.DeleteTemplate(template.Template);
}

public Task<Vm> Answer(string id, VmAnswer answer)
Expand Down

0 comments on commit 9a6c223

Please sign in to comment.