app module

app.cpu_stats(lab_id, machine_id)

Returns the cpu statistics per core along with the average cpu utilisation.

Parameters:
  • lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
  • machine_id (int) – machine id is the last octet of the ip address
Returns:

json containing the cpu statistics

app.exam_mode_off(lab_id)

Turns off the exam mode for the specified lab which enables the usb port for memory devices.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:None
app.exam_mode_on(lab_id)

Turns on the exam mode for the specified lab which disables the usb port for memory devices.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:None
app.lab_hardware_info(lab_id, hardware_name)

Returns the specified hardware over all the specified lab machines.

Parameters:
  • lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
  • hardware_name (str) – hardware_name can be any of the {keyboard, mouse}
Returns:

json containing the associated boolean values over all lab machines

app.lab_machine_status(lab_id, machine_id)

Returns the online status of the specified machine in the specified lab.

Parameters:
  • lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
  • machine_id (int) – machine id is the last octet of the ip address
Returns:

json containing the bool value associated with the status of the machine

app.lab_status(lab_id)

Return all the online status of all the machines of the specified lab id.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:json containing associated bool values over every lab machine
app.list_of_softwares(lab_id, machine_id)

Returns the list of softwares installed on the system specified in the given lab.

Parameters:
  • lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
  • machine_id (int) – machine id is the last octet of the ip address
Returns:

json containing the list of softwares

app.machine_hardware_info(lab_id, machine_id)

Returns whether the specified machine has keyboard and hardware attached to it.

Parameters:
  • lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
  • machine_id (int) – machine id is the last octet of the ip address
Returns:

json of type {‘keyboard’: bool,’mouse’:bool}

app.shutdown(lab_id)

Turn off all the machines in the specified lab.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:None
app.update_mac_to_ip_mapping(lab_id)

Gets the mac id to ip mapppings of all the machines in the specified lab.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:json containing the mapping
app.wakeup(lab_id)

Turn on all the machines in the specified lab.

Parameters:lab_id (str) – id of the lab, anyone of {sl1,sl2,cs101}
Returns:None