Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR healthbot] update healthbot t2 config #532

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
31 changes: 31 additions & 0 deletions src/healthbot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Azure CLI healthbot Extension #
This is the extension for healthbot

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

### Included Features ###
#### healthbot ####
##### Create #####
```
az healthbot create --bot-name "samplebotname" --location "East US" --name "F0" --resource-group "healthbotClient"
```
##### Show #####
```
az healthbot show --name "samplebotname" --resource-group "healthbotClient"
```
##### List #####
```
az healthbot list --resource-group "OneResourceGroupName"
```
##### Update #####
```
az healthbot update --bot-name "samplebotname" --name "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 HealthbotCommandsLoader(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(HealthbotCommandsLoader, 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 = HealthbotCommandsLoader
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 Healthbot
return get_mgmt_service_client(cli_ctx,
Healthbot)


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 --bot-name "samplebotname" --location "East US" --name "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', 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('name', 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', type=str, help='The name of the Bot resource.', id_part='name')
c.argument('tags', tags_type)
c.argument('name', 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