Skip to content

Commit

Permalink
F #-: GOCA: allow merge or append when using one.vm.updateconf
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Willis <[email protected]>
  • Loading branch information
peterwillis committed Aug 29, 2024
1 parent 5d6b857 commit d90634e
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/oca/go/src/goca/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,23 @@ func (vc *VMController) UpdateContext(ctx context.Context, tpl string, uType par
return err
}

// UpdateConf updates (appends) a set of supported configuration attributes in
// UpdateConf updates a set of supported configuration attributes in
// the VM template
func (vc *VMController) UpdateConf(tpl string) error {
return vc.UpdateConfContext(context.Background(), tpl)
// - tpl: The new vm contents. Syntax can be the usual attribute=value or XML.
// - uType: Update type: Replace: Replace the whole template.
// Merge: Merge new template with the existing one.
func (vc *VMController) UpdateConf(tpl string, uType parameters.UpdateType) error {
return vc.UpdateConfContext(context.Background(), tpl, uType)
}

// UpdateConf updates (appends) a set of supported configuration attributes in
// UpdateConf updates a set of supported configuration attributes in
// the VM template
func (vc *VMController) UpdateConfContext(ctx context.Context, tpl string) error {
_, err := vc.c.Client.CallContext(ctx, "one.vm.updateconf", vc.ID, tpl)
// - ctx: context for cancelation
// - tpl: The new vm contents. Syntax can be the usual attribute=value or XML.
// - uType: Update type: Replace: Replace the whole template.
// Merge: Merge new template with the existing one.
func (vc *VMController) UpdateConfContext(ctx context.Context, tpl string, uType parameters.UpdateType) error {
_, err := vc.c.Client.CallContext(ctx, "one.vm.updateconf", vc.ID, tpl, uType)
return err
}

Expand Down

0 comments on commit d90634e

Please sign in to comment.