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

[ReleasePR desktopvirtualization] Dev desktopvirtualization microsoft.desktop virtualization 2021 05 13 preview #2675

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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from azure.cli.core import AzCommandsLoader
from azext_desktopvirtualization.generated._help import helps # pylint: disable=unused-import
try:
from azext_desktopvirtualization.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class DesktopVirtualizationAPIClientCommandsLoader(AzCommandsLoader):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
"azext.minCliCoreVersion": "2.11.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,29 @@
def cf_desktopvirtualization_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.desktopvirtualization import DesktopVirtualizationAPIClient
return get_mgmt_service_client(cli_ctx, DesktopVirtualizationAPIClient)
return get_mgmt_service_client(cli_ctx,
DesktopVirtualizationAPIClient)


def cf_workspace(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).workspace


def cf_scaling_plan(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).scaling_plan


def cf_application_group(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).application_group


def cf_host_pool(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).host_pool


def cf_msix_package(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).msix_package


def cf_msix_image(cli_ctx, *_):
return cf_desktopvirtualization_cl(cli_ctx).msix_image
357 changes: 316 additions & 41 deletions src/desktopvirtualization/azext_desktopvirtualization/generated/_help.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,168 @@
# pylint: disable=protected-access

import argparse
from knack.util import CLIError
from collections import defaultdict
from knack.util import CLIError


class AddDesktopvirtualizationScalingPlanCreateSchedules(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDesktopvirtualizationScalingPlanCreateSchedules, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'name':
d['name'] = v[0]
elif kl == 'days-of-week':
d['days_of_week'] = v
elif kl == 'ramp-up-start-time':
d['ramp_up_start_time'] = v[0]
elif kl == 'ramp-up-algorithm':
d['ramp_up_algorithm'] = v[0]
elif kl == 'ramp-up-minimum-host-pct':
d['ramp_up_minimum_host_pct'] = v[0]
elif kl == 'ramp-up-capacity-threshold-pct':
d['ramp_up_capacity_threshold_pct'] = v[0]
elif kl == 'peak-start-time':
d['peak_start_time'] = v[0]
elif kl == 'peak-load-balancing-algorithm':
d['peak_load_balancing_algorithm'] = v[0]
elif kl == 'ramp-down-start-time':
d['ramp_down_start_time'] = v[0]
elif kl == 'ramp-down-load-balancing-algorithm':
d['ramp_down_load_balancing_algorithm'] = v[0]
elif kl == 'ramp-down-minimum-hosts-pct':
d['ramp_down_minimum_hosts_pct'] = v[0]
elif kl == 'ramp-down-capacity-threshold-pct':
d['ramp_down_capacity_threshold_pct'] = v[0]
elif kl == 'ramp-down-force-logoff-users':
d['ramp_down_force_logoff_users'] = v[0]
elif kl == 'ramp-down-stop-hosts-when':
d['ramp_down_stop_hosts_when'] = v[0]
elif kl == 'ramp-down-notification-minutes':
d['ramp_down_notification_minutes'] = v[0]
elif kl == 'ramp-down-notification-message':
d['ramp_down_notification_message'] = v[0]
elif kl == 'off-peak-start-time':
d['off_peak_start_time'] = v[0]
elif kl == 'off-peak-load-balancing-algorithm':
d['off_peak_load_balancing_algorithm'] = v[0]
return d


class AddDesktopvirtualizationScalingPlanCreateHostPoolReferences(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDesktopvirtualizationScalingPlanCreateHostPoolReferences, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'host-pool-arm-path':
d['host_pool_arm_path'] = v[0]
elif kl == 'scaling-plan-enabled':
d['scaling_plan_enabled'] = v[0]
return d


class AddDesktopvirtualizationScalingPlanUpdateSchedules(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDesktopvirtualizationScalingPlanUpdateSchedules, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'name':
d['name'] = v[0]
elif kl == 'days-of-week':
d['days_of_week'] = v
elif kl == 'ramp-up-start-time':
d['ramp_up_start_time'] = v[0]
elif kl == 'ramp-up-algorithm':
d['ramp_up_algorithm'] = v[0]
elif kl == 'ramp-up-minimum-host-pct':
d['ramp_up_minimum_host_pct'] = v[0]
elif kl == 'ramp-up-capacity-threshold-pct':
d['ramp_up_capacity_threshold_pct'] = v[0]
elif kl == 'peak-start-time':
d['peak_start_time'] = v[0]
elif kl == 'peak-load-balancing-algorithm':
d['peak_load_balancing_algorithm'] = v[0]
elif kl == 'ramp-down-start-time':
d['ramp_down_start_time'] = v[0]
elif kl == 'ramp-down-load-balancing-algorithm':
d['ramp_down_load_balancing_algorithm'] = v[0]
elif kl == 'ramp-down-minimum-hosts-pct':
d['ramp_down_minimum_hosts_pct'] = v[0]
elif kl == 'ramp-down-capacity-threshold-pct':
d['ramp_down_capacity_threshold_pct'] = v[0]
elif kl == 'ramp-down-force-logoff-users':
d['ramp_down_force_logoff_users'] = v[0]
elif kl == 'ramp-down-stop-hosts-when':
d['ramp_down_stop_hosts_when'] = v[0]
elif kl == 'ramp-down-notification-minutes':
d['ramp_down_notification_minutes'] = v[0]
elif kl == 'ramp-down-notification-message':
d['ramp_down_notification_message'] = v[0]
elif kl == 'off-peak-start-time':
d['off_peak_start_time'] = v[0]
elif kl == 'off-peak-load-balancing-algorithm':
d['off_peak_load_balancing_algorithm'] = v[0]
return d


class AddDesktopvirtualizationScalingPlanUpdateHostPoolReferences(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDesktopvirtualizationScalingPlanUpdateHostPoolReferences, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'host-pool-arm-path':
d['host_pool_arm_path'] = v[0]
elif kl == 'scaling-plan-enabled':
d['scaling_plan_enabled'] = v[0]
return d


class AddDesktopvirtualizationHostpoolCreateRegistrationInfo(argparse.Action):
Expand Down Expand Up @@ -62,3 +222,63 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use
elif kl == 'registration-token-operation':
d['registration_token_operation'] = v[0]
return d


class AddPackageDependencies(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddPackageDependencies, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'dependency-name':
d['dependency_name'] = v[0]
elif kl == 'publisher':
d['publisher'] = v[0]
elif kl == 'min-version':
d['min_version'] = v[0]
return d


class AddPackageApplications(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddPackageApplications, self).__call__(parser, namespace, action, option_string)

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'app-id':
d['app_id'] = v[0]
elif kl == 'description':
d['description'] = v[0]
elif kl == 'app-user-model-id':
d['app_user_model_id'] = v[0]
elif kl == 'friendly-name':
d['friendly_name'] = v[0]
elif kl == 'icon-image-name':
d['icon_image_name'] = v[0]
elif kl == 'raw-icon':
d['raw_icon'] = v[0]
elif kl == 'raw-png':
d['raw_png'] = v[0]
return d
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ def load_command_table(self, _):
g.custom_show_command('show', 'desktopvirtualization_workspace_show')
g.custom_command('create', 'desktopvirtualization_workspace_create')
g.custom_command('update', 'desktopvirtualization_workspace_update')
g.custom_command('delete', 'desktopvirtualization_workspace_delete')
g.custom_command('delete', 'desktopvirtualization_workspace_delete', confirmation=True)

from azext_desktopvirtualization.generated._client_factory import cf_scaling_plan
desktopvirtualization_scaling_plan = CliCommandType(
operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._scaling_plan_opera'
'tions#ScalingPlanOperations.{}',
client_factory=cf_scaling_plan)
with self.command_group('desktopvirtualization scaling-plan', desktopvirtualization_scaling_plan,
client_factory=cf_scaling_plan, is_experimental=True) as g:
g.custom_command('list', 'desktopvirtualization_scaling_plan_list')
g.custom_show_command('show', 'desktopvirtualization_scaling_plan_show')
g.custom_command('create', 'desktopvirtualization_scaling_plan_create')
g.custom_command('update', 'desktopvirtualization_scaling_plan_update')
g.custom_command('delete', 'desktopvirtualization_scaling_plan_delete', confirmation=True)

from azext_desktopvirtualization.generated._client_factory import cf_application_group
desktopvirtualization_application_group = CliCommandType(
Expand All @@ -39,7 +52,7 @@ def load_command_table(self, _):
g.custom_show_command('show', 'desktopvirtualization_applicationgroup_show')
g.custom_command('create', 'desktopvirtualization_applicationgroup_create')
g.custom_command('update', 'desktopvirtualization_applicationgroup_update')
g.custom_command('delete', 'desktopvirtualization_applicationgroup_delete')
g.custom_command('delete', 'desktopvirtualization_applicationgroup_delete', confirmation=True)

from azext_desktopvirtualization.generated._client_factory import cf_host_pool
desktopvirtualization_host_pool = CliCommandType(
Expand All @@ -52,4 +65,26 @@ def load_command_table(self, _):
g.custom_show_command('show', 'desktopvirtualization_hostpool_show')
g.custom_command('create', 'desktopvirtualization_hostpool_create')
g.custom_command('update', 'desktopvirtualization_hostpool_update')
g.custom_command('delete', 'desktopvirtualization_hostpool_delete')
g.custom_command('delete', 'desktopvirtualization_hostpool_delete', confirmation=True)

from azext_desktopvirtualization.generated._client_factory import cf_msix_package
desktopvirtualization_msix_package = CliCommandType(
operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._msix_package_opera'
'tions#MsixPackageOperations.{}',
client_factory=cf_msix_package)
with self.command_group('desktopvirtualization msix-package', desktopvirtualization_msix_package,
client_factory=cf_msix_package, is_experimental=True) as g:
g.custom_command('list', 'desktopvirtualization_msix_package_list')
g.custom_show_command('show', 'desktopvirtualization_msix_package_show')
g.custom_command('create', 'desktopvirtualization_msix_package_create')
g.custom_command('update', 'desktopvirtualization_msix_package_update')
g.custom_command('delete', 'desktopvirtualization_msix_package_delete', confirmation=True)

from azext_desktopvirtualization.generated._client_factory import cf_msix_image
desktopvirtualization_msix_image = CliCommandType(
operations_tmpl='azext_desktopvirtualization.vendored_sdks.desktopvirtualization.operations._msix_image_operati'
'ons#MsixImageOperations.{}',
client_factory=cf_msix_image)
with self.command_group('desktopvirtualization msix-image', desktopvirtualization_msix_image,
client_factory=cf_msix_image, is_experimental=True) as g:
g.custom_command('expand', 'desktopvirtualization_msix_image_expand')
Loading