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 connectedmachine] [Hub Generated] Review request for Microsoft.HybridCompute to add version stable/2020-08-02 #391

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 0 additions & 8 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
Release History
===============

0.2.0
+++++
* machineextensions support

0.1.1
+++++
* Remove the limitation of max compatible cli core version

0.1.0
++++++
* Initial release.
85 changes: 42 additions & 43 deletions src/connectedmachine/azext_connectedmachine/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,115 +12,114 @@
from knack.help_files import helps


helps['connectedmachine machine'] = """
helps['connectedmachine'] = """
type: group
short-summary: connectedmachine machine
short-summary: connectedmachine
"""

helps['connectedmachine machine list'] = """
helps['connectedmachine list'] = """
type: command
short-summary: "Lists all the hybrid machines in the specified subscription."
short-summary: "Lists all the hybrid machines in the specified resource group. And Lists all the hybrid machines \
in the specified subscription."
examples:
- name: List Machines by resource group
text: |-
az connectedmachine machine list --resource-group "myResourceGroup"
az connectedmachine list --resource-group "myResourceGroup"
- name: List Machines by subscription
text: |-
az connectedmachine list
"""

helps['connectedmachine machine show'] = """
helps['connectedmachine show'] = """
type: command
short-summary: "Retrieves information about the model view or the instance view of a hybrid machine."
examples:
- name: Get Machine
text: |-
az connectedmachine machine show --name "myMachine" --resource-group "myResourceGroup"
az connectedmachine show --name "myMachine" --resource-group "myResourceGroup"
"""

helps['connectedmachine machine delete'] = """
helps['connectedmachine delete'] = """
type: command
short-summary: "The operation to remove a hybrid machine identity in Azure."
examples:
- name: Delete a Machine
text: |-
az connectedmachine machine delete --name "myMachine" --resource-group "myResourceGroup"
az connectedmachine delete --name "myMachine" --resource-group "myResourceGroup"
"""

helps['connectedmachine machine-extension'] = """
helps['connectedmachine extension'] = """
type: group
short-summary: connectedmachine machine-extension
short-summary: connectedmachine extension
"""

helps['connectedmachine machine-extension list'] = """
helps['connectedmachine extension list'] = """
type: command
short-summary: "The operation to get all extensions of a non-Azure machine"
short-summary: "The operation to get all extensions of a non-Azure machine."
examples:
- name: Get all Machine Extensions
text: |-
az connectedmachine machine-extension list --machine-name "myMachine" --resource-group \
"myResourceGroup"
az connectedmachine extension list --machine-name "myMachine" --resource-group "myResourceGroup"
"""

helps['connectedmachine machine-extension show'] = """
helps['connectedmachine extension show'] = """
type: command
short-summary: "The operation to get the extension."
examples:
- name: Get Machine Extension
text: |-
az connectedmachine machine-extension show --machine-name "myMachine" --name "CustomScriptExtension" \
az connectedmachine extension show --machine-name "myMachine" --n "CustomScriptExtension" \
--resource-group "myResourceGroup"
"""

helps['connectedmachine machine-extension create'] = """
helps['connectedmachine extension create'] = """
type: command
short-summary: "The operation to create or update the extension."
short-summary: "The operation to Create the extension."
examples:
- name: Create or Update a Machine Extension
- name: Create or Update a Machine Extension (PUT)
text: |-
az connectedmachine machine-extension create --machine-name "myMachine" --name "CustomScriptExtension" \
--location "eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings \
"{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" \
--type-handler-version "1.10" --resource-group "myResourceGroup"
az connectedmachine extension create --machine-name "myMachine" --n "CustomScriptExtension" --location \
"eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"pow\
ershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" --type-handler-version "1.10" \
--resource-group "myResourceGroup"
"""

helps['connectedmachine machine-extension update'] = """
helps['connectedmachine extension update'] = """
type: command
short-summary: "The operation to update the extension."
examples:
- name: Update a Machine Extension
- name: Create or Update a Machine Extension (PATCH)
text: |-
az connectedmachine machine-extension update --machine-name "myMachine" --name "CustomScriptExtension" \
--type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe \
-c \\\\\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --resource-group \
az connectedmachine extension update --machine-name "myMachine" --n "CustomScriptExtension" --type \
"CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe -c \
\\\\\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --resource-group \
"myResourceGroup"
"""

helps['connectedmachine machine-extension delete'] = """
helps['connectedmachine extension delete'] = """
type: command
short-summary: "The operation to delete the extension."
examples:
- name: Delete a Machine Extension
text: |-
az connectedmachine machine-extension delete --machine-name "myMachine" --name "MMA" --resource-group \
az connectedmachine extension delete --machine-name "myMachine" --n "MMA" --resource-group \
"myResourceGroup"
"""

helps['connectedmachine machine-extension wait'] = """
helps['connectedmachine extension wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the connectedmachine machine-extension is \
met.
short-summary: Place the CLI in a waiting state until a condition of the connectedmachine extension is met.
examples:
- name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \
created.
- name: Pause executing next line of CLI script until the connectedmachine extension is successfully created.
text: |-
az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \
az connectedmachine extension wait --machine-name "myMachine" --n "CustomScriptExtension" \
--resource-group "myResourceGroup" --created
- name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \
updated.
- name: Pause executing next line of CLI script until the connectedmachine extension is successfully updated.
text: |-
az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \
az connectedmachine extension wait --machine-name "myMachine" --n "CustomScriptExtension" \
--resource-group "myResourceGroup" --updated
- name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \
deleted.
- name: Pause executing next line of CLI script until the connectedmachine extension is successfully deleted.
text: |-
az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \
az connectedmachine extension wait --machine-name "myMachine" --n "CustomScriptExtension" \
--resource-group "myResourceGroup" --deleted
"""
33 changes: 19 additions & 14 deletions src/connectedmachine/azext_connectedmachine/generated/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,36 @@

def load_arguments(self, _):

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

with self.argument_context('connectedmachine machine show') as c:
with self.argument_context('connectedmachine show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the '
'hybrid machine.', id_part='name')

with self.argument_context('connectedmachine machine delete') as c:
with self.argument_context('connectedmachine delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the '
'hybrid machine.', id_part='name')

with self.argument_context('connectedmachine machine-extension list') as c:
with self.argument_context('connectedmachine extension list') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine containing the extension.')
c.argument('expand', type=str, help='The expand expression to apply on the operation.')

with self.argument_context('connectedmachine machine-extension show') as c:
with self.argument_context('connectedmachine extension show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name')
c.argument('name', options_list=['--name', '-n', '--extension-name'], type=str, help='The name of the machine extension.', id_part='child_name_1')
c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')

with self.argument_context('connectedmachine machine-extension create') as c:
with self.argument_context('connectedmachine extension create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or '
'updated.')
c.argument('name', options_list=['--name', '-n', '--extension-name'], type=str, help='The name of the machine extension.')
c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.')
c.argument('tags', tags_type)
c.argument('location', arg_type=get_location_type(self.cli_ctx),
validator=get_default_location_from_resource_group)
Expand All @@ -71,11 +73,12 @@ def load_arguments(self, _):
'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
'value: json-string/@json-file.')

with self.argument_context('connectedmachine machine-extension update') as c:
with self.argument_context('connectedmachine extension update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or '
'updated.', id_part='name')
c.argument('name', options_list=['--name', '-n', '--extension-name'], type=str, help='The name of the machine extension.', id_part='child_name_1')
c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')
c.argument('tags', tags_type)
c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if '
'the extension configuration has not changed.')
Expand All @@ -93,13 +96,15 @@ def load_arguments(self, _):
'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
'value: json-string/@json-file.')

with self.argument_context('connectedmachine machine-extension delete') as c:
with self.argument_context('connectedmachine extension delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine where the extension should be deleted.',
id_part='name')
c.argument('name', options_list=['--name', '-n', '--extension-name'], type=str, help='The name of the machine extension.', id_part='child_name_1')
c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')

with self.argument_context('connectedmachine machine-extension wait') as c:
with self.argument_context('connectedmachine extension wait') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name')
c.argument('name', options_list=['--name', '-n', '--extension-name'], type=str, help='The name of the machine extension.', id_part='child_name_1')
c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')
24 changes: 11 additions & 13 deletions src/connectedmachine/azext_connectedmachine/generated/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ def load_command_table(self, _):
operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_operations#MachineOp'
'erations.{}',
client_factory=cf_machine)
with self.command_group('connectedmachine machine', connectedmachine_machine, client_factory=cf_machine,
is_experimental=True) as g:
g.custom_command('list', 'connectedmachine_machine_list')
g.custom_show_command('show', 'connectedmachine_machine_show')
g.custom_command('delete', 'connectedmachine_machine_delete', confirmation=True)
with self.command_group('connectedmachine', connectedmachine_machine, client_factory=cf_machine) as g:
g.custom_command('list', 'connectedmachine_list')
g.custom_show_command('show', 'connectedmachine_show')
g.custom_command('delete', 'connectedmachine_delete', confirmation=True)

from azext_connectedmachine.generated._client_factory import cf_machine_extension
connectedmachine_machine_extension = CliCommandType(
operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_extension_operations'
'#MachineExtensionOperations.{}',
client_factory=cf_machine_extension)
with self.command_group('connectedmachine machine-extension', connectedmachine_machine_extension,
with self.command_group('connectedmachine extension', connectedmachine_machine_extension,
client_factory=cf_machine_extension, is_experimental=True) as g:
g.custom_command('list', 'connectedmachine_machine_extension_list')
g.custom_show_command('show', 'connectedmachine_machine_extension_show')
g.custom_command('create', 'connectedmachine_machine_extension_create', supports_no_wait=True)
g.custom_command('update', 'connectedmachine_machine_extension_update', supports_no_wait=True)
g.custom_command('delete', 'connectedmachine_machine_extension_delete', supports_no_wait=True,
confirmation=True)
g.custom_wait_command('wait', 'connectedmachine_machine_extension_show')
g.custom_command('list', 'connectedmachine_extension_list')
g.custom_show_command('show', 'connectedmachine_extension_show')
g.custom_command('create', 'connectedmachine_extension_create', supports_no_wait=True)
g.custom_command('update', 'connectedmachine_extension_update', supports_no_wait=True)
g.custom_command('delete', 'connectedmachine_extension_delete', supports_no_wait=True, confirmation=True)
g.custom_wait_command('wait', 'connectedmachine_extension_show')
Loading