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] Enable swagger ci for azure-powershell #687

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
2 changes: 1 addition & 1 deletion src/healthbot/azext_healthbot/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
examples:
- name: BotCreate
text: |-
az healthbot create --name "samplebotname" --location "East US" --sku "F0" --resource-group \
az healthbot create --bot-name "samplebotname" --location "East US" --name "F0" --resource-group \
"healthbotClient"
"""

Expand Down
8 changes: 4 additions & 4 deletions src/healthbot/azext_healthbot/generated/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def load_arguments(self, _):

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('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',
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', options_list=['--name', '-n', '--bot-name'], type=str, help='The name of the Bot resource.', id_part='name')
c.argument('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',
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:
Expand Down
8 changes: 4 additions & 4 deletions src/healthbot/azext_healthbot/generated/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ def healthbot_create(client,
resource_group_name,
bot_name,
location,
sku,
name,
tags=None,
no_wait=False):
parameters = {}
parameters['tags'] = tags
parameters['location'] = location
parameters['sku'] = {}
parameters['sku']['name'] = sku
parameters['sku']['name'] = name
return sdk_no_wait(no_wait,
client.begin_create,
resource_group_name=resource_group_name,
Expand All @@ -49,11 +49,11 @@ def healthbot_update(client,
resource_group_name,
bot_name,
tags=None,
sku=None):
name=None):
parameters = {}
parameters['tags'] = tags
parameters['sku'] = {}
parameters['sku']['name'] = sku
parameters['sku']['name'] = name
return client.update(resource_group_name=resource_group_name,
bot_name=bot_name,
parameters=parameters)
Expand Down
19 changes: 10 additions & 9 deletions src/healthbot/azext_healthbot/tests/latest/example_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def step_create(test, rg, rg_2, checks=None):
if checks is None:
checks = []
test.cmd('az healthbot create '
'--name "{myBot}" '
'--location "eastus" '
'--sku "F0" '
'--resource-group "{rg}"',
'--bot-name "{myBot}" '
'--location "East US" '
'--name "F0" '
'--resource-group "{rg_2}"',
checks=checks)


Expand Down Expand Up @@ -52,7 +52,7 @@ def step_show(test, rg, rg_2, checks=None):
checks = []
test.cmd('az healthbot show '
'--name "{myBot}" '
'--resource-group "{rg}"',
'--resource-group "{rg_2}"',
checks=checks)


Expand All @@ -62,9 +62,9 @@ def step_update(test, rg, rg_2, checks=None):
if checks is None:
checks = []
test.cmd('az healthbot update '
'--name "{myBot}" '
'--sku "F0" '
'--resource-group "{rg}"',
'--bot-name "{myBot}" '
'--name "F0" '
'--resource-group "{rg_2}"',
checks=checks)


Expand All @@ -75,5 +75,6 @@ def step_delete(test, rg, rg_2, checks=None):
checks = []
test.cmd('az healthbot delete -y '
'--name "{myBot}" '
'--resource-group "{rg}"',
'--resource-group "{rg_2}"',
checks=checks)

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def call_scenario(test, rg, rg_2):
setup_scenario(test, rg, rg_2)
step_create(test, rg, rg_2, checks=[
test.check("name", "{myBot}", case_sensitive=False),
test.check("location", "eastus", case_sensitive=False),
test.check("location", "East US", case_sensitive=False),
test.check("sku.name", "F0", case_sensitive=False),
])
step_list(test, rg, rg_2, checks=[])
Expand All @@ -54,12 +54,12 @@ def call_scenario(test, rg, rg_2):
])
step_show(test, rg, rg_2, checks=[
test.check("name", "{myBot}", case_sensitive=False),
test.check("location", "eastus", case_sensitive=False),
test.check("location", "East US", case_sensitive=False),
test.check("sku.name", "F0", case_sensitive=False),
])
step_update(test, rg, rg_2, checks=[
test.check("name", "{myBot}", case_sensitive=False),
test.check("location", "eastus", case_sensitive=False),
test.check("location", "East US", case_sensitive=False),
test.check("sku.name", "F0", case_sensitive=False),
])
step_delete(test, rg, rg_2, checks=[])
Expand All @@ -76,9 +76,11 @@ def __init__(self, *args, **kwargs):
'myBot': 'samplebotname',
})

@ResourceGroupPreparer(name_prefix='clitest', random_name_length=20, key='rg', parameter_name='rg')
@ResourceGroupPreparer(name_prefix='clitest', random_name_length=20, key='rg_2', parameter_name='rg_2')

@ResourceGroupPreparer(name_prefix='clitesthealthbot_OneResourceGroupName'[:7], key='rg', parameter_name='rg')
@ResourceGroupPreparer(name_prefix='clitesthealthbot_healthbotClient'[:7], key='rg_2', parameter_name='rg_2')
def test_healthbot_Scenario(self, rg, rg_2):
call_scenario(self, rg, rg_2)
calc_coverage(__file__)
raise_if()

8 changes: 4 additions & 4 deletions src/healthbot/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@ az healthbot show --name "samplebotname" --resource-group "healthbotClient"

##### <a name="ExamplesBotsCreate">Example</a>
```
az healthbot create --name "samplebotname" --location "East US" --sku "F0" --resource-group "healthbotClient"
az healthbot create --bot-name "samplebotname" --location "East US" --name "F0" --resource-group "healthbotClient"
```
##### <a name="ParametersBotsCreate">Parameters</a>
|Option|Type|Description|Path (SDK)|Swagger name|
|------|----|-----------|----------|------------|
|**--resource-group-name**|string|The name of the Bot resource group in the user subscription.|resource_group_name|resourceGroupName|
|**--bot-name**|string|The name of the Bot resource.|bot_name|botName|
|**--location**|string|The geo-location where the resource lives|location|location|
|**--sku**|sealed-choice|The name of the HealthBot SKU|
|**--name**|sealed-choice|The name of the HealthBot SKU|name|name|
|**--tags**|dictionary|Resource tags.|tags|tags|

#### <a name="BotsUpdate">Command `az healthbot update`</a>

##### <a name="ExamplesBotsUpdate">Example</a>
```
az healthbot update --name "samplebotname" --sku "F0" --resource-group "healthbotClient"
az healthbot update --bot-name "samplebotname" --name "F0" --resource-group "healthbotClient"
```
##### <a name="ParametersBotsUpdate">Parameters</a>
|Option|Type|Description|Path (SDK)|Swagger name|
|------|----|-----------|----------|------------|
|**--resource-group-name**|string|The name of the Bot resource group in the user subscription.|resource_group_name|resourceGroupName|
|**--bot-name**|string|The name of the Bot resource.|bot_name|botName|
|**--tags**|dictionary|Tags for a HealthBot.|tags|tags|
|**--sku**|sealed-choice|The name of the HealthBot SKU|
|**--name**|sealed-choice|The name of the HealthBot SKU|name|name|

#### <a name="BotsDelete">Command `az healthbot delete`</a>

Expand Down