Class Methods

class netlab.api.ClassApiMixin
class_add(*, cls_name, com_id, cls_change_ex=True, cls_def_pw_account=None, cls_def_pw_console=None, cls_def_pw_enable=None, cls_email_logs=<ClassEmailLogs.NO: 'N'>, cls_end_date=None, cls_lab_limit=<ClassLabLimit.ENFORCE: 'E'>, cls_max_slots_per_res=None, cls_min_hours_btw_res=None, cls_no_delete=False, cls_retain_ilt=False, cls_retain_period=None, cls_retain_st=True, cls_self_sched=True, cls_start_date=None, cls_team_sched=False, **kwargs)

This method allows you to add a class to the NETLAB+ system.

Parameters
  • cls_name (str) – Class name.

  • com_id (int) – Community ID.

  • cls_change_ex (bool) – Allow student to change exercise.

  • cls_def_pw_account (str) – Class default account password.

  • cls_def_pw_console (str) – Class default console password.

  • cls_def_pw_enable (str) – Class default enable password.

  • cls_email_logs (ClassEmailLogs) – Email reservation logs for real equipment pods.

  • cls_end_date (datetime.date) – Class end date.

  • cls_lab_limit (ClassLabLimit) – Class lab time limit.

  • cls_max_slots_per_res (int) – Maximum number of slots per reservation.

  • cls_min_hours_btw_res (int) – Minimum hours between reservations.

  • cls_no_delete (bool) – Prevent from deletion.

  • cls_retain_ilt (bool) – Retain instructor led logs.

  • cls_retain_period (int) – The number of days to retain logs for.

  • cls_retain_st (bool) – Retain student logs.

  • cls_self_sched (bool) – Allow students to self schedule.

  • cls_start_date (datetime.date) – Class start date.

  • cls_team_sched (bool) – Allow teams to schedule.

Returns

On success, returns the cls_id of the newly created class.

Return type

int

class_get(*, cls_id, properties='default', **kwargs)

This method allows you to retrieve a single class and properties.

Parameters
  • cls_id (int) – Class ID.

  • properties (list[str] or 'all') – List of properties to retrieve. Defaults to “all”.

Returns

On success, returns an object with the requested properties:

Return type

dict

Properties

cls_change_ex

Allow student to change exercise.

cls_def_pw_account

Class default account password.

cls_def_pw_console

Class default console password.

cls_def_pw_enable

Class default enable password.

cls_email_logs

Email reservation logs for real equipment pods. netlab.enums.ClassEmailLogs

cls_end_date

Class end date.

cls_id

Unique class identifier.

cls_lab_limit

Lab limit settings. netlab.enums.ClassLabLimit

cls_max_slots_per_res

Maximum number of slots per reservation.

cls_min_hours_btw_res

Minimum number of hours between reservations.

cls_name

Unique class name per community.

cls_no_delete

Prevent from deletion.

cls_retain_ilt

Retain instructor led logs.

cls_retain_period

Number of days to retain class logs.

cls_retain_st

Retain student logs.

cls_self_sched

Allow students to self schedule.

cls_start_date

Class start date.

cls_team_sched

Allow teams to schedule.

cls_uuid

Class UUID.

com_id

Unique community identifier.

enrollment

Count of those enrolled.

leads

List of leads and properties sorted by acc_sort_name.

class_list(*, com_id=None, member=False, properties='default', **kwargs)

This method allows you to retrieve a list of classes and their properties.

Parameters
  • com_id (int) – Community ID.

  • member (bool) – If true, get list of classes the caller is in.

  • properties (list[str] or 'all' or 'default') – List of properties to retrieve. See Properties section for list of available properties.

Returns

On success, returns an object with the requested properties:

Return type

dict

Properties

cls_change_ex

Allow student to change exercise.

cls_def_pw_account

Class default account password.

cls_def_pw_console

Class default console password.

cls_def_pw_enable

Class default enable password.

cls_email_logs

Email reservation logs for real equipment pods. netlab.enums.ClassEmailLogs

cls_end_date

Class end date.

cls_id

Unique class identifier.

cls_lab_limit

Lab limit settings. netlab.enums.ClassLabLimit

cls_max_slots_per_res

Maximum number of slots per reservation.

cls_min_hours_btw_res

Minimum number of hours between reservations.

cls_name

Unique class name per community.

cls_no_delete

Prevent from deletion.

cls_retain_ilt

Retain instructor led logs.

cls_retain_period

Number of days to retain class logs.

cls_retain_st

Retain student logs.

cls_self_sched

Allow students to self schedule.

cls_start_date

Class start date.

cls_team_sched

Allow teams to schedule.

cls_uuid

Class UUID.

com_id

Unique community identifier.

enrollment

Count of those enrolled.

leads

List of leads and properties sorted by acc_sort_name.

class_remove(*, cls_id, delete_students=False, **kwargs)

This method removes a class from the NETLAB+ system.

Parameters
  • cls_id (int) – Local system class.

  • delete_students (bool) – False Do not delete student accounts. True Delete student accounts that are exclusively in this class. Student accounts that are members of multiple classes are not deleted.

Returns

The removal has succeeded.

Return type

‘OK’

class_roster_add(*, acc_id, cls_id, lead=False, ros_team=None, **kwargs)

This method allows you to add a member to a class roster.

Parameters
  • acc_id (str) – Unique account identifier.

  • cls_id (str) – Unique class identifier.

  • lead (bool) – Add as lead.

  • ros_team (str) – Assign user to a team. Single character, A-Z.

Returns

The addition has succeeded.

Return type

‘OK’

class_roster_list(*, cls_id, leads=False, **kwargs)

This method lists users in the class roster.

Parameters
  • cls_id (int) – Local system class.

  • leads (bool) – None Return all users in the roster (leads and learners). True Return lead instructors only. False Return learners only.

Returns

On success, returns an object with the requested properties:

Return type

dict

Properties

acc_display_name

Account name people will see this name in discussions, messages and comments.

acc_email

Account email.

acc_id

Local system account identifier.

acc_full_name

Account full name.

acc_last_login

Timestamp of last account login. Possibly None.

acc_logins

Number of times a user has logged in.

acc_sort_name

Account name as it appears in sorted lists.

acc_time_last_access

Timestamp of last access. Possibly None.

acc_type

Account type. netlab.enums.AccountType

acc_user_id

Account user identifier.

cls_id

Unique class identifier.

lead

If user is a lead instructor.

ros_team

Assignment of user to a team (designated by team letter). None if user is not assigned to a team.

class_roster_remove(*, acc_id, cls_id, **kwargs)

This method removes a user from the class roster.

Parameters
  • acc_id (int) – Account identifier of user to be removed.

  • cls_id (str) – Unique class identifier.

Returns

The removal has succeeded.

Return type

‘OK’

class_update(*, cls_id, cls_change_ex=None, cls_def_pw_account=None, cls_def_pw_console=None, cls_def_pw_enable=None, cls_email_logs=None, cls_end_date=None, cls_lab_limit=None, cls_max_slots_per_res=None, cls_min_hours_btw_res=None, cls_name=None, cls_no_delete=None, cls_retain_ilt=None, cls_retain_period=None, cls_retain_st=None, cls_self_sched=None, cls_start_date=None, cls_team_sched=None, cls_ext_slots_per_res=None, **kwargs)

This method allows you to update a class and its properties.

Parameters
  • cls_id (int) – Unique class identifier.

  • cls_change_ex (bool) – Allow student to change exercise.

  • cls_def_pw_account (str) – Class default account password.

  • cls_def_pw_console (str) – Class default console password.

  • cls_def_pw_enable (str) – Class default enable password.

  • cls_email_logs (ClassEmailLogs) – Email reservation logs for real equipment pods.

  • cls_end_date (datetime.date) – Class end date.

  • cls_lab_limit (ClassLabLimit) – Class lab time limit.

  • cls_max_slots_per_res (int) – Maximum number of slots per reservation.

  • cls_min_hours_btw_res (int) – Minimum hours between reservations.

  • cls_name (str) – Class name.

  • cls_no_delete (bool) – Prevent from deletion.

  • cls_retain_ilt (bool) – Retain instructor led logs.

  • cls_retain_period (int) – The number of days to retain logs for.

  • cls_retain_st (bool) – Retain student logs.

  • cls_self_sched (bool) – Allow students to self schedule.

  • cls_start_date (datetime.date) – Class start date.

  • cls_team_sched (bool) – Allow teams to schedule.

  • cls_ext_slots_per_res (int or enums.ClassExtensionSlots) – Allow extensions to reservations for students and teams. Instructors are not restricted to this limit.

Returns

The update has succeeded.

Return type

‘OK’