Styx Core
chaos.lib.styx
get_styx_registry(payload)
Fetches the Styx registry data from the specified URL.
Returns:
| Type | Description |
|---|---|
tuple[str | None, str | None]
|
tuple[str | None, str | None]: A tuple containing the registry data (str) and an error message (str), if applicable. |
handle_styx(payload)
Handles parsing and routing for the specified styx subcommands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
StyxPayload
|
The structured payload containing the requested action and corresponding details. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[dict[str, dict[str, str]] | None]
|
ResultPayload[dict[str, dict[str, str]] | None]: The generic result of the styx operation. |
install_styx_entries(payload)
Installs the given Styx registry entries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
StyxPayload
|
The structured payload containing the list of registry entries to install and the force flag. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: The status payload regarding the operation's outcome. |
list_styx_entries(payload)
Lists the available Styx registry entries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
StyxPayload
|
The structured payload containing the list of registry entries to display. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[dict[str, dict[str, str]]]
|
ResultPayload[dict[str, dict[str, str]]: A payload containing matched registry details. |
parse_styx_registry(registry_data, registry_names)
Parses the Styx registry data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry_data
|
str
|
The raw string data of the registry YAML. |
required |
registry_names
|
list[str]
|
The list of specific registry names to parse. |
required |
Returns:
| Type | Description |
|---|---|
tuple[list[dict], list[str]]
|
tuple[list[dict], list[str]]: A tuple of matched entries and a list of parsing errors. |
uninstall_styx_entries(entries)
Uninstalls the given Styx registry entries using pip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entries
|
list[str]
|
The list of registry entries to uninstall. |
required |
Returns:
| Type | Description |
|---|---|
ResultPayload[None]
|
ResultPayload[None]: A payload summarizing the deletion state. |