+
+Run Process With Logging And Status Check
+ [Arguments] @{proc_args}
+ [Documentation] Execute an OS command, log STDOUT and STDERR output and check exit code to be 0
+ ${result}= Run Process @{proc_args}
+ Log ${result.stdout}
+ Log ${result.stderr}
+ Should Be Equal As Integers ${result.rc} 0
+ [Return] ${result}
+
+Get Data From URI
+ [Arguments] ${session} ${uri} ${headers}=${NONE}
+ [Documentation] Issue a GET request and return the data obtained or on error log the error and fail.
+ ... Issues a GET request for ${uri} in ${session} using headers from
+ ... ${headers}. If the request returns a HTTP error, fails. Otherwise
+ ... returns the data obtained by the request.
+ ${response}= RequestsLibrary.Get Request ${session} ${uri} ${headers}
+ Builtin.Return_From_Keyword_If ${response.status_code} == 200 ${response.text}
+ Builtin.Log ${response.text}
+ Builtin.Fail The request failed with code ${response.status_code}
+
+No Content From URI
+ [Arguments] ${session} ${uri} ${headers}=${NONE}
+ [Documentation] Issue a GET request and return on error 404 (No content) or will fail and log the content.
+ ... Issues a GET request for ${uri} in ${session} using headers from
+ ... ${headers}. If the request returns a HTTP error, fails. Otherwise
+ ... returns the data obtained by the request.
+ ${response}= RequestsLibrary.Get Request ${session} ${uri} ${headers}
+ Builtin.Return_From_Keyword_If ${response.status_code} == 404
+ Builtin.Log ${response.text}
+ Builtin.Fail The request failed with code ${response.status_code}
+
+Get Index From List Of Dictionaries
+ [Arguments] ${dictionary_list} ${key} ${value}
+ [Documentation] Extract index for the dictionary in a list that contains a key-value pair. Returns -1 if key-value is not found.
+ ${length}= Get Length ${dictionary_list}
+ ${index}= Set Variable -1
+ : FOR ${i} IN RANGE ${length}
+ \ ${dictionary}= Get From List ${dictionary_list} ${i}
+ \ Run Keyword If '&{dictionary}[${key}]' == '${value}' Set Test Variable ${index} ${i}
+ [Return] ${index}
+
+Check Item Occurrence
+ [Arguments] ${string} ${dictionary_item_occurrence}
+ [Documentation] Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present.
+ : FOR ${item} IN @{dictionary_item_occurrence}
+ \ Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}]
+
+Post Log Check
+ [Arguments] ${uri} ${body} ${status_code}=200
+ [Documentation] Post body to ${uri}, log response content, and check status
+ ${resp}= RequestsLibrary.Post Request session ${uri} ${body}
+ Log ${resp.content}
+ Should Be Equal As Strings ${resp.status_code} ${status_code}
+ [Return] ${resp}