@@ -3197,22 +3197,84 @@ def ls_shell_complete(ctx, param, incomplete) -> List[str]:
3197
3197
image_names : List [str ] = list (map (lambda x : x [0 ], images ))
3198
3198
active_networks_names : List [str ] = ContainerController .list_all_networks ()
3199
3199
return (["containers" , "networks" , "images" , "emulations" , "all" , "environments" , "prometheus" , "node_exporter" ,
3200
- "cadvisor" , "pgadmin" , "flask" , "statsmanager" , "--all" , "--running" , "--stopped" ] + emulations
3201
- + container_names + image_names + active_networks_names + simulations )
3200
+ "cadvisor" , "pgadmin" , "flask" , "statsmanager" , "simulations" , "emulation_executions" , "cluster" , "nginx" ,
3201
+ "postgresql" , "docker" , "hostmanagers" , "clientmanager" , "snortmanagers" , "elkmanager" , "trafficmanagers" ,
3202
+ "kafkamanager" , "ossecmanagers" , "ryumanager" , "filebeats" , "metricbeats" , "packetbeats" , "logfiles" ,
3203
+ "heartbeats" , "logfile" , "--ip" , "--id" , "--name" , "--logfile_name" , "--all" , "--running" , "--stopped" ]
3204
+ + emulations + container_names + image_names + active_networks_names + simulations )
3202
3205
3203
3206
3204
3207
@click .command ("ls" , help = "containers | networks | images | emulations | all | environments | prometheus "
3205
3208
"| node_exporter | cadvisor | pgadmin | statsmanager | flask | "
3206
3209
"simulations | emulation_executions | cluster | nginx | postgresql | docker | hostmanagers | "
3207
3210
"clientmanager | snortmanagers | elkmanager | trafficmanagers | kafkamanager | "
3208
- "ossecmanagers | ryumanager | filebeats | metricbeats | heartbeats | logfiles | logfile" )
3211
+ "ossecmanagers | ryumanager | filebeats | metricbeats | heartbeats| packetbeats | logfiles | "
3212
+ "logfile \n \n "
3213
+ "\b \n "
3214
+ "- \033 [95mcontainers\033 [0m: list all|stopped|running containers. \n "
3215
+ "- \033 [95mnetworks\033 [0m: list active networks. \n "
3216
+ "- \033 [95mimages\033 [0m: list all images in CSLE. \n "
3217
+ "- \033 [95memulations\033 [0m: list all|stopped|running emulations.\n "
3218
+ "- \033 [95mall\033 [0m: list all cluster, networks, containers, images, emulations, emulation"
3219
+ " executions, simulations, and CSLE gym environments.\n "
3220
+ "- \033 [95menvironments\033 [0m: list all registered Open AI gym environments.\n "
3221
+ "- \033 [95mprometheus\033 [0m: list status of prometheus. \n "
3222
+ "- \033 [95mnode_exporter\033 [0m: list status of node exporter. \n "
3223
+ "- \033 [95mcadvisor\033 [0m: list status of cadvisor. \n "
3224
+ "- \033 [95mpgadmin\033 [0m: list status of pgadmin. \n "
3225
+ "- \033 [95mstatsmanager\033 [0m: list status of the docker stats manager.\n "
3226
+ "- \033 [95mflask\033 [0m: list status of the management system.\n "
3227
+ "- \033 [95msimulations\033 [0m: list all simulations. \n "
3228
+ "- \033 [95memulation_executions\033 [0m: list all emulation executions. \n "
3229
+ "- \033 [95mcluster\033 [0m: list all clusters. \n "
3230
+ "- \033 [95mnginx\033 [0m: lists status of nginx. \n "
3231
+ "- \033 [95mpostgresql\033 [0m: lists status of PostgreSQL. \n "
3232
+ "- \033 [95mdocker\033 [0m: lists status of the docker engine. \n "
3233
+ "- \033 [95mhostmanagers\033 [0m: displays the status and IP addresses of host managers running"
3234
+ " on a node with the specified --ip option for the emulation identified by the specified"
3235
+ " --name and --id.\n "
3236
+ "- \033 [95mclientmanager\033 [0m: list the information about the client manager and its status"
3237
+ " for a node with the specified --ip option for the emulation identified by the specified"
3238
+ " --name and --id.\n "
3239
+ "- \033 [95msnortmanagers\033 [0m: list the ip address and status of snortmangers for a "
3240
+ "node with the specified --ip option for the emulation identified by the specified"
3241
+ " --name and --id.\n "
3242
+ "- \033 [95melkmanager\033 [0m: list information and status of elk manager for a node with the"
3243
+ " specified --ip option for the emulation identified by the specified --name and --id.\n "
3244
+ "- \033 [95mtrafficmanagers\033 [0m: list ip address and status of trafficmangers for a "
3245
+ "node with the specified --ip option for the emulation identified by the specified"
3246
+ " --name and --id.\n "
3247
+ "- \033 [95mkafkamanager\033 [0m: list information and status of the kafka manager for "
3248
+ "a node with the specified --ip option for the emulation identified by the specified "
3249
+ "--name and --id.\n "
3250
+ "- \033 [95mossecmanagers\033 [0m: list ip address and status of ossec managers for a node with"
3251
+ " the specified --ip option for the emulation identified by the specified --name and --id.\n "
3252
+ "- \033 [95mryumanager\033 [0m: list information about ryu managers for a node with"
3253
+ " the specified --ip option for the emulation identified by the specified --name and --id."
3254
+ "The emulation should include SDN for this command.\n "
3255
+ "- \033 [95mfilebeats\033 [0m: list ip address and status of filebeats for the running "
3256
+ "containers for a node with the specified --ip option for the emulation identified by the"
3257
+ " specified --name and --id.\n "
3258
+ "- \033 [95mmetricbeats\033 [0m: list ip address and status of metricbeats for the running"
3259
+ " containers for a node with the specified --ip option for the emulation identified by"
3260
+ " the specified --name and --id.\n "
3261
+ "- \033 [95mheartbeats\033 [0m: list ip address and status of heartbeats for the running "
3262
+ "containers for a node with the specified --ip option for the emulation identified by the "
3263
+ "specified --name and --id.\n "
3264
+ "- \033 [95mpacketbeats\033 [0m: list ip address and status of packetbeats for the running"
3265
+ " containers for a node with the specified --ip option for the emulation identified by the"
3266
+ " specified --name and --id.\n "
3267
+ "- \033 [95mlogfiles\033 [0m: list all CSLE log files with their path for a node with "
3268
+ "the specified --ip option.\n "
3269
+ "- \033 [95mlogfile\033 [0m: show the logs in a file with the path specified with "
3270
+ "--logfile_name option for a node with the specified --ip option.\n " )
3209
3271
@click .argument ('entity' , default = 'all' , type = str , shell_complete = ls_shell_complete )
3210
3272
@click .option ('--all' , is_flag = True , help = 'list all' )
3211
3273
@click .option ('--running' , is_flag = True , help = 'list running only (default)' )
3212
3274
@click .option ('--stopped' , is_flag = True , help = 'list stopped only' )
3213
- @click .option ('--ip' , default = "" , type = str )
3214
- @click .option ('--id' , default = None , type = int )
3215
- @click .option ('--name' , default = "" , type = str )
3275
+ @click .option ('--ip' , default = "" , type = str , help = 'node IP address to run the command' )
3276
+ @click .option ('--id' , default = None , type = int , help = "emulation id" )
3277
+ @click .option ('--name' , default = "" , type = str , help = 'name of the emulation' )
3216
3278
@click .option ('--logfile_name' , default = "" , type = str , help = 'name of the logfile to to retrieve' )
3217
3279
def ls (entity : str , all : bool , running : bool , stopped : bool , ip : str , name : str , id : int , logfile_name : str ) -> None :
3218
3280
"""
@@ -3222,6 +3284,10 @@ def ls(entity: str, all: bool, running: bool, stopped: bool, ip: str, name: str,
3222
3284
:param all: flag that indicates whether all containers/emulations should be listed
3223
3285
:param running: flag that indicates whether running containers/emulations should be listed (default)
3224
3286
:param stopped: flag that indicates whether stopped containers/emulations should be listed
3287
+ :param ip: node IP address to run the command
3288
+ :param id: id of the emulation that we run ls command for
3289
+ :param name: name of the emulation that we run ls command for
3290
+ :param logfile_name: name of the log file to be shown
3225
3291
:return: None
3226
3292
"""
3227
3293
import csle_common .constants .constants as constants
@@ -4045,7 +4111,7 @@ def list_all(all: bool = False, running: bool = True, stopped: bool = False) ->
4045
4111
4046
4112
def list_statsmanager () -> None :
4047
4113
"""
4048
- List status of the docker host manager
4114
+ List status of the docker stats manager
4049
4115
4050
4116
:return: None
4051
4117
"""
@@ -4718,9 +4784,9 @@ def help() -> None:
4718
4784
click .secho (f"{ click .style ('init' , fg = 'magenta' )} Initializes CSLE and sets up mgmt accounts " ,
4719
4785
bold = False )
4720
4786
click .secho (f"{ click .style ('ls' , fg = 'magenta' )} Lists information about CSLE " , bold = False )
4721
- click .secho (f"{ click .style ('start' , fg = 'magenta' )} Starts en emulation, a job,"
4787
+ click .secho (f"{ click .style ('start' , fg = 'magenta' )} Starts an emulation, a job,"
4722
4788
f" or a container " , bold = False )
4723
- click .secho (f"{ click .style ('stop' , fg = 'magenta' )} Stops en entity, eg. emulation, a job,"
4789
+ click .secho (f"{ click .style ('stop' , fg = 'magenta' )} Stops an entity, eg. emulation, a job,"
4724
4790
f" or a container " , bold = False )
4725
4791
click .secho (f"{ click .style ('rm' , fg = 'magenta' )} Removes a container, a network, an image, "
4726
4792
f"all networks, all images, or all containers " , bold = False )
0 commit comments