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

{Do not merge} Feature graphservices cli #26823

Closed
wants to merge 6 commits into from
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
44 changes: 44 additions & 0 deletions src/azure-cli/azure/cli/command_modules/graphservices/__init__.py
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions src/azure-cli/azure/cli/command_modules/graphservices/_help.py
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions src/azure-cli/azure/cli/command_modules/graphservices/_params.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -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
# --------------------------------------------------------------------------------------------
16 changes: 16 additions & 0 deletions src/azure-cli/azure/cli/command_modules/graphservices/commands.py
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions src/azure-cli/azure/cli/command_modules/graphservices/custom.py
Original file line number Diff line number Diff line change
@@ -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__)
Original file line number Diff line number Diff line change
@@ -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
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -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
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -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')
# ])
Loading