Class CapabilitiesShow
java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
ai.wanaku.cli.main.commands.capabilities.CapabilitiesShow
Command implementation for displaying detailed information about specific service capabilities.
This command retrieves and displays comprehensive details about capabilities for a specified service. When multiple capabilities exist for the same service, it provides an interactive selection interface allowing users to choose which specific capability instance to examine.
The command supports filtering capabilities by service name and handles various scenarios:
- No capabilities found - displays warning message
- Single capability - directly shows detailed information
- Multiple capabilities - presents interactive selection menu
Example usage:
wanaku capabilities show http
wanaku capabilities show --host http://remote:8080 sqs
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Wanaku CLI Team
-
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 show command.Methods inherited from class ai.wanaku.cli.main.commands.BaseCommand
call, initService
-
Constructor Details
-
CapabilitiesShow
public CapabilitiesShow()
-
-
Method Details
-
doCall
public Integer doCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) throws IOException, Exception Executes the capabilities show command.This method orchestrates the entire capability retrieval and display process:
- Initializes the targets service with the specified host
- Fetches all available capabilities from the API
- Filters capabilities by the specified service name
- Handles display based on the number of matching capabilities found
- Specified by:
doCallin classBaseCommand- Parameters:
terminal- the terminal instance for user interactionprinter- the printer instance for formatted output- Returns:
BaseCommand.EXIT_OKon successful execution,BaseCommand.EXIT_ERRORon failure- Throws:
IOException- if an I/O error occurs during API communication or terminal interactionException- if any other error occurs during command execution
-