graviteeio_cli/commands/apim/apps/ls.py
def ls(obj, output):
    """
This command lists all Application available on Api management platform.

Default query with output `table`: `[].{Id: id, Name: name, Tags: style_tags(tags), Synchronized: style_synchronized(is_synchronized), Status: style_state(state), Workflow: style_workflow_state(workflow_state)}`
    """

    app_client: AppClient = obj['app_client']
    apps = app_client.get()
    outputFormatType = OutputFormatType.value_of(output)

    if outputFormatType.TABLE == outputFormatType:
        query = "[].{Id: id, Name: name, Type: type, Owner: owner.displayName}"

    try:
        apps_filtered = jmespath.search(query, apps)

        logging.debug("apps_filtered: {}".format(apps_filtered))
        if not apps_filtered:
            click.echo("No result")
            return

        header = None
        if type(apps_filtered) is list and type(apps_filtered[0]) is dict and len(apps_filtered) > 0:
            header = apps_filtered[0].keys()

        outputFormatType.echo(apps_filtered, header=header)

    except exceptions.JMESPathError as jmespatherr:
        logging.exception("LIST JMESPathError exception")
        raise GraviteeioError(str(jmespatherr))

This command lists all Application available on Api management platform.

Default query with output `table`: `[].{Id: id, Name: name, Tags: style_tags(tags), Synchronized: style_synchronized(is_synchronized), Status: style_state(state), Workflow: style_workflow_state(workflow_state)}`
    
This command lists all Application available on Api management platform.
This command lists all Application available on Api management platform .
def ls(obj, output):
    app_client: AppClient = obj['app_client']
    apps = app_client.get()
    outputFormatType = OutputFormatType.value_of(output)
    if outputFormatType.TABLE == outputFormatType:
        query = "[].{Id: id, Name: name, Type: type, Owner: owner.displayName}"
    try:
        apps_filtered = jmespath.search(query, apps)
        logging.debug("apps_filtered: {}".format(apps_filtered))
        if not apps_filtered:
            click.echo("No result")
            return
        header = None
        if type(apps_filtered) is list and type(apps_filtered[0]) is dict and len(apps_filtered) > 0:
            header = apps_filtered[0].keys()
        outputFormatType.echo(apps_filtered, header=header)
    except exceptions.JMESPathError as jmespatherr:
        logging.exception("LIST JMESPathError exception")
        raise GraviteeioError(str(jmespatherr))
def ls ( obj , output ) : app_client : AppClient = obj [ 'app_client' ] apps = app_client . get ( ) outputFormatType = OutputFormatType . value_of ( output ) if outputFormatType . TABLE == outputFormatType : query = "[].{Id: id, Name: name, Type: type, Owner: owner.displayName}" try : apps_filtered = jmespath . search ( query , apps ) logging . debug ( "apps_filtered: {}" . format ( apps_filtered ) ) if not apps_filtered : click . echo ( "No result" ) return header = None if type ( apps_filtered ) is list and type ( apps_filtered [ 0 ] ) is dict and len ( apps_filtered ) > 0 : header = apps_filtered [ 0 ] . keys ( ) outputFormatType . echo ( apps_filtered , header = header ) except exceptions . JMESPathError as jmespatherr : logging . exception ( "LIST JMESPathError exception" ) raise GraviteeioError ( str ( jmespatherr ) )
This command lists all Application available on Api management platform.
This command lists all Application available on Api management platform .
"""
This command lists all Application available on Api management platform.

Default query with output `table`: `[].{Id: id, Name: name, Tags: style_tags(tags), Synchronized: style_synchronized(is_synchronized), Status: style_state(state), Workflow: style_workflow_state(workflow_state)}`
    """
obj
output