Skip to content

Commit

Permalink
Revert "[DeploymentManager] BREAKING CHANGE: az deploymentmanager: …
Browse files Browse the repository at this point in the history
…Remove command module since it is no longer maintained by service (Azure#25523)"

This reverts commit 5d5ed03.
  • Loading branch information
zhoxing-ms committed Mar 2, 2023
1 parent 9a1b2a9 commit 4deb7da
Show file tree
Hide file tree
Showing 29 changed files with 2,329 additions and 0 deletions.
10 changes: 10 additions & 0 deletions azure-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,16 @@
<Compile Include="command_modules\azure-cli-consumption\azure\cli\command_modules\consumption\__init__.py" />
<Compile Include="command_modules\azure-cli-consumption\azure_bdist_wheel.py" />
<Compile Include="command_modules\azure-cli-consumption\setup.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\commands.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\custom.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\tests\latest\recording_processors.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\tests\latest\test_deploymentmanager_scenario.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\_client_factory.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\_help.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\_params.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure\cli\command_modules\deploymentmanager\__init__.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\azure_bdist_wheel.py" />
<Compile Include="command_modules\azure-cli-deploymentmanager\setup.py" />
<Compile Include="command_modules\azure-cli-dla\azure\cli\command_modules\dla\commands.py" />
<Compile Include="command_modules\azure-cli-dla\azure\cli\command_modules\dla\custom.py" />
<Compile Include="command_modules\azure-cli-dla\azure\cli\command_modules\dla\tests\latest\recording_processors.py" />
Expand Down
20 changes: 20 additions & 0 deletions azure-cli2017.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,15 @@
<Compile Include="azure-cli\azure\cli\command_modules\cosmosdb\_params.py" />
<Compile Include="azure-cli\azure\cli\command_modules\cosmosdb\_validators.py" />
<Compile Include="azure-cli\azure\cli\command_modules\cosmosdb\__init__.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\commands.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\custom.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\test_deploymentmanager_scenario.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\__init__.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\__init__.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\_client_factory.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\_help.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\_params.py" />
<Compile Include="azure-cli\azure\cli\command_modules\deploymentmanager\__init__.py" />
<Compile Include="azure-cli\azure\cli\command_modules\dla\commands.py" />
<Compile Include="azure-cli\azure\cli\command_modules\dla\custom.py" />
<Compile Include="azure-cli\azure\cli\command_modules\dla\tests\latest\recording_processors.py" />
Expand Down Expand Up @@ -1062,6 +1071,10 @@
<Folder Include="azure-cli\azure\cli\command_modules\cosmosdb\" />
<Folder Include="azure-cli\azure\cli\command_modules\cosmosdb\tests\" />
<Folder Include="azure-cli\azure\cli\command_modules\cosmosdb\tests\latest\" />
<Folder Include="azure-cli\azure\cli\command_modules\deploymentmanager\" />
<Folder Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\" />
<Folder Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\" />
<Folder Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\" />
<Folder Include="azure-cli\azure\cli\command_modules\dla\" />
<Folder Include="azure-cli\azure\cli\command_modules\dla\tests\" />
<Folder Include="azure-cli\azure\cli\command_modules\dla\tests\latest\" />
Expand Down Expand Up @@ -1330,6 +1343,13 @@
<Content Include="azure-cli\azure\cli\command_modules\botservice\web.config" />
<Content Include="azure-cli\azure\cli\command_modules\botservice\webapp.template.json" />
<Content Include="azure-cli\azure\cli\command_modules\botservice\webappv4.template.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\storage.copy.parameters.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\storage.copy.template.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\storage.parameters.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\storage.template.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\artifactroot\storage_invalid.parameters.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\createrollout.json" />
<Content Include="azure-cli\azure\cli\command_modules\deploymentmanager\tests\latest\createrollout_failurerollout.json" />
<Content Include="azure-cli\azure\cli\command_modules\keyvault\tests\latest\ec256.pem" />
<Content Include="azure-cli\azure\cli\command_modules\keyvault\tests\latest\ec521pw.pem" />
<Content Include="azure-cli\azure\cli\command_modules\keyvault\tests\latest\import_pem_encrypted_pwd_123.pem" />
Expand Down
1 change: 1 addition & 0 deletions doc/sphinx/azhelpgen/doc_source_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"cosmosdb": "src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py",
"databoxedge": "src/azure-cli/azure/cli/command_modules/databoxedge/_help.py",
"deployment": "src/azure-cli/azure/cli/command_modules/resource/_help.py",
"deploymentmanager": "src/azure-cli/azure/cli/command_modules/deploymentmanager/_help.py",
"dla": "src/azure-cli/azure/cli/command_modules/dla/_help.py",
"dls": "src/azure-cli/azure/cli/command_modules/dls/_help.py",
"dms": "src/azure-cli/azure/cli/command_modules/dms/_help.py",
Expand Down
65 changes: 65 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,71 @@ cosmosdb collection:
db_resource_group_name:
rule_exclusions:
- parameter_should_not_end_in_resource_group
deploymentmanager service create:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
target_subscription_id:
rule_exclusions:
- option_length_too_long
deploymentmanager service delete:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service list:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service show:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service update:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
target_subscription_id:
rule_exclusions:
- option_length_too_long
deploymentmanager service-unit create:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
target_resource_group:
rule_exclusions:
- option_length_too_long
deploymentmanager service-unit delete:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service-unit list:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service-unit show:
parameters:
service_topology_name:
rule_exclusions:
- option_length_too_long
deploymentmanager service-unit update:
parameters:
deployment_mode:
rule_exclusions:
- no_parameter_defaults_for_update_commands
service_topology_name:
rule_exclusions:
- option_length_too_long
target_resource_group:
rule_exclusions:
- option_length_too_long
disk create:
parameters:
gallery_image_reference:
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/automation_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'container': 19,
'cosmosdb': 45,
'databoxedge': 25,
'deploymentmanager': 18,
'dla': 19,
'dls': 22,
'dms': 22,
Expand Down
2 changes: 2 additions & 0 deletions scripts/live_test/CLITest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
Target: cosmosdb
databoxedge:
Target: databoxedge
deploymentmanager:
Target: deploymentmanager
dla:
Target: dla
dls:
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
MGMT_CONSUMPTION = ('azure.mgmt.consumption', None)
MGMT_CONTAINERINSTANCE = ('azure.mgmt.containerinstance', None)
MGMT_COSMOSDB = ('azure.mgmt.cosmosdb', None)
MGMT_DEPLOYMENTMANAGER = ('azure.mgmt.deploymentmanager', None)
MGMT_DATALAKE_ANALYTICS = ('azure.mgmt.datalake.analytics', None)
MGMT_DATALAKE_STORE = ('azure.mgmt.datalake.store', None)
MGMT_DATAMIGRATION = ('azure.mgmt.datamigration', None)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

import azure.cli.command_modules.deploymentmanager._help # pylint: disable=unused-import


class DeploymentManagerCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azure.cli.core.profiles import ResourceType
deploymentmanager_custom = CliCommandType(
operations_tmpl='azure.cli.command_modules.deploymentmanager.custom#{}')
super(DeploymentManagerCommandsLoader, self).__init__(cli_ctx=cli_ctx,
resource_type=ResourceType.MGMT_DEPLOYMENTMANAGER,
custom_command_type=deploymentmanager_custom)

def load_command_table(self, args):
from azure.cli.command_modules.deploymentmanager.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azure.cli.command_modules.deploymentmanager._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = DeploymentManagerCommandsLoader
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def _deploymentmanager_client_factory(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.deploymentmanager import DeploymentManagerClient
return get_mgmt_service_client(cli_ctx, DeploymentManagerClient)


def cf_artifact_sources(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).artifact_sources


def cf_service_topologies(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).service_topologies


def cf_services(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).services


def cf_service_units(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).service_units


def cf_steps(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).steps


def cf_rollouts(cli_ctx, *_):
return _deploymentmanager_client_factory(cli_ctx).rollouts
Loading

0 comments on commit 4deb7da

Please sign in to comment.