From 4fbacf7e9493d9284f30eb8929c3b7a592cd35da Mon Sep 17 00:00:00 2001 From: Talons Lee Date: Thu, 1 Aug 2019 13:54:28 +0800 Subject: [PATCH] add method GetIsATemplate() to vm This method can be used to exclude templates from the result of GetVMAll(). Signed-off-by: Talons Lee --- vm.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vm.go b/vm.go index 799ae38..a111212 100644 --- a/vm.go +++ b/vm.go @@ -572,6 +572,15 @@ func (self *VM) SetIsATemplate(is_a_template bool) (err error) { return } +func (self *VM) GetIsATemplate() (is_a_template bool, err error) { + result := APIResult{} + err = self.Client.APICall(&result, "VM.get_is_a_template", self.Ref) + if err != nil { + return false, err + } + return result.Value.(bool), nil +} + func (self *VM) GetOtherConfig() (other_config map[string]string, err error) { result := APIResult{} other_config = make(map[string]string)