From: garciadeblas Date: Wed, 20 Nov 2024 08:41:33 +0000 (+0100) Subject: Add profile-type to oka-add command X-Git-Tag: v17.0.0~9 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=8a976b00269f30e57e1d853485e47bb89a5b2293;p=osm%2Fosmclient.git Add profile-type to oka-add command Change-Id: I64724449667a9b73f9d8c8f59630576411664b32 Signed-off-by: garciadeblas --- diff --git a/osmclient/cli_commands/oka.py b/osmclient/cli_commands/oka.py index b6d4eb5..ff7ad83 100755 --- a/osmclient/cli_commands/oka.py +++ b/osmclient/cli_commands/oka.py @@ -26,9 +26,22 @@ logger = logging.getLogger("osmclient") @click.command(name="oka-add", short_help="adds an OSM Kubernetes Application (OKA)") @click.argument("name") @click.argument("path") +@click.option( + "--profile-type", + type=click.Choice( + [ + "infra-controller-profile", + "infra-config-profile", + "app-profile", + "resource-profile", + ] + ), + default="app-profile", + help="type of profile", +) @click.option("--description", default="", help="human readable description") @click.pass_context -def oka_add(ctx, name, path, description): +def oka_add(ctx, name, path, profile_type, description): """adds an OKA to OSM \b @@ -36,8 +49,15 @@ def oka_add(ctx, name, path, description): PATH: path to a folder with the OKA or to a tar.gz file with the OKA """ logger.debug("") + profile_type_mapping = { + "infra-controller-profile": "infra_controller_profiles", + "infra-config-profile": "infra_config_profiles", + "app-profile": "app_profiles", + "resource-profile": "resource_profiles", + } oka = {} oka["name"] = name + oka["profile_type"] = profile_type_mapping[profile_type] if description: oka["description"] = description ctx.obj.oka.create(name, content_dict=oka, filename=path)