Skip to content
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
18 changes: 18 additions & 0 deletions sdk/azure-mgmt-kusto/azure/mgmt/kusto/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .kusto_management_client import KustoManagementClient
from .version import VERSION

__all__ = ['KustoManagementClient']

__version__ = VERSION

105 changes: 105 additions & 0 deletions sdk/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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 msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.clusters_operations import ClustersOperations
from .operations.databases_operations import DatabasesOperations
from .operations.attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations
from .operations.data_connections_operations import DataConnectionsOperations
from .operations.operations import Operations
from . import models


class KustoManagementClientConfiguration(AzureConfiguration):
"""Configuration for KustoManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(KustoManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-kusto/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class KustoManagementClient(SDKClient):
"""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 config: Configuration for client.
:vartype config: KustoManagementClientConfiguration

:ivar clusters: Clusters operations
:vartype clusters: azure.mgmt.kusto.operations.ClustersOperations
:ivar databases: Databases operations
:vartype databases: azure.mgmt.kusto.operations.DatabasesOperations
:ivar attached_database_configurations: AttachedDatabaseConfigurations operations
:vartype attached_database_configurations: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations
:ivar data_connections: DataConnections operations
:vartype data_connections: azure.mgmt.kusto.operations.DataConnectionsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.kusto.operations.Operations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = KustoManagementClientConfiguration(credentials, subscription_id, base_url)
super(KustoManagementClient, self).__init__(self.config.credentials, self.config)

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

self.clusters = ClustersOperations(
self._client, self.config, self._serialize, self._deserialize)
self.databases = DatabasesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.attached_database_configurations = AttachedDatabaseConfigurationsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.data_connections = DataConnectionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
161 changes: 161 additions & 0 deletions sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# 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.
# --------------------------------------------------------------------------

try:
from .trusted_external_tenant_py3 import TrustedExternalTenant
from .intelligent_autoscale_py3 import IntelligentAutoscale
from .azure_sku_py3 import AzureSku
from .azure_capacity_py3 import AzureCapacity
from .azure_resource_sku_py3 import AzureResourceSku
from .sku_location_info_item_py3 import SkuLocationInfoItem
from .sku_description_py3 import SkuDescription
from .database_statistics_py3 import DatabaseStatistics
from .cluster_py3 import Cluster
from .cluster_update_py3 import ClusterUpdate
from .attached_database_configuration_py3 import AttachedDatabaseConfiguration
from .database_py3 import Database
from .read_write_database_py3 import ReadWriteDatabase
from .read_only_attached_database_py3 import ReadOnlyAttachedDatabase
from .database_principal_py3 import DatabasePrincipal
from .database_principal_list_result_py3 import DatabasePrincipalListResult
from .follower_database_result_py3 import FollowerDatabaseResult
from .data_connection_py3 import DataConnection
from .data_connection_validation_result_py3 import DataConnectionValidationResult
from .database_principal_list_request_py3 import DatabasePrincipalListRequest
from .follower_database_request_py3 import FollowerDatabaseRequest
from .data_connection_validation_py3 import DataConnectionValidation
from .event_hub_data_connection_py3 import EventHubDataConnection
from .event_grid_data_connection_py3 import EventGridDataConnection
from .data_connection_validation_list_result_py3 import DataConnectionValidationListResult
from .cluster_check_name_request_py3 import ClusterCheckNameRequest
from .check_name_request_py3 import CheckNameRequest
from .data_connection_check_name_request_py3 import DataConnectionCheckNameRequest
from .check_name_result_py3 import CheckNameResult
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .tracked_resource_py3 import TrackedResource
from .azure_entity_resource_py3 import AzureEntityResource
from .resource_py3 import Resource
from .proxy_resource_py3 import ProxyResource
except (SyntaxError, ImportError):
from .trusted_external_tenant import TrustedExternalTenant
from .intelligent_autoscale import IntelligentAutoscale
from .azure_sku import AzureSku
from .azure_capacity import AzureCapacity
from .azure_resource_sku import AzureResourceSku
from .sku_location_info_item import SkuLocationInfoItem
from .sku_description import SkuDescription
from .database_statistics import DatabaseStatistics
from .cluster import Cluster
from .cluster_update import ClusterUpdate
from .attached_database_configuration import AttachedDatabaseConfiguration
from .database import Database
from .read_write_database import ReadWriteDatabase
from .read_only_attached_database import ReadOnlyAttachedDatabase
from .database_principal import DatabasePrincipal
from .database_principal_list_result import DatabasePrincipalListResult
from .follower_database_result import FollowerDatabaseResult
from .data_connection import DataConnection
from .data_connection_validation_result import DataConnectionValidationResult
from .database_principal_list_request import DatabasePrincipalListRequest
from .follower_database_request import FollowerDatabaseRequest
from .data_connection_validation import DataConnectionValidation
from .event_hub_data_connection import EventHubDataConnection
from .event_grid_data_connection import EventGridDataConnection
from .data_connection_validation_list_result import DataConnectionValidationListResult
from .cluster_check_name_request import ClusterCheckNameRequest
from .check_name_request import CheckNameRequest
from .data_connection_check_name_request import DataConnectionCheckNameRequest
from .check_name_result import CheckNameResult
from .operation_display import OperationDisplay
from .operation import Operation
from .tracked_resource import TrackedResource
from .azure_entity_resource import AzureEntityResource
from .resource import Resource
from .proxy_resource import ProxyResource
from .follower_database_result_paged import FollowerDatabaseResultPaged
from .cluster_paged import ClusterPaged
from .sku_description_paged import SkuDescriptionPaged
from .azure_resource_sku_paged import AzureResourceSkuPaged
from .database_paged import DatabasePaged
from .database_principal_paged import DatabasePrincipalPaged
from .attached_database_configuration_paged import AttachedDatabaseConfigurationPaged
from .data_connection_paged import DataConnectionPaged
from .operation_paged import OperationPaged
from .kusto_management_client_enums import (
State,
ProvisioningState,
AzureSkuName,
AzureSkuTier,
AzureScaleType,
DataFormat,
DatabasePrincipalRole,
DatabasePrincipalType,
Type,
Reason,
)

__all__ = [
'TrustedExternalTenant',
'IntelligentAutoscale',
'AzureSku',
'AzureCapacity',
'AzureResourceSku',
'SkuLocationInfoItem',
'SkuDescription',
'DatabaseStatistics',
'Cluster',
'ClusterUpdate',
'AttachedDatabaseConfiguration',
'Database',
'ReadWriteDatabase',
'ReadOnlyAttachedDatabase',
'DatabasePrincipal',
'DatabasePrincipalListResult',
'FollowerDatabaseResult',
'DataConnection',
'DataConnectionValidationResult',
'DatabasePrincipalListRequest',
'FollowerDatabaseRequest',
'DataConnectionValidation',
'EventHubDataConnection',
'EventGridDataConnection',
'DataConnectionValidationListResult',
'ClusterCheckNameRequest',
'CheckNameRequest',
'DataConnectionCheckNameRequest',
'CheckNameResult',
'OperationDisplay',
'Operation',
'TrackedResource',
'AzureEntityResource',
'Resource',
'ProxyResource',
'FollowerDatabaseResultPaged',
'ClusterPaged',
'SkuDescriptionPaged',
'AzureResourceSkuPaged',
'DatabasePaged',
'DatabasePrincipalPaged',
'AttachedDatabaseConfigurationPaged',
'DataConnectionPaged',
'OperationPaged',
'State',
'ProvisioningState',
'AzureSkuName',
'AzureSkuTier',
'AzureScaleType',
'DataFormat',
'DatabasePrincipalRole',
'DatabasePrincipalType',
'Type',
'Reason',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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 .proxy_resource import ProxyResource


class AttachedDatabaseConfiguration(ProxyResource):
"""Class representing an attached database configuration.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:vartype type: str
:param location: Resource location.
:type location: str
:param database_name: Required. The name of the database which you would
like to attach, use * if you want to follow all current and future
databases.
:type database_name: str
:param cluster_resource_id: Required. The resource id of the cluster where
the databases you would like to attach reside.
:type cluster_resource_id: str
:ivar attached_database_names: The list of databases from the
clusterResourceId which are currently attached to the cluster.
:vartype attached_database_names: list[str]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'database_name': {'required': True},
'cluster_resource_id': {'required': True},
'attached_database_names': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'database_name': {'key': 'properties.databaseName', 'type': 'str'},
'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'},
'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(AttachedDatabaseConfiguration, self).__init__(**kwargs)
self.location = kwargs.get('location', None)
self.database_name = kwargs.get('database_name', None)
self.cluster_resource_id = kwargs.get('cluster_resource_id', None)
self.attached_database_names = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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 msrest.paging import Paged


class AttachedDatabaseConfigurationPaged(Paged):
"""
A paging container for iterating over a list of :class:`AttachedDatabaseConfiguration <azure.mgmt.kusto.models.AttachedDatabaseConfiguration>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[AttachedDatabaseConfiguration]'}
}

def __init__(self, *args, **kwargs):

super(AttachedDatabaseConfigurationPaged, self).__init__(*args, **kwargs)
Loading