From cb91b48f41f3749019df534596f32427315eabbc Mon Sep 17 00:00:00 2001 From: rawmind0 Date: Tue, 29 Jan 2019 21:34:56 +0100 Subject: [PATCH] Added PatchVirtualServer and PatchVirtualAddress functions to update VirtualServer and VirtualAddress objects using patch method --- ltm.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ltm.go b/ltm.go index 2c8564b..21a6185 100644 --- a/ltm.go +++ b/ltm.go @@ -1824,11 +1824,17 @@ func (b *BigIP) DeleteVirtualServer(name string) error { } // ModifyVirtualServer allows you to change any attribute of a virtual server. Fields that -// can be modified are referenced in the VirtualServer struct. +// can be modified are referenced in the VirtualServer struct. Set all the attributes. func (b *BigIP) ModifyVirtualServer(name string, config *VirtualServer) error { return b.put(config, uriLtm, uriVirtual, name) } +// PatchVirtualServer allows you to change any attribute of a virtual server. Fields that +// can be modified are referenced in the VirtualServer struct. Sets only the attributes specified. +func (b *BigIP) PatchVirtualServer(name string, config *VirtualServer) error { + return b.patch(config, uriLtm, uriVirtual, name) +} + // VirtualServerProfiles gets the profiles currently associated with a virtual server. func (b *BigIP) VirtualServerProfiles(vs string) (*Profiles, error) { var p Profiles @@ -1891,11 +1897,17 @@ func (b *BigIP) VirtualAddressStatus(vaddr, state string) error { } // ModifyVirtualAddress allows you to change any attribute of a virtual address. Fields that -// can be modified are referenced in the VirtualAddress struct. +// can be modified are referenced in the VirtualAddress struct. Sets all the attributes. func (b *BigIP) ModifyVirtualAddress(vaddr string, config *VirtualAddress) error { return b.put(config, uriLtm, uriVirtualAddress, vaddr) } +// PatchVirtualAddress allows you to change any attribute of a virtual address. Fields that +// can be modified are referenced in the VirtualAddress struct. Sets only the attributes specified. +func (b *BigIP) PatchVirtualAddress(vaddr string, config *VirtualAddress) error { + return b.patch(config, uriLtm, uriVirtualAddress, vaddr) +} + func (b *BigIP) DeleteVirtualAddress(vaddr string) error { return b.delete(uriLtm, uriVirtualAddress, vaddr) }