Commit 72e89a0b authored by Bejarano Rodriguez Ronal's avatar Bejarano Rodriguez Ronal
Browse files

Execution file for calling missions using mir_client.py

parent bcc7fd9a
import hashlib
from mir_client import APIClient
def test_mir_client():
base_url = "http://mir.com/api/v2.0.0"
username = "Distributor"
password_digest = hashlib.sha256(
"distributor".encode("latin1")).hexdigest()
client = APIClient(base_url, username, password_digest)
# Put "greet at the front door" mission in the queue
missions = client.get_missions()
print(str(missions))
greet_front_door_mission_guid = "da618ed5-57c1-11ea-97a3-0001299877fe"
client.post_mission_queue(greet_front_door_mission_guid)
# Begin executing next pending mission in the queue
state_ready = 3
client.put_status(state_ready)
# Go back to the charging station
charging_station_mission_guid = "1e636e97-5e47-11ea-9e8c-0001299877fe"
client.post_mission_queue(charging_station_mission_guid)
test_mir_client()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment