-Get_Netconf_Entity_Info
- [Arguments] ${entity} ${session}
- [Documentation] Get owner and candidates for the specified netconf entity
- ... TODO: Merge with ClusterKeywords.Get_Cluster_Entity_Owner which
- ... contains most of the code from this keyword.
- ${entity_type}= BuiltIn.Set_Variable netconf-node/${entity}
- ${candidates_list}= Create List
- ${data}= Utils.Get Data From URI ${session} /restconf/operational/entity-owners:entity-owners
- Log ${data}
- ${clear_data}= Replace String ${data} /general-entity:entity[general-entity:name=' ${EMPTY}
- ${clear_data}= Replace String ${clear_data} '] ${EMPTY}
- ${json}= RequestsLibrary.To Json ${clear_data}
- ${entity_type_list}= Get From Dictionary &{json}[entity-owners] entity-type
- ${entity_type_index}= Get Index From List Of Dictionaries ${entity_type_list} type ${entity_type}
- Should Not Be Equal ${entity_type_index} -1 No Entity Owner found for ${entity_type}
- ${entity_list}= Get From Dictionary @{entity_type_list}[${entity_type_index}] entity
- ${entity_index}= Utils.Get Index From List Of Dictionaries ${entity_list} id ${entity}
- Should Not Be Equal ${entity_index} -1 Device ${entity} not found in Entity Owner ${entity_type}
- ${entity_owner}= Get From Dictionary @{entity_list}[${entity_index}] owner
- Should Not Be Empty ${entity_owner} No owner found for ${entity}
- ${owner}= Replace String ${entity_owner} member- ${EMPTY}
- ${owner}= Convert To Integer ${owner}
- ${entity_candidates_list}= Get From Dictionary @{entity_list}[${entity_index}] candidate
- ${list_length}= Get Length ${entity_candidates_list}
- : FOR ${entity_candidate} IN @{entity_candidates_list}
- \ ${candidate}= Replace String &{entity_candidate}[name] member- ${EMPTY}
- \ ${candidate}= Convert To Integer ${candidate}
- \ Append To List ${candidates_list} ${candidate}
- Remove Values From List ${candidates_list} ${owner}
- [Return] ${owner} ${candidates_list}
-