|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for |
| 5 | +# license information. |
| 6 | +# |
| 7 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 8 | +# Changes may cause incorrect behavior and will be lost if the code is |
| 9 | +# regenerated. |
| 10 | +# -------------------------------------------------------------------------- |
| 11 | + |
| 12 | +from msrest.service_client import SDKClient |
| 13 | +from msrest import Serializer, Deserializer |
| 14 | +from msrestazure import AzureConfiguration |
| 15 | +from .version import VERSION |
| 16 | +from .operations.clusters_operations import ClustersOperations |
| 17 | +from .operations.databases_operations import DatabasesOperations |
| 18 | +from .operations.operations import Operations |
| 19 | +from . import models |
| 20 | + |
| 21 | + |
| 22 | +class KustoManagementClientConfiguration(AzureConfiguration): |
| 23 | + """Configuration for KustoManagementClient |
| 24 | + Note that all parameters used to create this instance are saved as instance |
| 25 | + attributes. |
| 26 | +
|
| 27 | + :param credentials: Credentials needed for the client to connect to Azure. |
| 28 | + :type credentials: :mod:`A msrestazure Credentials |
| 29 | + object<msrestazure.azure_active_directory>` |
| 30 | + :param subscription_id: Gets subscription credentials which uniquely |
| 31 | + identify Microsoft Azure subscription. The subscription ID forms part of |
| 32 | + the URI for every service call. |
| 33 | + :type subscription_id: str |
| 34 | + :param str base_url: Service URL |
| 35 | + """ |
| 36 | + |
| 37 | + def __init__( |
| 38 | + self, credentials, subscription_id, base_url=None): |
| 39 | + |
| 40 | + if credentials is None: |
| 41 | + raise ValueError("Parameter 'credentials' must not be None.") |
| 42 | + if subscription_id is None: |
| 43 | + raise ValueError("Parameter 'subscription_id' must not be None.") |
| 44 | + if not base_url: |
| 45 | + base_url = 'https://management.azure.com' |
| 46 | + |
| 47 | + super(KustoManagementClientConfiguration, self).__init__(base_url) |
| 48 | + |
| 49 | + self.add_user_agent('azure-mgmt-kusto/{}'.format(VERSION)) |
| 50 | + self.add_user_agent('Azure-SDK-For-Python') |
| 51 | + |
| 52 | + self.credentials = credentials |
| 53 | + self.subscription_id = subscription_id |
| 54 | + |
| 55 | + |
| 56 | +class KustoManagementClient(SDKClient): |
| 57 | + """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. |
| 58 | +
|
| 59 | + :ivar config: Configuration for client. |
| 60 | + :vartype config: KustoManagementClientConfiguration |
| 61 | +
|
| 62 | + :ivar clusters: Clusters operations |
| 63 | + :vartype clusters: azure.mgmt.kusto.operations.ClustersOperations |
| 64 | + :ivar databases: Databases operations |
| 65 | + :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations |
| 66 | + :ivar operations: Operations operations |
| 67 | + :vartype operations: azure.mgmt.kusto.operations.Operations |
| 68 | +
|
| 69 | + :param credentials: Credentials needed for the client to connect to Azure. |
| 70 | + :type credentials: :mod:`A msrestazure Credentials |
| 71 | + object<msrestazure.azure_active_directory>` |
| 72 | + :param subscription_id: Gets subscription credentials which uniquely |
| 73 | + identify Microsoft Azure subscription. The subscription ID forms part of |
| 74 | + the URI for every service call. |
| 75 | + :type subscription_id: str |
| 76 | + :param str base_url: Service URL |
| 77 | + """ |
| 78 | + |
| 79 | + def __init__( |
| 80 | + self, credentials, subscription_id, base_url=None): |
| 81 | + |
| 82 | + self.config = KustoManagementClientConfiguration(credentials, subscription_id, base_url) |
| 83 | + super(KustoManagementClient, self).__init__(self.config.credentials, self.config) |
| 84 | + |
| 85 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 86 | + self.api_version = '2017-09-07-privatepreview' |
| 87 | + self._serialize = Serializer(client_models) |
| 88 | + self._deserialize = Deserializer(client_models) |
| 89 | + |
| 90 | + self.clusters = ClustersOperations( |
| 91 | + self._client, self.config, self._serialize, self._deserialize) |
| 92 | + self.databases = DatabasesOperations( |
| 93 | + self._client, self.config, self._serialize, self._deserialize) |
| 94 | + self.operations = Operations( |
| 95 | + self._client, self.config, self._serialize, self._deserialize) |
0 commit comments