Skip to content

Commit

Permalink
Adding updated Kusto extension (#1605)
Browse files Browse the repository at this point in the history
* Adding kusto folder

* adding , **kwargs

* Update _params.py

* add recordings

* cluster1

* continuation line under-indented for visual indent

* unexpected spaces around keyword / parameter equals

* Update CODEOWNERS

* add help

* remove 'wait'

* Update _help.py

* move changes to 'manual' folder

* blank line

* blank line

* add recordings

* from knack.help_files import helps

* Update _help.py

* Update test_kusto_scenario.py

* Update _help.py

* Update _help.py

* Delete _help.py

* Update _help.py

* Delete __init__.cpython-38.pyc

* Delete action.cpython-38.pyc

* Delete custom.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete _configuration.cpython-38.pyc

* Delete _kusto_management_client.cpython-38.pyc

* Delete _version.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete _kusto_management_client_enums.cpython-38.pyc

* Delete _models_py3.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete _attached_database_configuration_operations.cpython-38.pyc

* Delete _cluster_operations.cpython-38.pyc

* Delete _cluster_principal_assignment_operations.cpython-38.pyc

* Delete _data_connection_operations.cpython-38.pyc

* Delete _database_operations.cpython-38.pyc

* Delete _database_principal_assignment_operations.cpython-38.pyc

* Delete _operation_operations.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete test_kusto_scenario.cpython-38-PYTEST.pyc

* Delete __init__.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete __init__.cpython-38.pyc

* Delete test_kusto_scenario.cpython-38-PYTEST.pyc

* Delete __init__.cpython-38.pyc

* Delete _client_factory.cpython-38.pyc

* Delete _help.cpython-38.pyc

* Delete _params.cpython-38.pyc

* Delete action.cpython-38.pyc

* Delete commands.cpython-38.pyc

* Delete custom.cpython-38.pyc

* Delete test_kusto.yaml

* Add files via upload

* Delete test_kusto_scenario.py

* new kusto scenario

* Update test_kusto_scenario.py

* Update CODEOWNERS

* Update CODEOWNERS

* Update azure-pipelines.yml

* add manual _help.py

* Delete report.md

* Update _help.py
  • Loading branch information
astauben authored May 1, 2020
1 parent 13404e3 commit d6aad6c
Show file tree
Hide file tree
Showing 63 changed files with 33,365 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@
/src/datashare/ @fengzhou-msft

/src/log-analytics-solution/ @zhoxing-ms

/src/kusto/ @ilayr @orhasban @astauben
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ jobs:
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7
- bash: pip install wheel==0.30.0
displayName: 'Install wheel==0.30.0'
- task: Bash@3
displayName: "Verify Extension Ref Docs"
inputs:
Expand Down
8 changes: 8 additions & 0 deletions src/kusto/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
5 changes: 5 additions & 0 deletions src/kusto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'kusto' Extension
==========================================

This package is for the 'kusto' extension.
i.e. 'az kusto'
46 changes: 46 additions & 0 deletions src/kusto/azext_kusto/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_kusto.generated._help import helps # pylint: disable=unused-import


class KustoManagementClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_kusto.generated._client_factory import cf_kusto
kusto_custom = CliCommandType(
operations_tmpl='azext_kusto.custom#{}',
client_factory=cf_kusto)
super(KustoManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=kusto_custom)

def load_command_table(self, args):
from azext_kusto.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_kusto.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_kusto.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_kusto.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = KustoManagementClientCommandsLoader
17 changes: 17 additions & 0 deletions src/kusto/azext_kusto/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/kusto/azext_kusto/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
}
17 changes: 17 additions & 0 deletions src/kusto/azext_kusto/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/kusto/azext_kusto/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
39 changes: 39 additions & 0 deletions src/kusto/azext_kusto/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_kusto(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.kusto import KustoManagementClient
return get_mgmt_service_client(cli_ctx, KustoManagementClient)


def cf_cluster(cli_ctx, *_):
return cf_kusto(cli_ctx).cluster


def cf_cluster_principal_assignment(cli_ctx, *_):
return cf_kusto(cli_ctx).cluster_principal_assignment


def cf_database(cli_ctx, *_):
return cf_kusto(cli_ctx).database


def cf_database_principal_assignment(cli_ctx, *_):
return cf_kusto(cli_ctx).database_principal_assignment


def cf_attached_database_configuration(cli_ctx, *_):
return cf_kusto(cli_ctx).attached_database_configuration


def cf_data_connection(cli_ctx, *_):
return cf_kusto(cli_ctx).data_connection
Loading

0 comments on commit d6aad6c

Please sign in to comment.