@@ -353,48 +353,52 @@ def get_experiment_details(experiment_handle, api_key):
353
353
)
354
354
355
355
356
- @cli .group ("deployments" )
356
+ @cli .group ("deployments" , help = "Manage deployments" )
357
357
def deployments ():
358
358
pass
359
359
360
360
361
- @deployments .command ("create" )
361
+ @deployments .command ("create" , help = "Create new deployment" )
362
362
@click .option (
363
363
"--deploymentType" ,
364
364
"deploymentType" ,
365
365
type = ChoiceType (DEPLOYMENT_TYPES_MAP , case_sensitive = False ),
366
366
required = True ,
367
+ help = "Model deployment type" ,
367
368
)
368
369
@click .option (
369
370
"--modelId" ,
370
371
"modelId" ,
371
372
required = True ,
373
+ help = "ID of a trained model" ,
372
374
)
373
375
@click .option (
374
376
"--name" ,
375
377
"name" ,
376
378
required = True ,
379
+ help = "Human-friendly name for new model deployment" ,
377
380
)
378
381
@click .option (
379
382
"--machineType" ,
380
383
"machineType" ,
384
+ type = click .Choice (constants .MACHINE_TYPES ),
381
385
required = True ,
386
+ help = "Type of machine for new deployment" ,
382
387
)
383
388
@click .option (
384
389
"--imageUrl" ,
385
390
"imageUrl" ,
386
391
required = True ,
392
+ help = "Docker image for model serving" ,
387
393
)
388
394
@click .option (
389
395
"--instanceCount" ,
390
396
"instanceCount" ,
391
397
type = int ,
392
398
required = True ,
399
+ help = "Number of machine instances" ,
393
400
)
394
- @click .option (
395
- "--apiKey" ,
396
- "api_key" ,
397
- )
401
+ @api_key_option
398
402
def create_deployment (api_key = None , ** kwargs ):
399
403
del_if_value_is_none (kwargs )
400
404
deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
@@ -415,90 +419,88 @@ def create_deployment(api_key=None, **kwargs):
415
419
)
416
420
417
421
418
- @deployments .command ("list" )
422
+ @deployments .command ("list" , help = "List deployments with optional filtering" )
419
423
@click .option (
420
424
"--state" ,
421
425
"state" ,
422
- type = ChoiceType (DEPLOYMENT_STATES_MAP , case_sensitive = False )
423
- )
424
- @click .option (
425
- "--apiKey" ,
426
- "api_key" ,
426
+ type = ChoiceType (DEPLOYMENT_STATES_MAP , case_sensitive = False ),
427
+ help = "Filter by deployment state" ,
427
428
)
429
+ @api_key_option
428
430
def get_deployments_list (api_key = None , ** kwargs ):
429
431
del_if_value_is_none (kwargs )
430
432
deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
431
433
command = deployments_commands .ListDeploymentsCommand (api = deployments_api )
432
434
command .execute (kwargs )
433
435
434
436
435
- @deployments .command ("update" )
437
+ @deployments .command ("update" , help = "Update deployment properties" )
436
438
@click .option (
437
439
"--id" ,
438
- "id " ,
440
+ "id_ " ,
439
441
required = True ,
442
+ help = "Deployment ID" ,
440
443
)
441
444
@click .option (
442
445
"--modelId" ,
443
446
"modelId" ,
447
+ help = "ID of a trained model" ,
444
448
)
445
449
@click .option (
446
450
"--name" ,
447
451
"name" ,
452
+ help = "Human-friendly name for new model deployment" ,
448
453
)
449
454
@click .option (
450
455
"--machineType" ,
451
456
"machineType" ,
457
+ help = "Type of machine for new deployment" ,
452
458
)
453
459
@click .option (
454
460
"--imageUrl" ,
455
461
"imageUrl" ,
462
+ help = "Docker image for model serving" ,
456
463
)
457
464
@click .option (
458
465
"--instanceCount" ,
459
466
"instanceCount" ,
467
+ type = int ,
468
+ help = "Number of machine instances" ,
460
469
)
461
- @click .option (
462
- "--apiKey" ,
463
- "api_key" ,
464
- )
465
- def update_deployment_model (id = None , api_key = None , ** kwargs ):
470
+ @api_key_option
471
+ def update_deployment_model (id_ , api_key , ** kwargs ):
466
472
del_if_value_is_none (kwargs )
467
473
deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
468
474
command = deployments_commands .UpdateModelCommand (api = deployments_api )
469
- command .execute (id , kwargs )
475
+ command .execute (id_ , kwargs )
470
476
471
477
472
- @deployments .command ("start" )
478
+ @deployments .command ("start" , help = "Start deployment" )
473
479
@click .option (
474
480
"--id" ,
475
- "id " ,
481
+ "id_ " ,
476
482
required = True ,
483
+ help = "Deployment ID" ,
477
484
)
478
- @click .option (
479
- "--apiKey" ,
480
- "api_key" ,
481
- )
482
- def start_deployment (id , api_key = None ):
485
+ @api_key_option
486
+ def start_deployment (id_ , api_key = None ):
483
487
deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
484
488
command = deployments_commands .StartDeploymentCommand (api = deployments_api )
485
- command .execute (id )
489
+ command .execute (id_ )
486
490
487
491
488
- @deployments .command ("delete" )
492
+ @deployments .command ("delete" , help = "Delete deployment" )
489
493
@click .option (
490
494
"--id" ,
491
- "id " ,
495
+ "id_ " ,
492
496
required = True ,
497
+ help = "Deployment ID" ,
493
498
)
494
- @click .option (
495
- "--apiKey" ,
496
- "api_key" ,
497
- )
498
- def delete_deployment (id , api_key = None ):
499
+ @api_key_option
500
+ def delete_deployment (id_ , api_key = None ):
499
501
deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
500
502
command = deployments_commands .DeleteDeploymentCommand (api = deployments_api )
501
- command .execute (id )
503
+ command .execute (id_ )
502
504
503
505
504
506
REGIONS_MAP = collections .OrderedDict (
@@ -510,7 +512,7 @@ def delete_deployment(id, api_key=None):
510
512
)
511
513
512
514
513
- @cli .group ("machines" )
515
+ @cli .group ("machines" , help = "Manage machines" )
514
516
def machines_group ():
515
517
pass
516
518
@@ -874,7 +876,10 @@ def restart_machine(machine_id, api_key):
874
876
command .execute (machine_id )
875
877
876
878
877
- @machines_group .command ("show" )
879
+ show_machine_details_help = "Show machine information for the machine with the given id."
880
+
881
+
882
+ @machines_group .command ("show" , help = show_machine_details_help )
878
883
@click .option (
879
884
"--machineId" ,
880
885
"machine_id" ,
0 commit comments