diff --git a/oks_cli/cache.py b/oks_cli/cache.py index f8e7702..5301c4a 100644 --- a/oks_cli/cache.py +++ b/oks_cli/cache.py @@ -5,7 +5,7 @@ # DEFINE THE CACHE COMMAND GROUP @click.group(help="Cache related commands.") @click.option('--project-name', '-p', required = False, help="Project Name", shell_complete=project_completer) -@click.option('--cluster-name', '-c', required = False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required = False, help="Cluster Name", shell_complete=cluster_completer) @click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cache(ctx, project_name, cluster_name, profile): @@ -21,7 +21,7 @@ def delete_cache(force): @cache.command('kubeconfigs', help="List cached kubeconfigs") @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--cluster-name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) @click.option('--plain', is_flag=True, help="Plain table format") @click.option('--msword', is_flag=True, help="Microsoft Word table format") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) diff --git a/oks_cli/cluster.py b/oks_cli/cluster.py index 06cce76..d0bcf6a 100644 --- a/oks_cli/cluster.py +++ b/oks_cli/cluster.py @@ -19,10 +19,8 @@ # DEFINE THE CLUSTER GROUP @click.group(help="Cluster related commands.") -@click.option('--project', 'project_name', required = False, help="Project Name") -@click.option('--project-name', '-p', required = False, help="Project Name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required = False, help="Cluster Name") -@click.option('--cluster-name', '-c', required = False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) @click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cluster(ctx, project_name, cluster_name, profile): @@ -31,7 +29,7 @@ def cluster(ctx, project_name, cluster_name, profile): # LOGIN ON CLUSTER @cluster.command('login', help="Set a default cluster") -@click.option('--cluster-name', '-c', required=False, help="Name of cluster", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Name of cluster", shell_complete=cluster_completer) @click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cluster_login(ctx, cluster_name, profile): @@ -71,13 +69,12 @@ def cluster_logout(ctx, profile): # LIST CLUSTERS @cluster.command('list', help="List all clusters") @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required = False, help="Cluster Name") -@click.option('--cluster-name', '-c', required = False, help="Cluster Name", shell_complete=cluster_completer) -@click.option('--deleted', is_flag=True, help="List deleted clusters") +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--deleted', '-x', is_flag=True, help="List deleted clusters") # x pour "deleted" / "removed" @click.option('--plain', is_flag=True, help="Plain table format") @click.option('--msword', is_flag=True, help="Microsoft Word table format") @click.option('--watch', '-w', is_flag=True, help="Watch the changes") -@click.option('-o', '--output', type=click.Choice(["json", "yaml", "wide"]), help="Specify output format") +@click.option('--output', '-o', type=click.Choice(["json", "yaml", "wide"]), help="Specify output format") @click.option('--profile', help="Configuration profile to use") @click.pass_context def cluster_list(ctx, project_name, cluster_name, deleted, plain, msword, watch, output, profile): @@ -215,10 +212,9 @@ def format_row(cluster): # GET CLUSTER BY NAME @cluster.command('get', help="Get a cluster by name") -@click.option('--project-name', '-p', required = False, help="Project Name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required=False, help="Cluster Name", shell_complete=cluster_completer) -@click.option('--cluster-name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cluster_get_command(ctx, project_name, cluster_name, output, profile): @@ -313,22 +309,22 @@ def _create_cluster(project_name, cluster_config, output): @cluster.command('create', help="Create a new cluster") @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) @click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) -@click.option('--description', help="Description of the cluster") -@click.option('--admin', help="Admin Whitelist") -@click.option('--version', shell_complete=shell_completions, help="Kubernetes version") +@click.option('--description', '-d', help="Description of the cluster") +@click.option('--admin', '-a', help="Admin Whitelist") +@click.option('--version', '-v', shell_complete=shell_completions, help="Kubernetes version") @click.option('--cidr-pods', help="CIDR of pods") @click.option('--cidr-service', help='CIDR of services') @click.option('--control-plane', shell_complete=shell_completions, help="Controlplane plan") -@click.option('--zone', multiple=True, shell_complete=shell_completions, help="List of Control Plane availability zones") +@click.option('--zone', '-z', multiple=True, shell_complete=shell_completions, help="List of Control Plane availability zones") @click.option('--enable-admission-plugins', help="List of admission plugins, separated by commas") @click.option('--disable-admission-plugins', help="List of admission plugins, separated by commas") -@click.option('--quirk', multiple=True, help="Quirk") -@click.option('--tags', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") +@click.option('--quirk', '-q', multiple=True, help="Quirk") +@click.option('--tags', '-t', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") @click.option('--disable-api-termination', type=click.BOOL, help="Disable delete action by API") -@click.option('--cp-multi-az', is_flag=True, help="enable control plane multi az") +@click.option('--cp-multi-az', '-m', is_flag=True, help="Enable control plane multi AZ") @click.option('--dry-run', is_flag=True, help="Client dry-run, only print the object that would be sent, without sending it") -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") -@click.option('-f', '--filename', type=click.File("r"), help="Path to file to use to create the cluster ") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--filename', '-f', type=click.File("r"), help="Path to file to use to create the cluster ") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cluster_create_command(ctx, project_name, cluster_name, description, admin, version, cidr_pods, cidr_service, control_plane, zone, enable_admission_plugins, disable_admission_plugins, quirk, tags, disable_api_termination, cp_multi_az, dry_run, output, filename, profile): @@ -412,20 +408,19 @@ def cluster_create_command(ctx, project_name, cluster_name, description, admin, # UPDATE CLUSTER @cluster.command('update', help="Update a cluster by name") @click.option('--project-name', '-p', required=False, help="Project name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required=False, help="Cluster name") -@click.option('--cluster-name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) -@click.option('--description', help="Description of the cluster") -@click.option('--admin', help="Admin Whitelist") -@click.option('--version', shell_complete=shell_completions, help="Kubernetes version") -@click.option('--tags', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) +@click.option('--description', '-d', help="Description of the cluster") +@click.option('--admin', '-a', help="Admin Whitelist") +@click.option('--version', '-v', shell_complete=shell_completions, help="Kubernetes version") +@click.option('--tags', '-t', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") @click.option('--enable-admission-plugins', help="List of admission plugins, separated by commas") @click.option('--disable-admission-plugins', help="List of admission plugins, separated by commas") -@click.option('--quirk', multiple=True, help="Quirk") +@click.option('--quirk', '-q', multiple=True, help="Quirk") @click.option('--disable-api-termination', type=click.BOOL, help="Disable delete action by API") @click.option('--control-plane', shell_complete=shell_completions, help="Controlplane plan") @click.option('--dry-run', is_flag=True, help="Client dry-run, only print the object that would be sent, without sending it") -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") -@click.option('-f', '--filename', type=click.File("r"), help="Path to file to use to update the cluster ") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--filename', '-f', type=click.File("r"), help="Path to file to use to update the cluster ") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def cluster_update_command(ctx, project_name, cluster_name, description, admin, version, tags, enable_admission_plugins, disable_admission_plugins, quirk, disable_api_termination, control_plane, dry_run, output, filename, profile): @@ -500,9 +495,8 @@ def cluster_update_command(ctx, project_name, cluster_name, description, admin, # UPGRADE CLUSTER @cluster.command('upgrade', help="Upgrade a cluster by name") @click.option('--project-name', '-p', required=False, help="Project name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required=False, help="Cluster name") -@click.option('--cluster-name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--force', is_flag=True, help="Force upgrade") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context @@ -522,9 +516,8 @@ def cluster_update_command(ctx, project_name, cluster_name, output, force, profi # DELETE CLUSTER BY NAME @cluster.command('delete', help="Delete a cluster by name") @click.option('--project-name', '-p', required=False, help="Project name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required=False, help="Cluster name") -@click.option('--cluster-name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster name", shell_complete=cluster_completer) +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--dry-run', is_flag=True, help="Run without any action") @click.option('--force', is_flag=True, help="Force deletion without confirmation") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @@ -554,8 +547,7 @@ def cluster_delete_command(ctx, project_name, cluster_name, output, dry_run, for # GET KUBECONFIG @cluster.command('kubeconfig', help="Fetch the kubeconfig for a cluster") @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--name', 'cluster_name', required=False, help="Cluster name") -@click.option('--cluster-name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) @click.option('--print-path', is_flag=True, help="Print path to saved kubeconfig") @click.option('--refresh', '--force', is_flag=True, help="Force refresh saved kubeconfig") @click.option('--nacl', is_flag=True, help="Use public key encryption on wire (require api support)") @@ -664,11 +656,11 @@ def _run_kubectl(project_id, cluster_id, user, group, args, input=None): @cluster.command('kubectl', help='Fetch the kubeconfig for a cluster and run kubectl against it', context_settings={"ignore_unknown_options": True}) @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--cluster-name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) @click.option('--user', type=click.STRING, help="User") @click.option('--group', type=click.STRING, help="Group") -@click.argument("args", nargs=-1, type=click.UNPROCESSED) @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) +@click.argument("args", nargs=-1, type=click.UNPROCESSED) @click.pass_context def cluster_kubectl_command(ctx, project_name, cluster_name, user, group, args, profile): """CLI command to run kubectl against a specified cluster using its kubeconfig.""" @@ -681,9 +673,9 @@ def cluster_kubectl_command(ctx, project_name, cluster_name, user, group, args, _run_kubectl(project_id, cluster_id, user, group, args) -@click.group(help="nodepool related commands.") +@click.group(help="Nodepool related commands.") @click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--cluster-name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) @click.option('--user', type=click.STRING, help="User") @click.option('--group', type=click.STRING, help="Group") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @@ -711,14 +703,14 @@ def nodepool_list(ctx): 'get', 'nodepool', '-o', 'wide']) -@nodepool.command('create') +@nodepool.command('create', help="Create a new nodepool") @click.option('--nodepool-name', '-n', default="nodepool01", help="Nodepool Name") -@click.option('--count', default=2, help="Count of nodes") -@click.option('--type', 'vmtype', default="tinav6.c2r4p3", help="Type of VMs") -@click.option('--zone', multiple=True, required=True, help="Provide zone") -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--count', '-c', default=2, help="Count of nodes") +@click.option('--type', 'vmtype', '-t', default="tinav6.c2r4p3", help="Type of VMs") +@click.option('--zone', '-z', multiple=True, required=True, help="Provide zone(s)") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--dry-run', is_flag=True, help="Run without any action") -@click.option('-f', '--filename', type=click.File("r"), help="Path to file to use to create the Nodepool ") +@click.option('--filename', '-f', type=click.File("r"), help="Path to file to use to create the Nodepool") @click.pass_context def setup_worker_pool(ctx, nodepool_name, count, vmtype, zone, output, dry_run, filename): """Create a new nodepool in the cluster, optionally from a file or parameters.""" diff --git a/oks_cli/main.py b/oks_cli/main.py index c67f295..8ee69b4 100755 --- a/oks_cli/main.py +++ b/oks_cli/main.py @@ -9,14 +9,14 @@ from .cache import cache from .quotas import quotas -from .utils import ctx_update, login_profile, install_completions, profile_completer, cluster_completer, project_completer +from .utils import ctx_update, install_completions, profile_completer, cluster_completer, project_completer # Main CLI entry point @click.group(invoke_without_command=True) -@click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) -@click.option('--project-name', '-p', required = False, help="Project Name", shell_complete=project_completer) -@click.option('--cluster-name', '-c', required = False, help="Cluster Name", shell_complete=cluster_completer) -@click.option('-v', '--verbose', count=True) +@click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) +@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) +@click.option('--cluster-name', '--name', '-c', required=False, help="Cluster Name", shell_complete=cluster_completer) +@click.option('--verbose', '-v', count=True, help="Increase verbosity") @click.pass_context def cli(ctx, project_name, cluster_name, profile, verbose): """ diff --git a/oks_cli/profile.py b/oks_cli/profile.py index d0a5d16..ffbe9bc 100644 --- a/oks_cli/profile.py +++ b/oks_cli/profile.py @@ -11,14 +11,14 @@ def profile(): @profile.command('add', help="Add AK/SK or username/password new profile") -@click.option('--profile-name', required=False, help="Name of profile, optional", type=click.STRING) +@click.option('--profile-name', '--profile', required=False, help="Name of profile, optional", type=click.STRING) @click.option('--access-key', required=False, help="AK of profile", type=click.STRING) @click.option('--secret-key', required=False, help="SK of profile", type=click.STRING) @click.option('--username', required=False, help="Username", type=click.STRING) @click.option('--password', required=False, help="Password", type=click.STRING) @click.option('--region', required=True, help="Region name", type=click.Choice(['eu-west-2', 'cloudgouv-eu-west-1'])) @click.option('--endpoint', required=False, help="API endpoint", type=click.STRING) -@click.option('--jwt', required=False, help="Enable jwt, by default is false", type=click.BOOL) +@click.option('--jwt', help="Enable JWT, by default is false") def add_profile(profile_name, access_key, secret_key, username, password, region, endpoint, jwt): """Add a new profile with AK/SK or username/password authentication.""" if not profile_name: @@ -98,8 +98,8 @@ def update_profile(profile_name, region, endpoint, jwt, new_name, force): click.echo(msg) @profile.command('delete', help="Delete a profile by name") -@click.option('--profile-name', required=True, help="Name of profile", type=click.STRING) -@click.option('--force', is_flag=True, help="Force deletion without confirmation") +@click.option('--profile-name', '--profile', required=True, help="Name of profile", type=click.STRING) +@click.option('--force', '-f', is_flag=True, help="Force deletion without confirmation") def delete_profile(profile_name, force): """Delete a profile with confirmation.""" profiles = profile_list() @@ -113,7 +113,7 @@ def delete_profile(profile_name, force): click.echo(f"Profile {profile_name_bold} has been successfully deleted") @profile.command('list', help="List existing profiles") -@click.option('-o', '--output', type=click.Choice(["json", "yaml", "table", "wide"]), help="Specify output format, by default is wide") +@click.option('--output', '-o', type=click.Choice(["json", "yaml", "table", "wide"]), help="Specify output format, by default is wide") def list_profiles(output): """Display all configured profiles with their settings.""" profiles = profile_list() diff --git a/oks_cli/project.py b/oks_cli/project.py index 204f99d..281c134 100644 --- a/oks_cli/project.py +++ b/oks_cli/project.py @@ -11,8 +11,8 @@ # DEIFNE THE PROJECT COMMAND GROUP @click.group(help="Project related commands.") @click.option('--project', 'project_name', required = False, help="Project Name") -@click.option('--project-name', '-p', required = False, help="Project Name", shell_complete=project_completer) -@click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) +@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) +@click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def project(ctx, project_name, profile): """Group of commands related to project management.""" @@ -59,12 +59,12 @@ def project_logout(ctx, profile): # LIST PROJECTS @project.command('list', help="List all projects") @click.option('--project-name', '-p', help="Name of project", type=click.STRING, shell_complete=project_completer) -@click.option('--deleted', is_flag=True, help="List deleted projects") +@click.option('--deleted', '-x', is_flag=True, help="List deleted projects") @click.option('--plain', is_flag=True, help="Plain table format") @click.option('--msword', is_flag=True, help="Microsoft Word table format") -@click.option('--uuid', is_flag=True, help="show uuid") +@click.option('--uuid', is_flag=True, help="Show UUID") @click.option('--watch', '-w', is_flag=True, help="Watch the changes") -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--profile', help="Configuration profile to use") @click.pass_context def project_list(ctx, project_name, deleted, plain, msword, uuid, watch, output, profile): @@ -193,15 +193,15 @@ def format_row(project): # CREATE PROJECT BY NAME @project.command('create', help="Create a new project") -@click.option('--project-name', '-p', help="Name of the project", shell_complete=project_completer) -@click.option('--description', help="Description of the project") +@click.option('--project-name', '-p', help="Name of the project", type=click.STRING, shell_complete=project_completer) +@click.option('--description', '-d', help="Description of the project") @click.option('--cidr', help='CIDR for the project') -@click.option('--quirk', multiple=True, help="Quirk") -@click.option('--tags', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") +@click.option('--quirk', '-q', multiple=True, help="Quirk") +@click.option('--tags', '-t', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") @click.option('--disable-api-termination', type=click.BOOL, help="Disable delete action by API") @click.option('--dry-run', is_flag=True, help="Client dry-run, only print the object that would be sent, without sending it") -@click.option('-o', '--output', type=click.Choice(["json", "yaml", "silent"]), help="Specify output format, by default is json") -@click.option('-f', '--filename', type=click.File("r"), help="Path to file to use to create the project ") +@click.option('--output', '-o', type=click.Choice(["json", "yaml", "silent"]), help="Specify output format, by default is json") +@click.option('--filename', '-f', type=click.File("r"), help="Path to file to use to create the project") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def project_create(ctx, project_name, description, cidr, quirk, tags, disable_api_termination, dry_run, output, filename, profile): @@ -255,7 +255,7 @@ def project_create(ctx, project_name, description, cidr, quirk, tags, disable_ap # GET PROJECT BY NAME @project.command('get', help="Get default project or the project by name") @click.option('--project-name', '-p', help="Name of the project", shell_complete=project_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def project_get(ctx, project_name, output, profile): @@ -270,8 +270,8 @@ def project_get(ctx, project_name, output, profile): # DELETE PROJECT BY NAME @project.command('delete', help="Delete a project by name") -@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--project-name', '-p', required=False, help="Project Name", type=click.STRING, shell_complete=project_completer) +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--dry-run', is_flag=True, help="Run without any action") @click.option('--force', is_flag=True, help="Force deletion without confirmation") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @@ -302,12 +302,12 @@ def project_delete_command(ctx, project_name, output, dry_run, force, profile): # UPDATE PROJECT BY NAME @project.command('update', help="Update a project by name") -@click.option('--project-name', '-p', required=False, help="Project Name", shell_complete=project_completer) -@click.option('--description', help="Description of the project") -@click.option('--quirk', multiple=True, help="Quirk") -@click.option('--tags', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") +@click.option('--project-name', '-p', required=False, help="Project Name", type=click.STRING, shell_complete=project_completer) +@click.option('--description', '-d', help="Description of the project") +@click.option('--quirk', '-q', multiple=True, help="Quirk") +@click.option('--tags', '-t', help="Comma-separated list of tags, example: 'key1=value1,key2=value2'") @click.option('--disable-api-termination', type=click.BOOL, help="Disable delete action by API") -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--dry-run', is_flag=True, help="Run without any action") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context @@ -351,7 +351,7 @@ def project_update_command(ctx, project_name, description, quirk, tags, disable_ # GET PROJECT QUOTAS BY PROJECT NAME @project.command('quotas', help="Get project quotas") @click.option('--project-name', '-p', help="Name of the project", shell_complete=project_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml", "table"]), help="Specify output format, by default is json") +@click.option('--output', '-o', type=click.Choice(["json", "yaml", "table"]), help="Specify output format, by default is json") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def project_get_quotas(ctx, project_name, output, profile): @@ -379,7 +379,7 @@ def project_get_quotas(ctx, project_name, output, profile): # GET PROJECT SNAPSHOTS BY PROJECT NAME @project.command('snapshots', help="Get project snapshots") @click.option('--project-name', '-p', help="Name of the project", shell_complete=project_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") @click.option('--profile', help="Configuration profile to use", shell_complete=profile_completer) @click.pass_context def project_get(ctx, project_name, output, profile): @@ -395,8 +395,8 @@ def project_get(ctx, project_name, output, profile): # GET PUBLIC IPS BY PROJECT NAME @project.command('publicips', help="Get project public ips") @click.option('--project-name', '-p', help="Name of the project", shell_complete=project_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") -@click.option('--profile', help="Configuration profile to use") +@click.option('--output', '-o', type=click.Choice(["json", "yaml"]), help="Specify output format, by default is json") +@click.option('--profile',help="Configuration profile to use") @click.pass_context def project_get_public_ips(ctx, project_name, output, profile): """Retrieve the list of public IPs associated with the specified project.""" diff --git a/oks_cli/quotas.py b/oks_cli/quotas.py index d857b8a..62dd8f9 100644 --- a/oks_cli/quotas.py +++ b/oks_cli/quotas.py @@ -4,7 +4,7 @@ @click.command(help="Get Quotas") @click.option("--profile", help="Configuration profile to use", shell_complete=profile_completer) -@click.option('-o', '--output', type=click.Choice(["json", "yaml", "table"]), help="Specify output format, by default is json") +@click.option('--output','-o', type=click.Choice(["json", "yaml", "table"]), help="Specify output format, by default is json") @click.pass_context def quotas(ctx, profile, output): """Retrieve global quotas across all projects for the given profile."""