@@ -52,6 +52,7 @@ def _format_routes(routes):
5252
5353_formatters = {
5454 'admin_state_up' : _format_admin_state ,
55+ 'is_admin_state_up' : _format_admin_state ,
5556 'external_gateway_info' : _format_external_gateway_info ,
5657 'availability_zones' : utils .format_list ,
5758 'availability_zone_hints' : utils .format_list ,
@@ -62,6 +63,9 @@ def _format_routes(routes):
6263def _get_columns (item ):
6364 column_map = {
6465 'tenant_id' : 'project_id' ,
66+ 'is_ha' : 'ha' ,
67+ 'is_distributed' : 'distributed' ,
68+ 'is_admin_state_up' : 'admin_state_up' ,
6569 }
6670 return sdk_utils .get_osc_show_columns_for_sdk_resource (item , column_map )
6771
@@ -150,6 +154,8 @@ def take_action(self, parsed_args):
150154 subnet_id = subnet .id )
151155
152156
157+ # TODO(yanxing'an): Use the SDK resource mapped attribute names once the
158+ # OSC minimum requirements include SDK 1.0.
153159class CreateRouter (command .ShowOne ):
154160 _description = _ ("Create a new router" )
155161
@@ -255,6 +261,8 @@ def take_action(self, parsed_args):
255261 raise exceptions .CommandError (msg )
256262
257263
264+ # TODO(yanxing'an): Use the SDK resource mapped attribute names once the
265+ # OSC minimum requirements include SDK 1.0.
258266class ListRouter (command .Lister ):
259267 _description = _ ("List routers" )
260268
@@ -297,10 +305,10 @@ def take_action(self, parsed_args):
297305 'id' ,
298306 'name' ,
299307 'status' ,
300- 'admin_state_up ' ,
301- 'distributed ' ,
302- 'ha ' ,
303- 'tenant_id ' ,
308+ 'is_admin_state_up ' ,
309+ 'is_distributed ' ,
310+ 'is_ha ' ,
311+ 'project_id ' ,
304312 )
305313 column_headers = (
306314 'ID' ,
@@ -319,8 +327,10 @@ def take_action(self, parsed_args):
319327
320328 if parsed_args .enable :
321329 args ['admin_state_up' ] = True
330+ args ['is_admin_state_up' ] = True
322331 elif parsed_args .disable :
323332 args ['admin_state_up' ] = False
333+ args ['is_admin_state_up' ] = False
324334
325335 if parsed_args .project :
326336 project_id = identity_common .find_project (
@@ -329,6 +339,7 @@ def take_action(self, parsed_args):
329339 parsed_args .project_domain ,
330340 ).id
331341 args ['tenant_id' ] = project_id
342+ args ['project_id' ] = project_id
332343 if parsed_args .long :
333344 columns = columns + (
334345 'routes' ,
@@ -407,6 +418,8 @@ def take_action(self, parsed_args):
407418 subnet_id = subnet .id )
408419
409420
421+ # TODO(yanxing'an): Use the SDK resource mapped attribute names once the
422+ # OSC minimum requirements include SDK 1.0.
410423class SetRouter (command .Command ):
411424 _description = _ ("Set router properties" )
412425
0 commit comments