Boltctl¶
The main bolt controller
BoltCtl
¶
Class for managing bolts end-to-end from the command line.
__init__(discovered_bolt)
¶
Initialize BoltCtl with a DiscoveredBolt object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
discovered_bolt |
DiscoveredBolt
|
DiscoveredBolt object used to create and manage bolts. |
required |
create_bolt(input_type, output_type, state_type, id, **kwargs)
¶
Create a bolt of a specific type.
Parameters:
Returns:
Name | Type | Description |
---|---|---|
Bolt |
Bolt
|
The created bolt. |
create_parser(parser)
¶
Add arguments to the command-line parser for managing the bolt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parser |
argparse.ArgumentParser
|
Command-line parser. |
required |
deploy_bolt(args)
¶
Deploy a spout of a specific type.
Parameters:
execute_bolt(bolt, method_name, *args, **kwargs)
¶
Execute a method of a bolt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bolt |
Bolt
|
The bolt to execute. |
required |
method_name |
str
|
The name of the method to execute. |
required |
*args |
Positional arguments to pass to the method. |
()
|
|
**kwargs |
Keyword arguments to pass to the method. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
The result of the method. |
run(args)
¶
Run the command-line interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
argparse.Namespace
|
Parsed command-line arguments. |
required |