Skip to content

Commit 927d089

Browse files
authored
[AutoPR azure-kusto/resource-manager] Kusto: Add Kusto swagger specification, documentation and examples (#3081)
* Generated from e74c7d26a62942c0124daf6bedc0649af3bd5f8a Fixing default tag of Kusto Mgmt * Kusto packaging
1 parent ab01fc1 commit 927d089

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2687
-0
lines changed

azure-mgmt-kusto/HISTORY.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0 (1970-01-01)
7+
++++++++++++++++++
8+
9+
* Initial Release

azure-mgmt-kusto/MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include *.rst
2+
include azure_bdist_wheel.py

azure-mgmt-kusto/README.rst

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Microsoft Azure SDK for Python
2+
==============================
3+
4+
This is the Microsoft Azure Kusto Management Client Library.
5+
6+
Azure Resource Manager (ARM) is the next generation of management APIs that
7+
replace the old Azure Service Management (ASM).
8+
9+
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
10+
11+
For the older Azure Service Management (ASM) libraries, see
12+
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
13+
14+
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.
15+
16+
17+
Compatibility
18+
=============
19+
20+
**IMPORTANT**: If you have an earlier version of the azure package
21+
(version < 1.0), you should uninstall it before installing this package.
22+
23+
You can check the version using pip:
24+
25+
.. code:: shell
26+
27+
pip freeze
28+
29+
If you see azure==0.11.0 (or any version below 1.0), uninstall it first:
30+
31+
.. code:: shell
32+
33+
pip uninstall azure
34+
35+
36+
Usage
37+
=====
38+
39+
For code examples, see `Kusto Management
40+
<https://docs.microsoft.com/python/api/overview/azure/>`__
41+
on docs.microsoft.com.
42+
43+
44+
Provide Feedback
45+
================
46+
47+
If you encounter any bugs or have suggestions, please file an issue in the
48+
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
49+
section of the project.

azure-mgmt-kusto/azure/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 .kusto_management_client import KustoManagementClient
13+
from .version import VERSION
14+
15+
__all__ = ['KustoManagementClient']
16+
17+
__version__ = VERSION
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
try:
13+
from .cluster_py3 import Cluster
14+
from .cluster_update_py3 import ClusterUpdate
15+
from .database_py3 import Database
16+
from .database_update_py3 import DatabaseUpdate
17+
from .operation_display_py3 import OperationDisplay
18+
from .operation_py3 import Operation
19+
from .proxy_resource_py3 import ProxyResource
20+
from .tracked_resource_py3 import TrackedResource
21+
from .azure_entity_resource_py3 import AzureEntityResource
22+
from .resource_py3 import Resource
23+
except (SyntaxError, ImportError):
24+
from .cluster import Cluster
25+
from .cluster_update import ClusterUpdate
26+
from .database import Database
27+
from .database_update import DatabaseUpdate
28+
from .operation_display import OperationDisplay
29+
from .operation import Operation
30+
from .proxy_resource import ProxyResource
31+
from .tracked_resource import TrackedResource
32+
from .azure_entity_resource import AzureEntityResource
33+
from .resource import Resource
34+
from .cluster_paged import ClusterPaged
35+
from .database_paged import DatabasePaged
36+
from .operation_paged import OperationPaged
37+
from .kusto_management_client_enums import (
38+
ProvisioningState,
39+
)
40+
41+
__all__ = [
42+
'Cluster',
43+
'ClusterUpdate',
44+
'Database',
45+
'DatabaseUpdate',
46+
'OperationDisplay',
47+
'Operation',
48+
'ProxyResource',
49+
'TrackedResource',
50+
'AzureEntityResource',
51+
'Resource',
52+
'ClusterPaged',
53+
'DatabasePaged',
54+
'OperationPaged',
55+
'ProvisioningState',
56+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 .resource import Resource
13+
14+
15+
class AzureEntityResource(Resource):
16+
"""The resource model definition for a Azure Resource Manager resource with an
17+
etag.
18+
19+
Variables are only populated by the server, and will be ignored when
20+
sending a request.
21+
22+
:ivar id: Fully qualified resource Id for the resource. Ex -
23+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
24+
:vartype id: str
25+
:ivar name: The name of the resource
26+
:vartype name: str
27+
:ivar type: The type of the resource. Ex-
28+
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
29+
:vartype type: str
30+
:ivar etag: Resource Etag.
31+
:vartype etag: str
32+
"""
33+
34+
_validation = {
35+
'id': {'readonly': True},
36+
'name': {'readonly': True},
37+
'type': {'readonly': True},
38+
'etag': {'readonly': True},
39+
}
40+
41+
_attribute_map = {
42+
'id': {'key': 'id', 'type': 'str'},
43+
'name': {'key': 'name', 'type': 'str'},
44+
'type': {'key': 'type', 'type': 'str'},
45+
'etag': {'key': 'etag', 'type': 'str'},
46+
}
47+
48+
def __init__(self, **kwargs):
49+
super(AzureEntityResource, self).__init__(**kwargs)
50+
self.etag = None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 .resource_py3 import Resource
13+
14+
15+
class AzureEntityResource(Resource):
16+
"""The resource model definition for a Azure Resource Manager resource with an
17+
etag.
18+
19+
Variables are only populated by the server, and will be ignored when
20+
sending a request.
21+
22+
:ivar id: Fully qualified resource Id for the resource. Ex -
23+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
24+
:vartype id: str
25+
:ivar name: The name of the resource
26+
:vartype name: str
27+
:ivar type: The type of the resource. Ex-
28+
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
29+
:vartype type: str
30+
:ivar etag: Resource Etag.
31+
:vartype etag: str
32+
"""
33+
34+
_validation = {
35+
'id': {'readonly': True},
36+
'name': {'readonly': True},
37+
'type': {'readonly': True},
38+
'etag': {'readonly': True},
39+
}
40+
41+
_attribute_map = {
42+
'id': {'key': 'id', 'type': 'str'},
43+
'name': {'key': 'name', 'type': 'str'},
44+
'type': {'key': 'type', 'type': 'str'},
45+
'etag': {'key': 'etag', 'type': 'str'},
46+
}
47+
48+
def __init__(self, **kwargs) -> None:
49+
super(AzureEntityResource, self).__init__(**kwargs)
50+
self.etag = None

0 commit comments

Comments
 (0)