@@ -353,48 +353,52 @@ def get_experiment_details(experiment_handle, api_key):
353353)
354354
355355
356- @cli .group ("deployments" )
356+ @cli .group ("deployments" , help = "Manage deployments" )
357357def deployments ():
358358 pass
359359
360360
361- @deployments .command ("create" )
361+ @deployments .command ("create" , help = "Create new deployment" )
362362@click .option (
363363 "--deploymentType" ,
364364 "deploymentType" ,
365365 type = ChoiceType (DEPLOYMENT_TYPES_MAP , case_sensitive = False ),
366366 required = True ,
367+ help = "Model deployment type" ,
367368)
368369@click .option (
369370 "--modelId" ,
370371 "modelId" ,
371372 required = True ,
373+ help = "ID of a trained model" ,
372374)
373375@click .option (
374376 "--name" ,
375377 "name" ,
376378 required = True ,
379+ help = "Human-friendly name for new model deployment" ,
377380)
378381@click .option (
379382 "--machineType" ,
380383 "machineType" ,
384+ type = click .Choice (constants .MACHINE_TYPES ),
381385 required = True ,
386+ help = "Type of machine for new deployment" ,
382387)
383388@click .option (
384389 "--imageUrl" ,
385390 "imageUrl" ,
386391 required = True ,
392+ help = "Docker image for model serving" ,
387393)
388394@click .option (
389395 "--instanceCount" ,
390396 "instanceCount" ,
391397 type = int ,
392398 required = True ,
399+ help = "Number of machine instances" ,
393400)
394- @click .option (
395- "--apiKey" ,
396- "api_key" ,
397- )
401+ @api_key_option
398402def create_deployment (api_key = None , ** kwargs ):
399403 del_if_value_is_none (kwargs )
400404 deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
@@ -415,90 +419,88 @@ def create_deployment(api_key=None, **kwargs):
415419)
416420
417421
418- @deployments .command ("list" )
422+ @deployments .command ("list" , help = "List deployments with optional filtering" )
419423@click .option (
420424 "--state" ,
421425 "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" ,
427428)
429+ @api_key_option
428430def get_deployments_list (api_key = None , ** kwargs ):
429431 del_if_value_is_none (kwargs )
430432 deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
431433 command = deployments_commands .ListDeploymentsCommand (api = deployments_api )
432434 command .execute (kwargs )
433435
434436
435- @deployments .command ("update" )
437+ @deployments .command ("update" , help = "Update deployment properties" )
436438@click .option (
437439 "--id" ,
438- "id " ,
440+ "id_ " ,
439441 required = True ,
442+ help = "Deployment ID" ,
440443)
441444@click .option (
442445 "--modelId" ,
443446 "modelId" ,
447+ help = "ID of a trained model" ,
444448)
445449@click .option (
446450 "--name" ,
447451 "name" ,
452+ help = "Human-friendly name for new model deployment" ,
448453)
449454@click .option (
450455 "--machineType" ,
451456 "machineType" ,
457+ help = "Type of machine for new deployment" ,
452458)
453459@click .option (
454460 "--imageUrl" ,
455461 "imageUrl" ,
462+ help = "Docker image for model serving" ,
456463)
457464@click .option (
458465 "--instanceCount" ,
459466 "instanceCount" ,
467+ type = int ,
468+ help = "Number of machine instances" ,
460469)
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 ):
466472 del_if_value_is_none (kwargs )
467473 deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
468474 command = deployments_commands .UpdateModelCommand (api = deployments_api )
469- command .execute (id , kwargs )
475+ command .execute (id_ , kwargs )
470476
471477
472- @deployments .command ("start" )
478+ @deployments .command ("start" , help = "Start deployment" )
473479@click .option (
474480 "--id" ,
475- "id " ,
481+ "id_ " ,
476482 required = True ,
483+ help = "Deployment ID" ,
477484)
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 ):
483487 deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
484488 command = deployments_commands .StartDeploymentCommand (api = deployments_api )
485- command .execute (id )
489+ command .execute (id_ )
486490
487491
488- @deployments .command ("delete" )
492+ @deployments .command ("delete" , help = "Delete deployment" )
489493@click .option (
490494 "--id" ,
491- "id " ,
495+ "id_ " ,
492496 required = True ,
497+ help = "Deployment ID" ,
493498)
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 ):
499501 deployments_api = client .API (config .CONFIG_HOST , api_key = api_key )
500502 command = deployments_commands .DeleteDeploymentCommand (api = deployments_api )
501- command .execute (id )
503+ command .execute (id_ )
502504
503505
504506REGIONS_MAP = collections .OrderedDict (
@@ -510,7 +512,7 @@ def delete_deployment(id, api_key=None):
510512)
511513
512514
513- @cli .group ("machines" )
515+ @cli .group ("machines" , help = "Manage machines" )
514516def machines_group ():
515517 pass
516518
@@ -874,7 +876,10 @@ def restart_machine(machine_id, api_key):
874876 command .execute (machine_id )
875877
876878
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 )
878883@click .option (
879884 "--machineId" ,
880885 "machine_id" ,
0 commit comments