Team Core
chaos.lib.team
Module for managing team structures, including initialization, activation, deactivation, listing, cloning, and pruning.
gatherDeactivateTeam(payload)
Gathers confirmation for a comprehensive deactivation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamDeactivatePayload
|
Instructions targeting a specific company setup to sever. |
required |
Returns:
| Type | Description |
|---|---|
DataGatherRequest | None
|
DataGatherRequest | None: User confirmation request if required, or None. |
gatherInitTeam(payload)
Gathers data needed to initialize a team structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamInitPayload
|
The initial payload detailing the team configuration and requirements. |
required |
Returns:
| Type | Description |
|---|---|
DataGatherRequest | None
|
DataGatherRequest | None: A request containing prompts to clarify options from the user, or None if no extra inputs are needed. |
gatherPruneTeams(payload)
Prompts the user before pruning stale records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamPrunePayload
|
Context wrapping parameters and |
required |
Returns:
| Type | Description |
|---|---|
DataGatherRequest | None
|
DataGatherRequest | None: Confirmation requirement prompt, if lacking the automated override flag. |
handleActivateTeam(payload)
Activates a team by reading the .chaos.yml file and creating necessary symlinks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamActivatePayload
|
Payload containing the target path context to read the configuration from. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: Status representation of symlink deployments and setup validations. |
handleCloneGitTeam(payload)
Clones a git repository and activates the team if valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamClonePayload
|
Payload supplying git repository details and target local path. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: Results containing operations metadata or rollback trace logs on failure. |
Notes
Validity relies on the presence of a properly configured .chaos.yml.
handleDeactivateTeam(payload)
Deactivates specified teams or all teams for a company.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamDeactivatePayload
|
Details specifying the subset of teams to purge or if a complete teardown is targeted. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: Feedback referencing all unlinked setups. |
handleInitTeam(payload)
Handles the initialization of the directory structure and required configurations for a team.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamInitPayload
|
The fully resolved payload (post-gathering) necessary for setup. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: Status payload indicating the result and reporting any issues. |
handlePruneTeams(payload)
Prunes stale team symlinks that point to non-existent directories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamPrunePayload
|
Defines the scope (all companies or specific targets) to run the pruning script against. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: Metrics encapsulating the total number of pruned paths. |
listTeams(payload)
Lists all activated teams, optionally filtered by company.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
TeamListPayload
|
Constraints mapping the query filters (e.g. company name). |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[dict[str, list[str]]]
|
ResultPayload[dict[str, list[str]]]: Found directories matching specified target query. |
chaos.lib.teamUtils
Utility functions for validating, initializing, and managing team structures and symlinks.