diff --git a/src/kusto/HISTORY.rst b/src/kusto/HISTORY.rst index 27f152061e8..1c139576ba0 100644 --- a/src/kusto/HISTORY.rst +++ b/src/kusto/HISTORY.rst @@ -1,8 +1,8 @@ -.. :changelog: - -Release History -=============== - -0.1.0 -++++++ -* Initial release. +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/kusto/azext_kusto/__init__.py b/src/kusto/azext_kusto/__init__.py index 87ad305c2dc..ef7aec28329 100644 --- a/src/kusto/azext_kusto/__init__.py +++ b/src/kusto/azext_kusto/__init__.py @@ -1,46 +1,50 @@ -# -------------------------------------------------------------------------- -# 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) - parent = super(KustoManagementClientCommandsLoader, self) - parent.__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 +# -------------------------------------------------------------------------- +# 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 +try: + from azext_kusto.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +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_cl + kusto_custom = CliCommandType( + operations_tmpl='azext_kusto.custom#{}', + client_factory=cf_kusto_cl) + parent = super(KustoManagementClientCommandsLoader, self) + parent.__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 diff --git a/src/kusto/azext_kusto/action.py b/src/kusto/azext_kusto/action.py index a846b2766c4..d95d53bf711 100644 --- a/src/kusto/azext_kusto/action.py +++ b/src/kusto/azext_kusto/action.py @@ -1,17 +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 +# -------------------------------------------------------------------------- +# 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 diff --git a/src/kusto/azext_kusto/azext_metadata.json b/src/kusto/azext_kusto/azext_metadata.json index 7b56fb1e11a..4f48fa652a5 100644 --- a/src/kusto/azext_kusto/azext_metadata.json +++ b/src/kusto/azext_kusto/azext_metadata.json @@ -1,4 +1,4 @@ -{ - "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.3.1" +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.11.0" } \ No newline at end of file diff --git a/src/kusto/azext_kusto/custom.py b/src/kusto/azext_kusto/custom.py index 7f31674ce96..dbe9d5f9742 100644 --- a/src/kusto/azext_kusto/custom.py +++ b/src/kusto/azext_kusto/custom.py @@ -1,17 +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 +# -------------------------------------------------------------------------- +# 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 diff --git a/src/kusto/azext_kusto/generated/__init__.py b/src/kusto/azext_kusto/generated/__init__.py index ee0c4f36bd0..c9cfdc73e77 100644 --- a/src/kusto/azext_kusto/generated/__init__.py +++ b/src/kusto/azext_kusto/generated/__init__.py @@ -1,12 +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__) +# 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__) diff --git a/src/kusto/azext_kusto/generated/_client_factory.py b/src/kusto/azext_kusto/generated/_client_factory.py index 96406ce744f..7c129ea935b 100644 --- a/src/kusto/azext_kusto/generated/_client_factory.py +++ b/src/kusto/azext_kusto/generated/_client_factory.py @@ -1,39 +1,40 @@ -# -------------------------------------------------------------------------- -# 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 +# -------------------------------------------------------------------------- +# 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_cl(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_cl(cli_ctx).cluster + + +def cf_cluster_principal_assignment(cli_ctx, *_): + return cf_kusto_cl(cli_ctx).cluster_principal_assignment + + +def cf_database(cli_ctx, *_): + return cf_kusto_cl(cli_ctx).database + + +def cf_database_principal_assignment(cli_ctx, *_): + return cf_kusto_cl(cli_ctx).database_principal_assignment + + +def cf_attached_database_configuration(cli_ctx, *_): + return cf_kusto_cl(cli_ctx).attached_database_configuration + + +def cf_data_connection(cli_ctx, *_): + return cf_kusto_cl(cli_ctx).data_connection diff --git a/src/kusto/azext_kusto/generated/_help.py b/src/kusto/azext_kusto/generated/_help.py index d1e784f9643..cd2a55a3577 100644 --- a/src/kusto/azext_kusto/generated/_help.py +++ b/src/kusto/azext_kusto/generated/_help.py @@ -1,758 +1,795 @@ -# -------------------------------------------------------------------------- -# 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=too-many-lines - -from knack.help_files import helps - - -helps['kusto cluster'] = """ - type: group - short-summary: kusto cluster -""" - -helps['kusto cluster list'] = """ - type: command - short-summary: Lists all Kusto clusters within a subscription. - examples: - - name: KustoClustersListByResourceGroup - text: |- - az kusto cluster list --resource-group "kustorptest" -""" - -helps['kusto cluster show'] = """ - type: command - short-summary: Gets a Kusto cluster. - examples: - - name: KustoClustersGet - text: |- - az kusto cluster show --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster create'] = """ - type: command - short-summary: Create or update a Kusto cluster. - parameters: - - name: --sku - short-summary: The SKU of the cluster. - long-summary: | - Usage: --sku name=XX capacity=XX tier=XX - - name: Required. SKU name. - capacity: The number of instances of the cluster. - tier: Required. SKU tier. - - name: --trusted-external-tenants - short-summary: The cluster's external tenants. - long-summary: | - Usage: --trusted-external-tenants value=XX - - value: GUID representing an external tenant. - - Multiple actions can be specified by using more than one --trusted-external-tenants argument. - - name: --optimized-autoscale - short-summary: Optimized auto scale definition. - long-summary: | - Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX - - version: Required. The version of the template defined, for instance 1. - is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. - minimum: Required. Minimum allowed instances count. - maximum: Required. Maximum allowed instances count. - - name: --virtual-network-configuration - short-summary: Virtual network definition. - long-summary: | - Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX - - subnet-id: Required. The subnet resource id. - engine-public-ip-id: Required. Engine service's public IP address resource id. - data-management-public-ip-id: Required. Data management's service public IP address resource id. - - name: --key-vault-properties - short-summary: KeyVault properties for the cluster encryption. - long-summary: | - Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX - - key-name: Required. The name of the key vault key. - key-version: Required. The version of the key vault key. - key-vault-uri: Required. The Uri of the key vault. - examples: - - name: KustoClustersCreateOrUpdate - text: |- - az kusto cluster create --cluster-name "kustoclusterrptest4" --identity-type "SystemAssigned" --location "westus\ -" --enable-double-encryption false --enable-purge true --enable-streaming-ingest true --sku name="Standard_L8s" capacit\ -y=2 tier="Standard" --resource-group "kustorptest" -""" - -helps['kusto cluster update'] = """ - type: command - short-summary: Update a Kusto cluster. - parameters: - - name: --sku - short-summary: The SKU of the cluster. - long-summary: | - Usage: --sku name=XX capacity=XX tier=XX - - name: Required. SKU name. - capacity: The number of instances of the cluster. - tier: Required. SKU tier. - - name: --trusted-external-tenants - short-summary: The cluster's external tenants. - long-summary: | - Usage: --trusted-external-tenants value=XX - - value: GUID representing an external tenant. - - Multiple actions can be specified by using more than one --trusted-external-tenants argument. - - name: --optimized-autoscale - short-summary: Optimized auto scale definition. - long-summary: | - Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX - - version: Required. The version of the template defined, for instance 1. - is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. - minimum: Required. Minimum allowed instances count. - maximum: Required. Maximum allowed instances count. - - name: --virtual-network-configuration - short-summary: Virtual network definition. - long-summary: | - Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX - - subnet-id: Required. The subnet resource id. - engine-public-ip-id: Required. Engine service's public IP address resource id. - data-management-public-ip-id: Required. Data management's service public IP address resource id. - - name: --key-vault-properties - short-summary: KeyVault properties for the cluster encryption. - long-summary: | - Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX - - key-name: Required. The name of the key vault key. - key-version: Required. The version of the key vault key. - key-vault-uri: Required. The Uri of the key vault. - examples: - - name: KustoClustersUpdate - text: |- - az kusto cluster update --cluster-name "kustoclusterrptest4" --identity-type "SystemAssigned" --location "westus\ -" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" key-vault-uri="https://d\ -ummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" -""" - -helps['kusto cluster delete'] = """ - type: command - short-summary: Deletes a Kusto cluster. - examples: - - name: KustoClustersDelete - text: |- - az kusto cluster delete --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster add-language-extension'] = """ - type: command - short-summary: Add a list of language extensions that can run within KQL queries. - parameters: - - name: --value - short-summary: The list of language extensions. - long-summary: | - Usage: --value language-extension-name=XX - - language-extension-name: The language extension name. - - Multiple actions can be specified by using more than one --value argument. - examples: - - name: KustoClusterAddLanguageExtensions - text: |- - az kusto cluster add-language-extension --cluster-name "kustoclusterrptest4" --value language-extension-name="PY\ -THON" --value language-extension-name="R" --resource-group "kustorptest" -""" - -helps['kusto cluster detach-follower-database'] = """ - type: command - short-summary: Detaches all followers of a database owned by this cluster. - examples: - - name: KustoClusterDetachFollowerDatabases - text: |- - az kusto cluster detach-follower-database --cluster-name "kustoclusterrptest4" --attached-database-configuration\ --name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/reso\ -urceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" -""" - -helps['kusto cluster diagnose-virtual-network'] = """ - type: command - short-summary: Diagnoses network connectivity status for external resources on which the service is dependent on. - examples: - - name: KustoClusterDiagnoseVirtualNetwork - text: |- - az kusto cluster diagnose-virtual-network --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster list-follower-database'] = """ - type: command - short-summary: Returns a list of databases that are owned by this cluster and were followed by another cluster. - examples: - - name: KustoClusterListFollowerDatabases - text: |- - az kusto cluster list-follower-database --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster list-language-extension'] = """ - type: command - short-summary: Returns a list of language extensions that can run within KQL queries. - examples: - - name: KustoClusterListLanguageExtensions - text: |- - az kusto cluster list-language-extension --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster list-sku'] = """ - type: command - short-summary: Lists eligible SKUs for Kusto resource provider. - examples: - - name: KustoClustersListResourceSkus - text: |- - az kusto cluster list-sku --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster remove-language-extension'] = """ - type: command - short-summary: Remove a list of language extensions that can run within KQL queries. - parameters: - - name: --value - short-summary: The list of language extensions. - long-summary: | - Usage: --value language-extension-name=XX - - language-extension-name: The language extension name. - - Multiple actions can be specified by using more than one --value argument. - examples: - - name: KustoClusterRemoveLanguageExtensions - text: |- - az kusto cluster remove-language-extension --cluster-name "kustoclusterrptest4" --value language-extension-name=\ -"PYTHON" --value language-extension-name="R" --resource-group "kustorptest" -""" - -helps['kusto cluster start'] = """ - type: command - short-summary: Starts a Kusto cluster. - examples: - - name: KustoClustersStart - text: |- - az kusto cluster start --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster stop'] = """ - type: command - short-summary: Stops a Kusto cluster. - examples: - - name: KustoClustersStop - text: |- - az kusto cluster stop --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto cluster wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto cluster is met. - examples: - - name: Pause executing next line of CLI script until the kusto cluster is successfully created. - text: |- - az kusto cluster wait --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto cluster is successfully updated. - text: |- - az kusto cluster wait --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" --updated - - name: Pause executing next line of CLI script until the kusto cluster is successfully deleted. - text: |- - az kusto cluster wait --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" --deleted -""" - -helps['kusto cluster-principal-assignment'] = """ - type: group - short-summary: kusto cluster-principal-assignment -""" - -helps['kusto cluster-principal-assignment list'] = """ - type: command - short-summary: Lists all Kusto cluster principalAssignments. - examples: - - name: KustoPrincipalAssignmentsList - text: |- - az kusto cluster-principal-assignment list --cluster-name "kustoclusterrptest4" --resource-group "kustor\ -ptest" -""" - -helps['kusto cluster-principal-assignment show'] = """ - type: command - short-summary: Gets a Kusto cluster principalAssignment. - examples: - - name: KustoClusterPrincipalAssignmentsGet - text: |- - az kusto cluster-principal-assignment show --cluster-name "kustoclusterrptest4" --principal-assignment-n\ -ame "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto cluster-principal-assignment create'] = """ - type: command - short-summary: Create a Kusto cluster principalAssignment. - examples: - - name: KustoClusterPrincipalAssignmentsCreateOrUpdate - text: |- - az kusto cluster-principal-assignment create --cluster-name "kustoclusterrptest4" --principal-id "876543\ -21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ -123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto cluster-principal-assignment update'] = """ - type: command - short-summary: Create a Kusto cluster principalAssignment. - examples: - - name: KustoClusterPrincipalAssignmentsCreateOrUpdate - text: |- - az kusto cluster-principal-assignment update --cluster-name "kustoclusterrptest4" --principal-id "876543\ -21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ -123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto cluster-principal-assignment delete'] = """ - type: command - short-summary: Deletes a Kusto cluster principalAssignment. - examples: - - name: KustoClusterPrincipalAssignmentsDelete - text: |- - az kusto cluster-principal-assignment delete --cluster-name "kustoclusterrptest4" --principal-assignment\ --name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto cluster-principal-assignment wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto cluster-principal-assignment is met. - examples: - - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully crea\ -ted. - text: |- - az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" --principal-assignment-n\ -ame "kustoprincipal1" --resource-group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully dele\ -ted. - text: |- - az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" --principal-assignment-n\ -ame "kustoprincipal1" --resource-group "kustorptest" --deleted -""" - -helps['kusto database'] = """ - type: group - short-summary: kusto database -""" - -helps['kusto database list'] = """ - type: command - short-summary: Returns the list of databases of the given Kusto cluster. - examples: - - name: KustoDatabasesListByCluster - text: |- - az kusto database list --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto database show'] = """ - type: command - short-summary: Returns a database. - examples: - - name: KustoDatabasesGet - text: |- - az kusto database show --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ -group "kustorptest" -""" - -helps['kusto database create'] = """ - type: command - short-summary: Creates or updates a database. - examples: - - name: KustoDatabasesCreateOrUpdate - text: |- - az kusto database create --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ -ite-database location="westus" soft-delete-period="P1D" --resource-group "kustorptest" -""" - -helps['kusto database update'] = """ - type: command - short-summary: Updates a database. - examples: - - name: KustoDatabasesUpdate - text: |- - az kusto database update --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ -ite-database soft-delete-period="P1D" --resource-group "kustorptest" -""" - -helps['kusto database delete'] = """ - type: command - short-summary: Deletes the database with the given name. - examples: - - name: KustoDatabasesDelete - text: |- - az kusto database delete --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resourc\ -e-group "kustorptest" -""" - -helps['kusto database add-principal'] = """ - type: command - short-summary: Add Database principals permissions. - parameters: - - name: --value - short-summary: The list of Kusto database principals. - long-summary: | - Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX - - role: Required. Database principal role. - name: Required. Database principal name. - type: Required. Database principal type. - fqn: Database principal fully qualified name. - email: Database principal email if exists. - app-id: Application id - relevant only for application principal type. - - Multiple actions can be specified by using more than one --value argument. - examples: - - name: KustoDatabaseAddPrincipals - text: |- - az kusto database add-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --\ -value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value na\ -me="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="Some\ -App" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kustorp\ -test" -""" - -helps['kusto database list-principal'] = """ - type: command - short-summary: Returns a list of database principals of the given Kusto cluster and database. - examples: - - name: KustoDatabaseListPrincipals - text: |- - az kusto database list-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" -\ --resource-group "kustorptest" -""" - -helps['kusto database remove-principal'] = """ - type: command - short-summary: Remove Database principals permissions. - parameters: - - name: --value - short-summary: The list of Kusto database principals. - long-summary: | - Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX - - role: Required. Database principal role. - name: Required. Database principal name. - type: Required. Database principal type. - fqn: Database principal fully qualified name. - email: Database principal email if exists. - app-id: Application id - relevant only for application principal type. - - Multiple actions can be specified by using more than one --value argument. - examples: - - name: KustoDatabaseRemovePrincipals - text: |- - az kusto database remove-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8"\ - --value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value\ - name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="S\ -omeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kust\ -orptest" -""" - -helps['kusto database wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto database is met. - examples: - - name: Pause executing next line of CLI script until the kusto database is successfully created. - text: |- - az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ -group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto database is successfully updated. - text: |- - az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ -group "kustorptest" --updated - - name: Pause executing next line of CLI script until the kusto database is successfully deleted. - text: |- - az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ -group "kustorptest" --deleted -""" - -helps['kusto database-principal-assignment'] = """ - type: group - short-summary: kusto database-principal-assignment -""" - -helps['kusto database-principal-assignment list'] = """ - type: command - short-summary: Lists all Kusto cluster database principalAssignments. - examples: - - name: KustoPrincipalAssignmentsList - text: |- - az kusto database-principal-assignment list --cluster-name "kustoclusterrptest4" --database-name "Kustod\ -atabase8" --resource-group "kustorptest" -""" - -helps['kusto database-principal-assignment show'] = """ - type: command - short-summary: Gets a Kusto cluster database principalAssignment. - examples: - - name: KustoDatabasePrincipalAssignmentsGet - text: |- - az kusto database-principal-assignment show --cluster-name "kustoclusterrptest4" --database-name "Kustod\ -atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto database-principal-assignment create'] = """ - type: command - short-summary: Creates a Kusto cluster database principalAssignment. - examples: - - name: KustoDatabasePrincipalAssignmentsCreateOrUpdate - text: |- - az kusto database-principal-assignment create --cluster-name "kustoclusterrptest4" --database-name "Kust\ -odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ -345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto database-principal-assignment update'] = """ - type: command - short-summary: Creates a Kusto cluster database principalAssignment. - examples: - - name: KustoDatabasePrincipalAssignmentsCreateOrUpdate - text: |- - az kusto database-principal-assignment update --cluster-name "kustoclusterrptest4" --database-name "Kust\ -odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ -345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto database-principal-assignment delete'] = """ - type: command - short-summary: Deletes a Kusto principalAssignment. - examples: - - name: KustoDatabasePrincipalAssignmentsDelete - text: |- - az kusto database-principal-assignment delete --cluster-name "kustoclusterrptest4" --database-name "Kust\ -odatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" -""" - -helps['kusto database-principal-assignment wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto database-principal-assignment is met\ -. - examples: - - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully cre\ -ated. - text: |- - az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name "Kustod\ -atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully del\ -eted. - text: |- - az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name "Kustod\ -atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --deleted -""" - -helps['kusto attached-database-configuration'] = """ - type: group - short-summary: kusto attached-database-configuration -""" - -helps['kusto attached-database-configuration list'] = """ - type: command - short-summary: Returns the list of attached database configurations of the given Kusto cluster. - examples: - - name: KustoAttachedDatabaseConfigurationsListByCluster - text: |- - az kusto attached-database-configuration list --cluster-name "kustoclusterrptest4" --resource-group "kus\ -torptest" -""" - -helps['kusto attached-database-configuration show'] = """ - type: command - short-summary: Returns an attached database configuration. - examples: - - name: AttachedDatabaseConfigurationsGet - text: |- - az kusto attached-database-configuration show --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name "k\ -ustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto attached-database-configuration create'] = """ - type: command - short-summary: Creates or updates an attached database configuration. - examples: - - name: AttachedDatabaseConfigurationsCreateOrUpdate - text: |- - az kusto attached-database-configuration create --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name \ -"kustoclusterrptest4" --location "westus" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/re\ -sourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --database-name "kustodatabase" --defau\ -lt-principals-modification-kind "Union" --resource-group "kustorptest" -""" - -helps['kusto attached-database-configuration update'] = """ - type: command - short-summary: Creates or updates an attached database configuration. - examples: - - name: AttachedDatabaseConfigurationsCreateOrUpdate - text: |- - az kusto attached-database-configuration update --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name \ -"kustoclusterrptest4" --location "westus" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/re\ -sourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --database-name "kustodatabase" --defau\ -lt-principals-modification-kind "Union" --resource-group "kustorptest" -""" - -helps['kusto attached-database-configuration delete'] = """ - type: command - short-summary: Deletes the attached database configuration with the given name. - examples: - - name: AttachedDatabaseConfigurationsDelete - text: |- - az kusto attached-database-configuration delete --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name \ -"kustoclusterrptest4" --resource-group "kustorptest" -""" - -helps['kusto attached-database-configuration wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto attached-database-configuration is m\ -et. - examples: - - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully c\ -reated. - text: |- - az kusto attached-database-configuration wait --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name "k\ -ustoclusterrptest4" --resource-group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully d\ -eleted. - text: |- - az kusto attached-database-configuration wait --attached-database-configuration-name "attachedDatabaseConfigurations1" --cluster-name "k\ -ustoclusterrptest4" --resource-group "kustorptest" --deleted -""" - -helps['kusto data-connection'] = """ - type: group - short-summary: kusto data-connection -""" - -helps['kusto data-connection list'] = """ - type: command - short-summary: Returns the list of data connections of the given Kusto database. - examples: - - name: KustoDatabasesListByCluster - text: |- - az kusto data-connection list --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --re\ -source-group "kustorptest" -""" - -helps['kusto data-connection show'] = """ - type: command - short-summary: Returns a data connection. - examples: - - name: KustoDataConnectionsGet - text: |- - az kusto data-connection show --cluster-name "kustoclusterrptest4" --data-connection-name "DataConnections8" --database-\ -name "KustoDatabase8" --resource-group "kustorptest" -""" - -helps['kusto data-connection event-grid'] = """ - type: group - short-summary: kusto data-connection sub group event-grid -""" - -helps['kusto data-connection event-grid create'] = """ - type: command - short-summary: Creates or updates a data connection. -""" - -helps['kusto data-connection event-hub'] = """ - type: group - short-summary: kusto data-connection sub group event-hub -""" - -helps['kusto data-connection event-hub create'] = """ - type: command - short-summary: Creates or updates a data connection. - examples: - - name: KustoDataConnectionsCreateOrUpdate - text: |- - az kusto data-connection event-hub create --cluster-name "kustoclusterrptest4" --data-connection-name "DataConnections8"\ - --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ -ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ -enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" -""" - -helps['kusto data-connection iot-hub'] = """ - type: group - short-summary: kusto data-connection sub group iot-hub -""" - -helps['kusto data-connection iot-hub create'] = """ - type: command - short-summary: Creates or updates a data connection. -""" - -helps['kusto data-connection event-grid update'] = """ - type: command - short-summary: Updates a data connection. -""" - -helps['kusto data-connection event-hub update'] = """ - type: command - short-summary: Updates a data connection. - examples: - - name: KustoDataConnectionsUpdate - text: |- - az kusto data-connection event-hub update --cluster-name "kustoclusterrptest4" --data-connection-name "DataConnections8"\ - --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ -ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ -enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" -""" - -helps['kusto data-connection iot-hub update'] = """ - type: command - short-summary: Updates a data connection. -""" - -helps['kusto data-connection delete'] = """ - type: command - short-summary: Deletes the data connection with the given name. - examples: - - name: KustoDataConnectionsDelete - text: |- - az kusto data-connection delete --cluster-name "kustoclusterrptest4" --data-connection-name "kustoeventhubconnection1" -\ --database-name "KustoDatabase8" --resource-group "kustorptest" -""" - -helps['kusto data-connection event-grid data-connection-validation'] = """ - type: command - short-summary: Checks that the data connection parameters are valid. -""" - -helps['kusto data-connection event-hub data-connection-validation'] = """ - type: command - short-summary: Checks that the data connection parameters are valid. - examples: - - name: KustoDataConnectionValidation - text: |- - az kusto data-connection event-hub data-connection-validation --cluster-name "kustoclusterrptest4" --dat\ -abase-name "KustoDatabase8" --data-connection-name "DataConnections8" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ -ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ -enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" -""" - -helps['kusto data-connection iot-hub data-connection-validation'] = """ - type: command - short-summary: Checks that the data connection parameters are valid. -""" - -helps['kusto data-connection wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the kusto data-connection is met. - examples: - - name: Pause executing next line of CLI script until the kusto data-connection is successfully created. - text: |- - az kusto data-connection wait --cluster-name "kustoclusterrptest4" --data-connection-name "DataConnections8" --database-\ -name "KustoDatabase8" --resource-group "kustorptest" --created - - name: Pause executing next line of CLI script until the kusto data-connection is successfully deleted. - text: |- - az kusto data-connection wait --cluster-name "kustoclusterrptest4" --data-connection-name "DataConnections8" --database-\ -name "KustoDatabase8" --resource-group "kustorptest" --deleted -""" +# -------------------------------------------------------------------------- +# 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=too-many-lines + +from knack.help_files import helps + + +helps['kusto cluster'] = """ + type: group + short-summary: kusto cluster +""" + +helps['kusto cluster list'] = """ + type: command + short-summary: "Lists all Kusto clusters within a subscription." + examples: + - name: KustoClustersListByResourceGroup + text: |- + az kusto cluster list --resource-group "kustorptest" +""" + +helps['kusto cluster show'] = """ + type: command + short-summary: "Gets a Kusto cluster." + examples: + - name: KustoClustersGet + text: |- + az kusto cluster show --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster create'] = """ + type: command + short-summary: "Create or update a Kusto cluster." + parameters: + - name: --sku + short-summary: "The SKU of the cluster." + long-summary: | + Usage: --sku name=XX capacity=XX tier=XX + + name: Required. SKU name. + capacity: The number of instances of the cluster. + tier: Required. SKU tier. + - name: --trusted-external-tenants + short-summary: "The cluster's external tenants." + long-summary: | + Usage: --trusted-external-tenants value=XX + + value: GUID representing an external tenant. + + Multiple actions can be specified by using more than one --trusted-external-tenants argument. + - name: --optimized-autoscale + short-summary: "Optimized auto scale definition." + long-summary: | + Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX + + version: Required. The version of the template defined, for instance 1. + is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. + minimum: Required. Minimum allowed instances count. + maximum: Required. Maximum allowed instances count. + - name: --virtual-network-configuration + short-summary: "Virtual network definition." + long-summary: | + Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX + + subnet-id: Required. The subnet resource id. + engine-public-ip-id: Required. Engine service's public IP address resource id. + data-management-public-ip-id: Required. Data management's service public IP address resource id. + - name: --key-vault-properties + short-summary: "KeyVault properties for the cluster encryption." + long-summary: | + Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX + + key-name: Required. The name of the key vault key. + key-version: Required. The version of the key vault key. + key-vault-uri: Required. The Uri of the key vault. + examples: + - name: KustoClustersCreateOrUpdate + text: |- + az kusto cluster create --name "kustoclusterrptest4" --identity-type "SystemAssigned" --location \ +"westus" --enable-double-encryption false --enable-purge true --enable-streaming-ingest true --sku name="Standard_L8s" \ +capacity=2 tier="Standard" --resource-group "kustorptest" +""" + +helps['kusto cluster update'] = """ + type: command + short-summary: "Update a Kusto cluster." + parameters: + - name: --sku + short-summary: "The SKU of the cluster." + long-summary: | + Usage: --sku name=XX capacity=XX tier=XX + + name: Required. SKU name. + capacity: The number of instances of the cluster. + tier: Required. SKU tier. + - name: --trusted-external-tenants + short-summary: "The cluster's external tenants." + long-summary: | + Usage: --trusted-external-tenants value=XX + + value: GUID representing an external tenant. + + Multiple actions can be specified by using more than one --trusted-external-tenants argument. + - name: --optimized-autoscale + short-summary: "Optimized auto scale definition." + long-summary: | + Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX + + version: Required. The version of the template defined, for instance 1. + is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. + minimum: Required. Minimum allowed instances count. + maximum: Required. Maximum allowed instances count. + - name: --virtual-network-configuration + short-summary: "Virtual network definition." + long-summary: | + Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX + + subnet-id: Required. The subnet resource id. + engine-public-ip-id: Required. Engine service's public IP address resource id. + data-management-public-ip-id: Required. Data management's service public IP address resource id. + - name: --key-vault-properties + short-summary: "KeyVault properties for the cluster encryption." + long-summary: | + Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX + + key-name: Required. The name of the key vault key. + key-version: Required. The version of the key vault key. + key-vault-uri: Required. The Uri of the key vault. + examples: + - name: KustoClustersUpdate + text: |- + az kusto cluster update --name "kustoclusterrptest4" --identity-type "SystemAssigned" --location \ +"westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" \ +key-vault-uri="https://dummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" +""" + +helps['kusto cluster delete'] = """ + type: command + short-summary: "Deletes a Kusto cluster." + examples: + - name: KustoClustersDelete + text: |- + az kusto cluster delete --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster add-language-extension'] = """ + type: command + short-summary: "Add a list of language extensions that can run within KQL queries." + parameters: + - name: --value + short-summary: "The list of language extensions." + long-summary: | + Usage: --value language-extension-name=XX + + language-extension-name: The language extension name. + + Multiple actions can be specified by using more than one --value argument. + examples: + - name: KustoClusterAddLanguageExtensions + text: |- + az kusto cluster add-language-extension --name "kustoclusterrptest4" --value \ +language-extension-name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster detach-follower-database'] = """ + type: command + short-summary: "Detaches all followers of a database owned by this cluster." + examples: + - name: KustoClusterDetachFollowerDatabases + text: |- + az kusto cluster detach-follower-database --name "kustoclusterrptest4" --attached-database-configuration\ +-name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/reso\ +urceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" +""" + +helps['kusto cluster diagnose-virtual-network'] = """ + type: command + short-summary: "Diagnoses network connectivity status for external resources on which the service is dependent \ +on." + examples: + - name: KustoClusterDiagnoseVirtualNetwork + text: |- + az kusto cluster diagnose-virtual-network --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster list-follower-database'] = """ + type: command + short-summary: "Returns a list of databases that are owned by this cluster and were followed by another cluster." + examples: + - name: KustoClusterListFollowerDatabases + text: |- + az kusto cluster list-follower-database --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster list-language-extension'] = """ + type: command + short-summary: "Returns a list of language extensions that can run within KQL queries." + examples: + - name: KustoClusterListLanguageExtensions + text: |- + az kusto cluster list-language-extension --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster list-sku'] = """ + type: command + short-summary: "Lists eligible SKUs for Kusto resource provider." + examples: + - name: KustoClustersListResourceSkus + text: |- + az kusto cluster list-sku --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster remove-language-extension'] = """ + type: command + short-summary: "Remove a list of language extensions that can run within KQL queries." + parameters: + - name: --value + short-summary: "The list of language extensions." + long-summary: | + Usage: --value language-extension-name=XX + + language-extension-name: The language extension name. + + Multiple actions can be specified by using more than one --value argument. + examples: + - name: KustoClusterRemoveLanguageExtensions + text: |- + az kusto cluster remove-language-extension --name "kustoclusterrptest4" --value \ +language-extension-name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster start'] = """ + type: command + short-summary: "Starts a Kusto cluster." + examples: + - name: KustoClustersStart + text: |- + az kusto cluster start --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster stop'] = """ + type: command + short-summary: "Stops a Kusto cluster." + examples: + - name: KustoClustersStop + text: |- + az kusto cluster stop --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto cluster is met. + examples: + - name: Pause executing next line of CLI script until the kusto cluster is successfully created. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto cluster is successfully updated. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto cluster is successfully deleted. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --deleted +""" + +helps['kusto cluster-principal-assignment'] = """ + type: group + short-summary: kusto cluster-principal-assignment +""" + +helps['kusto cluster-principal-assignment list'] = """ + type: command + short-summary: "Lists all Kusto cluster principalAssignments." + examples: + - name: KustoPrincipalAssignmentsList + text: |- + az kusto cluster-principal-assignment list --cluster-name "kustoclusterrptest4" --resource-group \ +"kustorptest" +""" + +helps['kusto cluster-principal-assignment show'] = """ + type: command + short-summary: "Gets a Kusto cluster principalAssignment." + examples: + - name: KustoClusterPrincipalAssignmentsGet + text: |- + az kusto cluster-principal-assignment show --cluster-name "kustoclusterrptest4" \ +--principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment create'] = """ + type: command + short-summary: "Create a Kusto cluster principalAssignment." + examples: + - name: KustoClusterPrincipalAssignmentsCreateOrUpdate + text: |- + az kusto cluster-principal-assignment create --cluster-name "kustoclusterrptest4" --principal-id \ +"87654321-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id \ +"12345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment update'] = """ + type: command + short-summary: "Create a Kusto cluster principalAssignment." +""" + +helps['kusto cluster-principal-assignment delete'] = """ + type: command + short-summary: "Deletes a Kusto cluster principalAssignment." + examples: + - name: KustoClusterPrincipalAssignmentsDelete + text: |- + az kusto cluster-principal-assignment delete --cluster-name "kustoclusterrptest4" \ +--principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto cluster-principal-assignment is \ +met. + examples: + - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully \ +created. + text: |- + az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" \ +--principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully \ +updated. + text: |- + az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" \ +--principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully \ +deleted. + text: |- + az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" \ +--principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --deleted +""" + +helps['kusto database'] = """ + type: group + short-summary: kusto database +""" + +helps['kusto database list'] = """ + type: command + short-summary: "Returns the list of databases of the given Kusto cluster." + examples: + - name: KustoDatabasesListByCluster + text: |- + az kusto database list --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto database show'] = """ + type: command + short-summary: "Returns a database." + examples: + - name: KustoDatabasesGet + text: |- + az kusto database show --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" +""" + +helps['kusto database create'] = """ + type: command + short-summary: "Creates or updates a database." + parameters: + - name: --read-write-database + short-summary: "Class representing a read write database." + long-summary: | + Usage: --read-write-database soft-delete-period=XX hot-cache-period=XX location=XX kind=XX + + soft-delete-period: The time the data should be kept before it stops being accessible to queries in \ +TimeSpan. + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + - name: --read-only-following-database + short-summary: "Class representing a read only following database." + long-summary: | + Usage: --read-only-following-database hot-cache-period=XX location=XX kind=XX + + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + examples: + - name: KustoDatabasesCreateOrUpdate + text: |- + az kusto database create --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--read-write-database location="westus" soft-delete-period="P1D" --resource-group "kustorptest" +""" + +helps['kusto database update'] = """ + type: command + short-summary: "Updates a database." + parameters: + - name: --read-write-database + short-summary: "Class representing a read write database." + long-summary: | + Usage: --read-write-database soft-delete-period=XX hot-cache-period=XX location=XX kind=XX + + soft-delete-period: The time the data should be kept before it stops being accessible to queries in \ +TimeSpan. + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + - name: --read-only-following-database + short-summary: "Class representing a read only following database." + long-summary: | + Usage: --read-only-following-database hot-cache-period=XX location=XX kind=XX + + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + examples: + - name: KustoDatabasesUpdate + text: |- + az kusto database update --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--parameters "{\\"properties\\":{\\"softDeletePeriod\\":\\"P1D\\"}}" --resource-group "kustorptest" +""" + +helps['kusto database delete'] = """ + type: command + short-summary: "Deletes the database with the given name." + examples: + - name: KustoDatabasesDelete + text: |- + az kusto database delete --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" +""" + +helps['kusto database add-principal'] = """ + type: command + short-summary: "Add Database principals permissions." + parameters: + - name: --value + short-summary: "The list of Kusto database principals." + long-summary: | + Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX + + role: Required. Database principal role. + name: Required. Database principal name. + type: Required. Database principal type. + fqn: Database principal fully qualified name. + email: Database principal email if exists. + app-id: Application id - relevant only for application principal type. + + Multiple actions can be specified by using more than one --value argument. + examples: + - name: KustoDatabaseAddPrincipals + text: |- + az kusto database add-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value \ +name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value \ +name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" \ +--resource-group "kustorptest" +""" + +helps['kusto database list-principal'] = """ + type: command + short-summary: "Returns a list of database principals of the given Kusto cluster and database." + examples: + - name: KustoDatabaseListPrincipals + text: |- + az kusto database list-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" +""" + +helps['kusto database remove-principal'] = """ + type: command + short-summary: "Remove Database principals permissions." + parameters: + - name: --value + short-summary: "The list of Kusto database principals." + long-summary: | + Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX + + role: Required. Database principal role. + name: Required. Database principal name. + type: Required. Database principal type. + fqn: Database principal fully qualified name. + email: Database principal email if exists. + app-id: Application id - relevant only for application principal type. + + Multiple actions can be specified by using more than one --value argument. + examples: + - name: KustoDatabaseRemovePrincipals + text: |- + az kusto database remove-principal --cluster-name "kustoclusterrptest4" --database-name \ +"KustoDatabase8" --value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" \ +role="Admin" --value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" \ +role="Viewer" --value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" \ +role="Admin" --resource-group "kustorptest" +""" + +helps['kusto database wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto database is met. + examples: + - name: Pause executing next line of CLI script until the kusto database is successfully created. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto database is successfully updated. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto database is successfully deleted. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" --deleted +""" + +helps['kusto database-principal-assignment'] = """ + type: group + short-summary: kusto database-principal-assignment +""" + +helps['kusto database-principal-assignment list'] = """ + type: command + short-summary: "Lists all Kusto cluster database principalAssignments." + examples: + - name: KustoPrincipalAssignmentsList + text: |- + az kusto database-principal-assignment list --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment show'] = """ + type: command + short-summary: "Gets a Kusto cluster database principalAssignment." + examples: + - name: KustoDatabasePrincipalAssignmentsGet + text: |- + az kusto database-principal-assignment show --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment create'] = """ + type: command + short-summary: "Creates a Kusto cluster database principalAssignment." + examples: + - name: KustoDatabasePrincipalAssignmentsCreateOrUpdate + text: |- + az kusto database-principal-assignment create --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" \ +--tenant-id "12345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group \ +"kustorptest" +""" + +helps['kusto database-principal-assignment update'] = """ + type: command + short-summary: "Creates a Kusto cluster database principalAssignment." +""" + +helps['kusto database-principal-assignment delete'] = """ + type: command + short-summary: "Deletes a Kusto principalAssignment." + examples: + - name: KustoDatabasePrincipalAssignmentsDelete + text: |- + az kusto database-principal-assignment delete --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto database-principal-assignment is \ +met. + examples: + - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully \ +created. + text: |- + az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully \ +updated. + text: |- + az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully \ +deleted. + text: |- + az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name \ +"Kustodatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --deleted +""" + +helps['kusto attached-database-configuration'] = """ + type: group + short-summary: kusto attached-database-configuration +""" + +helps['kusto attached-database-configuration list'] = """ + type: command + short-summary: "Returns the list of attached database configurations of the given Kusto cluster." + examples: + - name: KustoAttachedDatabaseConfigurationsListByCluster + text: |- + az kusto attached-database-configuration list --cluster-name "kustoclusterrptest4" --resource-group \ +"kustorptest" +""" + +helps['kusto attached-database-configuration show'] = """ + type: command + short-summary: "Returns an attached database configuration." + examples: + - name: AttachedDatabaseConfigurationsGet + text: |- + az kusto attached-database-configuration show --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration create'] = """ + type: command + short-summary: "Creates or updates an attached database configuration." + examples: + - name: AttachedDatabaseConfigurationsCreateOrUpdate + text: |- + az kusto attached-database-configuration create --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --location "westus" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/re\ +sourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --database-name "kustodatabase" \ +--default-principals-modification-kind "Union" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration update'] = """ + type: command + short-summary: "Creates or updates an attached database configuration." +""" + +helps['kusto attached-database-configuration delete'] = """ + type: command + short-summary: "Deletes the attached database configuration with the given name." + examples: + - name: AttachedDatabaseConfigurationsDelete + text: |- + az kusto attached-database-configuration delete --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto attached-database-configuration is \ +met. + examples: + - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully \ +created. + text: |- + az kusto attached-database-configuration wait --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully \ +updated. + text: |- + az kusto attached-database-configuration wait --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully \ +deleted. + text: |- + az kusto attached-database-configuration wait --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" --deleted +""" + +helps['kusto data-connection'] = """ + type: group + short-summary: kusto data-connection +""" + +helps['kusto data-connection list'] = """ + type: command + short-summary: "Returns the list of data connections of the given Kusto database." + examples: + - name: KustoDatabasesListByCluster + text: |- + az kusto data-connection list --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" \ +--resource-group "kustorptest" +""" + +helps['kusto data-connection show'] = """ + type: command + short-summary: "Returns a data connection." + examples: + - name: KustoDataConnectionsGet + text: |- + az kusto data-connection show --cluster-name "kustoclusterrptest4" --name "DataConnections8" \ +--database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid'] = """ + type: group + short-summary: kusto data-connection sub group event-grid +""" + +helps['kusto data-connection event-grid create'] = """ + type: command + short-summary: "Creates or updates a data connection." +""" + +helps['kusto data-connection event-hub'] = """ + type: group + short-summary: kusto data-connection sub group event-hub +""" + +helps['kusto data-connection event-hub create'] = """ + type: command + short-summary: "Creates or updates a data connection." + examples: + - name: KustoDataConnectionsCreateOrUpdate + text: |- + az kusto data-connection event-hub create --cluster-name "kustoclusterrptest4" --name \ +"DataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" \ +--event-hub-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Micro\ +soft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub'] = """ + type: group + short-summary: kusto data-connection sub group iot-hub +""" + +helps['kusto data-connection iot-hub create'] = """ + type: command + short-summary: "Creates or updates a data connection." +""" + +helps['kusto data-connection event-grid update'] = """ + type: command + short-summary: "Updates a data connection." +""" + +helps['kusto data-connection event-hub update'] = """ + type: command + short-summary: "Updates a data connection." + examples: + - name: KustoDataConnectionsUpdate + text: |- + az kusto data-connection event-hub update --cluster-name "kustoclusterrptest4" --name \ +"DataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" \ +--event-hub-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Micro\ +soft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub update'] = """ + type: command + short-summary: "Updates a data connection." +""" + +helps['kusto data-connection delete'] = """ + type: command + short-summary: "Deletes the data connection with the given name." + examples: + - name: KustoDataConnectionsDelete + text: |- + az kusto data-connection delete --cluster-name "kustoclusterrptest4" --name "kustoeventhubconnection1" \ +--database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid data-connection-validation'] = """ + type: command + short-summary: "Checks that the data connection parameters are valid." +""" + +helps['kusto data-connection event-hub data-connection-validation'] = """ + type: command + short-summary: "Checks that the data connection parameters are valid." + examples: + - name: KustoDataConnectionValidation + text: |- + az kusto data-connection event-hub data-connection-validation --cluster-name "kustoclusterrptest4" \ +--database-name "KustoDatabase8" --name "DataConnections8" --consumer-group "testConsumerGroup1" \ +--event-hub-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Micro\ +soft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub data-connection-validation'] = """ + type: command + short-summary: "Checks that the data connection parameters are valid." +""" + +helps['kusto data-connection wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto data-connection is met. + examples: + - name: Pause executing next line of CLI script until the kusto data-connection is successfully created. + text: |- + az kusto data-connection wait --cluster-name "kustoclusterrptest4" --name "DataConnections8" \ +--database-name "KustoDatabase8" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto data-connection is successfully deleted. + text: |- + az kusto data-connection wait --cluster-name "kustoclusterrptest4" --name "DataConnections8" \ +--database-name "KustoDatabase8" --resource-group "kustorptest" --deleted +""" diff --git a/src/kusto/azext_kusto/generated/_params.py b/src/kusto/azext_kusto/generated/_params.py index 3b70e5a28ad..fe8d63ded12 100644 --- a/src/kusto/azext_kusto/generated/_params.py +++ b/src/kusto/azext_kusto/generated/_params.py @@ -1,573 +1,635 @@ -# -------------------------------------------------------------------------- -# 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=too-many-lines -# pylint: disable=too-many-statements - -from knack.arguments import CLIArgumentType -from azure.cli.core.commands.parameters import ( - tags_type, - get_three_state_flag, - get_enum_type, - resource_group_name_type, - get_location_type -) -from azure.cli.core.commands.validators import get_default_location_from_resource_group -from azext_kusto.action import ( - AddSku, - AddTrustedExternalTenants, - AddOptimizedAutoscale, - AddVirtualNetworkConfiguration, - AddKeyVaultProperties, - AddClustersValue, - AddReadWriteDatabase, - AddReadOnlyFollowingDatabase, - AddDatabasesValue -) - - -def load_arguments(self, _): - - with self.argument_context('kusto cluster list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('kusto cluster show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('tags', tags_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster.') - c.argument('zones', nargs='+', help='The availability zones of the cluster.') - c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' - 'al tenants.') - c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' - 'n.') - c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' - 'he cluster\'s disks are encrypted.') - c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' - 'the streaming ingest is enabled.') - c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' - 'work definition.') - c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' - 'luster encryption.') - c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' - 'perations are enabled.') - c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if' - ' double encryption is enabled.') - c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') - c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne''d-identities'], help='The list of user identities associated with the Kusto cluster. The user ident''ity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionI''d}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{i''dentityName}\'. Expected value: json-string/@json-file.')) - - with self.argument_context('kusto cluster update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - c.argument('tags', tags_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster.') - c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' - 'al tenants.') - c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' - 'n.') - c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' - 'he cluster\'s disks are encrypted.') - c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' - 'the streaming ingest is enabled.') - c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' - 'work definition.') - c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' - 'luster encryption.') - c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' - 'perations are enabled.') - c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if' - ' double encryption is enabled.') - c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') - c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne''d-identities'], help='The list of user identities associated with the Kusto cluster. The user ident''ity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionI''d}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{i''dentityName}\'. Expected value: json-string/@json-file.')) - - with self.argument_context('kusto cluster delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster add-language-extension') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - c.argument('value', action=AddClustersValue, nargs='+', help='The list of language extensions.') - - with self.argument_context('kusto cluster detach-follower-database') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - c.argument('cluster_resource_id', help='Resource id of the cluster that follows a database owned by this cluste' - 'r.') - c.argument('attached_database_configuration_name', help='Resource name of the attached database configuration i' - 'n the follower cluster.') - - with self.argument_context('kusto cluster diagnose-virtual-network') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster list-follower-database') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto cluster list-language-extension') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto cluster list-sku') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto cluster remove-language-extension') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - c.argument('value', action=AddClustersValue, nargs='+', help='The list of language extensions.') - - with self.argument_context('kusto cluster start') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster stop') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', - id_part='name') - - with self.argument_context('kusto cluster-principal-assignment list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto cluster-principal-assignment show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '1') - - with self.argument_context('kusto cluster-principal-assignment create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') - c.argument('principal_id', help='The principal ID assigned to the cluster principal. It can be a user email, ap' - 'plication ID, or security group name.') - c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster principal' - ' role.') - c.argument('tenant_id', help='The tenant id of the principal') - c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') - - with self.argument_context('kusto cluster-principal-assignment update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '1') - c.argument('principal_id', help='The principal ID assigned to the cluster principal. It can be a user email, ap' - 'plication ID, or security group name.') - c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster principal' - ' role.') - c.argument('tenant_id', help='The tenant id of the principal') - c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') - - with self.argument_context('kusto cluster-principal-assignment delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '1') - - with self.argument_context('kusto cluster-principal-assignment wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '1') - - with self.argument_context('kusto database list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto database show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - - with self.argument_context('kusto database create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' - ' database.', arg_group='Parameters') - c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' - 'ting a read only following database.', arg_group='Parameters') - - with self.argument_context('kusto database update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' - ' database.', arg_group='Parameters') - c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' - 'ting a read only following database.', arg_group='Parameters') - - with self.argument_context('kusto database delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - - with self.argument_context('kusto database add-principal') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('value', action=AddDatabasesValue, nargs='+', help='The list of Kusto database principals.') - - with self.argument_context('kusto database list-principal') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - - with self.argument_context('kusto database remove-principal') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('value', action=AddDatabasesValue, nargs='+', help='The list of Kusto database principals.') - - with self.argument_context('kusto database wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - - with self.argument_context('kusto database-principal-assignment list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - - with self.argument_context('kusto database-principal-assignment show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '2') - - with self.argument_context('kusto database-principal-assignment create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') - c.argument('principal_id', help='The principal ID assigned to the database principal. It can be a user email, a' - 'pplication ID, or security group name.') - c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'View' - 'er']), help='Database principal role.') - c.argument('tenant_id', help='The tenant id of the principal') - c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') - - with self.argument_context('kusto database-principal-assignment update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '2') - c.argument('principal_id', help='The principal ID assigned to the database principal. It can be a user email, a' - 'pplication ID, or security group name.') - c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'View' - 'er']), help='Database principal role.') - c.argument('tenant_id', help='The tenant id of the principal') - c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') - - with self.argument_context('kusto database-principal-assignment delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '2') - - with self.argument_context('kusto database-principal-assignment wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' - '2') - - with self.argument_context('kusto attached-database-configuration list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - - with self.argument_context('kusto attached-database-configuration show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('attached_database_configuration_name', help='The name of the attache' - 'd database configuration.', id_part='child_name_1') - - with self.argument_context('kusto attached-database-configuration create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attache' - 'd database configuration.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' - ' follow all current and future databases.') - c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' - 'tach reside.') - c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') - - with self.argument_context('kusto attached-database-configuration update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' - ' follow all current and future databases.') - c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' - 'tach reside.') - c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') - - with self.argument_context('kusto attached-database-configuration delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('attached_database_configuration_name', help='The name of the attache' - 'd database configuration.', id_part='child_name_1') - - with self.argument_context('kusto attached-database-configuration wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('attached_database_configuration_name', help='The name of the attache' - 'd database configuration.', id_part='child_name_1') - - with self.argument_context('kusto data-connection list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - - with self.argument_context('kusto data-connection show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') - - with self.argument_context('kusto data-connection event-grid create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('storage_account_resource_id', - help='The resource ID of the storage account where the data resides.') - c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' - 'indicates that ingestion should ignore the first record of every file') - c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' - 'ge.BlobRenamed']), help='The name of blob storage event type to process.') - - with self.argument_context('kusto data-connection event-hub create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' - 'on.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub') - c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' - 'pe') - - with self.argument_context('kusto data-connection iot-hub create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('iot_hub_resource_id', - help='The resource ID of the Iot hub to be used to create a data connection.') - c.argument('consumer_group', help='The iot hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') - c.argument('shared_access_policy_name', help='The name of the share access policy') - - with self.argument_context('kusto data-connection event-grid update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('storage_account_resource_id', - help='The resource ID of the storage account where the data resides.') - c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' - 'indicates that ingestion should ignore the first record of every file') - c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' - 'ge.BlobRenamed']), help='The name of blob storage event type to process.') - - with self.argument_context('kusto data-connection event-hub update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' - 'on.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub') - c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' - 'pe') - - with self.argument_context('kusto data-connection iot-hub update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('iot_hub_resource_id', - help='The resource ID of the Iot hub to be used to create a data connection.') - c.argument('consumer_group', help='The iot hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') - c.argument('shared_access_policy_name', help='The name of the share access policy') - - with self.argument_context('kusto data-connection delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') - - with self.argument_context('kusto data-connection event-grid data-connection-validation') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('storage_account_resource_id', - help='The resource ID of the storage account where the data resides.') - c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' - 'indicates that ingestion should ignore the first record of every file') - c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' - 'ge.BlobRenamed']), help='The name of blob storage event type to process.') - - with self.argument_context('kusto data-connection event-hub data-connection-validation') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' - 'on.') - c.argument('consumer_group', help='The event hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub') - c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' - 'pe') - - with self.argument_context('kusto data-connection iot-hub data-connection-validation') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), - validator=get_default_location_from_resource_group) - c.argument('iot_hub_resource_id', - help='The resource ID of the Iot hub to be used to create a data connection.') - c.argument('consumer_group', help='The iot hub consumer group.') - c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' - 'n be added to each message.') - c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' - 'formation can be added to each message.') - c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' - ' data format of the message. Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') - c.argument('shared_access_policy_name', help='The name of the share access policy') - - with self.argument_context('kusto data-connection wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') - c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') - c.argument('data_connection_name', help='The name of the data connection.', - id_part='child_name_2') +# -------------------------------------------------------------------------- +# 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=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_kusto.action import ( + AddSku, + AddTrustedExternalTenants, + AddOptimizedAutoscale, + AddVirtualNetworkConfiguration, + AddKeyVaultProperties, + AddClustersValue, + AddReadWriteDatabase, + AddReadOnlyFollowingDatabase, + AddDatabasesValue +) + + +def load_arguments(self, _): + + with self.argument_context('kusto cluster list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('kusto cluster show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster.') + c.argument('zones', nargs='*', help='The availability zones of the cluster.') + c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='*', help='The cluster\'s ' + 'external tenants.') + c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='*', help='Optimized auto scale ' + 'definition.') + c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the cluster\'s disks are encrypted.') + c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the streaming ingest is enabled.') + c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='*', help='Virtual ' + 'network definition.') + c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='*', help='KeyVault properties for the ' + 'cluster encryption.') + c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge ' + 'operations are enabled.') + c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates ' + 'if double encryption is enabled.') + c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') + c.argument('identity_user_assigned_identities', type=validate_file_or_dict, help='The list of user identities ' + 'associated with the Kusto cluster. The user identity dictionary key references will be ARM ' + 'resource ids in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/prov' + 'iders/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('kusto cluster update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('sku', action=AddSku, nargs='*', help='The SKU of the cluster.') + c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='*', help='The cluster\'s ' + 'external tenants.') + c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='*', help='Optimized auto scale ' + 'definition.') + c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the cluster\'s disks are encrypted.') + c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the streaming ingest is enabled.') + c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='*', help='Virtual ' + 'network definition.') + c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='*', help='KeyVault properties for the ' + 'cluster encryption.') + c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge ' + 'operations are enabled.') + c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates ' + 'if double encryption is enabled.') + c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') + c.argument('identity_user_assigned_identities', type=validate_file_or_dict, help='The list of user identities ' + 'associated with the Kusto cluster. The user identity dictionary key references will be ARM ' + 'resource ids in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/prov' + 'iders/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('kusto cluster delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster add-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + c.argument('value', action=AddClustersValue, nargs='*', help='The list of language extensions.') + + with self.argument_context('kusto cluster detach-follower-database') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + c.argument('cluster_resource_id', type=str, help='Resource id of the cluster that follows a database owned by ' + 'this cluster.') + c.argument('attached_database_configuration_name', type=str, help='Resource name of the attached database ' + 'configuration in the follower cluster.') + + with self.argument_context('kusto cluster diagnose-virtual-network') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster list-follower-database') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.') + + with self.argument_context('kusto cluster list-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.') + + with self.argument_context('kusto cluster list-sku') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.') + + with self.argument_context('kusto cluster remove-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + c.argument('value', action=AddClustersValue, nargs='*', help='The list of language extensions.') + + with self.argument_context('kusto cluster start') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n', '--cluster-name'], type=str, help='The name of the ' + 'Kusto cluster.', id_part='name') + + with self.argument_context('kusto cluster-principal-assignment list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster-principal-assignment show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_1') + + with self.argument_context('kusto cluster-principal-assignment create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.') + c.argument('principal_id', type=str, help='The principal ID assigned to the cluster principal. It can be a ' + 'user email, application ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster ' + 'principal role.') + c.argument('tenant_id', type=str, help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto cluster-principal-assignment update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_1') + c.argument('principal_id', type=str, help='The principal ID assigned to the cluster principal. It can be a ' + 'user email, application ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster ' + 'principal role.') + c.argument('tenant_id', type=str, help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto cluster-principal-assignment delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_1') + + with self.argument_context('kusto cluster-principal-assignment wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_1') + + with self.argument_context('kusto database list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + + with self.argument_context('kusto database show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + + with self.argument_context('kusto database create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + c.argument('read_write_database', action=AddReadWriteDatabase, nargs='*', help='Class representing a read ' + 'write database.', arg_group='Parameters') + c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='*', help='Class ' + 'representing a read only following database.', arg_group='Parameters') + + with self.argument_context('kusto database update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('read_write_database', action=AddReadWriteDatabase, nargs='*', help='Class representing a read ' + 'write database.', arg_group='Parameters') + c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='*', help='Class ' + 'representing a read only following database.', arg_group='Parameters') + + with self.argument_context('kusto database delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + + with self.argument_context('kusto database add-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('value', action=AddDatabasesValue, nargs='*', help='The list of Kusto database principals.') + + with self.argument_context('kusto database list-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database remove-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('value', action=AddDatabasesValue, nargs='*', help='The list of Kusto database principals.') + + with self.argument_context('kusto database wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + + with self.argument_context('kusto database-principal-assignment list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database-principal-assignment show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_2') + + with self.argument_context('kusto database-principal-assignment create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.') + c.argument('principal_id', type=str, help='The principal ID assigned to the database principal. It can be a ' + 'user email, application ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', '' + 'Viewer']), help='Database principal role.') + c.argument('tenant_id', type=str, help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto database-principal-assignment update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_2') + c.argument('principal_id', type=str, help='The principal ID assigned to the database principal. It can be a ' + 'user email, application ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', '' + 'Viewer']), help='Database principal role.') + c.argument('tenant_id', type=str, help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto database-principal-assignment delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_2') + + with self.argument_context('kusto database-principal-assignment wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('principal_assignment_name', type=str, help='The name of the Kusto principalAssignment.', id_part='' + 'child_name_2') + + with self.argument_context('kusto attached-database-configuration list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + + with self.argument_context('kusto attached-database-configuration show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n', '' + '--attached-database-configuration-name'], + type=str, help='The name of the attached database configuration.', id_part='child_name_1') + + with self.argument_context('kusto attached-database-configuration create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('attached_database_configuration_name', options_list=['--name', '-n', '' + '--attached-database-configuration-name'], + type=str, help='The name of the attached database configuration.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('database_name', type=str, help='The name of the database which you would like to attach, use * if ' + 'you want to follow all current and future databases.') + c.argument('cluster_resource_id', type=str, help='The resource id of the cluster where the databases you would ' + 'like to attach reside.') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='' + 'The default principals modification kind') + + with self.argument_context('kusto attached-database-configuration update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n', '' + '--attached-database-configuration-name'], + type=str, help='The name of the attached database configuration.', id_part='child_name_1') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('database_name', type=str, help='The name of the database which you would like to attach, use * if ' + 'you want to follow all current and future databases.') + c.argument('cluster_resource_id', type=str, help='The resource id of the cluster where the databases you would ' + 'like to attach reside.') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='' + 'The default principals modification kind') + + with self.argument_context('kusto attached-database-configuration delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n', '' + '--attached-database-configuration-name'], + type=str, help='The name of the attached database configuration.', id_part='child_name_1') + + with self.argument_context('kusto attached-database-configuration wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n', '' + '--attached-database-configuration-name'], + type=str, help='The name of the attached database configuration.', id_part='child_name_1') + + with self.argument_context('kusto data-connection list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto data-connection show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') + + with self.argument_context('kusto data-connection event-grid create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', type=str, help='The resource ID of the storage account where the ' + 'data resides.') + c.argument('event_hub_resource_id', type=str, help='The resource ID where the event grid is configured to send ' + 'events.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', '' + 'Microsoft.Storage.BlobRenamed']), help='The ' + 'name of blob storage event type to process.') + + with self.argument_context('kusto data-connection event-hub create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', type=str, help='The resource ID of the event hub to be used to create a ' + 'data connection.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the event hub') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ' + 'type') + + with self.argument_context('kusto data-connection iot-hub create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', type=str, help='The resource ID of the Iot hub to be used to create a data ' + 'connection.') + c.argument('consumer_group', type=str, help='The iot hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the iot hub') + c.argument('shared_access_policy_name', type=str, help='The name of the share access policy') + + with self.argument_context('kusto data-connection event-grid update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', type=str, help='The resource ID of the storage account where the ' + 'data resides.') + c.argument('event_hub_resource_id', type=str, help='The resource ID where the event grid is configured to send ' + 'events.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', '' + 'Microsoft.Storage.BlobRenamed']), help='The ' + 'name of blob storage event type to process.') + + with self.argument_context('kusto data-connection event-hub update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', type=str, help='The resource ID of the event hub to be used to create a ' + 'data connection.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the event hub') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ' + 'type') + + with self.argument_context('kusto data-connection iot-hub update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', type=str, help='The resource ID of the Iot hub to be used to create a data ' + 'connection.') + c.argument('consumer_group', type=str, help='The iot hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the iot hub') + c.argument('shared_access_policy_name', type=str, help='The name of the share access policy') + + with self.argument_context('kusto data-connection delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') + + with self.argument_context('kusto data-connection event-grid data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', type=str, help='The resource ID of the storage account where the ' + 'data resides.') + c.argument('event_hub_resource_id', type=str, help='The resource ID where the event grid is configured to send ' + 'events.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', '' + 'Microsoft.Storage.BlobRenamed']), help='The ' + 'name of blob storage event type to process.') + + with self.argument_context('kusto data-connection event-hub data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', type=str, help='The resource ID of the event hub to be used to create a ' + 'data connection.') + c.argument('consumer_group', type=str, help='The event hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the event hub') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ' + 'type') + + with self.argument_context('kusto data-connection iot-hub data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', type=str, help='The resource ID of the Iot hub to be used to create a data ' + 'connection.') + c.argument('consumer_group', type=str, help='The iot hub consumer group.') + c.argument('table_name', type=str, help='The table where the data should be ingested. Optionally the table ' + 'information can be added to each message.') + c.argument('mapping_rule_name', type=str, help='The mapping rule to be used to ingest the data. Optionally the ' + 'mapping information can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', '' + 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + 'APACHEAVRO', 'W3CLOGFILE']), help='The data format of the ' + 'message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='*', help='System properties of the iot hub') + c.argument('shared_access_policy_name', type=str, help='The name of the share access policy') + + with self.argument_context('kusto data-connection wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', type=str, help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', type=str, help='The name of the database in the Kusto cluster.', id_part='' + 'child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n', '--data-connection-name'], type=str, help='' + 'The name of the data connection.', id_part='child_name_2') diff --git a/src/kusto/azext_kusto/generated/_validators.py b/src/kusto/azext_kusto/generated/_validators.py index e5ac7838677..b33a44c1ebf 100644 --- a/src/kusto/azext_kusto/generated/_validators.py +++ b/src/kusto/azext_kusto/generated/_validators.py @@ -1,9 +1,9 @@ -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/kusto/azext_kusto/generated/action.py b/src/kusto/azext_kusto/generated/action.py index 54127f7e785..a079e38c3d7 100644 --- a/src/kusto/azext_kusto/generated/action.py +++ b/src/kusto/azext_kusto/generated/action.py @@ -1,248 +1,248 @@ -# -------------------------------------------------------------------------- -# 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=protected-access - -import argparse -from knack.util import CLIError -from collections import defaultdict - - -class AddSku(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.sku = action - - 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 == 'capacity': - d['capacity'] = v[0] - elif kl == 'tier': - d['tier'] = v[0] - return d - - -class AddTrustedExternalTenants(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - super(AddTrustedExternalTenants, 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 == 'value': - d['value'] = v[0] - return d - - -class AddOptimizedAutoscale(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.optimized_autoscale = action - - 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 == 'version': - d['version'] = v[0] - elif kl == 'is-enabled': - d['is_enabled'] = v[0] - elif kl == 'minimum': - d['minimum'] = v[0] - elif kl == 'maximum': - d['maximum'] = v[0] - return d - - -class AddVirtualNetworkConfiguration(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.virtual_network_configuration = action - - 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 == 'subnet-id': - d['subnet_id'] = v[0] - elif kl == 'engine-public-ip-id': - d['engine_public_ip_id'] = v[0] - elif kl == 'data-management-public-ip-id': - d['data_management_public_ip_id'] = v[0] - return d - - -class AddKeyVaultProperties(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.key_vault_properties = action - - 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 == 'key-name': - d['key_name'] = v[0] - elif kl == 'key-version': - d['key_version'] = v[0] - elif kl == 'key-vault-uri': - d['key_vault_uri'] = v[0] - return d - - -class AddClustersValue(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - super(AddClustersValue, 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 == 'language-extension-name': - d['language_extension_name'] = v[0] - return d - - -class AddReadWriteDatabase(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.read_write_database = action - - 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 == 'soft-delete-period': - d['soft_delete_period'] = v[0] - elif kl == 'hot-cache-period': - d['hot_cache_period'] = v[0] - elif kl == 'location': - d['location'] = v[0] - d['kind'] = 'ReadWrite' - return d - - -class AddReadOnlyFollowingDatabase(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.read_only_following_database = action - - 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 == 'hot-cache-period': - d['hot_cache_period'] = v[0] - elif kl == 'location': - d['location'] = v[0] - d['kind'] = 'ReadOnlyFollowing' - return d - - -class AddDatabasesValue(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - super(AddDatabasesValue, 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 == 'role': - d['role'] = v[0] - elif kl == 'name': - d['name'] = v[0] - elif kl == 'type': - d['type'] = v[0] - elif kl == 'fqn': - d['fqn'] = v[0] - elif kl == 'email': - d['email'] = v[0] - elif kl == 'app-id': - d['app_id'] = v[0] - return d +# -------------------------------------------------------------------------- +# 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=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + 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 == 'capacity': + d['capacity'] = v[0] + elif kl == 'tier': + d['tier'] = v[0] + return d + + +class AddTrustedExternalTenants(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddTrustedExternalTenants, 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 == 'value': + d['value'] = v[0] + return d + + +class AddOptimizedAutoscale(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.optimized_autoscale = action + + 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 == 'version': + d['version'] = v[0] + elif kl == 'is-enabled': + d['is_enabled'] = v[0] + elif kl == 'minimum': + d['minimum'] = v[0] + elif kl == 'maximum': + d['maximum'] = v[0] + return d + + +class AddVirtualNetworkConfiguration(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.virtual_network_configuration = action + + 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 == 'subnet-id': + d['subnet_id'] = v[0] + elif kl == 'engine-public-ip-id': + d['engine_public_ip_id'] = v[0] + elif kl == 'data-management-public-ip-id': + d['data_management_public_ip_id'] = v[0] + return d + + +class AddKeyVaultProperties(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.key_vault_properties = action + + 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 == 'key-name': + d['key_name'] = v[0] + elif kl == 'key-version': + d['key_version'] = v[0] + elif kl == 'key-vault-uri': + d['key_vault_uri'] = v[0] + return d + + +class AddClustersValue(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddClustersValue, 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 == 'language-extension-name': + d['language_extension_name'] = v[0] + return d + + +class AddReadWriteDatabase(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.read_write_database = action + + 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 == 'soft-delete-period': + d['soft_delete_period'] = v[0] + elif kl == 'hot-cache-period': + d['hot_cache_period'] = v[0] + elif kl == 'location': + d['location'] = v[0] + d['kind'] = 'ReadWrite' + return d + + +class AddReadOnlyFollowingDatabase(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.read_only_following_database = action + + 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 == 'hot-cache-period': + d['hot_cache_period'] = v[0] + elif kl == 'location': + d['location'] = v[0] + d['kind'] = 'ReadOnlyFollowing' + return d + + +class AddDatabasesValue(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDatabasesValue, 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 == 'role': + d['role'] = v[0] + elif kl == 'name': + d['name'] = v[0] + elif kl == 'type': + d['type'] = v[0] + elif kl == 'fqn': + d['fqn'] = v[0] + elif kl == 'email': + d['email'] = v[0] + elif kl == 'app-id': + d['app_id'] = v[0] + return d diff --git a/src/kusto/azext_kusto/generated/commands.py b/src/kusto/azext_kusto/generated/commands.py index ab108067a0f..fd600949355 100644 --- a/src/kusto/azext_kusto/generated/commands.py +++ b/src/kusto/azext_kusto/generated/commands.py @@ -1,117 +1,122 @@ -# -------------------------------------------------------------------------- -# 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.commands import CliCommandType - - -def load_command_table(self, _): - - from azext_kusto.generated._client_factory import cf_cluster - kusto_cluster = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_operations#ClusterOperations.{}', - client_factory=cf_cluster) - with self.command_group('kusto cluster', kusto_cluster, client_factory=cf_cluster, is_experimental=True) as g: - g.custom_command('list', 'kusto_cluster_list') - g.custom_show_command('show', 'kusto_cluster_show') - g.custom_command('create', 'kusto_cluster_create', supports_no_wait=True) - g.custom_command('update', 'kusto_cluster_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_cluster_delete', supports_no_wait=True) - g.custom_command('add-language-extension', 'kusto_cluster_add_language_extension', supports_no_wait=True) - g.custom_command('detach-follower-database', 'kusto_cluster_detach_follower_database', supports_no_wait=True) - g.custom_command('diagnose-virtual-network', 'kusto_cluster_diagnose_virtual_network', supports_no_wait=True) - g.custom_command('list-follower-database', 'kusto_cluster_list_follower_database') - g.custom_command('list-language-extension', 'kusto_cluster_list_language_extension') - g.custom_command('list-sku', 'kusto_cluster_list_sku') - g.custom_command('remove-language-extension', 'kusto_cluster_remove_language_extension', - supports_no_wait=True) - g.custom_command('start', 'kusto_cluster_start', supports_no_wait=True) - g.custom_command('stop', 'kusto_cluster_stop', supports_no_wait=True) - g.custom_wait_command('wait', 'kusto_cluster_show') - - from azext_kusto.generated._client_factory import cf_cluster_principal_assignment - kusto_cluster_principal_assignment = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_principal_assignment_operations#ClusterPri' - 'ncipalAssignmentOperations.{}', - client_factory=cf_cluster_principal_assignment) - with self.command_group('kusto cluster-principal-assignment', kusto_cluster_principal_assignment, - client_factory=cf_cluster_principal_assignment, is_experimental=True) as g: - g.custom_command('list', 'kusto_cluster_principal_assignment_list') - g.custom_show_command('show', 'kusto_cluster_principal_assignment_show') - g.custom_command('create', 'kusto_cluster_principal_assignment_create', supports_no_wait=True) - g.custom_command('update', 'kusto_cluster_principal_assignment_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_cluster_principal_assignment_delete', supports_no_wait=True) - g.custom_wait_command('wait', 'kusto_cluster_principal_assignment_show') - - from azext_kusto.generated._client_factory import cf_database - kusto_database = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_operations#DatabaseOperations.{}', - client_factory=cf_database) - with self.command_group('kusto database', kusto_database, client_factory=cf_database, is_experimental=True) as g: - g.custom_command('list', 'kusto_database_list') - g.custom_show_command('show', 'kusto_database_show') - g.custom_command('create', 'kusto_database_create', supports_no_wait=True) - g.custom_command('update', 'kusto_database_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_database_delete', supports_no_wait=True) - g.custom_command('add-principal', 'kusto_database_add_principal') - g.custom_command('list-principal', 'kusto_database_list_principal') - g.custom_command('remove-principal', 'kusto_database_remove_principal') - g.custom_wait_command('wait', 'kusto_database_show') - - from azext_kusto.generated._client_factory import cf_database_principal_assignment - kusto_database_principal_assignment = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_principal_assignment_operations#DatabaseP' - 'rincipalAssignmentOperations.{}', - client_factory=cf_database_principal_assignment) - with self.command_group('kusto database-principal-assignment', kusto_database_principal_assignment, - client_factory=cf_database_principal_assignment, is_experimental=True) as g: - g.custom_command('list', 'kusto_database_principal_assignment_list') - g.custom_show_command('show', 'kusto_database_principal_assignment_show') - g.custom_command('create', 'kusto_database_principal_assignment_create', supports_no_wait=True) - g.custom_command('update', 'kusto_database_principal_assignment_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_database_principal_assignment_delete', supports_no_wait=True) - g.custom_wait_command('wait', 'kusto_database_principal_assignment_show') - - from azext_kusto.generated._client_factory import cf_attached_database_configuration - kusto_attached_database_configuration = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._attached_database_configuration_operations#Attache' - 'dDatabaseConfigurationOperations.{}', - client_factory=cf_attached_database_configuration) - with self.command_group('kusto attached-database-configuration', kusto_attached_database_configuration, - client_factory=cf_attached_database_configuration, is_experimental=True) as g: - g.custom_command('list', 'kusto_attached_database_configuration_list') - g.custom_show_command('show', 'kusto_attached_database_configuration_show') - g.custom_command('create', 'kusto_attached_database_configuration_create', supports_no_wait=True) - g.custom_command('update', 'kusto_attached_database_configuration_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_attached_database_configuration_delete', supports_no_wait=True) - g.custom_wait_command('wait', 'kusto_attached_database_configuration_show') - - from azext_kusto.generated._client_factory import cf_data_connection - kusto_data_connection = CliCommandType( - operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._data_connection_operations#DataConnectionOperation' - 's.{}', - client_factory=cf_data_connection) - with self.command_group('kusto data-connection', kusto_data_connection, client_factory=cf_data_connection, - is_experimental=True) as g: - g.custom_command('list', 'kusto_data_connection_list') - g.custom_show_command('show', 'kusto_data_connection_show') - g.custom_command('event-grid create', 'kusto_data_connection_event_grid_create', supports_no_wait=True) - g.custom_command('event-hub create', 'kusto_data_connection_event_hub_create', supports_no_wait=True) - g.custom_command('iot-hub create', 'kusto_data_connection_iot_hub_create', supports_no_wait=True) - g.custom_command('event-grid update', 'kusto_data_connection_event_grid_update', supports_no_wait=True) - g.custom_command('event-hub update', 'kusto_data_connection_event_hub_update', supports_no_wait=True) - g.custom_command('iot-hub update', 'kusto_data_connection_iot_hub_update', supports_no_wait=True) - g.custom_command('delete', 'kusto_data_connection_delete', supports_no_wait=True) - g.custom_command('event-grid data-connection-validation', 'kusto_data_connection_event_grid_data_connection_val' - 'idation', supports_no_wait=True) - g.custom_command('event-hub data-connection-validation', 'kusto_data_connection_event_hub_data_connection_valid' - 'ation', supports_no_wait=True) - g.custom_command('iot-hub data-connection-validation', 'kusto_data_connection_iot_hub_data_connection_validatio' - 'n', supports_no_wait=True) - g.custom_wait_command('wait', 'kusto_data_connection_show') +# -------------------------------------------------------------------------- +# 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=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_kusto.generated._client_factory import cf_cluster + kusto_cluster = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_operations#ClusterOperations.{}', + client_factory=cf_cluster) + with self.command_group('kusto cluster', kusto_cluster, client_factory=cf_cluster, is_experimental=True) as g: + g.custom_command('list', 'kusto_cluster_list') + g.custom_show_command('show', 'kusto_cluster_show') + g.custom_command('create', 'kusto_cluster_create', supports_no_wait=True) + g.custom_command('update', 'kusto_cluster_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_cluster_delete', supports_no_wait=True, confirmation=True) + g.custom_command('add-language-extension', 'kusto_cluster_add_language_extension', supports_no_wait=True) + g.custom_command('detach-follower-database', 'kusto_cluster_detach_follower_database', supports_no_wait=True) + g.custom_command('diagnose-virtual-network', 'kusto_cluster_diagnose_virtual_network', supports_no_wait=True) + g.custom_command('list-follower-database', 'kusto_cluster_list_follower_database') + g.custom_command('list-language-extension', 'kusto_cluster_list_language_extension') + g.custom_command('list-sku', 'kusto_cluster_list_sku') + g.custom_command('remove-language-extension', 'kusto_cluster_remove_language_extension', + supports_no_wait=True) + g.custom_command('start', 'kusto_cluster_start', supports_no_wait=True) + g.custom_command('stop', 'kusto_cluster_stop', supports_no_wait=True) + g.custom_wait_command('wait', 'kusto_cluster_show') + + from azext_kusto.generated._client_factory import cf_cluster_principal_assignment + kusto_cluster_principal_assignment = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_principal_assignment_operations#ClusterPri' + 'ncipalAssignmentOperations.{}', + client_factory=cf_cluster_principal_assignment) + with self.command_group('kusto cluster-principal-assignment', kusto_cluster_principal_assignment, + client_factory=cf_cluster_principal_assignment, is_experimental=True) as g: + g.custom_command('list', 'kusto_cluster_principal_assignment_list') + g.custom_show_command('show', 'kusto_cluster_principal_assignment_show') + g.custom_command('create', 'kusto_cluster_principal_assignment_create', supports_no_wait=True) + g.custom_command('update', 'kusto_cluster_principal_assignment_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_cluster_principal_assignment_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'kusto_cluster_principal_assignment_show') + + from azext_kusto.generated._client_factory import cf_database + kusto_database = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_operations#DatabaseOperations.{}', + client_factory=cf_database) + with self.command_group('kusto database', kusto_database, client_factory=cf_database, is_experimental=True) as g: + g.custom_command('list', 'kusto_database_list') + g.custom_show_command('show', 'kusto_database_show') + g.custom_command('create', 'kusto_database_create', supports_no_wait=True) + g.custom_command('update', 'kusto_database_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_database_delete', supports_no_wait=True, confirmation=True) + g.custom_command('add-principal', 'kusto_database_add_principal') + g.custom_command('list-principal', 'kusto_database_list_principal') + g.custom_command('remove-principal', 'kusto_database_remove_principal') + g.custom_wait_command('wait', 'kusto_database_show') + + from azext_kusto.generated._client_factory import cf_database_principal_assignment + kusto_database_principal_assignment = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_principal_assignment_operations#DatabaseP' + 'rincipalAssignmentOperations.{}', + client_factory=cf_database_principal_assignment) + with self.command_group('kusto database-principal-assignment', kusto_database_principal_assignment, + client_factory=cf_database_principal_assignment, is_experimental=True) as g: + g.custom_command('list', 'kusto_database_principal_assignment_list') + g.custom_show_command('show', 'kusto_database_principal_assignment_show') + g.custom_command('create', 'kusto_database_principal_assignment_create', supports_no_wait=True) + g.custom_command('update', 'kusto_database_principal_assignment_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_database_principal_assignment_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'kusto_database_principal_assignment_show') + + from azext_kusto.generated._client_factory import cf_attached_database_configuration + kusto_attached_database_configuration = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._attached_database_configuration_operations#Attache' + 'dDatabaseConfigurationOperations.{}', + client_factory=cf_attached_database_configuration) + with self.command_group('kusto attached-database-configuration', kusto_attached_database_configuration, + client_factory=cf_attached_database_configuration, is_experimental=True) as g: + g.custom_command('list', 'kusto_attached_database_configuration_list') + g.custom_show_command('show', 'kusto_attached_database_configuration_show') + g.custom_command('create', 'kusto_attached_database_configuration_create', supports_no_wait=True) + g.custom_command('update', 'kusto_attached_database_configuration_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_attached_database_configuration_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'kusto_attached_database_configuration_show') + + from azext_kusto.generated._client_factory import cf_data_connection + kusto_data_connection = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._data_connection_operations#DataConnectionOperation' + 's.{}', + client_factory=cf_data_connection) + with self.command_group('kusto data-connection', kusto_data_connection, client_factory=cf_data_connection, + is_experimental=True) as g: + g.custom_command('list', 'kusto_data_connection_list') + g.custom_show_command('show', 'kusto_data_connection_show') + g.custom_command('event-grid create', 'kusto_data_connection_event_grid_create', supports_no_wait=True) + g.custom_command('event-hub create', 'kusto_data_connection_event_hub_create', supports_no_wait=True) + g.custom_command('iot-hub create', 'kusto_data_connection_iot_hub_create', supports_no_wait=True) + g.custom_command('event-grid update', 'kusto_data_connection_event_grid_update', supports_no_wait=True) + g.custom_command('event-hub update', 'kusto_data_connection_event_hub_update', supports_no_wait=True) + g.custom_command('iot-hub update', 'kusto_data_connection_iot_hub_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_data_connection_delete', supports_no_wait=True, confirmation=True) + g.custom_command('event-grid data-connection-validation', 'kusto_data_connection_event_grid_data_connection_val' + 'idation', supports_no_wait=True) + g.custom_command('event-hub data-connection-validation', 'kusto_data_connection_event_hub_data_connection_valid' + 'ation', supports_no_wait=True) + g.custom_command('iot-hub data-connection-validation', 'kusto_data_connection_iot_hub_data_connection_validatio' + 'n', supports_no_wait=True) + g.custom_wait_command('wait', 'kusto_data_connection_show') diff --git a/src/kusto/azext_kusto/generated/custom.py b/src/kusto/azext_kusto/generated/custom.py index 0ed65217ee7..73d2aa01ce0 100644 --- a/src/kusto/azext_kusto/generated/custom.py +++ b/src/kusto/azext_kusto/generated/custom.py @@ -1,881 +1,876 @@ -# -------------------------------------------------------------------------- -# 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=too-many-lines - -import json -from knack.util import CLIError -from azure.cli.core.util import sdk_no_wait - - -def kusto_cluster_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list() - - -def kusto_cluster_show(client, - resource_group_name, - cluster_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_create(client, - resource_group_name, - cluster_name, - location, - sku, - tags=None, - zones=None, - trusted_external_tenants=None, - optimized_autoscale=None, - enable_disk_encryption=None, - enable_streaming_ingest=None, - virtual_network_configuration=None, - key_vault_properties=None, - enable_purge=None, - enable_double_encryption=None, - identity_type=None, - identity_user_assigned_identities=None, - no_wait=False): - if enable_streaming_ingest is None: - enable_streaming_ingest = False - if enable_purge is None: - enable_purge = False - if enable_double_encryption is None: - enable_double_encryption = False - if isinstance(identity_user_assigned_identities, str): - identity_user_assigned_identities = json.loads(identity_user_assigned_identities) - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - zones=zones, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=identity_type, - user_assigned_identities=identity_user_assigned_identities) - - -def kusto_cluster_update(client, - resource_group_name, - cluster_name, - tags=None, - location=None, - sku=None, - trusted_external_tenants=None, - optimized_autoscale=None, - enable_disk_encryption=None, - enable_streaming_ingest=None, - virtual_network_configuration=None, - key_vault_properties=None, - enable_purge=None, - enable_double_encryption=None, - identity_type=None, - identity_user_assigned_identities=None, - no_wait=False): - if enable_streaming_ingest is None: - enable_streaming_ingest = False - if enable_purge is None: - enable_purge = False - if enable_double_encryption is None: - enable_double_encryption = False - if isinstance(identity_user_assigned_identities, str): - identity_user_assigned_identities = json.loads(identity_user_assigned_identities) - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=identity_type, - user_assigned_identities=identity_user_assigned_identities) - - -def kusto_cluster_delete(client, - resource_group_name, - cluster_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_add_language_extension(client, - resource_group_name, - cluster_name, - value=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_add_language_extension, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value) - - -def kusto_cluster_detach_follower_database(client, - resource_group_name, - cluster_name, - cluster_resource_id, - attached_database_configuration_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_detach_follower_database, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_resource_id=cluster_resource_id, - attached_database_configuration_name=attached_database_configuration_name) - - -def kusto_cluster_diagnose_virtual_network(client, - resource_group_name, - cluster_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_diagnose_virtual_network, - resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_list_follower_database(client, - resource_group_name, - cluster_name): - return client.list_follower_database(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_list_language_extension(client, - resource_group_name, - cluster_name): - return client.list_language_extension(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_list_sku(client, - resource_group_name=None, - cluster_name=None): - if resource_group_name and cluster_name is not None: - return client.list_sku_by_resource(resource_group_name=resource_group_name, - cluster_name=cluster_name) - return client.list_sku() - - -def kusto_cluster_remove_language_extension(client, - resource_group_name, - cluster_name, - value=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_remove_language_extension, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value) - - -def kusto_cluster_start(client, - resource_group_name, - cluster_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_start, - resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_stop(client, - resource_group_name, - cluster_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_stop, - resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_principal_assignment_list(client, - resource_group_name, - cluster_name): - return client.list(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_cluster_principal_assignment_show(client, - resource_group_name, - cluster_name, - principal_assignment_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name) - - -def kusto_cluster_principal_assignment_create(client, - resource_group_name, - cluster_name, - principal_assignment_name, - principal_id=None, - role=None, - tenant_id=None, - principal_type=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) - - -def kusto_cluster_principal_assignment_update(client, - resource_group_name, - cluster_name, - principal_assignment_name, - principal_id=None, - role=None, - tenant_id=None, - principal_type=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) - - -def kusto_cluster_principal_assignment_delete(client, - resource_group_name, - cluster_name, - principal_assignment_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name) - - -def kusto_database_list(client, - resource_group_name, - cluster_name): - return client.list_by_cluster(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_database_show(client, - resource_group_name, - cluster_name, - database_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) - - -def kusto_database_create(client, - resource_group_name, - cluster_name, - database_name, - read_write_database=None, - read_only_following_database=None, - no_wait=False): - all_parameters = [] - if read_write_database is not None: - all_parameters.append(read_write_database) - if read_only_following_database is not None: - all_parameters.append(read_only_following_database) - if len(all_parameters) > 1: - raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') - if len(all_parameters) != 1: - raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' - 'ed!') - parameters = all_parameters[0] if len(all_parameters) == 1 else None - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters) - - -def kusto_database_update(client, - resource_group_name, - cluster_name, - database_name, - read_write_database=None, - read_only_following_database=None, - no_wait=False): - all_parameters = [] - if read_write_database is not None: - all_parameters.append(read_write_database) - if read_only_following_database is not None: - all_parameters.append(read_only_following_database) - if len(all_parameters) > 1: - raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') - if len(all_parameters) != 1: - raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' - 'ed!') - parameters = all_parameters[0] if len(all_parameters) == 1 else None - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters) - - -def kusto_database_delete(client, - resource_group_name, - cluster_name, - database_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) - - -def kusto_database_add_principal(client, - resource_group_name, - cluster_name, - database_name, - value=None): - return client.add_principal(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - value=value) - - -def kusto_database_list_principal(client, - resource_group_name, - cluster_name, - database_name): - return client.list_principal(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) - - -def kusto_database_remove_principal(client, - resource_group_name, - cluster_name, - database_name, - value=None): - return client.remove_principal(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - value=value) - - -def kusto_database_principal_assignment_list(client, - resource_group_name, - cluster_name, - database_name): - return client.list(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) - - -def kusto_database_principal_assignment_show(client, - resource_group_name, - cluster_name, - database_name, - principal_assignment_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name) - - -def kusto_database_principal_assignment_create(client, - resource_group_name, - cluster_name, - database_name, - principal_assignment_name, - principal_id=None, - role=None, - tenant_id=None, - principal_type=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) - - -def kusto_database_principal_assignment_update(client, - resource_group_name, - cluster_name, - database_name, - principal_assignment_name, - principal_id=None, - role=None, - tenant_id=None, - principal_type=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) - - -def kusto_database_principal_assignment_delete(client, - resource_group_name, - cluster_name, - database_name, - principal_assignment_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name) - - -def kusto_attached_database_configuration_list(client, - resource_group_name, - cluster_name): - return client.list_by_cluster(resource_group_name=resource_group_name, - cluster_name=cluster_name) - - -def kusto_attached_database_configuration_show(client, - resource_group_name, - cluster_name, - attached_database_configuration_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name) - - -def kusto_attached_database_configuration_create(client, - resource_group_name, - cluster_name, - attached_database_configuration_name, - location=None, - database_name=None, - cluster_resource_id=None, - default_principals_modification_kind=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind) - - -def kusto_attached_database_configuration_update(client, - resource_group_name, - cluster_name, - attached_database_configuration_name, - location=None, - database_name=None, - cluster_resource_id=None, - default_principals_modification_kind=None, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind) - - -def kusto_attached_database_configuration_delete(client, - resource_group_name, - cluster_name, - attached_database_configuration_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name) - - -def kusto_data_connection_list(client, - resource_group_name, - cluster_name, - database_name): - return client.list_by_database(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) - - -def kusto_data_connection_show(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name): - return client.get(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name) - - -def kusto_data_connection_event_grid_create(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - storage_account_resource_id=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - ignore_first_record=None, - blob_storage_event_type=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'EventGrid' - parameters['storage_account_resource_id'] = storage_account_resource_id - parameters['event_hub_resource_id'] = event_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['ignore_first_record'] = ignore_first_record - parameters['blob_storage_event_type'] = blob_storage_event_type - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_event_hub_create(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - compression=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'EventHub' - parameters['event_hub_resource_id'] = event_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['event_system_properties'] = event_system_properties - parameters['compression'] = compression - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_iot_hub_create(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - iot_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - shared_access_policy_name=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'IotHub' - parameters['iot_hub_resource_id'] = iot_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['event_system_properties'] = event_system_properties - parameters['shared_access_policy_name'] = shared_access_policy_name - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_event_grid_update(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - storage_account_resource_id=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - ignore_first_record=None, - blob_storage_event_type=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'EventGrid' - parameters['storage_account_resource_id'] = storage_account_resource_id - parameters['event_hub_resource_id'] = event_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['ignore_first_record'] = ignore_first_record - parameters['blob_storage_event_type'] = blob_storage_event_type - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_event_hub_update(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - compression=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'EventHub' - parameters['event_hub_resource_id'] = event_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['event_system_properties'] = event_system_properties - parameters['compression'] = compression - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_iot_hub_update(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - location=None, - iot_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - shared_access_policy_name=None, - no_wait=False): - parameters = {} - parameters['location'] = location - parameters['kind'] = 'IotHub' - parameters['iot_hub_resource_id'] = iot_hub_resource_id - parameters['consumer_group'] = consumer_group - parameters['table_name'] = table_name - parameters['mapping_rule_name'] = mapping_rule_name - parameters['data_format'] = data_format - parameters['event_system_properties'] = event_system_properties - parameters['shared_access_policy_name'] = shared_access_policy_name - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) - - -def kusto_data_connection_delete(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name) - - -def kusto_data_connection_event_grid_data_connection_validation(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name=None, - location=None, - storage_account_resource_id=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - ignore_first_record=None, - blob_storage_event_type=None, - no_wait=False): - properties = {} - properties['location'] = location - properties['kind'] = 'EventGrid' - properties['storage_account_resource_id'] = storage_account_resource_id - properties['event_hub_resource_id'] = event_hub_resource_id - properties['consumer_group'] = consumer_group - properties['table_name'] = table_name - properties['mapping_rule_name'] = mapping_rule_name - properties['data_format'] = data_format - properties['ignore_first_record'] = ignore_first_record - properties['blob_storage_event_type'] = blob_storage_event_type - return sdk_no_wait(no_wait, - client.begin_data_connection_validation, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) - - -def kusto_data_connection_event_hub_data_connection_validation(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name=None, - location=None, - event_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - compression=None, - no_wait=False): - properties = {} - properties['location'] = location - properties['kind'] = 'EventHub' - properties['event_hub_resource_id'] = event_hub_resource_id - properties['consumer_group'] = consumer_group - properties['table_name'] = table_name - properties['mapping_rule_name'] = mapping_rule_name - properties['data_format'] = data_format - properties['event_system_properties'] = event_system_properties - properties['compression'] = compression - return sdk_no_wait(no_wait, - client.begin_data_connection_validation, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) - - -def kusto_data_connection_iot_hub_data_connection_validation(client, - resource_group_name, - cluster_name, - database_name, - data_connection_name=None, - location=None, - iot_hub_resource_id=None, - consumer_group=None, - table_name=None, - mapping_rule_name=None, - data_format=None, - event_system_properties=None, - shared_access_policy_name=None, - no_wait=False): - properties = {} - properties['location'] = location - properties['kind'] = 'IotHub' - properties['iot_hub_resource_id'] = iot_hub_resource_id - properties['consumer_group'] = consumer_group - properties['table_name'] = table_name - properties['mapping_rule_name'] = mapping_rule_name - properties['data_format'] = data_format - properties['event_system_properties'] = event_system_properties - properties['shared_access_policy_name'] = shared_access_policy_name - return sdk_no_wait(no_wait, - client.begin_data_connection_validation, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) +# -------------------------------------------------------------------------- +# 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=too-many-lines + +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def kusto_cluster_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list() + + +def kusto_cluster_show(client, + resource_group_name, + cluster_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_create(client, + resource_group_name, + cluster_name, + location, + sku, + tags=None, + zones=None, + trusted_external_tenants=None, + optimized_autoscale=None, + enable_disk_encryption=None, + enable_streaming_ingest=None, + virtual_network_configuration=None, + key_vault_properties=None, + enable_purge=None, + enable_double_encryption=None, + identity_type=None, + identity_user_assigned_identities=None, + no_wait=False): + if enable_streaming_ingest is None: + enable_streaming_ingest = False + if enable_purge is None: + enable_purge = False + if enable_double_encryption is None: + enable_double_encryption = False + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) + + +def kusto_cluster_update(client, + resource_group_name, + cluster_name, + tags=None, + location=None, + sku=None, + trusted_external_tenants=None, + optimized_autoscale=None, + enable_disk_encryption=None, + enable_streaming_ingest=None, + virtual_network_configuration=None, + key_vault_properties=None, + enable_purge=None, + enable_double_encryption=None, + identity_type=None, + identity_user_assigned_identities=None, + no_wait=False): + if enable_streaming_ingest is None: + enable_streaming_ingest = False + if enable_purge is None: + enable_purge = False + if enable_double_encryption is None: + enable_double_encryption = False + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) + + +def kusto_cluster_delete(client, + resource_group_name, + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_add_language_extension(client, + resource_group_name, + cluster_name, + value=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_add_language_extension, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) + + +def kusto_cluster_detach_follower_database(client, + resource_group_name, + cluster_name, + cluster_resource_id, + attached_database_configuration_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_detach_follower_database, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_cluster_diagnose_virtual_network(client, + resource_group_name, + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_diagnose_virtual_network, + resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_follower_database(client, + resource_group_name, + cluster_name): + return client.list_follower_database(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_language_extension(client, + resource_group_name, + cluster_name): + return client.list_language_extension(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_sku(client, + resource_group_name=None, + cluster_name=None): + if resource_group_name and cluster_name is not None: + return client.list_sku_by_resource(resource_group_name=resource_group_name, + cluster_name=cluster_name) + return client.list_sku() + + +def kusto_cluster_remove_language_extension(client, + resource_group_name, + cluster_name, + value=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_remove_language_extension, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) + + +def kusto_cluster_start(client, + resource_group_name, + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_start, + resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_stop(client, + resource_group_name, + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_stop, + resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_principal_assignment_list(client, + resource_group_name, + cluster_name): + return client.list(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_principal_assignment_show(client, + resource_group_name, + cluster_name, + principal_assignment_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_cluster_principal_assignment_create(client, + resource_group_name, + cluster_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_cluster_principal_assignment_update(client, + resource_group_name, + cluster_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_cluster_principal_assignment_delete(client, + resource_group_name, + cluster_name, + principal_assignment_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_database_list(client, + resource_group_name, + cluster_name): + return client.list_by_cluster(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_database_show(client, + resource_group_name, + cluster_name, + database_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_create(client, + resource_group_name, + cluster_name, + database_name, + read_write_database=None, + read_only_following_database=None, + no_wait=False): + all_parameters = [] + if read_write_database is not None: + all_parameters.append(read_write_database) + if read_only_following_database is not None: + all_parameters.append(read_only_following_database) + if len(all_parameters) > 1: + raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') + if len(all_parameters) != 1: + raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is ' + 'provided!') + parameters = all_parameters[0] if len(all_parameters) == 1 else None + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) + + +def kusto_database_update(client, + resource_group_name, + cluster_name, + database_name, + read_write_database=None, + read_only_following_database=None, + no_wait=False): + all_parameters = [] + if read_write_database is not None: + all_parameters.append(read_write_database) + if read_only_following_database is not None: + all_parameters.append(read_only_following_database) + if len(all_parameters) > 1: + raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') + if len(all_parameters) != 1: + raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is ' + 'provided!') + parameters = all_parameters[0] if len(all_parameters) == 1 else None + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) + + +def kusto_database_delete(client, + resource_group_name, + cluster_name, + database_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_add_principal(client, + resource_group_name, + cluster_name, + database_name, + value=None): + return client.add_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + value=value) + + +def kusto_database_list_principal(client, + resource_group_name, + cluster_name, + database_name): + return client.list_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_remove_principal(client, + resource_group_name, + cluster_name, + database_name, + value=None): + return client.remove_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + value=value) + + +def kusto_database_principal_assignment_list(client, + resource_group_name, + cluster_name, + database_name): + return client.list(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_principal_assignment_show(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_database_principal_assignment_create(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_database_principal_assignment_update(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_database_principal_assignment_delete(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_attached_database_configuration_list(client, + resource_group_name, + cluster_name): + return client.list_by_cluster(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_attached_database_configuration_show(client, + resource_group_name, + cluster_name, + attached_database_configuration_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_attached_database_configuration_create(client, + resource_group_name, + cluster_name, + attached_database_configuration_name, + location=None, + database_name=None, + cluster_resource_id=None, + default_principals_modification_kind=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) + + +def kusto_attached_database_configuration_update(client, + resource_group_name, + cluster_name, + attached_database_configuration_name, + location=None, + database_name=None, + cluster_resource_id=None, + default_principals_modification_kind=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) + + +def kusto_attached_database_configuration_delete(client, + resource_group_name, + cluster_name, + attached_database_configuration_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_data_connection_list(client, + resource_group_name, + cluster_name, + database_name): + return client.list_by_database(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_data_connection_show(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name) + + +def kusto_data_connection_event_grid_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventGrid' + parameters['storage_account_resource_id'] = storage_account_resource_id + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['ignore_first_record'] = ignore_first_record + parameters['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_hub_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventHub' + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['compression'] = compression + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_iot_hub_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'IotHub' + parameters['iot_hub_resource_id'] = iot_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['shared_access_policy_name'] = shared_access_policy_name + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_grid_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventGrid' + parameters['storage_account_resource_id'] = storage_account_resource_id + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['ignore_first_record'] = ignore_first_record + parameters['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_hub_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventHub' + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['compression'] = compression + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_iot_hub_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'IotHub' + parameters['iot_hub_resource_id'] = iot_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['shared_access_policy_name'] = shared_access_policy_name + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_delete(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name) + + +def kusto_data_connection_event_grid_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): + properties = {} + properties['location'] = location + properties['kind'] = 'EventGrid' + properties['storage_account_resource_id'] = storage_account_resource_id + properties['event_hub_resource_id'] = event_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + properties['ignore_first_record'] = ignore_first_record + properties['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) + + +def kusto_data_connection_event_hub_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None, + no_wait=False): + properties = {} + properties['location'] = location + properties['kind'] = 'EventHub' + properties['event_hub_resource_id'] = event_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + properties['event_system_properties'] = event_system_properties + properties['compression'] = compression + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) + + +def kusto_data_connection_iot_hub_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None, + no_wait=False): + properties = {} + properties['location'] = location + properties['kind'] = 'IotHub' + properties['iot_hub_resource_id'] = iot_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + properties['event_system_properties'] = event_system_properties + properties['shared_access_policy_name'] = shared_access_policy_name + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) diff --git a/src/kusto/azext_kusto/manual/__init__.py b/src/kusto/azext_kusto/manual/__init__.py index ee0c4f36bd0..c9cfdc73e77 100644 --- a/src/kusto/azext_kusto/manual/__init__.py +++ b/src/kusto/azext_kusto/manual/__init__.py @@ -1,12 +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__) +# 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__) diff --git a/src/kusto/azext_kusto/tests/__init__.py b/src/kusto/azext_kusto/tests/__init__.py index 5f8f1fd97ad..50e0627daff 100644 --- a/src/kusto/azext_kusto/tests/__init__.py +++ b/src/kusto/azext_kusto/tests/__init__.py @@ -1,71 +1,114 @@ -# 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. -# -------------------------------------------------------------------------- -import inspect -import os -import sys -import traceback -from azure.core.exceptions import AzureError -from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError - - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) -exceptions = [] - - -def try_manual(func): - def import_manual_function(origin_func): - from importlib import import_module - decorated_path = inspect.getfile(origin_func) - module_path = __path__[0] - if not decorated_path.startswith(module_path): - raise Exception("Decorator can only be used in submodules!") - manual_path = os.path.join( - decorated_path[module_path.rfind(os.path.sep) + 1:]) - manual_file_path, manual_file_name = os.path.split(manual_path) - module_name, _ = os.path.splitext(manual_file_name) - manual_module = "..manual." + \ - ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) - return getattr(import_module(manual_module, package=__name__), origin_func.__name__) - - def get_func_to_call(): - func_to_call = func - try: - func_to_call = import_manual_function(func) - print("Found manual override for {}(...)".format(func.__name__)) - except (ImportError, AttributeError): - pass - return func_to_call - - def wrapper(*args, **kwargs): - func_to_call = get_func_to_call() - print("running {}()...".format(func.__name__)) - try: - return func_to_call(*args, **kwargs) - except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: - print("--------------------------------------") - print("step exception: ", e) - print("--------------------------------------", file=sys.stderr) - print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) - traceback.print_exc() - exceptions.append((func.__name__, sys.exc_info())) - - if inspect.isclass(func): - return get_func_to_call() - return wrapper - - -def raise_if(): - if exceptions: - if len(exceptions) <= 1: - raise exceptions[0][1][1] - message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) - message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) - raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) +# 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. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/kusto/azext_kusto/tests/latest/__init__.py b/src/kusto/azext_kusto/tests/latest/__init__.py index ee0c4f36bd0..c9cfdc73e77 100644 --- a/src/kusto/azext_kusto/tests/latest/__init__.py +++ b/src/kusto/azext_kusto/tests/latest/__init__.py @@ -1,12 +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__) +# 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__) diff --git a/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py index 2fc3d87700e..b776b2e7672 100644 --- a/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py +++ b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py @@ -1,533 +1,579 @@ -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- - -import os -from azure.cli.testsdk import ScenarioTest -from .. import try_manual, raise_if -from azure.cli.testsdk import ResourceGroupPreparer - - -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - - -@try_manual -def setup(test, rg): - pass - - -# EXAMPLE: KustoClustersCreateOrUpdate -@try_manual -def step_kustoclusterscreateorupdate(test, rg): - test.cmd('az kusto cluster create ' - '--name "{Clusters_3}" ' - '--identity-type "SystemAssigned" ' - '--location "westus" ' - '--enable-double-encryption false ' - '--enable-purge true ' - '--enable-streaming-ingest true ' - '--sku name="Standard_L8s" capacity=2 tier="Standard" ' - '--resource-group "{rg}"', - checks=[]) - test.cmd('az kusto cluster wait --created ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesCreateOrUpdate -@try_manual -def step_kustodatabasescreateorupdate(test, rg): - test.cmd('az kusto database create ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--parameters "{{\\"location\\":\\"westus\\",\\"properties\\":{{\\"softDeletePeriod\\":\\"P1D\\"}}}}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDataConnectionsCreateOrUpdate -@try_manual -def step_kustodataconnectionscreateorupdate(test, rg): - test.cmd('az kusto data-connection event-hub create ' - '--cluster-name "{Clusters_3}" ' - '--name "{DataConnections8}" ' - '--database-name "KustoDatabase8" ' - '--location "westus" ' - '--consumer-group "testConsumerGroup1" ' - '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' - 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: AttachedDatabaseConfigurationsCreateOrUpdate -@try_manual -def step_attacheddatabaseconfigurationscreateorupdate(test, rg): - test.cmd('az kusto attached-database-configuration create ' - '--name "{attachedDatabaseConfigurations1}" ' - '--cluster-name "{Clusters_3}" ' - '--location "westus" ' - '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/Clu' - 'sters/{Clusters_2}" ' - '--database-name "kustodatabase" ' - '--default-principals-modification-kind "Union" ' - '--resource-group "{rg}"', - checks=[]) - test.cmd('az kusto attached-database-configuration wait --created ' - '--name "{attachedDatabaseConfigurations1}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: AttachedDatabaseConfigurationsGet -@try_manual -def step_attacheddatabaseconfigurationsget(test, rg): - test.cmd('az kusto attached-database-configuration show ' - '--name "{attachedDatabaseConfigurations1}" ' - '--cluster-name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - -# EXAMPLE: KustoDataConnectionsGet - - -@try_manual -def step_kustodataconnectionsget(test, rg): - test.cmd('az kusto data-connection show ' - '--name "{DataConnections8}" ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesListByCluster -@try_manual -def step_kustodatabaseslistbycluster(test, rg): - test.cmd('az kusto database list ' - '--cluster-name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoAttachedDatabaseConfigurationsListByCluster -@try_manual -def step_kustoattacheddatabaseconfigurationslistbycluster(test, rg): - test.cmd('az kusto attached-database-configuration list ' - '--cluster-name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesGet -@try_manual -def step_kustodatabasesget(test, rg): - test.cmd('az kusto database show ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesListByCluster -@try_manual -def step_kustodatabaseslistbycluster(test, rg): - test.cmd('az kusto database list ' - '--cluster-name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersListResourceSkus -@try_manual -def step_kustoclusterslistresourceskus(test, rg): - test.cmd('az kusto cluster list-sku ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersGet -@try_manual -def step_kustoclustersget(test, rg): - test.cmd('az kusto cluster show ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersListByResourceGroup -@try_manual -def step_kustoclusterslistbyresourcegroup(test, rg): - test.cmd('az kusto cluster list ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersList -@try_manual -def step_kustoclusterslist(test, rg): - test.cmd('az kusto cluster list ' - '-g ""', - checks=[]) - - -# EXAMPLE: KustoClustersListSkus -@try_manual -def step_kustoclusterslistskus(test, rg): - test.cmd('az kusto cluster list-sku ' - '-g ""', - checks=[]) - - -# EXAMPLE: KustoOperationsList -@try_manual -def step_kustooperationslist(test, rg): - # EXAMPLE NOT FOUND! - pass - - -# EXAMPLE: KustoDataConnectionsUpdate -@try_manual -def step_kustodataconnectionsupdate(test, rg): - test.cmd('az kusto data-connection event-hub update ' - '--cluster-name "{Clusters_3}" ' - '--name "{DataConnections8}" ' - '--database-name "KustoDatabase8" ' - '--location "westus" ' - '--consumer-group "testConsumerGroup1" ' - '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' - 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDataConnectionValidation -@try_manual -def step_kustodataconnectionvalidation(test, rg): - test.cmd('az kusto data-connection event-hub data-connection-validation ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--name "{DataConnections8}" ' - '--consumer-group "testConsumerGroup1" ' - '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' - 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDataConnectionsCheckNameAvailability -@try_manual -def step_kustodataconnectionschecknameavailability(test, rg): - # EXAMPLE NOT FOUND! - pass - - -# EXAMPLE: KustoDatabaseRemovePrincipals -@try_manual -def step_kustodatabaseremoveprincipals(test, rg): - test.cmd('az kusto database remove-principal ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' - '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' - '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabaseListPrincipals -@try_manual -def step_kustodatabaselistprincipals(test, rg): - test.cmd('az kusto database list-principal ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabaseAddPrincipals -@try_manual -def step_kustodatabaseaddprincipals(test, rg): - test.cmd('az kusto database add-principal ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' - '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' - '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesUpdate -@try_manual -def step_kustodatabasesupdate(test, rg): - test.cmd('az kusto database update ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--parameters "{{\\"properties\\":{{\\"softDeletePeriod\\":\\"P1D\\"}}}}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClusterDetachFollowerDatabases -@try_manual -def step_kustoclusterdetachfollowerdatabases(test, rg): - test.cmd('az kusto cluster detach-follower-database ' - '--name "{Clusters_3}" ' - '--attached-database-configuration-name "{AttachedDatabaseConfigurations_2}" ' - '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/clu' - 'sters/{leader4}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabaseCheckNameAvailability -@try_manual -def step_kustodatabasechecknameavailability(test, rg): - # EXAMPLE NOT FOUND! - pass - - -# EXAMPLE: KustoClusterListFollowerDatabases -@try_manual -def step_kustoclusterlistfollowerdatabases(test, rg): - test.cmd('az kusto cluster list-follower-database ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersStart -@try_manual -def step_kustoclustersstart(test, rg): - test.cmd('az kusto cluster start ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersStop -@try_manual -def step_kustoclustersstop(test, rg): - test.cmd('az kusto cluster stop ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersUpdate -@try_manual -def step_kustoclustersupdate(test, rg): - test.cmd('az kusto cluster update ' - '--name "{Clusters_3}" ' - '--identity-type "SystemAssigned" ' - '--location "westus" ' - '--enable-purge true ' - '--enable-streaming-ingest true ' - '--key-vault-properties key-name="keyName" key-vault-uri="https://dummy.keyvault.com" key-version="keyVers' - 'ion" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersCheckNameAvailability -@try_manual -def step_kustoclusterschecknameavailability(test, rg): - # EXAMPLE NOT FOUND! - pass - - -# EXAMPLE: AttachedDatabaseConfigurationsDelete -@try_manual -def step_attacheddatabaseconfigurationsdelete(test, rg): - test.cmd('az kusto attached-database-configuration delete ' - '--name "{attachedDatabaseConfigurations1}" ' - '--cluster-name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDataConnectionsDelete -@try_manual -def step_kustodataconnectionsdelete(test, rg): - test.cmd('az kusto data-connection delete ' - '--cluster-name "{Clusters_3}" ' - '--name "{DataConnections_2}" ' - '--database-name "KustoDatabase8" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasesDelete -@try_manual -def step_kustodatabasesdelete(test, rg): - test.cmd('az kusto database delete ' - '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClustersDelete -@try_manual -def step_kustoclustersdelete(test, rg): - test.cmd('az kusto cluster delete ' - '--name "{Clusters_3}" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasePrincipalAssignmentsGet -@try_manual -def step_kustodatabaseprincipalassignmentsget(test, rg): - test.cmd('az kusto database-principal-assignment show ' - '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasePrincipalAssignmentsCreateOrUpdate -@try_manual -def step_kustodatabaseprincipalassignmentscreateorupdate(test, rg): - test.cmd('az kusto database-principal-assignment create ' - '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' - '--principal-id "87654321-1234-1234-1234-123456789123" ' - '--principal-type "App" ' - '--role "Admin" ' - '--tenant-id "12345678-1234-1234-1234-123456789123" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoDatabasePrincipalAssignmentsDelete -@try_manual -def step_kustodatabaseprincipalassignmentsdelete(test, rg): - test.cmd('az kusto database-principal-assignment delete ' - '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClusterPrincipalAssignmentsGet -@try_manual -def step_kustoclusterprincipalassignmentsget(test, rg): - test.cmd('az kusto cluster-principal-assignment show ' - '--cluster-name "{Clusters_3}" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClusterPrincipalAssignmentsCreateOrUpdate -@try_manual -def step_kustoclusterprincipalassignmentscreateorupdate(test, rg): - test.cmd('az kusto cluster-principal-assignment create ' - '--cluster-name "{Clusters_3}" ' - '--principal-id "87654321-1234-1234-1234-123456789123" ' - '--principal-type "App" ' - '--role "AllDatabasesAdmin" ' - '--tenant-id "12345678-1234-1234-1234-123456789123" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -# EXAMPLE: KustoClusterPrincipalAssignmentsDelete -@try_manual -def step_kustoclusterprincipalassignmentsdelete(test, rg): - test.cmd('az kusto cluster-principal-assignment delete ' - '--cluster-name "{Clusters_3}" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - - -@try_manual -def cleanup(test, rg): - pass - - -@try_manual -def call_scenario(test, rg): - setup(test, rg) - step_kustoclusterscreateorupdate(test, rg) - step_kustodatabasescreateorupdate(test, rg) - step_kustodataconnectionscreateorupdate(test, rg) - step_attacheddatabaseconfigurationscreateorupdate(test, rg) - step_attacheddatabaseconfigurationsget(test, rg) - step_kustodataconnectionsget(test, rg) - step_kustodatabaseslistbycluster(test, rg) - step_kustoattacheddatabaseconfigurationslistbycluster(test, rg) - step_kustodatabasesget(test, rg) - step_kustodatabaseslistbycluster(test, rg) - step_kustoclusterslistresourceskus(test, rg) - step_kustoclustersget(test, rg) - step_kustoclusterslistbyresourcegroup(test, rg) - step_kustoclusterslist(test, rg) - step_kustoclusterslistskus(test, rg) - step_kustooperationslist(test, rg) - step_kustodataconnectionsupdate(test, rg) - step_kustodataconnectionvalidation(test, rg) - step_kustodataconnectionschecknameavailability(test, rg) - step_kustodatabaseremoveprincipals(test, rg) - step_kustodatabaselistprincipals(test, rg) - step_kustodatabaseaddprincipals(test, rg) - step_kustodatabasesupdate(test, rg) - step_kustoclusterdetachfollowerdatabases(test, rg) - step_kustodatabasechecknameavailability(test, rg) - step_kustoclusterlistfollowerdatabases(test, rg) - step_kustoclustersstart(test, rg) - step_kustoclustersstop(test, rg) - step_kustoclustersupdate(test, rg) - step_kustoclusterschecknameavailability(test, rg) - step_attacheddatabaseconfigurationsdelete(test, rg) - step_kustodataconnectionsdelete(test, rg) - step_kustodatabasesdelete(test, rg) - step_kustoclustersdelete(test, rg) - step_kustodatabaseprincipalassignmentsget(test, rg) - step_kustodatabaseprincipalassignmentscreateorupdate(test, rg) - step_kustodatabaseprincipalassignmentsdelete(test, rg) - step_kustoclusterprincipalassignmentsget(test, rg) - step_kustoclusterprincipalassignmentscreateorupdate(test, rg) - step_kustoclusterprincipalassignmentsdelete(test, rg) - cleanup(test, rg) - - -@try_manual -class KustoManagementClientScenarioTest(ScenarioTest): - - @ResourceGroupPreparer(name_prefix='clitestkusto_kustorptest'[:7], key='rg', parameter_name='rg') - def test_kusto(self, rg): - - self.kwargs.update({ - 'subscription_id': self.get_subscription_id() - }) - - self.kwargs.update({ - 'Clusters_4': 'default', - 'AttachedDatabaseConfigurations_3': 'default', - 'leader4': 'leader4', - 'Clusters_2': 'KustoClusterLeader', - 'Clusters_3': 'kustoclusterrptest4', - 'attachedDatabaseConfigurations1': 'attachedDatabaseConfigurations1', - 'AttachedDatabaseConfigurations_2': 'myAttachedDatabaseConfiguration', - 'DataConnections8': 'DataConnections8', - 'DataConnections_2': 'kustoeventhubconnection1', - }) - - call_scenario(self, rg) - raise_if() +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from .. import try_manual, raise_if, calc_coverage +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: KustoClustersCreateOrUpdate +@try_manual +def step_kustoclusterscreateorupdate(test, rg): + test.cmd('az kusto cluster create ' + '--name "{myCluster}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-double-encryption false ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--sku name="Standard_L8s" capacity=2 tier="Standard" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myCluster}", case_sensitive=False), + test.check("identity.type", "SystemAssigned", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("enableDoubleEncryption", False), + test.check("enablePurge", True), + test.check("enableStreamingIngest", True), + test.check("sku.name", "Standard_L8s", case_sensitive=False), + test.check("sku.capacity", 2), + test.check("sku.tier", "Standard", case_sensitive=False), + ]) + test.cmd('az kusto cluster wait --created ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesCreateOrUpdate +@try_manual +def step_kustodatabasescreateorupdate(test, rg): + test.cmd('az kusto database create ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--read-write-database location="westus" soft-delete-period="P1D" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsCreateOrUpdate +@try_manual +def step_kustodataconnectionscreateorupdate(test, rg): + test.cmd('az kusto data-connection event-hub create ' + '--cluster-name "{myCluster}" ' + '--name "{myDataConnection}" ' + '--database-name "KustoDatabase8" ' + '--location "westus" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: AttachedDatabaseConfigurationsCreateOrUpdate +@try_manual +def step_attacheddatabaseconfigurationscreateorupdate(test, rg): + test.cmd('az kusto attached-database-configuration create ' + '--name "{myAttachedDatabaseConfiguration2}" ' + '--cluster-name "{myCluster}" ' + '--location "westus" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/Clu' + 'sters/{myCluster3}" ' + '--database-name "kustodatabase" ' + '--default-principals-modification-kind "Union" ' + '--resource-group "{rg}"', + checks=[ + test.check("location", "westus", case_sensitive=False), + test.check("clusterResourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Micros" + "oft.Kusto/Clusters/{myCluster3}", case_sensitive=False), + test.check("defaultPrincipalsModificationKind", "Union", case_sensitive=False), + ]) + test.cmd('az kusto attached-database-configuration wait --created ' + '--name "{myAttachedDatabaseConfiguration2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: AttachedDatabaseConfigurationsGet +@try_manual +def step_attacheddatabaseconfigurationsget(test, rg): + test.cmd('az kusto attached-database-configuration show ' + '--name "{myAttachedDatabaseConfiguration2}" ' + '--cluster-name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[ + test.check("location", "westus", case_sensitive=False), + test.check("defaultPrincipalsModificationKind", "Union", case_sensitive=False), + ]) + + +# EXAMPLE: KustoDataConnectionsGet +@try_manual +def step_kustodataconnectionsget(test, rg): + test.cmd('az kusto data-connection show ' + '--cluster-name "{myCluster}" ' + '--name "{myDataConnection}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[ + test.check("location", "westus", case_sensitive=False), + test.check("consumerGroup", "testConsumerGroup1", case_sensitive=False), + test.check("eventHubResourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Micro" + "soft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1", case_sensitive=False), + ]) + + +# EXAMPLE: KustoDatabasesListByCluster +@try_manual +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' + '--cluster-name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoAttachedDatabaseConfigurationsListByCluster +@try_manual +def step_kustoattacheddatabaseconfigurationslistbyclus(test, rg): + test.cmd('az kusto attached-database-configuration list ' + '--cluster-name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: KustoDatabasesGet +@try_manual +def step_kustodatabasesget(test, rg): + test.cmd('az kusto database show ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesListByCluster +@try_manual +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' + '--cluster-name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersListResourceSkus +@try_manual +def step_kustoclusterslistresourceskus(test, rg): + test.cmd('az kusto cluster list-sku ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersGet +@try_manual +def step_kustoclustersget(test, rg): + test.cmd('az kusto cluster show ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myCluster}", case_sensitive=False), + test.check("identity.type", "SystemAssigned", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("enableStreamingIngest", True), + test.check("sku.name", "Standard_L8s", case_sensitive=False), + test.check("sku.capacity", 2), + test.check("sku.tier", "Standard", case_sensitive=False), + ]) + + +# EXAMPLE: KustoClustersListByResourceGroup +@try_manual +def step_kustoclusterslistbyresourcegroup(test, rg): + test.cmd('az kusto cluster list ' + '--resource-group "{rg}"', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: KustoClustersList +@try_manual +def step_kustoclusterslist(test, rg): + test.cmd('az kusto cluster list ' + '-g ""', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: KustoClustersListSkus +@try_manual +def step_kustoclusterslistskus(test, rg): + test.cmd('az kusto cluster list-sku ' + '-g ""', + checks=[]) + + +# EXAMPLE: KustoOperationsList +@try_manual +def step_kustooperationslist(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: KustoDataConnectionsUpdate +@try_manual +def step_kustodataconnectionsupdate(test, rg): + test.cmd('az kusto data-connection event-hub update ' + '--cluster-name "{myCluster}" ' + '--name "{myDataConnection}" ' + '--database-name "KustoDatabase8" ' + '--location "westus" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionValidation +@try_manual +def step_kustodataconnectionvalidation(test, rg): + test.cmd('az kusto data-connection event-hub data-connection-validation ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--name "{myDataConnection}" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsCheckNameAvailability +@try_manual +def step_kustodataconnectionschecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: KustoDatabaseRemovePrincipals +@try_manual +def step_kustodatabaseremoveprincipals(test, rg): + test.cmd('az kusto database remove-principal ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' + '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' + '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabaseListPrincipals +@try_manual +def step_kustodatabaselistprincipals(test, rg): + test.cmd('az kusto database list-principal ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabaseAddPrincipals +@try_manual +def step_kustodatabaseaddprincipals(test, rg): + test.cmd('az kusto database add-principal ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' + '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' + '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesUpdate +@try_manual +def step_kustodatabasesupdate(test, rg): + test.cmd('az kusto database update ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--parameters "{{\\"properties\\":{{\\"softDeletePeriod\\":\\"P1D\\"}}}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClusterDetachFollowerDatabases +@try_manual +def step_kustoclusterdetachfollowerdatabases(test, rg): + test.cmd('az kusto cluster detach-follower-database ' + '--name "{myCluster}" ' + '--attached-database-configuration-name "{myAttachedDatabaseConfiguration}" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/clu' + 'sters/{myCluster2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabaseCheckNameAvailability +@try_manual +def step_kustodatabasechecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: KustoClusterListFollowerDatabases +@try_manual +def step_kustoclusterlistfollowerdatabases(test, rg): + test.cmd('az kusto cluster list-follower-database ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersStart +@try_manual +def step_kustoclustersstart(test, rg): + test.cmd('az kusto cluster start ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersStop +@try_manual +def step_kustoclustersstop(test, rg): + test.cmd('az kusto cluster stop ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersUpdate +@try_manual +def step_kustoclustersupdate(test, rg): + test.cmd('az kusto cluster update ' + '--name "{myCluster}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--key-vault-properties key-name="keyName" key-vault-uri="https://dummy.keyvault.com" ' + 'key-version="keyVersion" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myCluster}", case_sensitive=False), + test.check("identity.type", "SystemAssigned", case_sensitive=False), + test.check("location", "westus", case_sensitive=False), + test.check("enablePurge", True), + test.check("enableStreamingIngest", True), + test.check("keyVaultProperties.keyName", "keyName", case_sensitive=False), + test.check("keyVaultProperties.keyVaultUri", "https://dummy.keyvault.com", case_sensitive=False), + test.check("keyVaultProperties.keyVersion", "keyVersion", case_sensitive=False), + ]) + + +# EXAMPLE: KustoClustersCheckNameAvailability +@try_manual +def step_kustoclusterschecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: AttachedDatabaseConfigurationsDelete +@try_manual +def step_attacheddatabaseconfigurationsdelete(test, rg): + test.cmd('az kusto attached-database-configuration delete -y ' + '--name "{myAttachedDatabaseConfiguration2}" ' + '--cluster-name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsDelete +@try_manual +def step_kustodataconnectionsdelete(test, rg): + test.cmd('az kusto data-connection delete -y ' + '--cluster-name "{myCluster}" ' + '--name "{myDataConnection2}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesDelete +@try_manual +def step_kustodatabasesdelete(test, rg): + test.cmd('az kusto database delete -y ' + '--cluster-name "{myCluster}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersDelete +@try_manual +def step_kustoclustersdelete(test, rg): + test.cmd('az kusto cluster delete -y ' + '--name "{myCluster}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasePrincipalAssignmentsGet +@try_manual +def step_kustodatabaseprincipalassignmentsget(test, rg): + test.cmd('az kusto database-principal-assignment show ' + '--cluster-name "{myCluster}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasePrincipalAssignmentsCreateOrUpdate +@try_manual +def step_kustodatabaseprincipalassignmentscreateorupda(test, rg): + test.cmd('az kusto database-principal-assignment create ' + '--cluster-name "{myCluster}" ' + '--database-name "Kustodatabase8" ' + '--principal-id "87654321-1234-1234-1234-123456789123" ' + '--principal-type "App" ' + '--role "Admin" ' + '--tenant-id "12345678-1234-1234-1234-123456789123" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasePrincipalAssignmentsDelete +@try_manual +def step_kustodatabaseprincipalassignmentsdelete(test, rg): + test.cmd('az kusto database-principal-assignment delete -y ' + '--cluster-name "{myCluster}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClusterPrincipalAssignmentsGet +@try_manual +def step_kustoclusterprincipalassignmentsget(test, rg): + test.cmd('az kusto cluster-principal-assignment show ' + '--cluster-name "{myCluster}" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClusterPrincipalAssignmentsCreateOrUpdate +@try_manual +def step_kustoclusterprincipalassignmentscreateorupdat(test, rg): + test.cmd('az kusto cluster-principal-assignment create ' + '--cluster-name "{myCluster}" ' + '--principal-id "87654321-1234-1234-1234-123456789123" ' + '--principal-type "App" ' + '--role "AllDatabasesAdmin" ' + '--tenant-id "12345678-1234-1234-1234-123456789123" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClusterPrincipalAssignmentsDelete +@try_manual +def step_kustoclusterprincipalassignmentsdelete(test, rg): + test.cmd('az kusto cluster-principal-assignment delete -y ' + '--cluster-name "{myCluster}" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step_kustoclusterscreateorupdate(test, rg) + step_kustodatabasescreateorupdate(test, rg) + step_kustodataconnectionscreateorupdate(test, rg) + step_attacheddatabaseconfigurationscreateorupdate(test, rg) + step_attacheddatabaseconfigurationsget(test, rg) + step_kustodataconnectionsget(test, rg) + step_kustodatabaseslistbycluster(test, rg) + step_kustoattacheddatabaseconfigurationslistbyclus(test, rg) + step_kustodatabasesget(test, rg) + step_kustodatabaseslistbycluster(test, rg) + step_kustoclusterslistresourceskus(test, rg) + step_kustoclustersget(test, rg) + step_kustoclusterslistbyresourcegroup(test, rg) + step_kustoclusterslist(test, rg) + step_kustoclusterslistskus(test, rg) + step_kustooperationslist(test, rg) + step_kustodataconnectionsupdate(test, rg) + step_kustodataconnectionvalidation(test, rg) + step_kustodataconnectionschecknameavailability(test, rg) + step_kustodatabaseremoveprincipals(test, rg) + step_kustodatabaselistprincipals(test, rg) + step_kustodatabaseaddprincipals(test, rg) + step_kustodatabasesupdate(test, rg) + step_kustoclusterdetachfollowerdatabases(test, rg) + step_kustodatabasechecknameavailability(test, rg) + step_kustoclusterlistfollowerdatabases(test, rg) + step_kustoclustersstart(test, rg) + step_kustoclustersstop(test, rg) + step_kustoclustersupdate(test, rg) + step_kustoclusterschecknameavailability(test, rg) + step_attacheddatabaseconfigurationsdelete(test, rg) + step_kustodataconnectionsdelete(test, rg) + step_kustodatabasesdelete(test, rg) + step_kustoclustersdelete(test, rg) + step_kustodatabaseprincipalassignmentsget(test, rg) + step_kustodatabaseprincipalassignmentscreateorupda(test, rg) + step_kustodatabaseprincipalassignmentsdelete(test, rg) + step_kustoclusterprincipalassignmentsget(test, rg) + step_kustoclusterprincipalassignmentscreateorupdat(test, rg) + step_kustoclusterprincipalassignmentsdelete(test, rg) + cleanup(test, rg) + + +@try_manual +class KustoManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestkusto_kustorptest'[:7], key='rg', parameter_name='rg') + def test_kusto(self, rg): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myCluster4': 'default', + 'myAttachedDatabaseConfiguration3': 'default', + 'myCluster2': 'leader4', + 'myCluster3': 'KustoClusterLeader', + 'myCluster': 'kustoclusterrptest4', + 'myAttachedDatabaseConfiguration': 'myAttachedDatabaseConfiguration', + 'myAttachedDatabaseConfiguration2': 'attachedDatabaseConfigurations1', + 'myDataConnection': 'DataConnections8', + 'myDataConnection2': 'kustoeventhubconnection1', + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/kusto/azext_kusto/vendored_sdks/__init__.py b/src/kusto/azext_kusto/vendored_sdks/__init__.py index ee0c4f36bd0..c9cfdc73e77 100644 --- a/src/kusto/azext_kusto/vendored_sdks/__init__.py +++ b/src/kusto/azext_kusto/vendored_sdks/__init__.py @@ -1,12 +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__) +# 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__) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py index 1400c9fa9c1..09dc5c9bdea 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py @@ -10,7 +10,7 @@ __all__ = ['KustoManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py index ee4c2c9c9ac..d0716096c41 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -61,6 +62,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py deleted file mode 100644 index 60c349ae6a8..00000000000 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py index e1c166820e5..e5b678f2528 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -57,6 +58,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py index f42d9b81c9c..85d845459da 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -66,6 +66,10 @@ def list_by_cluster( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_cluster.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -157,7 +157,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -212,7 +211,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'AttachedDatabaseConfiguration') body_content_kwargs['content'] = body_content @@ -225,7 +223,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) @@ -241,7 +238,7 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, @@ -251,7 +248,7 @@ async def create_or_update( cluster_resource_id: Optional[str] = None, default_principals_modification_kind: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] = None, **kwargs - ) -> "models.AttachedDatabaseConfiguration": + ) -> AsyncLROPoller["models.AttachedDatabaseConfiguration"]: """Creates or updates an attached database configuration. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -263,20 +260,21 @@ async def create_or_update( :param location: Resource location. :type location: str :param database_name: The name of the database which you would like to attach, use * if you - want to follow all current and future databases. + want to follow all current and future databases. :type database_name: str :param cluster_resource_id: The resource id of the cluster where the databases you would like - to attach reside. + to attach reside. :type cluster_resource_id: str :param default_principals_modification_kind: The default principals modification kind. :type default_principals_modification_kind: str or ~kusto_management_client.models.DefaultPrincipalsModificationKind :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: AttachedDatabaseConfiguration, or the result of cls(response) - :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration + :return: An instance of AsyncLROPoller that returns either AttachedDatabaseConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.AttachedDatabaseConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -285,17 +283,19 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -310,8 +310,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore async def _delete_initial( self, @@ -342,7 +350,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -356,13 +363,13 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, attached_database_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the attached database configuration with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -372,12 +379,13 @@ async def delete( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -386,13 +394,15 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -404,5 +414,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py index 382ed19396a..7cece2f512f 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -145,7 +144,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'Cluster') body_content_kwargs['content'] = body_content @@ -158,7 +156,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', pipeline_response) @@ -171,7 +168,7 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, @@ -190,7 +187,7 @@ async def create_or_update( type: Optional[Union[str, "models.IdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs - ) -> "models.Cluster": + ) -> AsyncLROPoller["models.Cluster"]: """Create or update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -210,10 +207,10 @@ async def create_or_update( :param optimized_autoscale: Optimized auto scale definition. :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are - encrypted. + encrypted. :type enable_disk_encryption: bool :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is - enabled. + enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration @@ -222,21 +219,22 @@ async def create_or_update( :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool :param enable_double_encryption: A boolean value that indicates if double encryption is - enabled. + enabled. :type enable_double_encryption: bool :param type: The identity type. :type type: str or ~kusto_management_client.models.IdentityType :param user_assigned_identities: The list of user identities associated with the Kusto cluster. - The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Cluster, or the result of cls(response) - :rtype: ~kusto_management_client.models.Cluster + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -245,26 +243,28 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - location=location, - sku=sku, - tags=tags, - zones=zones, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=type, - user_assigned_identities=user_assigned_identities, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + location=location, + sku=sku, + tags=tags, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -279,8 +279,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _update_initial( self, @@ -327,7 +335,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'ClusterUpdate') body_content_kwargs['content'] = body_content @@ -340,7 +347,6 @@ async def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', pipeline_response) @@ -356,7 +362,7 @@ async def _update_initial( return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore - async def update( + async def begin_update( self, resource_group_name: str, cluster_name: str, @@ -374,7 +380,7 @@ async def update( type: Optional[Union[str, "models.IdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs - ) -> "models.Cluster": + ) -> AsyncLROPoller["models.Cluster"]: """Update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -392,10 +398,10 @@ async def update( :param optimized_autoscale: Optimized auto scale definition. :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are - encrypted. + encrypted. :type enable_disk_encryption: bool :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is - enabled. + enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration @@ -404,21 +410,22 @@ async def update( :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool :param enable_double_encryption: A boolean value that indicates if double encryption is - enabled. + enabled. :type enable_double_encryption: bool :param type: The identity type. :type type: str or ~kusto_management_client.models.IdentityType :param user_assigned_identities: The list of user identities associated with the Kusto cluster. - The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Cluster, or the result of cls(response) - :rtype: ~kusto_management_client.models.Cluster + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -427,25 +434,27 @@ async def update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=type, - user_assigned_identities=user_assigned_identities, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -460,8 +469,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _delete_initial( self, @@ -490,7 +507,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -504,12 +520,12 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -517,12 +533,13 @@ async def delete( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -531,12 +548,14 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -548,8 +567,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _stop_initial( self, @@ -578,7 +605,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -592,12 +618,12 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore - async def stop( + async def begin_stop( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -605,12 +631,13 @@ async def stop( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -619,12 +646,14 @@ async def stop( 'polling_interval', self._config.polling_interval ) - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -636,8 +665,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore async def _start_initial( self, @@ -666,7 +703,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -680,12 +716,12 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore - async def start( + async def begin_start( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -693,12 +729,13 @@ async def start( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -707,12 +744,14 @@ async def start( 'polling_interval', self._config.polling_interval ) - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -724,8 +763,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore def list_follower_database( self, @@ -733,7 +780,8 @@ def list_follower_database( cluster_name: str, **kwargs ) -> AsyncIterable["models.FollowerDatabaseListResult"]: - """Returns a list of databases that are owned by this cluster and were followed by another cluster. + """Returns a list of databases that are owned by this cluster and were followed by another + cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str @@ -750,6 +798,10 @@ def list_follower_database( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_follower_database.metadata['url'] # type: ignore @@ -763,15 +815,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -831,7 +879,6 @@ async def _detach_follower_database_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_follower_database_to_remove, 'FollowerDatabaseDefinition') body_content_kwargs['content'] = body_content @@ -849,14 +896,14 @@ async def _detach_follower_database_initial( _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore - async def detach_follower_database( + async def begin_detach_follower_database( self, resource_group_name: str, cluster_name: str, cluster_resource_id: str, attached_database_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Detaches all followers of a database owned by this cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -864,18 +911,19 @@ async def detach_follower_database( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param cluster_resource_id: Resource id of the cluster that follows a database owned by this - cluster. + cluster. :type cluster_resource_id: str :param attached_database_configuration_name: Resource name of the attached database - configuration in the follower cluster. + configuration in the follower cluster. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -884,14 +932,16 @@ async def detach_follower_database( 'polling_interval', self._config.polling_interval ) - raw_result = await self._detach_follower_database_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_resource_id=cluster_resource_id, - attached_database_configuration_name=attached_database_configuration_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._detach_follower_database_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -903,16 +953,24 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore async def _diagnose_virtual_network_initial( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.DiagnoseVirtualNetworkResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + ) -> Optional["models.DiagnoseVirtualNetworkResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DiagnoseVirtualNetworkResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-06-14" @@ -934,7 +992,6 @@ async def _diagnose_virtual_network_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -953,25 +1010,27 @@ async def _diagnose_virtual_network_initial( return deserialized _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore - async def diagnose_virtual_network( + async def begin_diagnose_virtual_network( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.DiagnoseVirtualNetworkResult": - """Diagnoses network connectivity status for external resources on which the service is dependent on. + ) -> AsyncLROPoller["models.DiagnoseVirtualNetworkResult"]: + """Diagnoses network connectivity status for external resources on which the service is dependent + on. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: DiagnoseVirtualNetworkResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DiagnoseVirtualNetworkResult + :return: An instance of AsyncLROPoller that returns either DiagnoseVirtualNetworkResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DiagnoseVirtualNetworkResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -980,12 +1039,14 @@ async def diagnose_virtual_network( 'polling_interval', self._config.polling_interval ) - raw_result = await self._diagnose_virtual_network_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._diagnose_virtual_network_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1000,8 +1061,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore def list_by_resource_group( self, @@ -1023,6 +1092,10 @@ def list_by_resource_group( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -1035,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1087,6 +1156,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -1098,15 +1171,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1150,6 +1219,10 @@ def list_sku( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_sku.metadata['url'] # type: ignore @@ -1161,15 +1234,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1241,7 +1310,6 @@ async def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_cluster_name, 'ClusterCheckNameRequest') body_content_kwargs['content'] = body_content @@ -1285,6 +1353,10 @@ def list_sku_by_resource( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_sku_by_resource.metadata['url'] # type: ignore @@ -1298,15 +1370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1356,6 +1424,10 @@ def list_language_extension( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_language_extension.metadata['url'] # type: ignore @@ -1369,15 +1441,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1436,7 +1504,6 @@ async def _add_language_extension_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_language_extensions_to_add, 'LanguageExtensionsList') body_content_kwargs['content'] = body_content @@ -1454,13 +1521,13 @@ async def _add_language_extension_initial( _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore - async def add_language_extension( + async def begin_add_language_extension( self, resource_group_name: str, cluster_name: str, value: Optional[List["models.LanguageExtension"]] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Add a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1470,12 +1537,13 @@ async def add_language_extension( :param value: The list of language extensions. :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1484,13 +1552,15 @@ async def add_language_extension( 'polling_interval', self._config.polling_interval ) - raw_result = await self._add_language_extension_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._add_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1502,8 +1572,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore async def _remove_language_extension_initial( self, @@ -1537,7 +1615,6 @@ async def _remove_language_extension_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_language_extensions_to_remove, 'LanguageExtensionsList') body_content_kwargs['content'] = body_content @@ -1555,13 +1632,13 @@ async def _remove_language_extension_initial( _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore - async def remove_language_extension( + async def begin_remove_language_extension( self, resource_group_name: str, cluster_name: str, value: Optional[List["models.LanguageExtension"]] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Remove a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1571,12 +1648,13 @@ async def remove_language_extension( :param value: The list of language extensions. :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1585,13 +1663,15 @@ async def remove_language_extension( 'polling_interval', self._config.polling_interval ) - raw_result = await self._remove_language_extension_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._remove_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1603,5 +1683,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py index 9c35c6bb8c0..74705b72f2c 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -92,7 +92,6 @@ async def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') body_content_kwargs['content'] = body_content @@ -156,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -211,7 +209,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'ClusterPrincipalAssignment') body_content_kwargs['content'] = body_content @@ -224,7 +221,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) @@ -237,7 +233,7 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, @@ -247,7 +243,7 @@ async def create_or_update( tenant_id: Optional[str] = None, principal_type: Optional[Union[str, "models.PrincipalType"]] = None, **kwargs - ) -> "models.ClusterPrincipalAssignment": + ) -> AsyncLROPoller["models.ClusterPrincipalAssignment"]: """Create a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -257,7 +253,7 @@ async def create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param principal_id: The principal ID assigned to the cluster principal. It can be a user - email, application ID, or security group name. + email, application ID, or security group name. :type principal_id: str :param role: Cluster principal role. :type role: str or ~kusto_management_client.models.ClusterPrincipalRole @@ -266,12 +262,13 @@ async def create_or_update( :param principal_type: Principal type. :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: ClusterPrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment + :return: An instance of AsyncLROPoller that returns either ClusterPrincipalAssignment or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.ClusterPrincipalAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -280,17 +277,19 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -305,8 +304,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _delete_initial( self, @@ -337,7 +344,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -351,13 +357,13 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, principal_assignment_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -367,12 +373,13 @@ async def delete( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,13 +388,15 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -399,8 +408,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, @@ -425,6 +442,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -438,15 +459,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py index b4a7b8ff101..97abdd3af9c 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -69,6 +69,10 @@ def list_by_database( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_database.metadata['url'] # type: ignore @@ -83,15 +87,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,8 +126,8 @@ async def _data_connection_validation_initial( data_connection_name: Optional[str] = None, properties: Optional["models.DataConnection"] = None, **kwargs - ) -> "models.DataConnectionValidationListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + ) -> Optional["models.DataConnectionValidationListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DataConnectionValidationListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) @@ -154,7 +154,6 @@ async def _data_connection_validation_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'DataConnectionValidation') body_content_kwargs['content'] = body_content @@ -177,7 +176,7 @@ async def _data_connection_validation_initial( return deserialized _data_connection_validation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore - async def data_connection_validation( + async def begin_data_connection_validation( self, resource_group_name: str, cluster_name: str, @@ -185,7 +184,7 @@ async def data_connection_validation( data_connection_name: Optional[str] = None, properties: Optional["models.DataConnection"] = None, **kwargs - ) -> "models.DataConnectionValidationListResult": + ) -> AsyncLROPoller["models.DataConnectionValidationListResult"]: """Checks that the data connection parameters are valid. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -199,12 +198,13 @@ async def data_connection_validation( :param properties: The data connection properties to validate. :type properties: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: DataConnectionValidationListResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DataConnectionValidationListResult + :return: An instance of AsyncLROPoller that returns either DataConnectionValidationListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnectionValidationListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -213,15 +213,17 @@ async def data_connection_validation( 'polling_interval', self._config.polling_interval ) - raw_result = await self._data_connection_validation_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._data_connection_validation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -236,8 +238,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore async def check_name_availability( self, @@ -292,7 +302,6 @@ async def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_data_connection_name, 'DataConnectionCheckNameRequest') body_content_kwargs['content'] = body_content @@ -360,7 +369,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -412,7 +420,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DataConnection') body_content_kwargs['content'] = body_content @@ -425,7 +432,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DataConnection', pipeline_response) @@ -441,7 +447,7 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, @@ -449,7 +455,7 @@ async def create_or_update( data_connection_name: str, parameters: "models.DataConnection", **kwargs - ) -> "models.DataConnection": + ) -> AsyncLROPoller["models.DataConnection"]: """Creates or updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -463,12 +469,13 @@ async def create_or_update( :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: DataConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.DataConnection + :return: An instance of AsyncLROPoller that returns either DataConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -477,15 +484,17 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -500,8 +509,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def _update_initial( self, @@ -538,7 +555,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DataConnection') body_content_kwargs['content'] = body_content @@ -551,7 +567,6 @@ async def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DataConnection', pipeline_response) @@ -567,7 +582,7 @@ async def _update_initial( return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore - async def update( + async def begin_update( self, resource_group_name: str, cluster_name: str, @@ -575,7 +590,7 @@ async def update( data_connection_name: str, parameters: "models.DataConnection", **kwargs - ) -> "models.DataConnection": + ) -> AsyncLROPoller["models.DataConnection"]: """Updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -589,12 +604,13 @@ async def update( :param parameters: The data connection parameters supplied to the Update operation. :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: DataConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.DataConnection + :return: An instance of AsyncLROPoller that returns either DataConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -603,15 +619,17 @@ async def update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -626,8 +644,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def _delete_initial( self, @@ -660,7 +686,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -674,14 +699,14 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, database_name: str, data_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the data connection with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -693,12 +718,13 @@ async def delete( :param data_connection_name: The name of the data connection. :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -707,14 +733,16 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -726,5 +754,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py index 340064db262..9756c8ac79e 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -92,7 +92,6 @@ async def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_resource_name, 'CheckNameRequest') body_content_kwargs['content'] = body_content @@ -136,6 +135,10 @@ def list_by_cluster( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_cluster.metadata['url'] # type: ignore @@ -149,15 +152,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -227,7 +226,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -277,7 +275,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Database') body_content_kwargs['content'] = body_content @@ -290,7 +287,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Database', pipeline_response) @@ -306,14 +302,14 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, database_name: str, parameters: "models.Database", **kwargs - ) -> "models.Database": + ) -> AsyncLROPoller["models.Database"]: """Creates or updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -325,12 +321,13 @@ async def create_or_update( :param parameters: The database parameters supplied to the CreateOrUpdate operation. :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Database, or the result of cls(response) - :rtype: ~kusto_management_client.models.Database + :return: An instance of AsyncLROPoller that returns either Database or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -339,14 +336,16 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -361,8 +360,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def _update_initial( self, @@ -397,7 +404,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Database') body_content_kwargs['content'] = body_content @@ -410,7 +416,6 @@ async def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Database', pipeline_response) @@ -426,14 +431,14 @@ async def _update_initial( return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore - async def update( + async def begin_update( self, resource_group_name: str, cluster_name: str, database_name: str, parameters: "models.Database", **kwargs - ) -> "models.Database": + ) -> AsyncLROPoller["models.Database"]: """Updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -445,12 +450,13 @@ async def update( :param parameters: The database parameters supplied to the Update operation. :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Database, or the result of cls(response) - :rtype: ~kusto_management_client.models.Database + :return: An instance of AsyncLROPoller that returns either Database or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,14 +465,16 @@ async def update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -481,8 +489,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def _delete_initial( self, @@ -513,7 +529,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -527,13 +542,13 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, database_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the database with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -543,12 +558,13 @@ async def delete( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -557,13 +573,15 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -575,8 +593,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def list_principal( self, @@ -604,6 +630,10 @@ def list_principal( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_principal.metadata['url'] # type: ignore @@ -618,15 +648,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -703,7 +729,6 @@ async def add_principal( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_database_principals_to_add, 'DatabasePrincipalListRequest') body_content_kwargs['content'] = body_content @@ -774,7 +799,6 @@ async def remove_principal( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_database_principals_to_remove, 'DatabasePrincipalListRequest') body_content_kwargs['content'] = body_content diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py index 4a483658e04..a2a28737c0a 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -96,7 +96,6 @@ async def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') body_content_kwargs['content'] = body_content @@ -164,7 +163,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -221,7 +219,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'DatabasePrincipalAssignment') body_content_kwargs['content'] = body_content @@ -234,7 +231,6 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) @@ -247,7 +243,7 @@ async def _create_or_update_initial( return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, @@ -258,7 +254,7 @@ async def create_or_update( tenant_id: Optional[str] = None, principal_type: Optional[Union[str, "models.PrincipalType"]] = None, **kwargs - ) -> "models.DatabasePrincipalAssignment": + ) -> AsyncLROPoller["models.DatabasePrincipalAssignment"]: """Creates a Kusto cluster database principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -270,7 +266,7 @@ async def create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param principal_id: The principal ID assigned to the database principal. It can be a user - email, application ID, or security group name. + email, application ID, or security group name. :type principal_id: str :param role: Database principal role. :type role: str or ~kusto_management_client.models.DatabasePrincipalRole @@ -279,12 +275,13 @@ async def create_or_update( :param principal_type: Principal type. :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: DatabasePrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment + :return: An instance of AsyncLROPoller that returns either DatabasePrincipalAssignment or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DatabasePrincipalAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -293,18 +290,20 @@ async def create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -319,8 +318,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _delete_initial( self, @@ -353,7 +360,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -367,14 +373,14 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore - async def delete( + async def begin_delete( self, resource_group_name: str, cluster_name: str, database_name: str, principal_assignment_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a Kusto principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -386,12 +392,13 @@ async def delete( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -400,14 +407,16 @@ async def delete( 'polling_interval', self._config.polling_interval ) - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -419,8 +428,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, @@ -448,6 +465,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -462,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py index d8d07749184..3a7f0aeac16 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py index c3c671d73ac..d4d27da772f 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py @@ -6,239 +6,257 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - -class AzureScaleType(str, Enum): +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AzureScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Scale type. """ - automatic = "automatic" - manual = "manual" - none = "none" + AUTOMATIC = "automatic" + MANUAL = "manual" + NONE = "none" -class AzureSkuName(str, Enum): +class AzureSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """SKU name. """ - standard_ds13_v2_1_tb_ps = "Standard_DS13_v2+1TB_PS" - standard_ds13_v2_2_tb_ps = "Standard_DS13_v2+2TB_PS" - standard_ds14_v2_3_tb_ps = "Standard_DS14_v2+3TB_PS" - standard_ds14_v2_4_tb_ps = "Standard_DS14_v2+4TB_PS" - standard_d13_v2 = "Standard_D13_v2" - standard_d14_v2 = "Standard_D14_v2" - standard_l8_s = "Standard_L8s" - standard_l16_s = "Standard_L16s" - standard_d11_v2 = "Standard_D11_v2" - standard_d12_v2 = "Standard_D12_v2" - standard_l4_s = "Standard_L4s" - dev_no_sla_standard_d11_v2 = "Dev(No SLA)_Standard_D11_v2" - standard_e2_a_v4 = "Standard_E2a_v4" - standard_e4_a_v4 = "Standard_E4a_v4" - standard_e8_a_v4 = "Standard_E8a_v4" - standard_e16_a_v4 = "Standard_E16a_v4" - standard_e8_as_v4_1_tb_ps = "Standard_E8as_v4+1TB_PS" - standard_e8_as_v4_2_tb_ps = "Standard_E8as_v4+2TB_PS" - standard_e16_as_v4_3_tb_ps = "Standard_E16as_v4+3TB_PS" - standard_e16_as_v4_4_tb_ps = "Standard_E16as_v4+4TB_PS" - dev_no_sla_standard_e2_a_v4 = "Dev(No SLA)_Standard_E2a_v4" - -class AzureSkuTier(str, Enum): + STANDARD_DS13_V2_1_TB_PS = "Standard_DS13_v2+1TB_PS" + STANDARD_DS13_V2_2_TB_PS = "Standard_DS13_v2+2TB_PS" + STANDARD_DS14_V2_3_TB_PS = "Standard_DS14_v2+3TB_PS" + STANDARD_DS14_V2_4_TB_PS = "Standard_DS14_v2+4TB_PS" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_L4_S = "Standard_L4s" + DEV_NO_SLA_STANDARD_D11_V2 = "Dev(No SLA)_Standard_D11_v2" + STANDARD_E2_A_V4 = "Standard_E2a_v4" + STANDARD_E4_A_V4 = "Standard_E4a_v4" + STANDARD_E8_A_V4 = "Standard_E8a_v4" + STANDARD_E16_A_V4 = "Standard_E16a_v4" + STANDARD_E8_AS_V4_1_TB_PS = "Standard_E8as_v4+1TB_PS" + STANDARD_E8_AS_V4_2_TB_PS = "Standard_E8as_v4+2TB_PS" + STANDARD_E16_AS_V4_3_TB_PS = "Standard_E16as_v4+3TB_PS" + STANDARD_E16_AS_V4_4_TB_PS = "Standard_E16as_v4+4TB_PS" + DEV_NO_SLA_STANDARD_E2_A_V4 = "Dev(No SLA)_Standard_E2a_v4" + +class AzureSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """SKU tier. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class BlobStorageEventType(str, Enum): +class BlobStorageEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The name of blob storage event type to process. """ - microsoft_storage_blob_created = "Microsoft.Storage.BlobCreated" - microsoft_storage_blob_renamed = "Microsoft.Storage.BlobRenamed" + MICROSOFT_STORAGE_BLOB_CREATED = "Microsoft.Storage.BlobCreated" + MICROSOFT_STORAGE_BLOB_RENAMED = "Microsoft.Storage.BlobRenamed" -class ClusterPrincipalRole(str, Enum): +class ClusterPrincipalRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Cluster principal role. """ - all_databases_admin = "AllDatabasesAdmin" - all_databases_viewer = "AllDatabasesViewer" + ALL_DATABASES_ADMIN = "AllDatabasesAdmin" + ALL_DATABASES_VIEWER = "AllDatabasesViewer" -class Compression(str, Enum): +class Compression(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The compression type """ - none = "None" - g_zip = "GZip" + NONE = "None" + G_ZIP = "GZip" -class DatabasePrincipalRole(str, Enum): +class DatabasePrincipalRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Database principal role. """ - admin = "Admin" - ingestor = "Ingestor" - monitor = "Monitor" - user = "User" - unrestricted_viewers = "UnrestrictedViewers" - viewer = "Viewer" + ADMIN = "Admin" + INGESTOR = "Ingestor" + MONITOR = "Monitor" + USER = "User" + UNRESTRICTED_VIEWERS = "UnrestrictedViewers" + VIEWER = "Viewer" -class DatabasePrincipalType(str, Enum): +class DatabasePrincipalType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Database principal type. """ - app = "App" - group = "Group" - user = "User" + APP = "App" + GROUP = "Group" + USER = "User" -class DefaultPrincipalsModificationKind(str, Enum): +class DefaultPrincipalsModificationKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The default principals modification kind """ - union = "Union" - replace = "Replace" - none = "None" + UNION = "Union" + REPLACE = "Replace" + NONE = "None" -class EventGridDataFormat(str, Enum): +class EventGridDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The data format of the message. Optionally the data format can be added to each message. """ - multijson = "MULTIJSON" - json = "JSON" - csv = "CSV" - tsv = "TSV" - scsv = "SCSV" - sohsv = "SOHSV" - psv = "PSV" - txt = "TXT" - raw = "RAW" - singlejson = "SINGLEJSON" - avro = "AVRO" - tsve = "TSVE" - parquet = "PARQUET" - orc = "ORC" - apacheavro = "APACHEAVRO" - w3_clogfile = "W3CLOGFILE" - -class EventHubDataFormat(str, Enum): + MULTIJSON = "MULTIJSON" + JSON = "JSON" + CSV = "CSV" + TSV = "TSV" + SCSV = "SCSV" + SOHSV = "SOHSV" + PSV = "PSV" + TXT = "TXT" + RAW = "RAW" + SINGLEJSON = "SINGLEJSON" + AVRO = "AVRO" + TSVE = "TSVE" + PARQUET = "PARQUET" + ORC = "ORC" + APACHEAVRO = "APACHEAVRO" + W3_CLOGFILE = "W3CLOGFILE" + +class EventHubDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The data format of the message. Optionally the data format can be added to each message. """ - multijson = "MULTIJSON" - json = "JSON" - csv = "CSV" - tsv = "TSV" - scsv = "SCSV" - sohsv = "SOHSV" - psv = "PSV" - txt = "TXT" - raw = "RAW" - singlejson = "SINGLEJSON" - avro = "AVRO" - tsve = "TSVE" - parquet = "PARQUET" - orc = "ORC" - apacheavro = "APACHEAVRO" - w3_clogfile = "W3CLOGFILE" - -class IdentityType(str, Enum): + MULTIJSON = "MULTIJSON" + JSON = "JSON" + CSV = "CSV" + TSV = "TSV" + SCSV = "SCSV" + SOHSV = "SOHSV" + PSV = "PSV" + TXT = "TXT" + RAW = "RAW" + SINGLEJSON = "SINGLEJSON" + AVRO = "AVRO" + TSVE = "TSVE" + PARQUET = "PARQUET" + ORC = "ORC" + APACHEAVRO = "APACHEAVRO" + W3_CLOGFILE = "W3CLOGFILE" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The identity type. """ - none = "None" - system_assigned = "SystemAssigned" + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" -class IotHubDataFormat(str, Enum): +class IotHubDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The data format of the message. Optionally the data format can be added to each message. """ - multijson = "MULTIJSON" - json = "JSON" - csv = "CSV" - tsv = "TSV" - scsv = "SCSV" - sohsv = "SOHSV" - psv = "PSV" - txt = "TXT" - raw = "RAW" - singlejson = "SINGLEJSON" - avro = "AVRO" - tsve = "TSVE" - parquet = "PARQUET" - orc = "ORC" - apacheavro = "APACHEAVRO" - w3_clogfile = "W3CLOGFILE" - -class Kind(str, Enum): + MULTIJSON = "MULTIJSON" + JSON = "JSON" + CSV = "CSV" + TSV = "TSV" + SCSV = "SCSV" + SOHSV = "SOHSV" + PSV = "PSV" + TXT = "TXT" + RAW = "RAW" + SINGLEJSON = "SINGLEJSON" + AVRO = "AVRO" + TSVE = "TSVE" + PARQUET = "PARQUET" + ORC = "ORC" + APACHEAVRO = "APACHEAVRO" + W3_CLOGFILE = "W3CLOGFILE" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Kind of the database """ - read_write = "ReadWrite" - read_only_following = "ReadOnlyFollowing" - event_hub = "EventHub" - event_grid = "EventGrid" - iot_hub = "IotHub" + READ_WRITE = "ReadWrite" + READ_ONLY_FOLLOWING = "ReadOnlyFollowing" + EVENT_HUB = "EventHub" + EVENT_GRID = "EventGrid" + IOT_HUB = "IotHub" -class LanguageExtensionName(str, Enum): +class LanguageExtensionName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Language extension that can run within KQL query. """ - python = "PYTHON" - r = "R" + PYTHON = "PYTHON" + R = "R" -class PrincipalsModificationKind(str, Enum): +class PrincipalsModificationKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The principals modification kind of the database """ - union = "Union" - replace = "Replace" - none = "None" + UNION = "Union" + REPLACE = "Replace" + NONE = "None" -class PrincipalType(str, Enum): +class PrincipalType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Principal type. """ - app = "App" - group = "Group" - user = "User" + APP = "App" + GROUP = "Group" + USER = "User" -class ProvisioningState(str, Enum): +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioned state of the resource. """ - running = "Running" - creating = "Creating" - deleting = "Deleting" - succeeded = "Succeeded" - failed = "Failed" - moving = "Moving" + RUNNING = "Running" + CREATING = "Creating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + MOVING = "Moving" -class Reason(str, Enum): +class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Message providing the reason why the given name is invalid. """ - invalid = "Invalid" - already_exists = "AlreadyExists" + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" -class State(str, Enum): +class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The state of the resource. """ - creating = "Creating" - unavailable = "Unavailable" - running = "Running" - deleting = "Deleting" - deleted = "Deleted" - stopping = "Stopping" - stopped = "Stopped" - starting = "Starting" - updating = "Updating" - -class Type(str, Enum): + CREATING = "Creating" + UNAVAILABLE = "Unavailable" + RUNNING = "Running" + DELETING = "Deleting" + DELETED = "Deleted" + STOPPING = "Stopping" + STOPPED = "Stopped" + STARTING = "Starting" + UPDATING = "Updating" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of resource, Microsoft.Kusto/clusters. """ - microsoft_kusto_clusters = "Microsoft.Kusto/clusters" - microsoft_kusto_clusters_databases = "Microsoft.Kusto/clusters/databases" - microsoft_kusto_clusters_attached_database_configurations = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" - microsoft_kusto_clusters_principal_assignments = "Microsoft.Kusto/clusters/principalAssignments" - microsoft_kusto_clusters_databases_data_connections = "Microsoft.Kusto/clusters/databases/dataConnections" - microsoft_kusto_clusters_databases_principal_assignments = "Microsoft.Kusto/clusters/databases/principalAssignments" + MICROSOFT_KUSTO_CLUSTERS = "Microsoft.Kusto/clusters" + MICROSOFT_KUSTO_CLUSTERS_DATABASES = "Microsoft.Kusto/clusters/databases" + MICROSOFT_KUSTO_CLUSTERS_ATTACHED_DATABASE_CONFIGURATIONS = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + MICROSOFT_KUSTO_CLUSTERS_PRINCIPAL_ASSIGNMENTS = "Microsoft.Kusto/clusters/principalAssignments" + MICROSOFT_KUSTO_CLUSTERS_DATABASES_DATA_CONNECTIONS = "Microsoft.Kusto/clusters/databases/dataConnections" + MICROSOFT_KUSTO_CLUSTERS_DATABASES_PRINCIPAL_ASSIGNMENTS = "Microsoft.Kusto/clusters/databases/principalAssignments" diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py index c3b64c97b95..e8b0194f226 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py @@ -920,7 +920,7 @@ def __init__( ): super(Database, self).__init__(**kwargs) self.location = kwargs.get('location', None) - self.kind = 'Database' + self.kind = 'Database' # type: str class DatabaseListResult(msrest.serialization.Model): @@ -1228,7 +1228,7 @@ def __init__( ): super(DataConnection, self).__init__(**kwargs) self.location = kwargs.get('location', None) - self.kind = 'DataConnection' + self.kind = 'DataConnection' # type: str class DataConnectionCheckNameRequest(msrest.serialization.Model): @@ -1441,7 +1441,7 @@ def __init__( **kwargs ): super(EventGridDataConnection, self).__init__(**kwargs) - self.kind = 'EventGrid' + self.kind = 'EventGrid' # type: str self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) self.event_hub_resource_id = kwargs.get('event_hub_resource_id', None) self.consumer_group = kwargs.get('consumer_group', None) @@ -1522,7 +1522,7 @@ def __init__( **kwargs ): super(EventHubDataConnection, self).__init__(**kwargs) - self.kind = 'EventHub' + self.kind = 'EventHub' # type: str self.event_hub_resource_id = kwargs.get('event_hub_resource_id', None) self.consumer_group = kwargs.get('consumer_group', None) self.table_name = kwargs.get('table_name', None) @@ -1660,7 +1660,7 @@ def __init__( **kwargs ): super(IotHubDataConnection, self).__init__(**kwargs) - self.kind = 'IotHub' + self.kind = 'IotHub' # type: str self.iot_hub_resource_id = kwargs.get('iot_hub_resource_id', None) self.consumer_group = kwargs.get('consumer_group', None) self.table_name = kwargs.get('table_name', None) @@ -1998,7 +1998,7 @@ def __init__( **kwargs ): super(ReadOnlyFollowingDatabase, self).__init__(**kwargs) - self.kind = 'ReadOnlyFollowing' + self.kind = 'ReadOnlyFollowing' # type: str self.provisioning_state = None self.soft_delete_period = None self.hot_cache_period = kwargs.get('hot_cache_period', None) @@ -2071,7 +2071,7 @@ def __init__( **kwargs ): super(ReadWriteDatabase, self).__init__(**kwargs) - self.kind = 'ReadWrite' + self.kind = 'ReadWrite' # type: str self.provisioning_state = None self.soft_delete_period = kwargs.get('soft_delete_period', None) self.hot_cache_period = kwargs.get('hot_cache_period', None) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py index 8088db1deaa..2ebd80310a5 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py @@ -1007,7 +1007,7 @@ def __init__( ): super(Database, self).__init__(**kwargs) self.location = location - self.kind: str = 'Database' + self.kind = 'Database' # type: str class DatabaseListResult(msrest.serialization.Model): @@ -1342,7 +1342,7 @@ def __init__( ): super(DataConnection, self).__init__(**kwargs) self.location = location - self.kind: str = 'DataConnection' + self.kind = 'DataConnection' # type: str class DataConnectionCheckNameRequest(msrest.serialization.Model): @@ -1579,7 +1579,7 @@ def __init__( **kwargs ): super(EventGridDataConnection, self).__init__(location=location, **kwargs) - self.kind: str = 'EventGrid' + self.kind = 'EventGrid' # type: str self.storage_account_resource_id = storage_account_resource_id self.event_hub_resource_id = event_hub_resource_id self.consumer_group = consumer_group @@ -1669,7 +1669,7 @@ def __init__( **kwargs ): super(EventHubDataConnection, self).__init__(location=location, **kwargs) - self.kind: str = 'EventHub' + self.kind = 'EventHub' # type: str self.event_hub_resource_id = event_hub_resource_id self.consumer_group = consumer_group self.table_name = table_name @@ -1821,7 +1821,7 @@ def __init__( **kwargs ): super(IotHubDataConnection, self).__init__(location=location, **kwargs) - self.kind: str = 'IotHub' + self.kind = 'IotHub' # type: str self.iot_hub_resource_id = iot_hub_resource_id self.consumer_group = consumer_group self.table_name = table_name @@ -2190,7 +2190,7 @@ def __init__( **kwargs ): super(ReadOnlyFollowingDatabase, self).__init__(location=location, **kwargs) - self.kind: str = 'ReadOnlyFollowing' + self.kind = 'ReadOnlyFollowing' # type: str self.provisioning_state = None self.soft_delete_period = None self.hot_cache_period = hot_cache_period @@ -2267,7 +2267,7 @@ def __init__( **kwargs ): super(ReadWriteDatabase, self).__init__(location=location, **kwargs) - self.kind: str = 'ReadWrite' + self.kind = 'ReadWrite' # type: str self.provisioning_state = None self.soft_delete_period = soft_delete_period self.hot_cache_period = hot_cache_period diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py index 403fd151411..2fdd2f6dbad 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py @@ -71,6 +71,10 @@ def list_by_cluster( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_cluster.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -163,7 +163,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,7 +218,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'AttachedDatabaseConfiguration') body_content_kwargs['content'] = body_content @@ -232,7 +230,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) @@ -259,7 +256,7 @@ def begin_create_or_update( default_principals_modification_kind=None, # type: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AttachedDatabaseConfiguration"] """Creates or updates an attached database configuration. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -271,14 +268,15 @@ def begin_create_or_update( :param location: Resource location. :type location: str :param database_name: The name of the database which you would like to attach, use * if you - want to follow all current and future databases. + want to follow all current and future databases. :type database_name: str :param cluster_resource_id: The resource id of the cluster where the databases you would like - to attach reside. + to attach reside. :type cluster_resource_id: str :param default_principals_modification_kind: The default principals modification kind. :type default_principals_modification_kind: str or ~kusto_management_client.models.DefaultPrincipalsModificationKind :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -293,17 +291,19 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -318,7 +318,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore def _delete_initial( @@ -351,7 +359,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -372,7 +379,7 @@ def begin_delete( attached_database_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the attached database configuration with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -382,6 +389,7 @@ def begin_delete( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -396,13 +404,15 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -414,5 +424,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py index 2d59f3994cf..4723a12adaf 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -111,8 +110,8 @@ def _create_or_update_initial( location, # type: str sku, # type: "models.AzureSku" tags=None, # type: Optional[Dict[str, str]] - trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] zones=None, # type: Optional[List[str]] + trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] enable_disk_encryption=None, # type: Optional[bool] enable_streaming_ingest=False, # type: Optional[bool] @@ -151,7 +150,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'Cluster') body_content_kwargs['content'] = body_content @@ -164,7 +162,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', pipeline_response) @@ -197,7 +194,7 @@ def begin_create_or_update( user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Cluster"] """Create or update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -217,10 +214,10 @@ def begin_create_or_update( :param optimized_autoscale: Optimized auto scale definition. :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are - encrypted. + encrypted. :type enable_disk_encryption: bool :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is - enabled. + enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration @@ -229,15 +226,16 @@ def begin_create_or_update( :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool :param enable_double_encryption: A boolean value that indicates if double encryption is - enabled. + enabled. :type enable_double_encryption: bool :param type: The identity type. :type type: str or ~kusto_management_client.models.IdentityType :param user_assigned_identities: The list of user identities associated with the Kusto cluster. - The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -252,26 +250,28 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - location=location, - sku=sku, - tags=tags, - zones=zones, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=type, - user_assigned_identities=user_assigned_identities, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + location=location, + sku=sku, + tags=tags, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -286,7 +286,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _update_initial( @@ -335,7 +343,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'ClusterUpdate') body_content_kwargs['content'] = body_content @@ -348,7 +355,6 @@ def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', pipeline_response) @@ -383,7 +389,7 @@ def begin_update( user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Cluster"] """Update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -401,10 +407,10 @@ def begin_update( :param optimized_autoscale: Optimized auto scale definition. :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are - encrypted. + encrypted. :type enable_disk_encryption: bool :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is - enabled. + enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration @@ -413,15 +419,16 @@ def begin_update( :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool :param enable_double_encryption: A boolean value that indicates if double encryption is - enabled. + enabled. :type enable_double_encryption: bool :param type: The identity type. :type type: str or ~kusto_management_client.models.IdentityType :param user_assigned_identities: The list of user identities associated with the Kusto cluster. - The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -436,25 +443,27 @@ def begin_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - enable_double_encryption=enable_double_encryption, - type=type, - user_assigned_identities=user_assigned_identities, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -469,7 +478,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _delete_initial( @@ -500,7 +517,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -520,7 +536,7 @@ def begin_delete( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -528,6 +544,7 @@ def begin_delete( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -542,12 +559,14 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -559,7 +578,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _stop_initial( @@ -590,7 +617,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +636,7 @@ def begin_stop( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -618,6 +644,7 @@ def begin_stop( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -632,12 +659,14 @@ def begin_stop( 'polling_interval', self._config.polling_interval ) - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -649,7 +678,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore def _start_initial( @@ -680,7 +717,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -700,7 +736,7 @@ def begin_start( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -708,6 +744,7 @@ def begin_start( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -722,12 +759,14 @@ def begin_start( 'polling_interval', self._config.polling_interval ) - raw_result = self._start_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -739,7 +778,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore def list_follower_database( @@ -749,7 +796,8 @@ def list_follower_database( **kwargs # type: Any ): # type: (...) -> Iterable["models.FollowerDatabaseListResult"] - """Returns a list of databases that are owned by this cluster and were followed by another cluster. + """Returns a list of databases that are owned by this cluster and were followed by another + cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str @@ -766,6 +814,10 @@ def list_follower_database( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_follower_database.metadata['url'] # type: ignore @@ -779,15 +831,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -848,7 +896,6 @@ def _detach_follower_database_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_follower_database_to_remove, 'FollowerDatabaseDefinition') body_content_kwargs['content'] = body_content @@ -874,7 +921,7 @@ def begin_detach_follower_database( attached_database_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Detaches all followers of a database owned by this cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -882,12 +929,13 @@ def begin_detach_follower_database( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param cluster_resource_id: Resource id of the cluster that follows a database owned by this - cluster. + cluster. :type cluster_resource_id: str :param attached_database_configuration_name: Resource name of the attached database - configuration in the follower cluster. + configuration in the follower cluster. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -902,14 +950,16 @@ def begin_detach_follower_database( 'polling_interval', self._config.polling_interval ) - raw_result = self._detach_follower_database_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_resource_id=cluster_resource_id, - attached_database_configuration_name=attached_database_configuration_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._detach_follower_database_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -921,7 +971,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore def _diagnose_virtual_network_initial( @@ -930,8 +988,8 @@ def _diagnose_virtual_network_initial( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnoseVirtualNetworkResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + # type: (...) -> Optional["models.DiagnoseVirtualNetworkResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DiagnoseVirtualNetworkResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-06-14" @@ -953,7 +1011,6 @@ def _diagnose_virtual_network_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -978,14 +1035,16 @@ def begin_diagnose_virtual_network( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller - """Diagnoses network connectivity status for external resources on which the service is dependent on. + # type: (...) -> LROPoller["models.DiagnoseVirtualNetworkResult"] + """Diagnoses network connectivity status for external resources on which the service is dependent + on. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1000,12 +1059,14 @@ def begin_diagnose_virtual_network( 'polling_interval', self._config.polling_interval ) - raw_result = self._diagnose_virtual_network_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._diagnose_virtual_network_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1020,7 +1081,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore def list_by_resource_group( @@ -1044,6 +1113,10 @@ def list_by_resource_group( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -1056,15 +1129,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1109,6 +1178,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -1120,15 +1193,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1173,6 +1242,10 @@ def list_sku( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_sku.metadata['url'] # type: ignore @@ -1184,15 +1257,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1265,7 +1334,6 @@ def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_cluster_name, 'ClusterCheckNameRequest') body_content_kwargs['content'] = body_content @@ -1310,6 +1378,10 @@ def list_sku_by_resource( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_sku_by_resource.metadata['url'] # type: ignore @@ -1323,15 +1395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1382,6 +1450,10 @@ def list_language_extension( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_language_extension.metadata['url'] # type: ignore @@ -1395,15 +1467,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1463,7 +1531,6 @@ def _add_language_extension_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_language_extensions_to_add, 'LanguageExtensionsList') body_content_kwargs['content'] = body_content @@ -1488,7 +1555,7 @@ def begin_add_language_extension( value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Add a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1498,6 +1565,7 @@ def begin_add_language_extension( :param value: The list of language extensions. :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1512,13 +1580,15 @@ def begin_add_language_extension( 'polling_interval', self._config.polling_interval ) - raw_result = self._add_language_extension_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._add_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1530,7 +1600,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore def _remove_language_extension_initial( @@ -1566,7 +1644,6 @@ def _remove_language_extension_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_language_extensions_to_remove, 'LanguageExtensionsList') body_content_kwargs['content'] = body_content @@ -1591,7 +1668,7 @@ def begin_remove_language_extension( value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Remove a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1601,6 +1678,7 @@ def begin_remove_language_extension( :param value: The list of language extensions. :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1615,13 +1693,15 @@ def begin_remove_language_extension( 'polling_interval', self._config.polling_interval ) - raw_result = self._remove_language_extension_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._remove_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1633,5 +1713,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py index 78025b3f58f..897fd160bfa 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py @@ -97,7 +97,6 @@ def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') body_content_kwargs['content'] = body_content @@ -162,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -218,7 +216,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'ClusterPrincipalAssignment') body_content_kwargs['content'] = body_content @@ -231,7 +228,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) @@ -255,7 +251,7 @@ def begin_create_or_update( principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ClusterPrincipalAssignment"] """Create a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -265,7 +261,7 @@ def begin_create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param principal_id: The principal ID assigned to the cluster principal. It can be a user - email, application ID, or security group name. + email, application ID, or security group name. :type principal_id: str :param role: Cluster principal role. :type role: str or ~kusto_management_client.models.ClusterPrincipalRole @@ -274,6 +270,7 @@ def begin_create_or_update( :param principal_type: Principal type. :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -288,17 +285,19 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -313,7 +312,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _delete_initial( @@ -346,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -367,7 +373,7 @@ def begin_delete( principal_assignment_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -377,6 +383,7 @@ def begin_delete( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -391,13 +398,15 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -409,7 +418,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( @@ -436,6 +453,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -449,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py index d8ba89afeff..64713992df9 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py @@ -74,6 +74,10 @@ def list_by_database( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_database.metadata['url'] # type: ignore @@ -88,15 +92,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,8 +132,8 @@ def _data_connection_validation_initial( properties=None, # type: Optional["models.DataConnection"] **kwargs # type: Any ): - # type: (...) -> "models.DataConnectionValidationListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + # type: (...) -> Optional["models.DataConnectionValidationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.DataConnectionValidationListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) @@ -160,7 +160,6 @@ def _data_connection_validation_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'DataConnectionValidation') body_content_kwargs['content'] = body_content @@ -192,7 +191,7 @@ def begin_data_connection_validation( properties=None, # type: Optional["models.DataConnection"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DataConnectionValidationListResult"] """Checks that the data connection parameters are valid. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -206,6 +205,7 @@ def begin_data_connection_validation( :param properties: The data connection properties to validate. :type properties: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -220,15 +220,17 @@ def begin_data_connection_validation( 'polling_interval', self._config.polling_interval ) - raw_result = self._data_connection_validation_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._data_connection_validation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -243,7 +245,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore def check_name_availability( @@ -300,7 +310,6 @@ def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_data_connection_name, 'DataConnectionCheckNameRequest') body_content_kwargs['content'] = body_content @@ -369,7 +378,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -422,7 +430,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DataConnection') body_content_kwargs['content'] = body_content @@ -435,7 +442,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DataConnection', pipeline_response) @@ -460,7 +466,7 @@ def begin_create_or_update( parameters, # type: "models.DataConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DataConnection"] """Creates or updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -474,6 +480,7 @@ def begin_create_or_update( :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -488,15 +495,17 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -511,7 +520,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def _update_initial( @@ -550,7 +567,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DataConnection') body_content_kwargs['content'] = body_content @@ -563,7 +579,6 @@ def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DataConnection', pipeline_response) @@ -588,7 +603,7 @@ def begin_update( parameters, # type: "models.DataConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DataConnection"] """Updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -602,6 +617,7 @@ def begin_update( :param parameters: The data connection parameters supplied to the Update operation. :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -616,15 +632,17 @@ def begin_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -639,7 +657,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def _delete_initial( @@ -674,7 +700,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +721,7 @@ def begin_delete( data_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the data connection with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -708,6 +733,7 @@ def begin_delete( :param data_connection_name: The name of the data connection. :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -722,14 +748,16 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -741,5 +769,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py index 848c2c3b5e8..a53df2bc65f 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py @@ -97,7 +97,6 @@ def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_resource_name, 'CheckNameRequest') body_content_kwargs['content'] = body_content @@ -142,6 +141,10 @@ def list_by_cluster( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_cluster.metadata['url'] # type: ignore @@ -155,15 +158,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -234,7 +233,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -285,7 +283,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Database') body_content_kwargs['content'] = body_content @@ -298,7 +295,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Database', pipeline_response) @@ -322,7 +318,7 @@ def begin_create_or_update( parameters, # type: "models.Database" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Database"] """Creates or updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -334,6 +330,7 @@ def begin_create_or_update( :param parameters: The database parameters supplied to the CreateOrUpdate operation. :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -348,14 +345,16 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -370,7 +369,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def _update_initial( @@ -407,7 +414,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Database') body_content_kwargs['content'] = body_content @@ -420,7 +426,6 @@ def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('Database', pipeline_response) @@ -444,7 +449,7 @@ def begin_update( parameters, # type: "models.Database" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Database"] """Updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -456,6 +461,7 @@ def begin_update( :param parameters: The database parameters supplied to the Update operation. :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -470,14 +476,16 @@ def begin_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -492,7 +500,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def _delete_initial( @@ -525,7 +541,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -546,7 +561,7 @@ def begin_delete( database_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the database with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -556,6 +571,7 @@ def begin_delete( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -570,13 +586,15 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -588,7 +606,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def list_principal( @@ -618,6 +644,10 @@ def list_principal( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_principal.metadata['url'] # type: ignore @@ -632,15 +662,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -718,7 +744,6 @@ def add_principal( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_database_principals_to_add, 'DatabasePrincipalListRequest') body_content_kwargs['content'] = body_content @@ -790,7 +815,6 @@ def remove_principal( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_database_principals_to_remove, 'DatabasePrincipalListRequest') body_content_kwargs['content'] = body_content diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py index 724c19b1cc8..ca9758e5153 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py @@ -101,7 +101,6 @@ def check_name_availability( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') body_content_kwargs['content'] = body_content @@ -170,7 +169,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -228,7 +226,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(_parameters, 'DatabasePrincipalAssignment') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) @@ -266,7 +262,7 @@ def begin_create_or_update( principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DatabasePrincipalAssignment"] """Creates a Kusto cluster database principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -278,7 +274,7 @@ def begin_create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param principal_id: The principal ID assigned to the database principal. It can be a user - email, application ID, or security group name. + email, application ID, or security group name. :type principal_id: str :param role: Database principal role. :type role: str or ~kusto_management_client.models.DatabasePrincipalRole @@ -287,6 +283,7 @@ def begin_create_or_update( :param principal_type: Principal type. :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -301,18 +298,20 @@ def begin_create_or_update( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -327,7 +326,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _delete_initial( @@ -362,7 +369,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -384,7 +390,7 @@ def begin_delete( principal_assignment_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a Kusto principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -396,6 +402,7 @@ def begin_delete( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -410,14 +417,16 @@ def begin_delete( 'polling_interval', self._config.polling_interval ) - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -429,7 +438,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( @@ -459,6 +476,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -473,15 +494,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py index 6a0f95858b9..a5a835e8cf9 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py @@ -63,6 +63,10 @@ def list( api_version = "2020-06-14" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py b/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py deleted file mode 100644 index 6f2ab0c5bff..00000000000 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -# coding: utf-8 - -from setuptools import setup, find_packages - -NAME = "kustomanagementclient" -VERSION = "0.1.0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] - -setup( - name=NAME, - version=VERSION, - description="KustoManagementClient", - author_email="", - url="", - keywords=["Swagger", "KustoManagementClient"], - install_requires=REQUIRES, - packages=find_packages(), - include_package_data=True, - long_description="""\ - The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. - """ -) diff --git a/src/kusto/kusto.egg-info/PKG-INFO b/src/kusto/kusto.egg-info/PKG-INFO deleted file mode 100644 index 570c2449bc6..00000000000 --- a/src/kusto/kusto.egg-info/PKG-INFO +++ /dev/null @@ -1,34 +0,0 @@ -Metadata-Version: 1.1 -Name: kusto -Version: 0.1.0 -Summary: Microsoft Azure Command-Line Tools KustoManagementClient Extension -Home-page: https://github.com/Azure/azure-cli-extensions/tree/master/src/kusto -Author: Microsoft Corporation -Author-email: azpycli@microsoft.com -License: MIT -Description: Microsoft Azure CLI 'kusto' Extension - ========================================== - - This package is for the 'kusto' extension. - i.e. 'az kusto' - - - .. :changelog: - - Release History - =============== - - 0.1.0 - ++++++ - * Initial release. - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: System Administrators -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: License :: OSI Approved :: MIT License diff --git a/src/kusto/kusto.egg-info/SOURCES.txt b/src/kusto/kusto.egg-info/SOURCES.txt deleted file mode 100644 index dcdb5808ee5..00000000000 --- a/src/kusto/kusto.egg-info/SOURCES.txt +++ /dev/null @@ -1,57 +0,0 @@ -README.md -setup.cfg -setup.py -azext_kusto/__init__.py -azext_kusto/action.py -azext_kusto/azext_metadata.json -azext_kusto/custom.py -azext_kusto/generated/__init__.py -azext_kusto/generated/_client_factory.py -azext_kusto/generated/_help.py -azext_kusto/generated/_params.py -azext_kusto/generated/_validators.py -azext_kusto/generated/action.py -azext_kusto/generated/commands.py -azext_kusto/generated/custom.py -azext_kusto/manual/__init__.py -azext_kusto/manual/_help.py -azext_kusto/manual/tests/__init__.py -azext_kusto/manual/tests/latest/__init__.py -azext_kusto/manual/tests/latest/test_kusto_scenario.py -azext_kusto/tests/__init__.py -azext_kusto/tests/latest/__init__.py -azext_kusto/tests/latest/preparers.py -azext_kusto/tests/latest/test_kusto_scenario.py -azext_kusto/vendored_sdks/__init__.py -azext_kusto/vendored_sdks/kusto/__init__.py -azext_kusto/vendored_sdks/kusto/_configuration.py -azext_kusto/vendored_sdks/kusto/_kusto_management_client.py -azext_kusto/vendored_sdks/kusto/_version.py -azext_kusto/vendored_sdks/kusto/setup.py -azext_kusto/vendored_sdks/kusto/aio/__init__.py -azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py -azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/__init__.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py -azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py -azext_kusto/vendored_sdks/kusto/models/__init__.py -azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py -azext_kusto/vendored_sdks/kusto/models/_models.py -azext_kusto/vendored_sdks/kusto/models/_models_py3.py -azext_kusto/vendored_sdks/kusto/operations/__init__.py -azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py -azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py -azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py -azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py -azext_kusto/vendored_sdks/kusto/operations/_database_operations.py -azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py -azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py -kusto.egg-info/PKG-INFO -kusto.egg-info/SOURCES.txt -kusto.egg-info/dependency_links.txt -kusto.egg-info/top_level.txt \ No newline at end of file diff --git a/src/kusto/kusto.egg-info/dependency_links.txt b/src/kusto/kusto.egg-info/dependency_links.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/src/kusto/kusto.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/kusto/kusto.egg-info/top_level.txt b/src/kusto/kusto.egg-info/top_level.txt deleted file mode 100644 index 37a1542d066..00000000000 --- a/src/kusto/kusto.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -azext_kusto diff --git a/src/kusto/report.md b/src/kusto/report.md index cc0809d3d39..c8eeb46fa50 100644 --- a/src/kusto/report.md +++ b/src/kusto/report.md @@ -1,576 +1,1165 @@ -# Azure CLI Module Creation Report - -### kusto attached-database-configuration create - -create a kusto attached-database-configuration. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| -|**--location**|string|Resource location.|location| -|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name| -|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id| -|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind| -### kusto attached-database-configuration delete - -delete a kusto attached-database-configuration. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| -### kusto attached-database-configuration list - -list a kusto attached-database-configuration. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto attached-database-configuration show - -show a kusto attached-database-configuration. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| -### kusto attached-database-configuration update - -create a kusto attached-database-configuration. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| -|**--location**|string|Resource location.|location| -|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name| -|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id| -|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind| -### kusto cluster add-language-extension - -add-language-extension a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--value**|array|The list of language extensions.|value| -### kusto cluster create - -create a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--location**|string|The geo-location where the resource lives|location| -|**--sku**|object|The SKU of the cluster.|sku| -|**--tags**|dictionary|Resource tags.|tags| -|**--zones**|array|The availability zones of the cluster.|zones| -|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants| -|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale| -|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption| -|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest| -|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration| -|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties| -|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge| -|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption| -|**--identity-type**|sealed-choice|The identity type.|type_identity_type| -|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| -### kusto cluster delete - -delete a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster detach-follower-database - -detach-follower-database a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--cluster-resource-id**|string|Resource id of the cluster that follows a database owned by this cluster.|cluster_resource_id| -|**--attached-database-configuration-name**|string|Resource name of the attached database configuration in the follower cluster.|attached_database_configuration_name| -### kusto cluster diagnose-virtual-network - -diagnose-virtual-network a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster list - -list a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -### kusto cluster list-follower-database - -list-follower-database a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster list-language-extension - -list-language-extension a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster list-sku - -list-sku a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster remove-language-extension - -remove-language-extension a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--value**|array|The list of language extensions.|value| -### kusto cluster show - -show a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster start - -start a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster stop - -stop a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster update - -update a kusto cluster. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--tags**|dictionary|Resource tags.|tags| -|**--location**|string|Resource location.|location| -|**--sku**|object|The SKU of the cluster.|sku| -|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants| -|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale| -|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption| -|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest| -|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration| -|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties| -|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge| -|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption| -|**--identity-type**|sealed-choice|The identity type.|type_identity_type| -|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| -### kusto cluster-principal-assignment create - -create a kusto cluster-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id| -|**--role**|choice|Cluster principal role.|role| -|**--tenant-id**|string|The tenant id of the principal|tenant_id| -|**--principal-type**|choice|Principal type.|principal_type| -### kusto cluster-principal-assignment delete - -delete a kusto cluster-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -### kusto cluster-principal-assignment list - -list a kusto cluster-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto cluster-principal-assignment show - -show a kusto cluster-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -### kusto cluster-principal-assignment update - -create a kusto cluster-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id| -|**--role**|choice|Cluster principal role.|role| -|**--tenant-id**|string|The tenant id of the principal|tenant_id| -|**--principal-type**|choice|Principal type.|principal_type| -### kusto data-connection delete - -delete a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -### kusto data-connection event-grid create - -event-grid create a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_grid_location| -|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| -|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| -|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| -|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| -### kusto data-connection event-grid data-connection-validation - -event-grid data-connection-validation a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_grid_location| -|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| -|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| -|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| -|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| -### kusto data-connection event-grid update - -event-grid update a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_grid_location| -|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| -|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| -|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| -|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| -### kusto data-connection event-hub create - -event-hub create a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_hub_location| -|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| -|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| -|**--compression**|choice|The event hub messages compression type|event_hub_compression| -### kusto data-connection event-hub data-connection-validation - -event-hub data-connection-validation a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_hub_location| -|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| -|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| -|**--compression**|choice|The event hub messages compression type|event_hub_compression| -### kusto data-connection event-hub update - -event-hub update a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|event_hub_location| -|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| -|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| -|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| -|**--compression**|choice|The event hub messages compression type|event_hub_compression| -### kusto data-connection iot-hub create - -iot-hub create a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|iot_hub_location| -|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| -|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| -|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| -|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| -### kusto data-connection iot-hub data-connection-validation - -iot-hub data-connection-validation a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|iot_hub_location| -|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| -|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| -|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| -|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| -### kusto data-connection iot-hub update - -iot-hub update a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -|**--location**|string|Resource location.|iot_hub_location| -|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| -|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| -|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| -|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| -|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| -|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| -|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| -### kusto data-connection list - -list a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -### kusto data-connection show - -show a kusto data-connection. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--data-connection-name**|string|The name of the data connection.|data_connection_name| -### kusto database add-principal - -add-principal a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--value**|array|The list of Kusto database principals.|value| -### kusto database create - -create a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--read-write-database**|object|Class representing a read write database.|read_write_database| -|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database| -### kusto database delete - -delete a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -### kusto database list - -list a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -### kusto database list-principal - -list-principal a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -### kusto database remove-principal - -remove-principal a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--value**|array|The list of Kusto database principals.|value| -### kusto database show - -show a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -### kusto database update - -update a kusto database. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--read-write-database**|object|Class representing a read write database.|read_write_database| -|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database| -### kusto database-principal-assignment create - -create a kusto database-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id| -|**--role**|choice|Database principal role.|role| -|**--tenant-id**|string|The tenant id of the principal|tenant_id| -|**--principal-type**|choice|Principal type.|principal_type| -### kusto database-principal-assignment delete - -delete a kusto database-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -### kusto database-principal-assignment list - -list a kusto database-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -### kusto database-principal-assignment show - -show a kusto database-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -### kusto database-principal-assignment update - -create a kusto database-principal-assignment. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| -|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| -|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| -|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| -|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id| -|**--role**|choice|Database principal role.|role| -|**--tenant-id**|string|The tenant id of the principal|tenant_id| -|**--principal-type**|choice|Principal type.|principal_type| \ No newline at end of file +# Azure CLI Module Creation Report + +### kusto attached-database-configuration create + +create a kusto attached-database-configuration. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto attached-database-configuration|AttachedDatabaseConfigurations| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name|attachedDatabaseConfigurationName| +|**--location**|string|Resource location.|location|location| +|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name|databaseName| +|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id|clusterResourceId| +|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind|defaultPrincipalsModificationKind| + +### kusto attached-database-configuration delete + +delete a kusto attached-database-configuration. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto attached-database-configuration|AttachedDatabaseConfigurations| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name|attachedDatabaseConfigurationName| + +### kusto attached-database-configuration list + +list a kusto attached-database-configuration. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto attached-database-configuration|AttachedDatabaseConfigurations| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|ListByCluster| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto attached-database-configuration show + +show a kusto attached-database-configuration. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto attached-database-configuration|AttachedDatabaseConfigurations| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name|attachedDatabaseConfigurationName| + +### kusto attached-database-configuration update + +update a kusto attached-database-configuration. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto attached-database-configuration|AttachedDatabaseConfigurations| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|CreateOrUpdate#Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name|attachedDatabaseConfigurationName| +|**--location**|string|Resource location.|location|location| +|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name|databaseName| +|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id|clusterResourceId| +|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind|defaultPrincipalsModificationKind| + +### kusto cluster add-language-extension + +add-language-extension a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|add-language-extension|AddLanguageExtensions| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--value**|array|The list of language extensions.|value|value| + +### kusto cluster create + +create a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--location**|string|The geo-location where the resource lives|location|location| +|**--sku**|object|The SKU of the cluster.|sku|sku| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--zones**|array|The availability zones of the cluster.|zones|zones| +|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants|trustedExternalTenants| +|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale|optimizedAutoscale| +|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption|enableDiskEncryption| +|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest|enableStreamingIngest| +|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration|virtualNetworkConfiguration| +|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties|keyVaultProperties| +|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge|enablePurge| +|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption|enableDoubleEncryption| +|**--identity-type**|sealed-choice|The identity type.|type|type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities|userAssignedIdentities| + +### kusto cluster delete + +delete a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster detach-follower-database + +detach-follower-database a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|detach-follower-database|DetachFollowerDatabases| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--cluster-resource-id**|string|Resource id of the cluster that follows a database owned by this cluster.|cluster_resource_id|clusterResourceId| +|**--attached-database-configuration-name**|string|Resource name of the attached database configuration in the follower cluster.|attached_database_configuration_name|attachedDatabaseConfigurationName| + +### kusto cluster diagnose-virtual-network + +diagnose-virtual-network a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|diagnose-virtual-network|DiagnoseVirtualNetwork| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster list + +list a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|ListByResourceGroup| +|list|List| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| + +### kusto cluster list-follower-database + +list-follower-database a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list-follower-database|ListFollowerDatabases| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster list-language-extension + +list-language-extension a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list-language-extension|ListLanguageExtensions| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster list-sku + +list-sku a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list-sku|ListSkusByResource| +|list-sku|ListSkus| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster remove-language-extension + +remove-language-extension a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|remove-language-extension|RemoveLanguageExtensions| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--value**|array|The list of language extensions.|value|value| + +### kusto cluster show + +show a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster start + +start a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|start|Start| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster stop + +stop a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|stop|Stop| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster update + +update a kusto cluster. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster|Clusters| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--location**|string|Resource location.|location|location| +|**--sku**|object|The SKU of the cluster.|sku|sku| +|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants|trustedExternalTenants| +|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale|optimizedAutoscale| +|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption|enableDiskEncryption| +|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest|enableStreamingIngest| +|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration|virtualNetworkConfiguration| +|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties|keyVaultProperties| +|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge|enablePurge| +|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption|enableDoubleEncryption| +|**--identity-type**|sealed-choice|The identity type.|type|type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities|userAssignedIdentities| + +### kusto cluster-principal-assignment create + +create a kusto cluster-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster-principal-assignment|ClusterPrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| +|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id|principalId| +|**--role**|choice|Cluster principal role.|role|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id|tenantId| +|**--principal-type**|choice|Principal type.|principal_type|principalType| + +### kusto cluster-principal-assignment delete + +delete a kusto cluster-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster-principal-assignment|ClusterPrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| + +### kusto cluster-principal-assignment list + +list a kusto cluster-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster-principal-assignment|ClusterPrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|List| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto cluster-principal-assignment show + +show a kusto cluster-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster-principal-assignment|ClusterPrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| + +### kusto cluster-principal-assignment update + +update a kusto cluster-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto cluster-principal-assignment|ClusterPrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|CreateOrUpdate#Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| +|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id|principalId| +|**--role**|choice|Cluster principal role.|role|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id|tenantId| +|**--principal-type**|choice|Principal type.|principal_type|principalType| + +### kusto data-connection delete + +delete a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| + +### kusto data-connection event-grid create + +event-grid create a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-grid create|CreateOrUpdate#Create#EventGrid| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_grid_location|location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id|storageAccountResourceId| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format|dataFormat| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record|ignoreFirstRecord| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type|blobStorageEventType| + +### kusto data-connection event-grid data-connection-validation + +event-grid data-connection-validation a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-grid data-connection-validation|dataConnectionValidation#EventGrid| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_grid_location|location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id|storageAccountResourceId| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format|dataFormat| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record|ignoreFirstRecord| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type|blobStorageEventType| + +### kusto data-connection event-grid update + +event-grid update a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-grid update|Update#EventGrid| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_grid_location|location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id|storageAccountResourceId| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format|dataFormat| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record|ignoreFirstRecord| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type|blobStorageEventType| + +### kusto data-connection event-hub create + +event-hub create a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-hub create|CreateOrUpdate#Create#EventHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_hub_location|location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties|eventSystemProperties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression|compression| + +### kusto data-connection event-hub data-connection-validation + +event-hub data-connection-validation a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-hub data-connection-validation|dataConnectionValidation#EventHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_hub_location|location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties|eventSystemProperties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression|compression| + +### kusto data-connection event-hub update + +event-hub update a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|event-hub update|Update#EventHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|event_hub_location|location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id|eventHubResourceId| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties|eventSystemProperties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression|compression| + +### kusto data-connection iot-hub create + +iot-hub create a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|iot-hub create|CreateOrUpdate#Create#IotHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|iot_hub_location|location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id|iotHubResourceId| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties|eventSystemProperties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name|sharedAccessPolicyName| + +### kusto data-connection iot-hub data-connection-validation + +iot-hub data-connection-validation a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|iot-hub data-connection-validation|dataConnectionValidation#IotHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|iot_hub_location|location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id|iotHubResourceId| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties|eventSystemProperties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name|sharedAccessPolicyName| + +### kusto data-connection iot-hub update + +iot-hub update a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|iot-hub update|Update#IotHub| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| +|**--location**|string|Resource location.|iot_hub_location|location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id|iotHubResourceId| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group|consumerGroup| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name|tableName| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name|mappingRuleName| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format|dataFormat| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties|eventSystemProperties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name|sharedAccessPolicyName| + +### kusto data-connection list + +list a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|ListByDatabase| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| + +### kusto data-connection show + +show a kusto data-connection. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto data-connection|DataConnections| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name|dataConnectionName| + +### kusto database add-principal + +add-principal a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|add-principal|AddPrincipals| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--value**|array|The list of Kusto database principals.|value|value| + +### kusto database create + +create a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--read-write-database**|object|Class representing a read write database.|read_write_database|ReadWriteDatabase| +|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database|ReadOnlyFollowingDatabase| + +### kusto database delete + +delete a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| + +### kusto database list + +list a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|ListByCluster| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| + +### kusto database list-principal + +list-principal a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list-principal|ListPrincipals| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| + +### kusto database remove-principal + +remove-principal a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|remove-principal|RemovePrincipals| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--value**|array|The list of Kusto database principals.|value|value| + +### kusto database show + +show a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| + +### kusto database update + +update a kusto database. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database|Databases| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--read-write-database**|object|Class representing a read write database.|read_write_database|ReadWriteDatabase| +|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database|ReadOnlyFollowingDatabase| + +### kusto database-principal-assignment create + +create a kusto database-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database-principal-assignment|DatabasePrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| +|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id|principalId| +|**--role**|choice|Database principal role.|role|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id|tenantId| +|**--principal-type**|choice|Principal type.|principal_type|principalType| + +### kusto database-principal-assignment delete + +delete a kusto database-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database-principal-assignment|DatabasePrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| + +### kusto database-principal-assignment list + +list a kusto database-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database-principal-assignment|DatabasePrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|List| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| + +### kusto database-principal-assignment show + +show a kusto database-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database-principal-assignment|DatabasePrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| + +### kusto database-principal-assignment update + +update a kusto database-principal-assignment. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|kusto database-principal-assignment|DatabasePrincipalAssignments| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|CreateOrUpdate#Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name|resourceGroupName| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name|clusterName| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name|databaseName| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name|principalAssignmentName| +|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id|principalId| +|**--role**|choice|Database principal role.|role|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id|tenantId| +|**--principal-type**|choice|Principal type.|principal_type|principalType| diff --git a/src/kusto/setup.py b/src/kusto/setup.py index d4a08f04021..69bacf1c574 100644 --- a/src/kusto/setup.py +++ b/src/kusto/setup.py @@ -1,57 +1,57 @@ -#!/usr/bin/env python - -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -from codecs import open -from setuptools import setup, find_packages - -# HISTORY.rst entry. -VERSION = '0.1.1' -try: - from .manual.version import VERSION -except ImportError: - pass - -# The full list of classifiers is available at -# https://pypi.python.org/pypi?%3Aaction=list_classifiers -CLASSIFIERS = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'License :: OSI Approved :: MIT License', -] - -DEPENDENCIES = [] -try: - from .manual.dependency import DEPENDENCIES -except ImportError: - pass - -with open('README.md', 'r', encoding='utf-8') as f: - README = f.read() -with open('HISTORY.rst', 'r', encoding='utf-8') as f: - HISTORY = f.read() - -setup( - name='kusto', - version=VERSION, - description='Microsoft Azure Command-Line Tools KustoManagementClient Extension', - author='Microsoft Corporation', - author_email='azpycli@microsoft.com', - url='https://github.com/Azure/azure-cli-extensions/tree/master/src/kusto', - long_description=README + '\n\n' + HISTORY, - license='MIT', - classifiers=CLASSIFIERS, - packages=find_packages(), - install_requires=DEPENDENCIES, - package_data={'azext_kusto': ['azext_metadata.json']}, -) +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_kusto.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='kusto', + version=VERSION, + description='Microsoft Azure Command-Line Tools KustoManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/kusto', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_kusto': ['azext_metadata.json']}, +)