- ${response} = RequestsLibrary.Get_Request operational data-change-counter:data-change-counter
- BuiltIn.Should_Be_Equal ${response.status_code} ${200} Got status: ${response.status_code} and message: ${response.text}
- # TODO: The following line can be insecure. Should we use regexp instead?
- # TODO: beware of new releases (carbon ...) and mind if more counters are used
- ${count} = BuiltIn.Run Keyword If "${ODL_STREAM}" in ["beryllium", "stable-lithium"] BuiltIn.Evaluate ${response.text}["data-change-counter"]["count"]
- ... ELSE BuiltIn.Evaluate ${response.text}["data-change-counter"]["counter"][0]["count"]
- [Return] ${count}
+ [Arguments] ${session}=operational
+ ${response} = RequestsLibrary.Get_Request ${session} ${CC_DATA_CHANGE_COUNTER_URL}
+ BuiltIn.Should_Be_Equal
+ ... ${response.status_code}
+ ... ${200}
+ ... Got status: ${response.status_code} and message: ${response.text}
+ # CompareStream.Set_Variable_If_At_Least_Else cannot be used direcly, because ${response.text}["data-change-counter"]["count"] would be
+ # evaluated before the stream comparison and it causes failures
+ BuiltIn.Log ${response.text}
+ ${count} = BuiltIn.Evaluate
+ ... json.loads('${response.text}')["data-change-counter:data-change-counter"]["counter"][0]["count"]
+ ... modules=json
+ RETURN ${count}