@@ -124,6 +124,28 @@ def def_show_parser(s_parser):
124124 return show_parser
125125
126126
127+ def def_show_os_parser (s_parser ):
128+ """
129+ Define the show_os subparser.
130+
131+ Parameters
132+ ----------
133+ s_parser: subparsers.
134+
135+ Returns
136+ -------
137+ ArgumentParser: the show subcommand parser.
138+ """
139+ show_os_parser = s_parser .add_parser ('show-os' ,
140+ description = 'Display the current network interface configuration as well as the VNIC configuration from OCI.' ,
141+ help = 'Display the current network interface configuration as well as the VNIC configuration from OCI.' )
142+ show_os_parser .add_argument ('--output-mode' ,
143+ choices = ('parsable' , 'table' , 'json' , 'text' ),
144+ help = 'Set output mode.' ,
145+ default = 'table' )
146+ return show_os_parser
147+
148+
127149def def_show_vnics_parser (s_parser ):
128150 """
129151 Define the show_vnics subparser
@@ -533,6 +555,9 @@ def get_arg_parser():
533555 # show
534556 _ = def_show_parser (subparser )
535557 #
558+ # show-os
559+ _ = def_show_os_parser (subparser )
560+ #
536561 # show-vnics
537562 _ = def_show_vnics_parser (subparser )
538563 #
@@ -1002,6 +1027,25 @@ def _display_subnet(interface):
10021027 return nw_conf
10031028
10041029
1030+ def do_show_os_network_config (show_args ):
1031+ """
1032+ Display the current network interface configuration as well as the VNIC configuration from OCI.
1033+
1034+ Parameters
1035+ ----------
1036+ show_args: namespace
1037+ The command line arguments.
1038+
1039+ Returns
1040+ -------
1041+ int: 0 on success, 1 otherwise.
1042+ """
1043+ _logger .debug ('%s' , where_am_i ())
1044+ vnic_utils = get_vnic_utils (show_args )
1045+ show_os_network_config (vnic_utils , show_args .output_mode )
1046+ return 0
1047+
1048+
10051049def show_os_network_config (vnic_utils , mode ):
10061050 """
10071051 Display the current network interface configuration as well as the VNIC configuration from OCI.
@@ -1011,7 +1055,7 @@ def show_os_network_config(vnic_utils, mode):
10111055 vnic_utils :
10121056 The VNIC configuration instance.
10131057
1014- mode :
1058+ mode : str
10151059 The output mode
10161060
10171061 Returns
@@ -2041,6 +2085,7 @@ def main():
20412085 """
20422086 sub_commands = {'usage' : show_usage ,
20432087 'show' : show_network ,
2088+ 'show-os' : do_show_os_network_config ,
20442089 'show-vnics' : show_vnics ,
20452090 'show-vnics-all' : show_vnics_all ,
20462091 'show-vcns' : show_vcns ,
0 commit comments