Skip to content

Commit 35ee6e2

Browse files
committed
add args
1 parent 3367958 commit 35ee6e2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

roboflow/adapters/deploymentapi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ class DeploymentApiError(Exception):
77
pass
88

99

10-
def add_deployment(api_key, machine_type, deployment_name, inference_version):
10+
def add_deployment(api_key, machine_type, duration, delete_on_expiration, deployment_name, inference_version):
1111
url = f"{DEDICATED_DEPLOYMENT_URL}/add"
1212
response = requests.post(
1313
url,
1414
json={
1515
"api_key": api_key,
1616
# "security_level": security_level,
1717
"machine_type": machine_type,
18+
"duration": duration,
19+
"delete_on_expiration": delete_on_expiration,
1820
"deployment_name": deployment_name,
1921
"inference_version": inference_version,
2022
},

roboflow/deployment.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ def add_deployment_parser(subparsers):
2929
deployment_add_parser.add_argument(
3030
"-m", dest="machine_type", help="machine type, run `roboflow deployment machine_type` to see available options"
3131
)
32+
deployment_add_parser.add_argument(
33+
"-t", dest="duration", help="duration, how long you want to keep the deployment (unit: hour, default: 3)",
34+
type=float, default=3
35+
)
36+
deployment_add_parser.add_argument(
37+
"-e", dest="delete_on_expiration", help="delete when expired (default: True)",
38+
type=bool, default=True
39+
)
3240
deployment_add_parser.add_argument(
3341
"-n", dest="deployment_name", help="deployment name, must contain 3-10 lowercase characters"
3442
)
@@ -60,6 +68,8 @@ def add_deployment(args):
6068
api_key,
6169
# args.security_level,
6270
args.machine_type,
71+
args.duration,
72+
args.delete_on_expiration,
6373
args.deployment_name,
6474
args.inference_version,
6575
)

0 commit comments

Comments
 (0)