Class CapabilitiesList
java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
ai.wanaku.cli.main.commands.capabilities.CapabilitiesList
Command-line interface for listing all service capabilities in the Wanaku system.
This command provides functionality to discover and display both management tools and resource providers available in the system, along with their current status and activity information. It combines data from multiple API endpoints to present a unified view of system capabilities in a tabular format.
The command supports the following functionality:
- Fetches management tools and resource providers from the API
- Retrieves activity status for each service
- Merges and correlates data from multiple sources
- Displays results in a formatted table with columns for service, type, host, port, status, and last seen
Usage examples:
# List all capabilities using default host wanaku capabilities list # List capabilities from a specific host wanaku capabilities list --host http://api.example.com:8080
Output format:
service | serviceType | host | port | status | lastSeen --------|-------------------|---------------|------|--------|---------- http | tool-invoker | 192.168.1.101 | 9000 | active | Monday, June 23, 2025 at 07:00:26 sqs | tool-invoker | 192.168.1.101 | 9011 | active | Monday, June 16, 2025 at 13:22:29
- See Also:
-
Field Summary
Fields inherited from class ai.wanaku.cli.main.commands.BaseCommand
EXIT_ERROR, EXIT_OK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) Executes the capabilities listing command.Methods inherited from class ai.wanaku.cli.main.commands.BaseCommand
call, initService
-
Constructor Details
-
CapabilitiesList
public CapabilitiesList()
-
-
Method Details
-
doCall
public Integer doCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) throws IOException, Exception Executes the capabilities listing command.This method orchestrates the entire process of:
- Creating a terminal instance for output
- Initializing the targets service with the specified host
- Fetching and merging capabilities data from the API
- Displaying the results in a formatted table
The method uses a try-with-resources block to ensure proper terminal cleanup and includes timeout handling for API operations.
- Specified by:
doCallin classBaseCommand- Returns:
BaseCommand.EXIT_OKif the command executes successfully- Throws:
Exception- if there's an error during execution, including:- API communication failures
- Terminal creation issues
- Data processing errors
- Timeout while waiting for API responses
IOException
-