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] add hybridcompute track2 config #486

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
13 changes: 0 additions & 13 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
Release History
===============

0.3.0
+++++
* Renamed machine-extension subgroup to extension
* Moved all commands under the machine subgroup to the extension level

0.2.0
+++++
* machineextensions support

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

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


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

helps['connectedmachine list'] = """
helps['connectedmachine machine 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 list --resource-group "myResourceGroup"
az connectedmachine machine list --resource-group "myResourceGroup"
- name: List Machines by resource group
text: |-
az connectedmachine machine list
"""

helps['connectedmachine show'] = """
helps['connectedmachine machine 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 show --name "myMachine" --resource-group "myResourceGroup"
az connectedmachine machine show --name "myMachine" --resource-group "myResourceGroup"
"""

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

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

helps['connectedmachine extension list'] = """
helps['connectedmachine machine-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 extension list --machine-name "myMachine" --resource-group "myResourceGroup"
az connectedmachine machine-extension list --machine-name "myMachine" --resource-group \
"myResourceGroup"
"""

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

helps['connectedmachine extension create'] = """
helps['connectedmachine machine-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 a Machine Extension (PUT)
- name: Create or Update a Machine Extension
text: |-
az connectedmachine extension create --machine-name "myMachine" --name "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"
az connectedmachine machine-extension create --machine-name "myMachine" --n "CustomScriptExtension" \
--location "eastus2euap" --type-properties-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"
"""

helps['connectedmachine extension update'] = """
helps['connectedmachine machine-extension update'] = """
type: command
short-summary: "The operation to update the extension."
examples:
- name: Update a Machine Extension (PATCH)
- name: Create or Update a Machine Extension
text: |-
az connectedmachine 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 machine-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 extension delete'] = """
helps['connectedmachine machine-extension delete'] = """
type: command
short-summary: "The operation to delete the extension."
examples:
- name: Delete a Machine Extension
text: |-
az connectedmachine extension delete --machine-name "myMachine" --name "MMA" --resource-group \
az connectedmachine machine-extension delete --machine-name "myMachine" --n "MMA" --resource-group \
"myResourceGroup"
"""

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

def load_arguments(self, _):

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

with self.argument_context('connectedmachine show') as c:
with self.argument_context('connectedmachine machine 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 delete') as c:
with self.argument_context('connectedmachine machine 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 extension list') as c:
with self.argument_context('connectedmachine machine-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 extension show') as c:
with self.argument_context('connectedmachine machine-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=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')

with self.argument_context('connectedmachine extension create') as c:
with self.argument_context('connectedmachine machine-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.')
Expand All @@ -60,8 +60,8 @@ def load_arguments(self, _):
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.')
c.argument('publisher', type=str, help='The name of the extension handler publisher.')
c.argument('type_', options_list=['--type'], type=str, help='Specifies the type of the extension; an example '
'is "CustomScriptExtension".')
c.argument('type_properties_type', type=str, help='Specifies the type of the extension; an example is '
'"CustomScriptExtension".')
c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.')
c.argument('auto_upgrade_minor_version', options_list=['--auto-upgrade-minor'],
arg_type=get_three_state_flag(), help='Indicates whether the extension should use a newer minor '
Expand All @@ -73,7 +73,7 @@ def load_arguments(self, _):
'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
'value: json-string/@json-file.')

with self.argument_context('connectedmachine extension update') as c:
with self.argument_context('connectedmachine machine-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')
Expand All @@ -96,14 +96,14 @@ def load_arguments(self, _):
'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected '
'value: json-string/@json-file.')

with self.argument_context('connectedmachine extension delete') as c:
with self.argument_context('connectedmachine machine-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=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
'extension.', id_part='child_name_1')

with self.argument_context('connectedmachine extension wait') as c:
with self.argument_context('connectedmachine machine-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=['-n', '--extension-name', '--name'], type=str, help='The name of the machine '
Expand Down
24 changes: 13 additions & 11 deletions src/connectedmachine/azext_connectedmachine/generated/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ 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', 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)
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)

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 extension', connectedmachine_machine_extension,
with self.command_group('connectedmachine machine-extension', connectedmachine_machine_extension,
client_factory=cf_machine_extension, is_experimental=True) as g:
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')
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')
Loading