air_sdk.endpoints.trainings

View as Markdown

Classes

NameDescription
TrainingNGCDataExternal user group data from NGC for a training event.
TrainingAttendeeDetailPer-attendee onboarding and access status for a training attendee.
TrainingTraining model representing a training event with NGC group and cloned simulation.
TrainingEndpointAPIEndpoint API for managing training events.

Module Contents

class air_sdk.endpoints.trainings.TrainingNGCData

Bases: typing.TypedDict

External user group data from NGC for a training event.

This data is retrieved from the NGC API and includes information about the user group, its members, and invitation status.

userGroupId: str
orgName: str
resourceGroup: str
name: str
description: str
idpListLocked: bool
requireMatchingEmail: bool
isUserGroupAdmin: bool
serviceRoles: list[str]
companyName: str
groupContactEmail: str
permissionSetDesc: str
startDate: str
endDate: str
confirmedUsers: list[str]
pendingInvitations: list[str]
type: str
class air_sdk.endpoints.trainings.TrainingAttendeeDetail

Bases: typing.TypedDict

Per-attendee onboarding and access status for a training attendee.

Args:

email: Attendee email address. has_onboarded_in_air: Whether the attendee has onboarded in DSX Air. action_needed: Follow-up action required for access, if any.

Returns:

One typed attendee-status entry.

Example:

>>> detail: TrainingAttendeeDetail = {
... 'email': 'student@example.com',
... 'has_onboarded_in_air': False,
... 'action_needed': 'User needs to log into DSX Air.',
... }
email: str
has_onboarded_in_air: bool
action_needed: str | None
class air_sdk.endpoints.trainings.Training

Bases: air_sdk.air_model.AirModel

Training model representing a training event with NGC group and cloned simulation.

Timing Constraints:

  • event_time must be at least 5h in the future
  • sim_start_time must be at least 1h in the future and 4h before event_time
  • sim_end_time must be at least 24h after event_time

Update Restrictions: Only event_time, sim_start_time, and sim_end_time can be updated. Name, parent simulation, checkpoint, and attendees cannot be modified after creation.

The training_simulation field is a lazy-loaded foreign key. Accessing it will automatically fetch the full Simulation object from the API.

get_model_api() -> type[TrainingEndpointAPI]
id: str

Unique identifier for the training event

name: str

Name of the training event (also NGC user group name, must be kebab-case)

display_name: str

Human-readable display name for the training event

Timestamp when the training was created

Timestamp when the training was last modified

creator: str

Email of the client that created the training

org: str

Organization UUID associated with this training

training_simulation: Simulation

Foreign key to template simulation (lazy loaded)

training_simulation_name: str

Name of the training simulation (read-only)

training_simulation_state: str

State of the training simulation (read-only)

event_time: datetime.datetime

When the training event will occur (must be 5h+ in future)

ngc_group_id: str

NGC external user group ID (must be kebab-case)

sim_start_time: datetime.datetime

When workbenches are created/started (1h+ future, 4h before event_time)

sim_end_time: datetime.datetime

When workbenches expire/destroyed (24h+ after event_time)

attendees: list[str]

List of validated attendee email addresses

attendee_details: list[TrainingAttendeeDetail]

Per-attendee onboarding/access status (read-only)

workbenches_created: bool

Whether workbenches have been created

update(
*,
display_name: str = ...,
event_time: datetime.datetime = ...,
sim_start_time: datetime.datetime = ...,
sim_end_time: datetime.datetime = ...,
**kwargs: Any
) -> None

Update individual fields of the training event.

Only display_name, event_time, sim_start_time, and sim_end_time can be updated. Name, parent simulation, checkpoint, and attendees cannot be modified via this endpoint after creation.

Timing Constraints:

  • event_time: Must be at least 5h in the future
  • sim_start_time: Must be 1h+ in future and 4h before event_time
  • sim_end_time: Must be at least 24h after event_time

Parameters:

  • display_name – Human-readable display name for the training event
  • event_time – When the training event will occur
  • sim_start_time – When workbenches are created/started
  • sim_end_time – When workbenches expire/destroyed
  • **kwargs – Additional fields for future API compatibility

Raises:

  • ValidationError – If timing constraints are violated

Example:

>>> training.update(
... event_time=datetime(2026, 3, 15, 9, 0),
... sim_start_time=datetime(2026, 3, 15, 5, 0),
... sim_end_time=datetime(2026, 3, 16, 9, 0)
... )
add_attendees(
*,
attendees: list[str],
**kwargs: Any
) -> None

Add attendees to the training event.

Parameters:

  • attendees – List of email addresses to add as attendees
  • **kwargs – Additional parameters

Example:

>>> training.add_attendees(
... attendees=['user1@example.com', 'user2@example.com']
... )
remove_attendees(
*,
attendees: list[str],
**kwargs: Any
) -> None

Remove attendees from the training event.

Parameters:

  • attendees – List of email addresses to remove from attendees
  • **kwargs – Additional parameters

Example:

>>> training.remove_attendees(
... attendees=['user1@example.com']
... )
get_external_user_group(**kwargs: Any) -> TrainingNGCData

Get NGC external user group information.

Makes an external API call to NGC to retrieve full details about the training’s user group, including confirmed users and pending invitations.

Parameters:

  • **kwargs – Additional parameters

Returns:

NGC user group data including members and invitation status

Example:

>>> group_data = training.get_external_user_group()
>>> print(f'Group: {group_data["name"]}')
>>> print(f'Confirmed users: {group_data.get("confirmedUsers", [])}')
>>> print(f'Pending invitations: {group_data.get("pendingInvitations", [])}')
get_workbenches(
*,
id: str = ...,
creator: str = ...,
assigned_to: str = ...,
**kwargs: Any
) -> IndexableIterator[Simulation]

Get the workbench simulations for this training.

The training’s training_simulation (the template) is automatically excluded from the results; only attendee workbenches are returned. Results are also scoped to simulations the calling user has permission to read.

Parameters:

  • id – Filter by the workbench simulation ID
  • creator – Filter by the username of the simulation creator
  • assigned_to – Filter by the email of the user assigned to the workbench simulation. This will match creator unless the assignee has never logged into DSX Air before.
  • **kwargs – Additional filter parameters

Returns:

Iterator of workbench Simulation instances for this training

Example:

>>> # All workbenches for the training
>>> for sim in training.get_workbenches():
... print(sim.name)
>>> # Find the workbench assigned to a specific attendee
>>> sims = list(training.get_workbenches(
... assigned_to='student@example.com'
... ))
class air_sdk.endpoints.trainings.TrainingEndpointAPI

Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.trainings.Training]

Endpoint API for managing training events.

Provides methods for listing, creating, retrieving, updating, and deleting training events, as well as managing attendees and retrieving NGC user group information.

API_PATH: str
ATTENDEES_ADD_PATH: str
ATTENDEES_REMOVE_PATH: str
EXTERNAL_USER_GROUP_PATH: str
WORKBENCH_SIMULATIONS_PATH: str
model: type[Training]
list(
*,
display_name: str = ...,
limit: int = ...,
name: str = ...,
ngc_group_id: str = ...,
offset: int = ...,
ordering: str = ...,
search: str = ...,
training_simulation: str | PrimaryKey = ...,
workbenches_created: bool = ...,
**params: Any

List all training events.

Parameters:

  • display_name – Filter by training display name
  • limit – Number of results to return per page
  • name – Filter by training name
  • ngc_group_id – Filter by NGC external user group ID
  • offset – Initial index from which to return results
  • ordering – Order by field (prefix with ”-” for desc). Options: -created, -creator, -display_name, -event_time, -modified, -name, -ngc_group_id, -sim_end_time, -sim_start_time, -training_simulation_name, -training_simulation_state, -workbenches_created, created, creator, display_name, event_time, modified, name, ngc_group_id, sim_end_time, sim_start_time, training_simulation_name, training_simulation_state, workbenches_created
  • search – Search by name, display_name, creator, training_simulation_name, training_simulation_state, event_time, sim_start_time, sim_end_time, created
  • training_simulation – Filter by template simulation ID
  • workbenches_created – Filter by workbenches creation status
  • **params – Additional filter parameters

Returns:

Iterator of Training instances

Example:

>>> for training in api.trainings.list():
... print(training.name)
>>> # Filter by name
>>> trainings = api.trainings.list(name='network-training')
>>> # Filter by simulation
>>> trainings = api.trainings.list(training_simulation='sim-123')
create(
*,
name: str,
parent_simulation: str | PrimaryKey,
attendees: list[str],
event_time: datetime.datetime,
sim_start_time: datetime.datetime,
sim_end_time: datetime.datetime,
display_name: str = ...,
parent_simulation_checkpoint: str | PrimaryKey = ...,
**kwargs: Any

Create a new training event with NGC group and cloned simulation.

The simulation will be cloned when creating the training. After cloning completes, the parent_simulation transitions to INACTIVE state and is no longer associated with the training. A dedicated training_simulation is created for the training session.

Parameters:

  • name – Name of the training event (must be kebab-case, used as NGC user group name)
  • parent_simulation – Simulation to clone for the training (transitions to INACTIVE after cloning)
  • attendees – List of attendee email addresses (required, case-sensitive, no duplicates)
  • event_time – When the training event will occur (must be 5h+ in future, sim_end_time must be 24h+ after this)
  • sim_start_time – When workbenches are created/started (must be 1h+ in future and 4h before event_time)
  • sim_end_time – When workbenches expire/destroyed (must be 24h+ after event_time)
  • display_name – Human-readable display name for the training event (defaults to name if not provided)
  • parent_simulation_checkpoint – Checkpoint from parent_simulation to clone onto training_simulation (optional)
  • **kwargs – Additional fields for future API compatibility

Returns:

Created Training instance

Example:

>>> training = api.trainings.create(
... name='network-training-101',
... parent_simulation='sim-id-123',
... attendees=['student1@example.com', 'student2@example.com'],
... event_time=datetime(2026, 3, 15, 9, 0),
... sim_start_time=datetime(2026, 3, 15, 5, 0),
... sim_end_time=datetime(2026, 3, 16, 9, 0)
... )
get(
pk: PrimaryKey,
**params: Any

Retrieve a specific training event.

Parameters:

  • pk – Training ID
  • **params – Additional query parameters

Returns:

Training instance

Example:

>>> training = api.trainings.get('training-id-123')
>>> print(training.name)
patch(
pk: PrimaryKey,
*,
display_name: str = ...,
event_time: datetime.datetime = ...,
sim_start_time: datetime.datetime = ...,
sim_end_time: datetime.datetime = ...,
**kwargs: Any

Update individual fields of a training event.

Only display_name, event_time, sim_start_time, and sim_end_time can be updated.

Parameters:

  • pk – Training ID
  • display_name – Human-readable display name for the training event
  • event_time – When the training event will occur
  • sim_start_time – When workbenches are created/started
  • sim_end_time – When workbenches expire/destroyed
  • **kwargs – Additional fields for future API compatibility

Returns:

Updated Training instance

Example:

>>> training = api.trainings.patch(
... 'training-id-123',
... event_time=datetime(2026, 3, 15, 9, 0),
... )
delete(
pk: PrimaryKey,
**kwargs: Any
) -> None

Delete a training event and its associated NGC user group.

Parameters:

  • pk – Training ID
  • **kwargs – Additional parameters

Example:

>>> api.trainings.delete('training-id-123')
update(
*,
training: Training | PrimaryKey,
display_name: str = ...,
event_time: datetime.datetime = ...,
sim_start_time: datetime.datetime = ...,
sim_end_time: datetime.datetime = ...,
**kwargs: Any

Update individual fields of a training event.

Only display_name, event_time, sim_start_time, and sim_end_time can be updated. Name, parent simulation, checkpoint, and attendees cannot be modified after creation.

Timing Constraints:

  • event_time: Must be at least 5h in the future
  • sim_start_time: Must be 1h+ in future and 4h before event_time
  • sim_end_time: Must be at least 24h after event_time

Parameters:

  • training – Training instance or training ID
  • display_name – Human-readable display name for the training event
  • event_time – When the training event will occur
  • sim_start_time – When workbenches are created/started
  • sim_end_time – When workbenches expire/destroyed
  • **kwargs – Additional fields for future API compatibility

Returns:

Updated Training instance

Raises:

  • ValidationError – If timing constraints are violated

Example:

>>> training = api.trainings.get('training-id-123')
>>> api.trainings.update(
... training=training,
... event_time=datetime(2026, 3, 15, 9, 0),
... sim_start_time=datetime(2026, 3, 15, 5, 0)
... )
add_attendees(
*,
training: Training | PrimaryKey,
attendees: list[str],
**kwargs: Any
) -> None

Add attendees to an existing training event.

Parameters:

  • training – Training instance or training ID
  • attendees – List of email addresses to add
  • **kwargs – Additional parameters

Example:

>>> api.trainings.add_attendees(
... training='training-id-123', attendees=['newuser@example.com']
... )
remove_attendees(
*,
training: Training | PrimaryKey,
attendees: list[str],
**kwargs: Any
) -> None

Remove attendees from an existing training event.

Parameters:

  • training – Training instance or training ID
  • attendees – List of email addresses to remove
  • **kwargs – Additional parameters

Example:

>>> api.trainings.remove_attendees( # fmt: skip
... training='training-id-123', attendees=['user@example.com']
... )
get_external_user_group(
*,
training: Training | PrimaryKey,
**kwargs: Any

Get NGC external user group data for a training.

Makes an external API call to NGC to retrieve full details about the training’s user group, including confirmed users and pending invitations.

Requires AIR_INSTRUCTOR, AIR_ORG_ADMIN, or USER_ADMIN roles.

Parameters:

  • training – Training instance or ID
  • **kwargs – Additional parameters

Returns:

NGC user group data including members and invitation status

Example:

>>> group_data = api.trainings.get_external_user_group(
... training='training-id-123'
... )
>>> print(f"Group name: {group_data['name']}")
>>> print(f"Organization: {group_data['orgName']}")
>>> confirmed = group_data.get('confirmedUsers', [])
>>> pending = group_data.get('pendingInvitations', [])
>>> print(f"Total users: {len(confirmed)} confirmed, {len(pending)} pending")
list_workbenches(
*,
training: Training | PrimaryKey,
id: str = ...,
creator: str = ...,
assigned_to: str = ...,
limit: int = ...,
offset: int = ...,
**kwargs: Any
) -> IndexableIterator[Simulation]

List workbench simulations associated with a training event.

Useful for instructors who need to find all attendee workbenches for a given training session. The training’s training_simulation (the template) is automatically excluded from the results; only attendee workbenches are returned. Results are also scoped to simulations the calling user has permission to read.

Parameters:

  • training – Training instance or training ID
  • id – Filter by the workbench simulation ID
  • creator – Filter by the username of the simulation creator
  • assigned_to – Filter by the email of the user assigned to the workbench simulation. This will match creator unless the assignee has never logged into DSX Air before.
  • limit – Number of results to return per page
  • offset – Initial index from which to return results
  • **kwargs – Additional filter parameters

Returns:

Iterator of workbench Simulation instances for the training

Example:

>>> # All workbenches for a training
>>> for sim in api.trainings.list_workbenches(training='training-id-123'):
... print(sim.name)
>>> # Find the workbench assigned to a specific attendee
>>> sims = list(api.trainings.list_workbenches(
... training='training-id-123',
... assigned_to='student@example.com',
... ))