# F5-SDK : How to update Virtual Address Traffic Group

**URL:** <https://community.f5.com/t/f5-sdk-how-to-update-virtual-address-traffic-group/40546>\
**Category:** Technical Forums\
**Tags:** icontrolrest, traffic-group, f5-sdk, devops\
**Created:** [February 15, 2019, 6:47pm UTC](https://community.f5.com/t/f5-sdk-how-to-update-virtual-address-traffic-group/40546 "2019-02-15T18:47:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_64435](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Muhammad\_64435](https://community.f5.com/u/Muhammad_64435)\
**Post date:** [February 15, 2019, 6:47pm UTC](https://community.f5.com/t/f5-sdk-how-to-update-virtual-address-traffic-group/40546/1 "2019-02-15T18:47:17Z")

</div>

I have an Active-Active LTM Deployment. Virtual Servers ( and Virtual Addresses ) are split between two units. I am trying to use F5-SDK to update traffic group so that VS/VA will move between two units.

```tcl
Vars
BigIP_IP = "10.10.100.100"
V_IP = "172.31.13.151:80"
New_TG = "/Common/traffic-group-2"

Connect
new_mgmt = ManagementRoot(BigIP_IP, username, password)

Load
v_a_info = new_mgmt.tm.ltm.virtual_address_s.load(name=V_IP, partition='Common')

Assign new TG
v_a_info.trafficGroup = New_TG

 Update Virtual Address 
v_a_info.modify(v_a_info.trafficGroup)

```

But getting this Error :

```tcl
Traceback (most recent call last):
File "update-virtual-address-traffic-group.py", line 13, in 
v_a_info = new_mgmt.tm.ltm.virtual_address_s.load(name=V_IP, partition='Common')
File "/usr/lib/python3.6/site-packages/f5/bigip/resource.py", line 655, in load
raise InvalidResource(error_message)
f5.sdk_exception.InvalidResource: Only Resources support 'load'.

```

Then found out that “Virtual Addresses” are “Collections” and I able to read them fine using below command and loop through all attributes of a Virtual Address:

```tcl
v_a_info = new_mgmt.tm.ltm.virtual_address_s.get_collection()

```

But then questions comes up how to update an Attribute of a “Virtual Address” in a Collection and push it back to the LTM to implement the change

```tcl
Versions
F5-SDK : 3.0.20
LTM : 12.1.2 HF2

```

I highly appreciate any help or link to resolve this issue

-Muhammad

---

<div class="post-metadata">

**Author:** ![JRahm](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jrahm/32/3327_2.png) [@JRahm](https://community.f5.com/u/JRahm)\
**Post date:** [February 15, 2019, 7:29pm UTC](https://community.f5.com/t/f5-sdk-how-to-update-virtual-address-traffic-group/40546/2 "2019-02-15T19:29:02Z")

</div>

Hi Muhammad, virtual\_address\_s is a collection, you need the resource to load:

```tcl
v_a_info = new_mgmt.tm.ltm.virtual_address_s.virtual_address.load(name=V_IP, partition='Common')

```
