Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR kusto] add kusto track2 config #469

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/kusto/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ Release History
0.1.0
++++++
* Initial release.

0.2.0
++++++
* Adding Engine v3 support and User-Assigned-Identity
30 changes: 19 additions & 11 deletions src/kusto/azext_kusto/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@

helps['kusto cluster list'] = """
type: command
short-summary: "Lists all Kusto clusters within a subscription."
short-summary: "Lists all Kusto clusters within a resource group. And Lists all Kusto clusters within a \
subscription."
examples:
- name: KustoClustersListByResourceGroup
text: |-
az kusto cluster list --resource-group "kustorptest"
- name: KustoClustersList
text: |-
az kusto cluster list
"""

helps['kusto cluster show'] = """
Expand All @@ -37,7 +41,7 @@

helps['kusto cluster create'] = """
type: command
short-summary: "Create or update a Kusto cluster."
short-summary: "Create a Kusto cluster."
parameters:
- name: --sku
short-summary: "The SKU of the cluster."
Expand Down Expand Up @@ -212,11 +216,15 @@

helps['kusto cluster list-sku'] = """
type: command
short-summary: "Lists eligible SKUs for Kusto resource provider."
short-summary: "Returns the SKUs available for the provided resource. And Lists eligible SKUs for Kusto resource \
provider."
examples:
- name: KustoClustersListResourceSkus
text: |-
az kusto cluster list-sku --name "kustoclusterrptest4" --resource-group "kustorptest"
- name: KustoClustersListSkus
text: |-
az kusto cluster list-sku
"""

helps['kusto cluster remove-language-extension'] = """
Expand Down Expand Up @@ -309,7 +317,7 @@

helps['kusto cluster-principal-assignment update'] = """
type: command
short-summary: "Create a Kusto cluster principalAssignment."
short-summary: "Update a Kusto cluster principalAssignment."
"""

helps['kusto cluster-principal-assignment delete'] = """
Expand Down Expand Up @@ -370,7 +378,7 @@

helps['kusto database create'] = """
type: command
short-summary: "Creates or updates a database."
short-summary: "Create a database."
parameters:
- name: --read-write-database
short-summary: "Class representing a read write database."
Expand Down Expand Up @@ -558,7 +566,7 @@

helps['kusto database-principal-assignment update'] = """
type: command
short-summary: "Creates a Kusto cluster database principalAssignment."
short-summary: "Update a Kusto cluster database principalAssignment."
"""

helps['kusto database-principal-assignment delete'] = """
Expand Down Expand Up @@ -620,7 +628,7 @@

helps['kusto attached-database-configuration create'] = """
type: command
short-summary: "Creates or updates an attached database configuration."
short-summary: "Create an attached database configuration."
examples:
- name: AttachedDatabaseConfigurationsCreateOrUpdate
text: |-
Expand All @@ -632,7 +640,7 @@

helps['kusto attached-database-configuration update'] = """
type: command
short-summary: "Creates or updates an attached database configuration."
short-summary: "Update an attached database configuration."
"""

helps['kusto attached-database-configuration delete'] = """
Expand Down Expand Up @@ -699,7 +707,7 @@

helps['kusto data-connection event-grid create'] = """
type: command
short-summary: "Creates or updates a data connection."
short-summary: "Create a data connection."
"""

helps['kusto data-connection event-hub'] = """
Expand All @@ -709,7 +717,7 @@

helps['kusto data-connection event-hub create'] = """
type: command
short-summary: "Creates or updates a data connection."
short-summary: "Create a data connection."
examples:
- name: KustoDataConnectionsCreateOrUpdate
text: |-
Expand All @@ -726,7 +734,7 @@

helps['kusto data-connection iot-hub create'] = """
type: command
short-summary: "Creates or updates a data connection."
short-summary: "Create a data connection."
"""

helps['kusto data-connection event-grid update'] = """
Expand Down
3 changes: 1 addition & 2 deletions src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-09-18"
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'kustomanagementclient/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion src/kusto/azext_kusto/vendored_sdks/kusto/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._kusto_management_client_async import KustoManagementClient
from ._kusto_management_client import KustoManagementClient
__all__ = ['KustoManagementClient']
66 changes: 66 additions & 0 deletions src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

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
from azure.core.credentials_async import AsyncTokenCredential

VERSION = "unknown"

class KustoManagementClientConfiguration(Configuration):
"""Configuration for KustoManagementClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
"""

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(KustoManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-09-18"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'kustomanagementclient/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
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)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 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.
# --------------------------------------------------------------------------

from typing import Any, Optional, TYPE_CHECKING

from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import KustoManagementClientConfiguration
from .operations import ClusterOperations
from .operations import ClusterPrincipalAssignmentOperations
from .operations import DatabaseOperations
from .operations import DatabasePrincipalAssignmentOperations
from .operations import AttachedDatabaseConfigurationOperations
from .operations import DataConnectionOperations
from .operations import OperationOperations
from .. import models


class KustoManagementClient(object):
"""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.

:ivar cluster: ClusterOperations operations
:vartype cluster: kusto_management_client.aio.operations.ClusterOperations
:ivar cluster_principal_assignment: ClusterPrincipalAssignmentOperations operations
:vartype cluster_principal_assignment: kusto_management_client.aio.operations.ClusterPrincipalAssignmentOperations
:ivar database: DatabaseOperations operations
:vartype database: kusto_management_client.aio.operations.DatabaseOperations
:ivar database_principal_assignment: DatabasePrincipalAssignmentOperations operations
:vartype database_principal_assignment: kusto_management_client.aio.operations.DatabasePrincipalAssignmentOperations
:ivar attached_database_configuration: AttachedDatabaseConfigurationOperations operations
:vartype attached_database_configuration: kusto_management_client.aio.operations.AttachedDatabaseConfigurationOperations
:ivar data_connection: DataConnectionOperations operations
:vartype data_connection: kusto_management_client.aio.operations.DataConnectionOperations
:ivar operation: OperationOperations operations
:vartype operation: kusto_management_client.aio.operations.OperationOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
**kwargs: Any
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = KustoManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.cluster = ClusterOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cluster_principal_assignment = ClusterPrincipalAssignmentOperations(
self._client, self._config, self._serialize, self._deserialize)
self.database = DatabaseOperations(
self._client, self._config, self._serialize, self._deserialize)
self.database_principal_assignment = DatabasePrincipalAssignmentOperations(
self._client, self._config, self._serialize, self._deserialize)
self.attached_database_configuration = AttachedDatabaseConfigurationOperations(
self._client, self._config, self._serialize, self._deserialize)
self.data_connection = DataConnectionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operation = OperationOperations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "KustoManagementClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.
# --------------------------------------------------------------------------

from ._cluster_operations import ClusterOperations
from ._cluster_principal_assignment_operations import ClusterPrincipalAssignmentOperations
from ._database_operations import DatabaseOperations
from ._database_principal_assignment_operations import DatabasePrincipalAssignmentOperations
from ._attached_database_configuration_operations import AttachedDatabaseConfigurationOperations
from ._data_connection_operations import DataConnectionOperations
from ._operation_operations import OperationOperations

__all__ = [
'ClusterOperations',
'ClusterPrincipalAssignmentOperations',
'DatabaseOperations',
'DatabasePrincipalAssignmentOperations',
'AttachedDatabaseConfigurationOperations',
'DataConnectionOperations',
'OperationOperations',
]
Loading