Skip to content

Commit

Permalink
✨feat: Add ConvertToTemplate method (#122)
Browse files Browse the repository at this point in the history
* ✨feat: Add DeleteContent method for storage

* ✨feat: Add ConvertToTemplate method
  • Loading branch information
alperencelik authored Mar 5, 2024
1 parent e312865 commit 799beb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,3 +635,11 @@ func (v *VirtualMachine) RRDData(ctx context.Context, timeframe Timeframe, conso
err = v.client.Get(ctx, u.String(), &rrddata)
return
}

func (v *VirtualMachine) ConvertToTemplate(ctx context.Context) (task *Task, err error) {
var upid UPID
if err = v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/template", v.Node, v.VMID), nil, &upid); err != nil {
return nil, err
}
return NewTask(upid, v.client), nil
}

0 comments on commit 799beb9

Please sign in to comment.