[Arguments] ${controller_ip} ${auth_data}
[Documentation] Makes a POST REST call to the AUTH_TOKEN_API with the given auth_data and returns the response
Create Session ODL_SESSION http://${controller_ip}:8181
- ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
+ ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= RequestsLibrary.POST ODL_SESSION ${AUTH_TOKEN_API} data=${auth_data} headers=${headers}
Delete All Sessions
[Return] ${resp}
Revoke Auth Token
[Arguments] ${token}
[Documentation] Requests the given token be revoked via POST to ${REVOKE_TOKEN_API}
- ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
+ ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= RequestsLibrary.POST ODL_SESSION ${REVOKE_TOKEN_API} data=${token} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 204
[Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB
[Arguments] ${user_id}=${EMPTY}
Create Session httpbin http://${CONTROLLER}:${RESTPORT}
- ${headers}= Create Dictionary Content-Type application/x-www-form-urlencoded
+ ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= RequestsLibrary.GET httpbin ${idmurl}/users/${user_id} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
Log ${resp.content}
[Documentation] Will return user information. If no user id is passed, it will retrieve all users in DB
[Arguments] ${user_data}
Create Session httpbin http://${CONTROLLER}:${RESTPORT}
- ${headers}= Create Dictionary Content-Type application/json
+ ${headers}= Create Dictionary Content-Type=application/json
${resp}= RequestsLibrary.POST httpbin ${idmurl}/users headers=${headers} data=${user_data}
Should Be Equal As Strings ${resp.status_code} 201
Log ${resp.content}