graviteeio_cli/commands/apim/apps/apply.py
def apply(ctx, app_id, values_file, set, debug, config_path):
    """
    This command allow to apply an APP configuration.
    If app id is not filled, api definition will be created. 
    app id can be passed in option of command line, with a pipe (i.e echo $APP_ID | gio apply ...) or in the values file with app-id param
    The APP is managed with the template engine (jinja).
    APP propetries are defined in plain YAML or JSON files.
    """
    app_client: AppClient = ctx.obj['app_client']
    # gio_config: GraviteeioConfig = ctx.obj['config']

    app_resolver = ConfigResolver(config_path, values_file)
    app_data = app_resolver.get_data(
            Config_Type.APP,
            set_values=set,
            debug=debug
    )

    if debug:
        click.echo("Data sent.")
        click.echo(json.dumps(app_data))
    else:

        if not click.get_text_stream('stdin').isatty() and not app_id:
            stdin_stream = click.get_text_stream('stdin').read().strip()
            app_id = stdin_stream

        if not app_id:
            app_id = app_resolver.get_value("app_id")

        if app_id:
            click.echo(f"Starting to apply APP: [{app_id}] '{app_data['name']}'.")
            resp = app_client.update_import(app_id, app_data)
            click.echo(f"APP [{app_id}] is updated")
        else:
            click.echo(f"Starting to create APP [{app_data['name']}].")
            resp = app_client.create_import(app_data)
            app_id = resp["id"]
            click.echo(f"APP has been created with id [{app_id}].")

    This command allow to apply an APP configuration.
    If app id is not filled, api definition will be created. 
    app id can be passed in option of command line, with a pipe (i.e echo $APP_ID | gio apply ...) or in the values file with app-id param
    The APP is managed with the template engine (jinja).
    APP propetries are defined in plain YAML or JSON files.
    
This command allow to apply an APP configuration.
If app id is not filled, api definition will be created.
app id can be passed in option of command line, with a pipe  or in the values file with app-id param
The APP is managed with the template engine (jinja).
APP propetries are defined in plain YAML or JSON files.
This command allow to apply an APP configuration . If app id is not filled api definition will be created . app id can be passed in option of command line with a pipe or in the values file with app - id param The APP is managed with the template engine ( jinja ) . APP propetries are defined in plain YAML or JSON files .
def apply(ctx, app_id, values_file, set, debug, config_path):
    app_client: AppClient = ctx.obj['app_client']
    app_resolver = ConfigResolver(config_path, values_file)
    app_data = app_resolver.get_data(
            Config_Type.APP,
            set_values=set,
            debug=debug
    )
    if debug:
        click.echo("Data sent.")
        click.echo(json.dumps(app_data))
    else:
        if not click.get_text_stream('stdin').isatty() and not app_id:
            stdin_stream = click.get_text_stream('stdin').read().strip()
            app_id = stdin_stream
        if not app_id:
            app_id = app_resolver.get_value("app_id")
        if app_id:
            click.echo(f"Starting to apply APP: [{app_id}] '{app_data['name']}'.")
            resp = app_client.update_import(app_id, app_data)
            click.echo(f"APP [{app_id}] is updated")
        else:
            click.echo(f"Starting to create APP [{app_data['name']}].")
            resp = app_client.create_import(app_data)
            app_id = resp["id"]
            click.echo(f"APP has been created with id [{app_id}].")
def apply ( ctx , app_id , values_file , set , debug , config_path ) : app_client : AppClient = ctx . obj [ 'app_client' ] app_resolver = ConfigResolver ( config_path , values_file ) app_data = app_resolver . get_data ( Config_Type . APP , set_values = set , debug = debug ) if debug : click . echo ( "Data sent." ) click . echo ( json . dumps ( app_data ) ) else : if not click . get_text_stream ( 'stdin' ) . isatty ( ) and not app_id : stdin_stream = click . get_text_stream ( 'stdin' ) . read ( ) . strip ( ) app_id = stdin_stream if not app_id : app_id = app_resolver . get_value ( "app_id" ) if app_id : click . echo ( f"Starting to apply APP: [{app_id}] '{app_data['name']}'." ) resp = app_client . update_import ( app_id , app_data ) click . echo ( f"APP [{app_id}] is updated" ) else : click . echo ( f"Starting to create APP [{app_data['name']}]." ) resp = app_client . create_import ( app_data ) app_id = resp [ "id" ] click . echo ( f"APP has been created with id [{app_id}]." )
This command allow to apply an APP configuration.
This command allow to apply an APP configuration .
"""
    This command allow to apply an APP configuration.
    If app id is not filled, api definition will be created. 
    app id can be passed in option of command line, with a pipe (i.e echo $APP_ID | gio apply ...) or in the values file with app-id param
    The APP is managed with the template engine (jinja).
    APP propetries are defined in plain YAML or JSON files.
    """ # gio_config: GraviteeioConfig = ctx.obj['config']
ctx
app_id
values_file
set
debug
config_path