Skip to content

Commit

Permalink
Azure Healthbot Az CLI extension (Azure#2965)
Browse files Browse the repository at this point in the history
* CodeGen from PR 12263 in Azure/azure-rest-api-specs
Healthbot - Update Python.md based on az cli extension doc & Create Java.md file. (#12263)

* Update python.md.

* Update python.md.

* Create Java.md

* Create Java.md

* Updated python.md with track2 configuration.

* Updated python.md with track2 configuration.

* Updated python.md with track2 configuration.

* Update specification/healthbot/resource-manager/readme.python.md

Co-authored-by: Qiaoqiao Zhang <[email protected]>

* Update specification/healthbot/resource-manager/readme.python.md

Co-authored-by: Qiaoqiao Zhang <[email protected]>

* Updated python.md with track2 configuration.

* Update specification/healthbot/resource-manager/readme.python.md

Co-authored-by: Qiaoqiao Zhang <[email protected]>

* Update specification/healthbot/resource-manager/readme.python.md

Co-authored-by: Qiaoqiao Zhang <[email protected]>

* Updated python.md with track2 configuration.

* Revert changes python.md.

* Revert "Revert changes python.md."

This reverts commit f0a48ae5

* Revert "Revert changes python.md."

This reverts commit f0a48ae5

* Add Java section.

* Add "title".

Co-authored-by: Qiaoqiao Zhang <[email protected]>

* Fixes based on review.

* Fixes based on review.

* Fixes based on review.

* Remove extra line.

* Change name to sku.

* Change name to sku.

* Change name to sku.

* Fiz autogenerated CLI issues.

* Add recordings for healthbot tests.

* Add recordings for healthbot tests.

* retrigger checks

Co-authored-by: SDKAuto <[email protected]>
Co-authored-by: Qiaoqiao Zhang <[email protected]>
  • Loading branch information
3 people authored Feb 23, 2021
1 parent 7d982c9 commit fae822a
Show file tree
Hide file tree
Showing 43 changed files with 4,215 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

/src/healthcareapis/ @fengzhou-msft

/src/healthbot/ @guy-microsoft

/src/hack/ @geektrainer

/src/internet-analyzer/ @jsntcy
Expand Down
8 changes: 8 additions & 0 deletions src/healthbot/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
33 changes: 33 additions & 0 deletions src/healthbot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Azure CLI healthbot Extension #
This is the extension for healthbot.
The Azure Health Bot service empowers healthcare organizations to build and deploy an AI-powered, compliant, conversational healthcare experience at scale.
The service combines built-in medical intelligence with natural language capabilities, extensibility tools and compliance constructs, allowing healthcare organizations such as Providers, Payers, Pharma, HMOs, Telehealth to give people access to trusted and relevant healthcare services and information.

### How to use ###
Install this extension using the below CLI command
```
az extension add --name healthbot
```

### Included Features ###
#### healthbot ####
##### Create #####
```
az healthbot create --name "samplebotname" --location "East US" --sku "F0" --resource-group "healthbotClient"
```
##### Show #####
```
az healthbot show --name "samplebotname" --resource-group "healthbotClient"
```
##### List #####
```
az healthbot list --resource-group "OneResourceGroupName"
```
##### Update #####
```
az healthbot update --name "samplebotname" --sku "F0" --resource-group "healthbotClient"
```
##### Delete #####
```
az healthbot delete --name "samplebotname" --resource-group "healthbotClient"
```
50 changes: 50 additions & 0 deletions src/healthbot/azext_healthbot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_healthbot.generated._help import helps # pylint: disable=unused-import
try:
from azext_healthbot.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class HealthbotClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_healthbot.generated._client_factory import cf_healthbot_cl
healthbot_custom = CliCommandType(
operations_tmpl='azext_healthbot.custom#{}',
client_factory=cf_healthbot_cl)
parent = super(HealthbotClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=healthbot_custom)

def load_command_table(self, args):
from azext_healthbot.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_healthbot.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_healthbot.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_healthbot.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = HealthbotClientCommandsLoader
17 changes: 17 additions & 0 deletions src/healthbot/azext_healthbot/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/healthbot/azext_healthbot/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/healthbot/azext_healthbot/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/healthbot/azext_healthbot/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
20 changes: 20 additions & 0 deletions src/healthbot/azext_healthbot/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_healthbot_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_healthbot.vendored_sdks.healthbot import HealthbotClient
return get_mgmt_service_client(cli_ctx,
HealthbotClient)


def cf_bot(cli_ctx, *_):
return cf_healthbot_cl(cli_ctx).bots
80 changes: 80 additions & 0 deletions src/healthbot/azext_healthbot/generated/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines

from knack.help_files import helps


helps['healthbot'] = """
type: group
short-summary: Manage bot with healthbot
"""

helps['healthbot list'] = """
type: command
short-summary: "Returns all the resources of a particular type belonging to a resource group And Returns all the \
resources of a particular type belonging to a subscription."
examples:
- name: List Bots by Resource Group
text: |-
az healthbot list --resource-group "OneResourceGroupName"
- name: List Bots by Subscription
text: |-
az healthbot list
"""

helps['healthbot show'] = """
type: command
short-summary: "Get a HealthBot."
examples:
- name: ResourceInfoGet
text: |-
az healthbot show --name "samplebotname" --resource-group "healthbotClient"
"""

helps['healthbot create'] = """
type: command
short-summary: "Create a new HealthBot."
examples:
- name: BotCreate
text: |-
az healthbot create --name "samplebotname" --location "East US" --sku "F0" --resource-group \
"healthbotClient"
"""

helps['healthbot update'] = """
type: command
short-summary: "Patch a HealthBot."
examples:
- name: BotUpdate
text: |-
az healthbot update --bot-name "samplebotname" --name "F0" --resource-group "healthbotClient"
"""

helps['healthbot delete'] = """
type: command
short-summary: "Delete a HealthBot."
examples:
- name: BotDelete
text: |-
az healthbot delete --name "samplebotname" --resource-group "healthbotClient"
"""

helps['healthbot wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the healthbot is met.
examples:
- name: Pause executing next line of CLI script until the healthbot is successfully created.
text: |-
az healthbot wait --name "samplebotname" --resource-group "healthbotClient" --created
- name: Pause executing next line of CLI script until the healthbot is successfully deleted.
text: |-
az healthbot wait --name "samplebotname" --resource-group "healthbotClient" --deleted
"""
56 changes: 56 additions & 0 deletions src/healthbot/azext_healthbot/generated/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements

from azure.cli.core.commands.parameters import (
tags_type,
get_enum_type,
resource_group_name_type,
get_location_type
)
from azure.cli.core.commands.validators import get_default_location_from_resource_group


def load_arguments(self, _):

with self.argument_context('healthbot list') as c:
c.argument('resource_group_name', resource_group_name_type)

with self.argument_context('healthbot show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('bot_name', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot '
'resource.', id_part='name')

with self.argument_context('healthbot create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('bot_name', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot resource.')
c.argument('tags', tags_type)
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
validator=get_default_location_from_resource_group)
c.argument('sku', arg_type=get_enum_type(['F0', 'S1', 'C0']), help='The name of the HealthBot SKU',
arg_group='Sku')

with self.argument_context('healthbot update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('bot_name', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot resource.', id_part='name')
c.argument('tags', tags_type)
c.argument('sku', arg_type=get_enum_type(['F0', 'S1', 'C0']), help='The name of the HealthBot SKU',
arg_group='Sku')

with self.argument_context('healthbot delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('bot_name', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot '
'resource.', id_part='name')

with self.argument_context('healthbot wait') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('bot_name', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot '
'resource.', id_part='name')
9 changes: 9 additions & 0 deletions src/healthbot/azext_healthbot/generated/_validators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
10 changes: 10 additions & 0 deletions src/healthbot/azext_healthbot/generated/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=protected-access
28 changes: 28 additions & 0 deletions src/healthbot/azext_healthbot/generated/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-statements
# pylint: disable=too-many-locals

from azure.cli.core.commands import CliCommandType


def load_command_table(self, _):

from azext_healthbot.generated._client_factory import cf_bot
healthbot_bot = CliCommandType(
operations_tmpl='azext_healthbot.vendored_sdks.healthbot.operations._bots_operations#BotsOperations.{}',
client_factory=cf_bot)
with self.command_group('healthbot', healthbot_bot, client_factory=cf_bot, is_experimental=True) as g:
g.custom_command('list', 'healthbot_list')
g.custom_show_command('show', 'healthbot_show')
g.custom_command('create', 'healthbot_create', supports_no_wait=True)
g.custom_command('update', 'healthbot_update')
g.custom_command('delete', 'healthbot_delete', supports_no_wait=True, confirmation=True)
g.custom_wait_command('wait', 'healthbot_show')
Loading

0 comments on commit fae822a

Please sign in to comment.