@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
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)