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

[Connectedmachine] Added a property in az connectedmachine extension create/update #4013

Merged
merged 15 commits into from
Oct 28, 2021
Merged
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