def do_instance_action_list(cs, args):
    """List actions on a server."""
    if cs.api_version < api_versions.APIVersion("2.21"):
        server = shell._find_server(cs, args.server)
    else:
        server = shell._find_server(cs, args.server, raise_if_notfound=False)
    actions = cs.instance_action.list(server)
    utils.print_list(actions,
                     ['Action', 'Request_ID', 'Message', 'Start_Time'],
                     sortby_index=3)
def do_instance_action_list(cs, args):
    """List actions on a server."""
    if cs.api_version < api_versions.APIVersion("2.21"):
        server = shell._find_server(cs, args.server)
    else:
        server = shell._find_server(cs, args.server, raise_if_notfound=False)
    actions = cs.instance_action.list(server)
    utils.print_list(actions,
                     ['Action', 'Request_ID', 'Message', 'Start_Time'],
                     sortby_index=3)
def do_instance_action(cs, args):
    """Show an action."""
    if cs.api_version < api_versions.APIVersion("2.21"):
        server = shell._find_server(cs, args.server)
    else:
        server = shell._find_server(cs, args.server, raise_if_notfound=False)
    action_resource = cs.instance_action.get(server, args.request_id)
    action = action_resource._info
    if 'events' in action:
        action['events'] = pprint.pformat(action['events'])
    utils.print_dict(action)
def do_instance_action(cs, args):
    """Show an action."""
    if cs.api_version < api_versions.APIVersion("2.21"):
        server = shell._find_server(cs, args.server)
    else:
        server = shell._find_server(cs, args.server, raise_if_notfound=False)
    action_resource = cs.instance_action.get(server, args.request_id)
    action = action_resource._info
    if 'events' in action:
        action['events'] = pprint.pformat(action['events'])
    utils.print_dict(action)