diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/__init__.py b/src/azure-cli/azure/cli/command_modules/graphservices/__init__.py new file mode 100644 index 00000000000..211e7f89bce --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/__init__.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azure.cli.command_modules.graphservices._help import helps # pylint: disable=unused-import +# from azure.cli.core.profiles import ResourceType # required when using python sdk + + +class GraphservicesCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azure.cli.command_modules.graphservices.custom#{}') + super().__init__(cli_ctx=cli_ctx, + # resource_type=ResourceType.XXX # required when using python sdk + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azure.cli.command_modules.graphservices.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + # try: + # from . import aaz + # except ImportError: + # aaz = None + # if aaz: + # load_aaz_command_table( + # loader=self, + # aaz_pkg_name=aaz.__name__, + # args=args + # ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azure.cli.command_modules.graphservices._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = GraphservicesCommandsLoader diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/_help.py b/src/azure-cli/azure/cli/command_modules/graphservices/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/_params.py b/src/azure-cli/azure/cli/command_modules/graphservices/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/aaz/__init__.py b/src/azure-cli/azure/cli/command_modules/graphservices/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/aaz/latest/__init__.py b/src/azure-cli/azure/cli/command_modules/graphservices/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/aaz/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/commands.py b/src/azure-cli/azure/cli/command_modules/graphservices/commands.py new file mode 100644 index 00000000000..30b4e29e7ca --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/commands.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType +# from azure.cli.core.profiles import ResourceType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/custom.py b/src/azure-cli/azure/cli/command_modules/graphservices/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/tests/__init__.py b/src/azure-cli/azure/cli/command_modules/graphservices/tests/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/tests/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/__init__.py b/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/test_graphservices.py b/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/test_graphservices.py new file mode 100644 index 00000000000..9b19b8228de --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/graphservices/tests/latest/test_graphservices.py @@ -0,0 +1,45 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * +import time + +# class GraphservicesScenario(ScenarioTest): +# @ResourceGroupPreparer(random_name_length=20) +# def test_billing_flow(self, resource_group): +# self.kwargs.update({ +# 'accountName' : self.create_random_name(prefix="azcliacc", length=20), +# 'aad_app_display_name' : self.create_random_name(prefix="azcliapp", length=20) +# }) +# +# #Create aad app for which billing will be enabled +# result = self.cmd('ad app create --display-name {aad_app_display_name}').get_output_in_json() +# self.kwargs['app_id'] = result['appId'] +# +# #Wait for application to finish creating +# time.sleep(120) +# +# #Create resource (enable billing on aad app) +# self.cmd('az graph-services account create --resource-group {rg} --name {accountName} --app-id {app_id} --tags key1=value1', checks=[ +# self.check('name', '{accountName}'), +# self.check('tags.key1', 'value1'), +# self.check('properties.provisioningState', 'Succeeded') +# ]) +# +# #Read created resource +# self.cmd('az graph-services account show --resource-group {rg} --name {accountName}', checks=[ +# self.check('name', '{accountName}'), +# self.check('properties.provisioningState', 'Succeeded'), +# self.check('properties.appId', '{app_id}'), +# ]) +# +# #Update resource +# self.cmd('az graph-services account update --resource-group {rg} --name {accountName} --tags updatedKey1=updatedValue1 --location global', checks=[ +# self.check('name', '{accountName}'), +# self.check('tags.updatedKey1', 'updatedValue1'), +# self.check('properties.provisioningState', 'Succeeded') +# ]) \ No newline at end of file