[Return] ${stdout}
+Update Network Service
+ [Arguments] ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout}
+
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-update ${ns_id} --updatetype ${update_type} --config ${ns_update_config} --timeout ${ns_update_timeout} --wait
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
+
+
Get Vnf Management Ip Address
[Arguments] ${ns_id} ${vnf_member_index}
[Return] ${stdout}
+Get Ns Id
+ [Arguments] ${ns_name}
+
+ Should Not Be Empty ${ns_name}
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${ns_name} | awk '{print $4}' 2>&1
+ log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ Should Not Be Empty ${stdout}
+ [Return] ${stdout}
+
+
Get Ns Vnf List
[Arguments] ${ns_id}
${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\"
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{app_names} = Split String ${stdout}
- [Return] ${app_names}
\ No newline at end of file
+ [Return] ${app_names}
+
+
+Get VDU Affinity Group Name
+ [Documentation] Return the affinity group name for a NF
+
+ [Arguments] ${ns_name} ${vnf_id} ${vdur_id}
+
+ ${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."affinity-or-anti-affinity-group-id"[0]' | tr -d \\" 2>&1
+ log ${affinity_group_id}
+ Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_id} values=False
+ ${rc} ${affinity_group_name}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq '."affinity-or-anti-affinity-group"[] | select(.id == "'${affinity_group_id}'")' | yq '.name' | tr -d \\" 2>&1
+ log ${affinity_group_name}
+ Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_name} values=False
+ [Return] ${affinity_group_name}