Skip to content

Commit e96cf0b

Browse files
authored
fix(cli_args): format cli deploy update clean args (#307)
1 parent f4c9dc7 commit e96cf0b

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

veadk/cli/cli_clean.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
@click.command()
2626
@click.option(
27-
"--vefaas-application-name",
27+
"--vefaas-app-name",
2828
required=True,
2929
help="VeFaaS application name to clean",
3030
)
@@ -39,7 +39,7 @@
3939
help="Volcengine secret key, if not set, will use the value of environment variable VOLCENGINE_SECRET_KEY",
4040
)
4141
def clean(
42-
vefaas_application_name: str, volcengine_access_key: str, volcengine_secret_key: str
42+
vefaas_app_name: str, volcengine_access_key: str, volcengine_secret_key: str
4343
) -> None:
4444
"""
4545
Clean and delete a VeFaaS application from the cloud.
@@ -49,7 +49,7 @@ def clean(
4949
and monitor the deletion process until completion.
5050
5151
Args:
52-
vefaas_application_name (str): The name of the VeFaaS application to delete
52+
vefaas_app_name (str): The name of the VeFaaS application to delete
5353
volcengine_access_key (str): Volcengine access key for authentication.
5454
If None, will use VOLCENGINE_ACCESS_KEY environment variable
5555
volcengine_secret_key (str): Volcengine secret key for authentication.
@@ -63,24 +63,22 @@ def clean(
6363
if not volcengine_secret_key:
6464
volcengine_secret_key = getenv("VOLCENGINE_SECRET_KEY")
6565

66-
confirm = input(f"Confirm delete cloud app {vefaas_application_name}? (y/N): ")
66+
confirm = input(f"Confirm delete cloud app {vefaas_app_name}? (y/N): ")
6767
if confirm.lower() != "y":
6868
click.echo("Delete cancelled.")
6969
return
7070
else:
7171
vefaas_client = VeFaaS(
7272
access_key=volcengine_access_key, secret_key=volcengine_secret_key
7373
)
74-
vefaas_application_id = vefaas_client.find_app_id_by_name(
75-
vefaas_application_name
76-
)
74+
vefaas_application_id = vefaas_client.find_app_id_by_name(vefaas_app_name)
7775
vefaas_client.delete(vefaas_application_id)
7876
click.echo(
79-
f"Cloud app {vefaas_application_name} delete request has been sent to VeFaaS"
77+
f"Cloud app {vefaas_app_name} delete request has been sent to VeFaaS"
8078
)
8179
while True:
8280
try:
83-
id = vefaas_client.find_app_id_by_name(vefaas_application_name)
81+
id = vefaas_client.find_app_id_by_name(vefaas_app_name)
8482
if not id:
8583
break
8684
time.sleep(3)

veadk/cli/cli_deploy.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

2323
@click.command()
2424
@click.option(
25-
"--access-key",
25+
"--volcengine-access-key",
2626
default=None,
2727
help="Volcengine access key",
2828
)
2929
@click.option(
30-
"--secret-key",
30+
"--volcengine-secret-key",
3131
default=None,
3232
help="Volcengine secret key",
3333
)
@@ -52,8 +52,8 @@
5252
@click.option("--use-adk-web", is_flag=True, help="Whether to use ADK Web")
5353
@click.option("--path", default=".", help="Local project path")
5454
def deploy(
55-
access_key: str,
56-
secret_key: str,
55+
volcengine_access_key: str,
56+
volcengine_secret_key: str,
5757
vefaas_app_name: str,
5858
veapig_instance_name: str,
5959
veapig_service_name: str,
@@ -77,9 +77,9 @@ def deploy(
7777
5. Cleaning up temporary files
7878
7979
Args:
80-
access_key: Volcengine access key for API authentication. If not provided,
80+
volcengine_access_key: Volcengine access key for API authentication. If not provided,
8181
will use VOLCENGINE_ACCESS_KEY environment variable
82-
secret_key: Volcengine secret key for API authentication. If not provided,
82+
volcengine_secret_key: Volcengine secret key for API authentication. If not provided,
8383
will use VOLCENGINE_SECRET_KEY environment variable
8484
vefaas_app_name: Name of the target Volcengine FaaS application where the
8585
project will be deployed
@@ -111,10 +111,10 @@ def deploy(
111111

112112
logger = get_logger(__name__)
113113

114-
if not access_key:
115-
access_key = getenv("VOLCENGINE_ACCESS_KEY")
116-
if not secret_key:
117-
secret_key = getenv("VOLCENGINE_SECRET_KEY")
114+
if not volcengine_access_key:
115+
volcengine_access_key = getenv("VOLCENGINE_ACCESS_KEY")
116+
if not volcengine_secret_key:
117+
volcengine_secret_key = getenv("VOLCENGINE_SECRET_KEY")
118118

119119
user_proj_abs_path = Path(path).resolve()
120120
template_dir_path = Path(vefaas.__file__).parent / "template"

veadk/cli/cli_update.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
help="Volcengine secret key for authentication. Defaults to VOLCENGINE_SECRET_KEY environment variable.",
3434
)
3535
@click.option(
36-
"--application-name",
36+
"--vefaas-app-name",
3737
required=True,
3838
help="Name of the cloud application to update.",
3939
)
@@ -45,7 +45,7 @@
4545
def update(
4646
volcengine_access_key: str,
4747
volcengine_secret_key: str,
48-
application_name: str,
48+
vefaas_app_name: str,
4949
path: str,
5050
) -> None:
5151
"""Update function code of a deployed cloud application on Volcengine FaaS.
@@ -65,7 +65,7 @@ def update(
6565
If not provided, uses VOLCENGINE_ACCESS_KEY environment variable.
6666
volcengine_secret_key: Volcengine platform secret key for authentication.
6767
If not provided, uses VOLCENGINE_SECRET_KEY environment variable.
68-
application_name: Name of the existing cloud application to update.
68+
vefaas_app_name: Name of the existing cloud application to update.
6969
path: Local directory path containing the updated agent project.
7070
Defaults to current directory if not specified.
7171
@@ -93,11 +93,11 @@ def update(
9393
try:
9494
# Update function code
9595
updated_app = engine.update_function_code(
96-
application_name=application_name,
96+
application_name=vefaas_app_name,
9797
path=path,
9898
)
9999

100-
logger.info(f"Successfully updated cloud application '{application_name}'")
100+
logger.info(f"Successfully updated cloud application '{vefaas_app_name}'")
101101
logger.info(f"Endpoint: {updated_app.vefaas_endpoint}")
102102
logger.info(f"Application ID: {updated_app.vefaas_application_id}")
103103

0 commit comments

Comments
 (0)