@click.command(name="app-update", short_help="updates an App Instance")
@utils.require_hostname
@click.argument("name")
-@click.option("--newname", help="New name for the App Instance")
-@click.option("--description", default="", help="human readable description")
-@click.option(
- "--oka",
- default="",
- help="name or ID of the OKA that the App Instance will be based on",
-)
-@click.option(
- "--sw-catalog-path",
- default="",
- help="folder in the SW catalog (git repo) that the App Instance will be based on",
-)
-@click.option(
- "--profile",
- default="",
- help="name or ID of the profile the App Instance will belong to",
-)
-@click.option(
- "--profile-type",
- type=click.Choice(
- [
- "infra-controller-profile",
- "infra-config-profile",
- "app-profile",
- "resource-profile",
- ]
- ),
- default="app-profile",
- help="type of profile. Default: app-profile",
-)
@click.option(
"--model",
default=None,
def app_update(
ctx,
name,
- oka,
- sw_catalog_path,
- profile,
- profile_type,
model,
params,
secret_params,
"""
logger.debug("")
app_changes = {}
- profile_type_mapping = {
- "infra-controller-profile": "infra_controller_profiles",
- "infra-config-profile": "infra_config_profiles",
- "app-profile": "app_profiles",
- "resource-profile": "resource_profiles",
- }
- if oka and sw_catalog_path:
- raise ClientException(
- '"--oka" option is incompatible with "--sw-catalog-path" option'
- )
- if oka:
- app_changes["oka"] = get_oka_id(ctx, oka)
- if sw_catalog_path:
- app_changes["sw_catalog_path"] = sw_catalog_path
- app_changes["profile_type"] = profile_type_mapping[profile_type]
- app_changes["profile"] = get_profile_id(ctx, profile, profile_type)
if model:
with open(model, "r", encoding="utf-8") as cf:
model_data = cf.read()