Skip to content

Commit

Permalink
[Connectedmachine] Added a property in az connectedmachine extension …
Browse files Browse the repository at this point in the history
…create/update (#4013)

* update

1. Added table format for connectedmachine list.
2. Renamed subgroups

* updated the README.md

* fixed code styling

* fixed --n ambiguity

* addressed code reviews

* addressed code reviews

* added enable-auto-upgrade param

* addressed code reviews

* changed the report.md

* re-ran tests
  • Loading branch information
dorothyhu authored Oct 28, 2021
1 parent d83f9d3 commit ad1897f
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 332 deletions.
8 changes: 6 additions & 2 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
Release History
===============

0.4.1
+++++
* Add the enable-auto-upgrade parameter in az connectedmachine extension create/update functions

0.4.0
+++++
* Add private link scope and private endpoint connection commands

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

0.2.0
+++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def load_arguments(self, _):
c.argument('type_', options_list=['--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('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension '
'should be automatically upgraded by the platform if there is a newer version available.')
c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should '
'use a newer minor version if one is available at deployment time. Once deployed, however, the '
'extension will not upgrade minor versions unless redeployed, even with this property set to true.')
Expand All @@ -92,6 +94,8 @@ def load_arguments(self, _):
c.argument('type_', options_list=['--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('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension '
'should be automatically upgraded by the platform if there is a newer version available.')
c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should '
'use a newer minor version if one is available at deployment time. Once deployed, however, the '
'extension will not upgrade minor versions unless redeployed, even with this property set to true.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def connectedmachine_extension_create(client,
publisher=None,
type_=None,
type_handler_version=None,
enable_auto_upgrade=None,
auto_upgrade_minor=None,
settings=None,
protected_settings=None,
Expand All @@ -79,6 +80,7 @@ def connectedmachine_extension_create(client,
extension_parameters['properties']['publisher'] = publisher
extension_parameters['properties']['type'] = type_
extension_parameters['properties']['type_handler_version'] = type_handler_version
extension_parameters['properties']['enable_auto_upgrade'] = enable_auto_upgrade
extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor
extension_parameters['properties']['settings'] = settings
extension_parameters['properties']['protected_settings'] = protected_settings
Expand All @@ -104,6 +106,7 @@ def connectedmachine_extension_update(client,
publisher=None,
type_=None,
type_handler_version=None,
enable_auto_upgrade=None,
auto_upgrade_minor=None,
settings=None,
protected_settings=None,
Expand All @@ -115,6 +118,7 @@ def connectedmachine_extension_update(client,
extension_parameters['properties']['publisher'] = publisher
extension_parameters['properties']['type'] = type_
extension_parameters['properties']['type_handler_version'] = type_handler_version
extension_parameters['properties']['enable_auto_upgrade'] = enable_auto_upgrade
extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor
extension_parameters['properties']['settings'] = settings
extension_parameters['properties']['protected_settings'] = protected_settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def step_extension_create(test, checks=None):
test.cmd('az connectedmachine extension create '
'--name "CustomScriptExtension" '
'--location "eastus2euap" '
'--enable-auto-upgrade true '
'--type "CustomScriptExtension" '
'--publisher "Microsoft.Compute" '
'--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{{{ $_.CPU '
Expand Down Expand Up @@ -100,6 +101,7 @@ def step_extension_update(test, checks=None):
checks = []
test.cmd('az connectedmachine extension update '
f'--name "{EXTENSION_NAME}" '
'--enable-auto-upgrade false '
'--settings "{{\\"commandToExecute\\":\\"hostname\\"}}" '
f'--machine-name "{MACHINE_NAME}" '
f'--resource-group "{RESOURCE_GROUP}"',
Expand Down
Loading

0 comments on commit ad1897f

Please sign in to comment.