File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
src/azure-cli/azure/cli/command_modules/cognitiveservices Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 664664short-summary: Get the status of a hosted agent deployment.
665665long-summary: |
666666 Calls the agent container status endpoint and returns the raw service payload.
667+ parameters:
668+ - name: --only-show-status
669+ short-summary: Only return the status field.
667670examples:
668671 - name: Get hosted agent deployment status.
669672 text: az cognitiveservices agent status --account-name myAccount --project-name myProject --name myAgent --agent-version 1
673+ - name: Get only the status field.
674+ text: az cognitiveservices agent status --account-name myAccount --project-name myProject --name myAgent --agent-version 1 --only-show-status
670675"""
671676
672677helps [
Original file line number Diff line number Diff line change @@ -393,6 +393,12 @@ def load_arguments(self, _):
393393 help = "Cognitive Services hosted agent version" ,
394394 required = True ,
395395 )
396+ c .argument (
397+ "only_show_status" ,
398+ options_list = ["--only-show-status" ],
399+ action = "store_true" ,
400+ help = "Only return the deployment status field." ,
401+ )
396402
397403 with self .argument_context ('cognitiveservices agent create' ) as c :
398404 c .argument (
Original file line number Diff line number Diff line change @@ -1399,9 +1399,13 @@ def agent_status(
13991399 project_name ,
14001400 agent_name ,
14011401 agent_version ,
1402+ only_show_status = False ,
14021403): # pylint: disable=unused-argument
14031404 """Get the status of a hosted agent deployment (default container)."""
1404- return _get_agent_container_status (client , agent_name , agent_version )
1405+ payload = _get_agent_container_status (client , agent_name , agent_version )
1406+ if only_show_status :
1407+ return {"status" : payload .get ("status" )}
1408+ return payload
14051409
14061410
14071411def _get_resource_group_by_account_name (cmd , account_name ):
You can’t perform that action at this time.
0 commit comments