diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/__init__.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/__init__.py new file mode 100644 index 000000000000..ab4927454444 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/__init__.py @@ -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 + diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py new file mode 100644 index 000000000000..808cc772ea32 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py @@ -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` + :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` + :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) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py new file mode 100644 index 000000000000..04a479f2d32e --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py @@ -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', +] diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration.py new file mode 100644 index 000000000000..10503cddc234 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration.py @@ -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 diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_paged.py new file mode 100644 index 000000000000..48f4e7ac02ab --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_paged.py @@ -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 ` 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) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_py3.py new file mode 100644 index 000000000000..d8e44fd4124e --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/attached_database_configuration_py3.py @@ -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_py3 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, *, database_name: str, cluster_resource_id: str, location: str=None, **kwargs) -> None: + super(AttachedDatabaseConfiguration, self).__init__(**kwargs) + self.location = location + self.database_name = database_name + self.cluster_resource_id = cluster_resource_id + self.attached_database_names = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity.py new file mode 100644 index 000000000000..96d735f74620 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity.py @@ -0,0 +1,50 @@ +# 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.serialization import Model + + +class AzureCapacity(Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: + 'automatic', 'manual', 'none' + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = kwargs.get('scale_type', None) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity_py3.py new file mode 100644 index 000000000000..2ea34f67e991 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity_py3.py @@ -0,0 +1,50 @@ +# 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.serialization import Model + + +class AzureCapacity(Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: + 'automatic', 'manual', 'none' + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__(self, *, scale_type, minimum: int, maximum: int, default: int, **kwargs) -> None: + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = scale_type + self.minimum = minimum + self.maximum = maximum + self.default = default diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..d3f80d87498a --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# 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 .resource_py3 import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku.py new file mode 100644 index 000000000000..d56bc39e1551 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class AzureResourceSku(Model): + """Azure resource SKU definition. + + :param resource_type: Resource Namespace and Type. + :type resource_type: str + :param sku: The SKU details. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param capacity: The SKU capacity. + :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'capacity': {'key': 'capacity', 'type': 'AzureCapacity'}, + } + + def __init__(self, **kwargs): + super(AzureResourceSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_paged.py new file mode 100644 index 000000000000..8e65487f9d19 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_paged.py @@ -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 AzureResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_py3.py new file mode 100644 index 000000000000..2eb83500c01f --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_py3.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class AzureResourceSku(Model): + """Azure resource SKU definition. + + :param resource_type: Resource Namespace and Type. + :type resource_type: str + :param sku: The SKU details. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param capacity: The SKU capacity. + :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'capacity': {'key': 'capacity', 'type': 'AzureCapacity'}, + } + + def __init__(self, *, resource_type: str=None, sku=None, capacity=None, **kwargs) -> None: + super(AzureResourceSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku.py new file mode 100644 index 000000000000..1c9c23a0e149 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku.py @@ -0,0 +1,48 @@ +# 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.serialization import Model + + +class AzureSku(Model): + """Azure SKU definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. SKU name. Possible values include: + 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', + 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', + 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2' + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: SKU capacity. + :type capacity: int + :param tier: Required. SKU tier. Possible values include: 'Basic', + 'Standard' + :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) + self.tier = kwargs.get('tier', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_py3.py new file mode 100644 index 000000000000..2122a176ce2a --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_py3.py @@ -0,0 +1,48 @@ +# 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.serialization import Model + + +class AzureSku(Model): + """Azure SKU definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. SKU name. Possible values include: + 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', + 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', + 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2' + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: SKU capacity. + :type capacity: int + :param tier: Required. SKU tier. Possible values include: 'Basic', + 'Standard' + :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name, tier, capacity: int=None, **kwargs) -> None: + super(AzureSku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + self.tier = tier diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request.py new file mode 100644 index 000000000000..42a65c4a3b39 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request.py @@ -0,0 +1,42 @@ +# 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.serialization import Model + + +class CheckNameRequest(Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, **kwargs): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request_py3.py new file mode 100644 index 000000000000..1df6abba7e98 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_request_py3.py @@ -0,0 +1,42 @@ +# 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.serialization import Model + + +class CheckNameRequest(Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, *, name: str, type, **kwargs) -> None: + super(CheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.py new file mode 100644 index 000000000000..28c9a31746ae --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class CheckNameResult(Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the + name is available. + :type name_available: bool + :param name: The name that was checked. + :type name: str + :param message: Message indicating an unavailable name due to a conflict, + or a description of the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.kusto.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.name = kwargs.get('name', None) + self.message = kwargs.get('message', None) + self.reason = kwargs.get('reason', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_py3.py new file mode 100644 index 000000000000..91edde6bcb30 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_py3.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class CheckNameResult(Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the + name is available. + :type name_available: bool + :param name: The name that was checked. + :type name: str + :param message: Message indicating an unavailable name due to a conflict, + or a description of the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.kusto.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, name: str=None, message: str=None, reason=None, **kwargs) -> None: + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = name_available + self.name = name + self.message = message + self.reason = reason diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py new file mode 100644 index 000000000000..5c96b59a2d64 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py @@ -0,0 +1,92 @@ +# 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 .tracked_resource import TrackedResource + + +class Cluster(TrackedResource): + """Class representing a Kusto cluster. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param sku: Required. The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: + 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', + 'Stopped', 'Starting', 'Updating' + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: + list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param intelligent_autoscale: Intelligent auto scale definition. + :type intelligent_autoscale: ~azure.mgmt.kusto.models.IntelligentAutoscale + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'intelligent_autoscale': {'key': 'properties.intelligentAutoscale', 'type': 'IntelligentAutoscale'}, + } + + def __init__(self, **kwargs): + super(Cluster, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) + self.intelligent_autoscale = kwargs.get('intelligent_autoscale', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request.py new file mode 100644 index 000000000000..d123a58838f4 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request.py @@ -0,0 +1,44 @@ +# 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.serialization import Model + + +class ClusterCheckNameRequest(Model): + """The result returned from a cluster check name availability request. + + 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. + + :param name: Required. Cluster name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Kusto/clusters. + Default value: "Microsoft.Kusto/clusters" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters" + + def __init__(self, **kwargs): + super(ClusterCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request_py3.py new file mode 100644 index 000000000000..fe69d0f10473 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request_py3.py @@ -0,0 +1,44 @@ +# 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.serialization import Model + + +class ClusterCheckNameRequest(Model): + """The result returned from a cluster check name availability request. + + 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. + + :param name: Required. Cluster name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Kusto/clusters. + Default value: "Microsoft.Kusto/clusters" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters" + + def __init__(self, *, name: str, **kwargs) -> None: + super(ClusterCheckNameRequest, self).__init__(**kwargs) + self.name = name diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_paged.py new file mode 100644 index 000000000000..c481b50a1897 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_paged.py @@ -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 ClusterPaged(Paged): + """ + A paging container for iterating over a list of :class:`Cluster ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Cluster]'} + } + + def __init__(self, *args, **kwargs): + + super(ClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py new file mode 100644 index 000000000000..524b3fdd733a --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py @@ -0,0 +1,92 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Cluster(TrackedResource): + """Class representing a Kusto cluster. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param sku: Required. The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: + 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', + 'Stopped', 'Starting', 'Updating' + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: + list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param intelligent_autoscale: Intelligent auto scale definition. + :type intelligent_autoscale: ~azure.mgmt.kusto.models.IntelligentAutoscale + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'intelligent_autoscale': {'key': 'properties.intelligentAutoscale', 'type': 'IntelligentAutoscale'}, + } + + def __init__(self, *, location: str, sku, tags=None, trusted_external_tenants=None, intelligent_autoscale=None, **kwargs) -> None: + super(Cluster, self).__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.trusted_external_tenants = trusted_external_tenants + self.intelligent_autoscale = intelligent_autoscale diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py new file mode 100644 index 000000000000..dc26f61d550d --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py @@ -0,0 +1,90 @@ +# 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 .resource import Resource + + +class ClusterUpdate(Resource): + """Class representing an update to a Kusto cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: + 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', + 'Stopped', 'Starting', 'Updating' + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: + list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param intelligent_autoscale: Intelligent auto scale definition. + :type intelligent_autoscale: ~azure.mgmt.kusto.models.IntelligentAutoscale + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'intelligent_autoscale': {'key': 'properties.intelligentAutoscale', 'type': 'IntelligentAutoscale'}, + } + + def __init__(self, **kwargs): + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.sku = kwargs.get('sku', None) + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) + self.intelligent_autoscale = kwargs.get('intelligent_autoscale', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py new file mode 100644 index 000000000000..cc1795c5e229 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py @@ -0,0 +1,90 @@ +# 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 .resource_py3 import Resource + + +class ClusterUpdate(Resource): + """Class representing an update to a Kusto cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: + 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', + 'Stopped', 'Starting', 'Updating' + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: + list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param intelligent_autoscale: Intelligent auto scale definition. + :type intelligent_autoscale: ~azure.mgmt.kusto.models.IntelligentAutoscale + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'intelligent_autoscale': {'key': 'properties.intelligentAutoscale', 'type': 'IntelligentAutoscale'}, + } + + def __init__(self, *, tags=None, location: str=None, sku=None, trusted_external_tenants=None, intelligent_autoscale=None, **kwargs) -> None: + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.sku = sku + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.trusted_external_tenants = trusted_external_tenants + self.intelligent_autoscale = intelligent_autoscale diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection.py new file mode 100644 index 000000000000..896b2d7a3ca1 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection.py @@ -0,0 +1,63 @@ +# 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 DataConnection(ProxyResource): + """Class representing an data connection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubDataConnection, EventGridDataConnection + + 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 kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'EventHub': 'EventHubDataConnection', 'EventGrid': 'EventGridDataConnection'} + } + + def __init__(self, **kwargs): + super(DataConnection, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.kind = None + self.kind = 'DataConnection' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request.py new file mode 100644 index 000000000000..2c31aa72d291 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request.py @@ -0,0 +1,46 @@ +# 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.serialization import Model + + +class DataConnectionCheckNameRequest(Model): + """The result returned from a data connections check name availability + request. + + 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. + + :param name: Required. Data Connection name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/dataConnections. Default value: + "Microsoft.Kusto/clusters/databases/dataConnections" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/databases/dataConnections" + + def __init__(self, **kwargs): + super(DataConnectionCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request_py3.py new file mode 100644 index 000000000000..7398e92e5ad5 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_check_name_request_py3.py @@ -0,0 +1,46 @@ +# 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.serialization import Model + + +class DataConnectionCheckNameRequest(Model): + """The result returned from a data connections check name availability + request. + + 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. + + :param name: Required. Data Connection name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/dataConnections. Default value: + "Microsoft.Kusto/clusters/databases/dataConnections" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/databases/dataConnections" + + def __init__(self, *, name: str, **kwargs) -> None: + super(DataConnectionCheckNameRequest, self).__init__(**kwargs) + self.name = name diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_paged.py new file mode 100644 index 000000000000..085f7a95e88e --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_paged.py @@ -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 DataConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(DataConnectionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_py3.py new file mode 100644 index 000000000000..3783107e8407 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_py3.py @@ -0,0 +1,63 @@ +# 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_py3 import ProxyResource + + +class DataConnection(ProxyResource): + """Class representing an data connection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubDataConnection, EventGridDataConnection + + 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 kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'EventHub': 'EventHubDataConnection', 'EventGrid': 'EventGridDataConnection'} + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(DataConnection, self).__init__(**kwargs) + self.location = location + self.kind = None + self.kind = 'DataConnection' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation.py new file mode 100644 index 000000000000..e0b3ea9b1efc --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation.py @@ -0,0 +1,32 @@ +# 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.serialization import Model + + +class DataConnectionValidation(Model): + """Class representing an data connection validation. + + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + """ + + _attribute_map = { + 'data_connection_name': {'key': 'dataConnectionName', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DataConnection'}, + } + + def __init__(self, **kwargs): + super(DataConnectionValidation, self).__init__(**kwargs) + self.data_connection_name = kwargs.get('data_connection_name', None) + self.properties = kwargs.get('properties', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result.py new file mode 100644 index 000000000000..cf4525a9bf56 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DataConnectionValidationListResult(Model): + """The list Kusto data connection validation result. + + :param value: The list of Kusto data connection validation errors. + :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnectionValidationResult]'}, + } + + def __init__(self, **kwargs): + super(DataConnectionValidationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result_py3.py new file mode 100644 index 000000000000..0be93df54a62 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_list_result_py3.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DataConnectionValidationListResult(Model): + """The list Kusto data connection validation result. + + :param value: The list of Kusto data connection validation errors. + :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnectionValidationResult]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DataConnectionValidationListResult, self).__init__(**kwargs) + self.value = value diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_py3.py new file mode 100644 index 000000000000..5c8e14b41503 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_py3.py @@ -0,0 +1,32 @@ +# 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.serialization import Model + + +class DataConnectionValidation(Model): + """Class representing an data connection validation. + + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + """ + + _attribute_map = { + 'data_connection_name': {'key': 'dataConnectionName', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DataConnection'}, + } + + def __init__(self, *, data_connection_name: str=None, properties=None, **kwargs) -> None: + super(DataConnectionValidation, self).__init__(**kwargs) + self.data_connection_name = data_connection_name + self.properties = properties diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result.py new file mode 100644 index 000000000000..aa142e24fd5c --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class DataConnectionValidationResult(Model): + """The result returned from a data connection validation request. + + :param error_message: A message which indicates a problem in data + connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectionValidationResult, self).__init__(**kwargs) + self.error_message = kwargs.get('error_message', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result_py3.py new file mode 100644 index 000000000000..4f13bcafb9ff --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/data_connection_validation_result_py3.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class DataConnectionValidationResult(Model): + """The result returned from a data connection validation request. + + :param error_message: A message which indicates a problem in data + connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, error_message: str=None, **kwargs) -> None: + super(DataConnectionValidationResult, self).__init__(**kwargs) + self.error_message = error_message diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py new file mode 100644 index 000000000000..13b5e3cf299d --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py @@ -0,0 +1,63 @@ +# 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 Database(ProxyResource): + """Class representing a Kusto database. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadWriteDatabase, ReadOnlyAttachedDatabase + + 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 kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ReadWrite': 'ReadWriteDatabase', 'ReadOnlyAttached': 'ReadOnlyAttachedDatabase'} + } + + def __init__(self, **kwargs): + super(Database, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.kind = None + self.kind = 'Database' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_paged.py new file mode 100644 index 000000000000..d925609492ce --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_paged.py @@ -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 DatabasePaged(Paged): + """ + A paging container for iterating over a list of :class:`Database ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Database]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabasePaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal.py new file mode 100644 index 000000000000..25006c75f921 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal.py @@ -0,0 +1,59 @@ +# 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.serialization import Model + + +class DatabasePrincipal(Model): + """A class representing database principal entity. + + All required parameters must be populated in order to send to Azure. + + :param role: Required. Database principal role. Possible values include: + 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param name: Required. Database principal name. + :type name: str + :param type: Required. Database principal type. Possible values include: + 'App', 'Group', 'User' + :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :param fqn: Database principal fully qualified name. + :type fqn: str + :param email: Database principal email if exists. + :type email: str + :param app_id: Application id - relevant only for application principal + type. + :type app_id: str + """ + + _validation = { + 'role': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'fqn': {'key': 'fqn', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatabasePrincipal, self).__init__(**kwargs) + self.role = kwargs.get('role', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.fqn = kwargs.get('fqn', None) + self.email = kwargs.get('email', None) + self.app_id = kwargs.get('app_id', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request.py new file mode 100644 index 000000000000..f4f220f63e6f --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DatabasePrincipalListRequest(Model): + """The list Kusto database principals operation request. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__(self, **kwargs): + super(DatabasePrincipalListRequest, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request_py3.py new file mode 100644 index 000000000000..2c6c03a3cf4d --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request_py3.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DatabasePrincipalListRequest(Model): + """The list Kusto database principals operation request. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DatabasePrincipalListRequest, self).__init__(**kwargs) + self.value = value diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result.py new file mode 100644 index 000000000000..015b4b5106b3 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DatabasePrincipalListResult(Model): + """The list Kusto database principals operation response. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__(self, **kwargs): + super(DatabasePrincipalListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result_py3.py new file mode 100644 index 000000000000..b1b800e73dc5 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result_py3.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class DatabasePrincipalListResult(Model): + """The list Kusto database principals operation response. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DatabasePrincipalListResult, self).__init__(**kwargs) + self.value = value diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_paged.py new file mode 100644 index 000000000000..ebecbcab0ad4 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_paged.py @@ -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 DatabasePrincipalPaged(Paged): + """ + A paging container for iterating over a list of :class:`DatabasePrincipal ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatabasePrincipal]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabasePrincipalPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_py3.py new file mode 100644 index 000000000000..32ae3e74b832 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_py3.py @@ -0,0 +1,59 @@ +# 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.serialization import Model + + +class DatabasePrincipal(Model): + """A class representing database principal entity. + + All required parameters must be populated in order to send to Azure. + + :param role: Required. Database principal role. Possible values include: + 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param name: Required. Database principal name. + :type name: str + :param type: Required. Database principal type. Possible values include: + 'App', 'Group', 'User' + :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :param fqn: Database principal fully qualified name. + :type fqn: str + :param email: Database principal email if exists. + :type email: str + :param app_id: Application id - relevant only for application principal + type. + :type app_id: str + """ + + _validation = { + 'role': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'fqn': {'key': 'fqn', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, *, role, name: str, type, fqn: str=None, email: str=None, app_id: str=None, **kwargs) -> None: + super(DatabasePrincipal, self).__init__(**kwargs) + self.role = role + self.name = name + self.type = type + self.fqn = fqn + self.email = email + self.app_id = app_id diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py new file mode 100644 index 000000000000..18d63e1db0fe --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py @@ -0,0 +1,63 @@ +# 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_py3 import ProxyResource + + +class Database(ProxyResource): + """Class representing a Kusto database. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadWriteDatabase, ReadOnlyAttachedDatabase + + 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 kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ReadWrite': 'ReadWriteDatabase', 'ReadOnlyAttached': 'ReadOnlyAttachedDatabase'} + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(Database, self).__init__(**kwargs) + self.location = location + self.kind = None + self.kind = 'Database' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics.py new file mode 100644 index 000000000000..8d0327ea29ab --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class DatabaseStatistics(Model): + """A class that contains database statistics information. + + :param size: The database size - the total size of compressed data and + index in bytes. + :type size: float + """ + + _attribute_map = { + 'size': {'key': 'size', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DatabaseStatistics, self).__init__(**kwargs) + self.size = kwargs.get('size', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics_py3.py new file mode 100644 index 000000000000..ef65a7665127 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics_py3.py @@ -0,0 +1,29 @@ +# 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.serialization import Model + + +class DatabaseStatistics(Model): + """A class that contains database statistics information. + + :param size: The database size - the total size of compressed data and + index in bytes. + :type size: float + """ + + _attribute_map = { + 'size': {'key': 'size', 'type': 'float'}, + } + + def __init__(self, *, size: float=None, **kwargs) -> None: + super(DatabaseStatistics, self).__init__(**kwargs) + self.size = size diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection.py new file mode 100644 index 000000000000..ca83ed443dfd --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection.py @@ -0,0 +1,90 @@ +# 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 .data_connection import DataConnection + + +class EventGridDataConnection(DataConnection): + """Class representing an Event Grid data connection. + + 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 kind: Required. Constant filled by server. + :type kind: str + :param storage_account_resource_id: Required. The resource ID of the + storage account where the data resides. + :type storage_account_resource_id: str + :param event_hub_resource_id: Required. The resource ID where the event + grid is configured to send events. + :type event_hub_resource_id: str + :param consumer_group: Required. The event hub consumer group. + :type consumer_group: str + :param table_name: Required. The table where the data should be ingested. + Optionally the table information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. + Optionally the mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: Required. The data format of the message. Optionally + the data format can be added to each message. Possible values include: + 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', + 'SINGLEJSON', 'AVRO' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'storage_account_resource_id': {'required': True}, + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + 'table_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventGridDataConnection, self).__init__(**kwargs) + 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) + self.table_name = kwargs.get('table_name', None) + self.mapping_rule_name = kwargs.get('mapping_rule_name', None) + self.data_format = kwargs.get('data_format', None) + self.kind = 'EventGrid' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection_py3.py new file mode 100644 index 000000000000..faa96aecab9b --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_grid_data_connection_py3.py @@ -0,0 +1,90 @@ +# 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 .data_connection_py3 import DataConnection + + +class EventGridDataConnection(DataConnection): + """Class representing an Event Grid data connection. + + 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 kind: Required. Constant filled by server. + :type kind: str + :param storage_account_resource_id: Required. The resource ID of the + storage account where the data resides. + :type storage_account_resource_id: str + :param event_hub_resource_id: Required. The resource ID where the event + grid is configured to send events. + :type event_hub_resource_id: str + :param consumer_group: Required. The event hub consumer group. + :type consumer_group: str + :param table_name: Required. The table where the data should be ingested. + Optionally the table information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. + Optionally the mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: Required. The data format of the message. Optionally + the data format can be added to each message. Possible values include: + 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', + 'SINGLEJSON', 'AVRO' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'storage_account_resource_id': {'required': True}, + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + 'table_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__(self, *, storage_account_resource_id: str, event_hub_resource_id: str, consumer_group: str, table_name: str, data_format, location: str=None, mapping_rule_name: str=None, **kwargs) -> None: + super(EventGridDataConnection, self).__init__(location=location, **kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.event_hub_resource_id = event_hub_resource_id + self.consumer_group = consumer_group + self.table_name = table_name + self.mapping_rule_name = mapping_rule_name + self.data_format = data_format + self.kind = 'EventGrid' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection.py new file mode 100644 index 000000000000..ac4e3424e520 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection.py @@ -0,0 +1,82 @@ +# 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 .data_connection import DataConnection + + +class EventHubDataConnection(DataConnection): + """Class representing an event hub data connection. + + 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 kind: Required. Constant filled by server. + :type kind: str + :param event_hub_resource_id: Required. The resource ID of the event hub + to be used to create a data connection. + :type event_hub_resource_id: str + :param consumer_group: Required. The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally + the table information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. + Optionally the mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data + format can be added to each message. Possible values include: 'MULTIJSON', + 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', + 'AVRO' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubDataConnection, self).__init__(**kwargs) + 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) + self.mapping_rule_name = kwargs.get('mapping_rule_name', None) + self.data_format = kwargs.get('data_format', None) + self.kind = 'EventHub' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection_py3.py new file mode 100644 index 000000000000..ded495f116c4 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_data_connection_py3.py @@ -0,0 +1,82 @@ +# 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 .data_connection_py3 import DataConnection + + +class EventHubDataConnection(DataConnection): + """Class representing an event hub data connection. + + 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 kind: Required. Constant filled by server. + :type kind: str + :param event_hub_resource_id: Required. The resource ID of the event hub + to be used to create a data connection. + :type event_hub_resource_id: str + :param consumer_group: Required. The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally + the table information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. + Optionally the mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data + format can be added to each message. Possible values include: 'MULTIJSON', + 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', + 'AVRO' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__(self, *, event_hub_resource_id: str, consumer_group: str, location: str=None, table_name: str=None, mapping_rule_name: str=None, data_format=None, **kwargs) -> None: + super(EventHubDataConnection, self).__init__(location=location, **kwargs) + self.event_hub_resource_id = event_hub_resource_id + self.consumer_group = consumer_group + self.table_name = table_name + self.mapping_rule_name = mapping_rule_name + self.data_format = data_format + self.kind = 'EventHub' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request.py new file mode 100644 index 000000000000..ec50a9b47ee5 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class FollowerDatabaseRequest(Model): + """A class representing follower database request. + + All required parameters must be populated in order to send to Azure. + + :param cluster_resource_id: Required. Resource id of the cluster that + follows a database owned by this cluster. + :type cluster_resource_id: str + :param database_name: Required. The database name owned by this cluster + that was followed. * in case following all databases. + :type database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'database_name': {'required': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FollowerDatabaseRequest, self).__init__(**kwargs) + self.cluster_resource_id = kwargs.get('cluster_resource_id', None) + self.database_name = kwargs.get('database_name', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request_py3.py new file mode 100644 index 000000000000..e799edd4e935 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_request_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class FollowerDatabaseRequest(Model): + """A class representing follower database request. + + All required parameters must be populated in order to send to Azure. + + :param cluster_resource_id: Required. Resource id of the cluster that + follows a database owned by this cluster. + :type cluster_resource_id: str + :param database_name: Required. The database name owned by this cluster + that was followed. * in case following all databases. + :type database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'database_name': {'required': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, *, cluster_resource_id: str, database_name: str, **kwargs) -> None: + super(FollowerDatabaseRequest, self).__init__(**kwargs) + self.cluster_resource_id = cluster_resource_id + self.database_name = database_name diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result.py new file mode 100644 index 000000000000..d3f090d354cc --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result.py @@ -0,0 +1,34 @@ +# 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.serialization import Model + + +class FollowerDatabaseResult(Model): + """A class representing database principal entity. + + :param cluster_resource_id: List of resource ids of clusters that are + following the database owned by this cluster. + :type cluster_resource_id: list[str] + :param database_name: The database name owned by this cluster that was + followed. * in case following all databases. + :type database_name: str + """ + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': '[str]'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FollowerDatabaseResult, self).__init__(**kwargs) + self.cluster_resource_id = kwargs.get('cluster_resource_id', None) + self.database_name = kwargs.get('database_name', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_paged.py new file mode 100644 index 000000000000..88c1b411447b --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_paged.py @@ -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 FollowerDatabaseResultPaged(Paged): + """ + A paging container for iterating over a list of :class:`FollowerDatabaseResult ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FollowerDatabaseResult]'} + } + + def __init__(self, *args, **kwargs): + + super(FollowerDatabaseResultPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_py3.py new file mode 100644 index 000000000000..d46a234ce806 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/follower_database_result_py3.py @@ -0,0 +1,34 @@ +# 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.serialization import Model + + +class FollowerDatabaseResult(Model): + """A class representing database principal entity. + + :param cluster_resource_id: List of resource ids of clusters that are + following the database owned by this cluster. + :type cluster_resource_id: list[str] + :param database_name: The database name owned by this cluster that was + followed. * in case following all databases. + :type database_name: str + """ + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': '[str]'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, *, cluster_resource_id=None, database_name: str=None, **kwargs) -> None: + super(FollowerDatabaseResult, self).__init__(**kwargs) + self.cluster_resource_id = cluster_resource_id + self.database_name = database_name diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale.py new file mode 100644 index 000000000000..f46105edd7c4 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class IntelligentAutoscale(Model): + """A class that contains the intelligent auto scale definition. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version of the template defined, for + instance 1. + :type version: int + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + """ + + _validation = { + 'version': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(IntelligentAutoscale, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale_py3.py new file mode 100644 index 000000000000..a874b35902ac --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/intelligent_autoscale_py3.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class IntelligentAutoscale(Model): + """A class that contains the intelligent auto scale definition. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version of the template defined, for + instance 1. + :type version: int + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + """ + + _validation = { + 'version': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + } + + def __init__(self, *, version: int, minimum: int, maximum: int, **kwargs) -> None: + super(IntelligentAutoscale, self).__init__(**kwargs) + self.version = version + self.minimum = minimum + self.maximum = maximum diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py new file mode 100644 index 000000000000..9d7c686cf779 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py @@ -0,0 +1,108 @@ +# 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 enum import Enum + + +class State(str, Enum): + + creating = "Creating" + unavailable = "Unavailable" + running = "Running" + deleting = "Deleting" + deleted = "Deleted" + stopping = "Stopping" + stopped = "Stopped" + starting = "Starting" + updating = "Updating" + + +class ProvisioningState(str, Enum): + + running = "Running" + creating = "Creating" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + moving = "Moving" + + +class AzureSkuName(str, Enum): + + standard_ds13_v21_tb_ps = "Standard_DS13_v2+1TB_PS" + standard_ds13_v22_tb_ps = "Standard_DS13_v2+2TB_PS" + standard_ds14_v23_tb_ps = "Standard_DS14_v2+3TB_PS" + standard_ds14_v24_tb_ps = "Standard_DS14_v2+4TB_PS" + standard_d13_v2 = "Standard_D13_v2" + standard_d14_v2 = "Standard_D14_v2" + standard_l8s = "Standard_L8s" + standard_l16s = "Standard_L16s" + standard_d11_v2 = "Standard_D11_v2" + standard_d12_v2 = "Standard_D12_v2" + standard_l4s = "Standard_L4s" + dev_no_sla_standard_d11_v2 = "Dev(No SLA)_Standard_D11_v2" + + +class AzureSkuTier(str, Enum): + + basic = "Basic" + standard = "Standard" + + +class AzureScaleType(str, Enum): + + automatic = "automatic" + manual = "manual" + none = "none" + + +class DataFormat(str, Enum): + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + + +class DatabasePrincipalRole(str, Enum): + + admin = "Admin" + ingestor = "Ingestor" + monitor = "Monitor" + user = "User" + unrestricted_viewers = "UnrestrictedViewers" + viewer = "Viewer" + + +class DatabasePrincipalType(str, Enum): + + app = "App" + group = "Group" + user = "User" + + +class Type(str, Enum): + + microsoft_kustoclustersdatabases = "Microsoft.Kusto/clusters/databases" + microsoft_kustoclustersattached_database_configurations = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + + +class Reason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py new file mode 100644 index 000000000000..e06852a9f611 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class Operation(Model): + """A REST API operation. + + :param name: The operation name. This is of the format + {provider}/{resource}/{operation}. + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.kusto.models.OperationDisplay + :param origin: The intended executor of the operation. + :type origin: str + :param properties: Properties of the operation. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display.py new file mode 100644 index 000000000000..cd0461e72f15 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider. + :type provider: str + :param operation: The operation type. For example: read, write, delete. + :type operation: str + :param resource: The resource type on which the operation is performed. + :type resource: str + :param description: The friendly name of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.operation = kwargs.get('operation', None) + self.resource = kwargs.get('resource', None) + self.description = kwargs.get('description', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display_py3.py new file mode 100644 index 000000000000..bfe8cb3f3656 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider. + :type provider: str + :param operation: The operation type. For example: read, write, delete. + :type operation: str + :param resource: The resource type on which the operation is performed. + :type resource: str + :param description: The friendly name of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, operation: str=None, resource: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.operation = operation + self.resource = resource + self.description = description diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_paged.py new file mode 100644 index 000000000000..35e6863fe30f --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_paged.py @@ -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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py new file mode 100644 index 000000000000..158551734c9b --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class Operation(Model): + """A REST API operation. + + :param name: The operation name. This is of the format + {provider}/{resource}/{operation}. + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.kusto.models.OperationDisplay + :param origin: The intended executor of the operation. + :type origin: str + :param properties: Properties of the operation. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource.py @@ -0,0 +1,45 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource_py3.py new file mode 100644 index 000000000000..2e8391f912d6 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# 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 .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database.py new file mode 100644 index 000000000000..989cf062fc19 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database.py @@ -0,0 +1,77 @@ +# 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 .database import Database + + +class ReadOnlyAttachedDatabase(Database): + """Class representing a read only attached database. + + 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 kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops + being accessible to queries in TimeSpan. + :vartype soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, **kwargs): + super(ReadOnlyAttachedDatabase, self).__init__(**kwargs) + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = kwargs.get('statistics', None) + self.kind = 'ReadOnlyAttached' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database_py3.py new file mode 100644 index 000000000000..ebc129f35b42 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_only_attached_database_py3.py @@ -0,0 +1,77 @@ +# 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 .database_py3 import Database + + +class ReadOnlyAttachedDatabase(Database): + """Class representing a read only attached database. + + 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 kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops + being accessible to queries in TimeSpan. + :vartype soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, *, location: str=None, hot_cache_period=None, statistics=None, **kwargs) -> None: + super(ReadOnlyAttachedDatabase, self).__init__(location=location, **kwargs) + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = hot_cache_period + self.statistics = statistics + self.kind = 'ReadOnlyAttached' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database.py new file mode 100644 index 000000000000..23b0ac9b7dee --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database.py @@ -0,0 +1,76 @@ +# 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 .database import Database + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + 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 kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it + stops being accessible to queries in TimeSpan. + :type soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, **kwargs): + super(ReadWriteDatabase, self).__init__(**kwargs) + self.provisioning_state = None + self.soft_delete_period = kwargs.get('soft_delete_period', None) + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = kwargs.get('statistics', None) + self.kind = 'ReadWrite' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database_py3.py new file mode 100644 index 000000000000..43210ac91d47 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/read_write_database_py3.py @@ -0,0 +1,76 @@ +# 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 .database_py3 import Database + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + 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 kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it + stops being accessible to queries in TimeSpan. + :type soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_period=None, statistics=None, **kwargs) -> None: + super(ReadWriteDatabase, self).__init__(location=location, **kwargs) + self.provisioning_state = None + self.soft_delete_period = soft_delete_period + self.hot_cache_period = hot_cache_period + self.statistics = statistics + self.kind = 'ReadWrite' diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource.py @@ -0,0 +1,47 @@ +# 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.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/resource_py3.py @@ -0,0 +1,47 @@ +# 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.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description.py new file mode 100644 index 000000000000..6bb95626c627 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description.py @@ -0,0 +1,60 @@ +# 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.serialization import Model + + +class SkuDescription(Model): + """The Kusto SKU description of given resource type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The resource type + :vartype resource_type: str + :ivar name: The name of the SKU + :vartype name: str + :ivar tier: The tier of the SKU + :vartype tier: str + :ivar locations: The set of locations that the SKU is available + :vartype locations: list[str] + :ivar location_info: Locations and zones + :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :ivar restrictions: The restrictions because of which SKU cannot be used + :vartype restrictions: list[object] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfoItem]'}, + 'restrictions': {'key': 'restrictions', 'type': '[object]'}, + } + + def __init__(self, **kwargs): + super(SkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.locations = None + self.location_info = None + self.restrictions = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_paged.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_paged.py new file mode 100644 index 000000000000..1ebdebe372fe --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_paged.py @@ -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 SkuDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`SkuDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SkuDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_py3.py new file mode 100644 index 000000000000..156a526d333c --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_description_py3.py @@ -0,0 +1,60 @@ +# 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.serialization import Model + + +class SkuDescription(Model): + """The Kusto SKU description of given resource type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The resource type + :vartype resource_type: str + :ivar name: The name of the SKU + :vartype name: str + :ivar tier: The tier of the SKU + :vartype tier: str + :ivar locations: The set of locations that the SKU is available + :vartype locations: list[str] + :ivar location_info: Locations and zones + :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :ivar restrictions: The restrictions because of which SKU cannot be used + :vartype restrictions: list[object] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfoItem]'}, + 'restrictions': {'key': 'restrictions', 'type': '[object]'}, + } + + def __init__(self, **kwargs) -> None: + super(SkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.locations = None + self.location_info = None + self.restrictions = None diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item.py new file mode 100644 index 000000000000..89ef6bb1dfb3 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item.py @@ -0,0 +1,38 @@ +# 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.serialization import Model + + +class SkuLocationInfoItem(Model): + """The locations and zones info for SKU. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The available location of the SKU. + :type location: str + :param zones: The available zone of the SKU. + :type zones: list[str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SkuLocationInfoItem, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item_py3.py new file mode 100644 index 000000000000..7e60b635e7d8 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/sku_location_info_item_py3.py @@ -0,0 +1,38 @@ +# 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.serialization import Model + + +class SkuLocationInfoItem(Model): + """The locations and zones info for SKU. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The available location of the SKU. + :type location: str + :param zones: The available zone of the SKU. + :type zones: list[str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, zones=None, **kwargs) -> None: + super(SkuLocationInfoItem, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource.py @@ -0,0 +1,55 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource_py3.py new file mode 100644 index 000000000000..b28cc1859448 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/tracked_resource_py3.py @@ -0,0 +1,55 @@ +# 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 .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant.py new file mode 100644 index 000000000000..5b325226ac50 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class TrustedExternalTenant(Model): + """Represents a tenant ID that is trusted by the cluster. + + :param value: GUID representing an external tenant. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustedExternalTenant, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant_py3.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant_py3.py new file mode 100644 index 000000000000..88c2fd5656fd --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant_py3.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class TrustedExternalTenant(Model): + """Represents a tenant ID that is trusted by the cluster. + + :param value: GUID representing an external tenant. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(TrustedExternalTenant, self).__init__(**kwargs) + self.value = value diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py new file mode 100644 index 000000000000..655d8473c5a3 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py @@ -0,0 +1,24 @@ +# 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 .clusters_operations import ClustersOperations +from .databases_operations import DatabasesOperations +from .attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations +from .data_connections_operations import DataConnectionsOperations +from .operations import Operations + +__all__ = [ + 'ClustersOperations', + 'DatabasesOperations', + 'AttachedDatabaseConfigurationsOperations', + 'DataConnectionsOperations', + 'Operations', +] diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/attached_database_configurations_operations.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/attached_database_configurations_operations.py new file mode 100644 index 000000000000..4429eb0301a7 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/attached_database_configurations_operations.py @@ -0,0 +1,376 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AttachedDatabaseConfigurationsOperations(object): + """AttachedDatabaseConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-01-21". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-21" + + self.config = config + + def list_by_cluster( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Returns the list of attached database configurations of the given Kusto + cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AttachedDatabaseConfiguration + :rtype: + ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationPaged[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AttachedDatabaseConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AttachedDatabaseConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + + def get( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, **operation_config): + """Returns an attached database configuration. + + :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 + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AttachedDatabaseConfiguration or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, attached_database_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AttachedDatabaseConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, attached_database_configuration_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an attached database configuration. + + :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 + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param parameters: The database parameters supplied to the + CreateOrUpdate operation. + :type parameters: + ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AttachedDatabaseConfiguration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration]] + :raises: :class:`CloudError` + """ + 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, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(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}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the attached database configuration with the given name. + + :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 + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py new file mode 100644 index 000000000000..141ae2c631ee --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py @@ -0,0 +1,1040 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ClustersOperations(object): + """ClustersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-01-21". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-21" + + self.config = config + + def get( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Gets a Kusto cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Cluster or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.Cluster or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Cluster') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + if response.status_code == 201: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a Kusto cluster. + + :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 + :param parameters: The Kusto cluster parameters supplied to the + CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.Cluster + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Cluster or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.Cluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.Cluster]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + + def _update_initial( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ClusterUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + if response.status_code == 201: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a Kusto cluster. + + :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 + :param parameters: The Kusto cluster parameters supplied to the Update + operation. + :type parameters: ~azure.mgmt.kusto.models.ClusterUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Cluster or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.Cluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.Cluster]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Kusto cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + + def _stop_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops a Kusto cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + + + def _start_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts a Kusto cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + + def list_follower_databases( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """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 + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FollowerDatabaseResult + :rtype: + ~azure.mgmt.kusto.models.FollowerDatabaseResultPaged[~azure.mgmt.kusto.models.FollowerDatabaseResult] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_follower_databases.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.FollowerDatabaseResultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FollowerDatabaseResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + + def detach_follower_databases( + self, resource_group_name, cluster_name, cluster_resource_id, database_name, custom_headers=None, raw=False, **operation_config): + """Detaches all followers of a database owned by this cluster. + + :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 + :param cluster_resource_id: Resource id of the cluster that follows a + database owned by this cluster. + :type cluster_resource_id: str + :param database_name: The database name owned by this cluster that was + followed. * in case following all databases. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FollowerDatabaseResult + :rtype: + ~azure.mgmt.kusto.models.FollowerDatabaseResultPaged[~azure.mgmt.kusto.models.FollowerDatabaseResult] + :raises: :class:`CloudError` + """ + follower_database_to_remove = models.FollowerDatabaseRequest(cluster_resource_id=cluster_resource_id, database_name=database_name) + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.detach_follower_databases.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(follower_database_to_remove, 'FollowerDatabaseRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.FollowerDatabaseResultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FollowerDatabaseResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + detach_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all Kusto clusters within a resource group. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Cluster + :rtype: + ~azure.mgmt.kusto.models.ClusterPaged[~azure.mgmt.kusto.models.Cluster] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all Kusto clusters within a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Cluster + :rtype: + ~azure.mgmt.kusto.models.ClusterPaged[~azure.mgmt.kusto.models.Cluster] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} + + def list_skus( + self, custom_headers=None, raw=False, **operation_config): + """Lists eligible SKUs for Kusto resource provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SkuDescription + :rtype: + ~azure.mgmt.kusto.models.SkuDescriptionPaged[~azure.mgmt.kusto.models.SkuDescription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_skus.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SkuDescriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SkuDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} + + def check_name_availability( + self, location, name, custom_headers=None, raw=False, **operation_config): + """Checks that the cluster name is valid and is not already in use. + + :param location: Azure location. + :type location: str + :param name: Cluster name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + cluster_name = models.ClusterCheckNameRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(cluster_name, 'ClusterCheckNameRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} + + def list_skus_by_resource( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Returns the SKUs available for the provided resource. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureResourceSku + :rtype: + ~azure.mgmt.kusto.models.AzureResourceSkuPaged[~azure.mgmt.kusto.models.AzureResourceSku] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_skus_by_resource.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AzureResourceSkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AzureResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_skus_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/data_connections_operations.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/data_connections_operations.py new file mode 100644 index 000000000000..5a51b776aa4a --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/data_connections_operations.py @@ -0,0 +1,647 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DataConnectionsOperations(object): + """DataConnectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-01-21". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-21" + + self.config = config + + def list_by_database( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, **operation_config): + """Returns the list of data connections of the given Kusto database. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DataConnection + :rtype: + ~azure.mgmt.kusto.models.DataConnectionPaged[~azure.mgmt.kusto.models.DataConnection] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DataConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DataConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} + + def data_connection_validation_method( + self, resource_group_name, cluster_name, database_name, data_connection_name=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Checks that the data connection parameters are valid. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataConnectionValidationListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.kusto.models.DataConnectionValidationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.DataConnectionValidation(data_connection_name=data_connection_name, properties=properties) + + # Construct URL + url = self.data_connection_validation_method.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataConnectionValidation') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataConnectionValidationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + data_connection_validation_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} + + def check_name_availability( + self, resource_group_name, cluster_name, database_name, name, custom_headers=None, raw=False, **operation_config): + """Checks that the data connection name is valid and is not already in + use. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Data Connection name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + data_connection_name = models.DataConnectionCheckNameRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(data_connection_name, 'DataConnectionCheckNameRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} + + def get( + self, resource_group_name, cluster_name, database_name, data_connection_name, custom_headers=None, raw=False, **operation_config): + """Returns a data connection. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.DataConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a data connection. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the + CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DataConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.DataConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.DataConnection]] + :raises: :class:`CloudError` + """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DataConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(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}'} + + + def _update_initial( + self, resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataConnection') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a data connection. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the + Update operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DataConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.DataConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.DataConnection]] + :raises: :class:`CloudError` + """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DataConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(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}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, database_name, data_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, database_name, data_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the data connection with the given name. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(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}'} diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py new file mode 100644 index 000000000000..10464d6c1323 --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py @@ -0,0 +1,776 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DatabasesOperations(object): + """DatabasesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-01-21". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-21" + + self.config = config + + def check_name_availability( + self, resource_group_name, cluster_name, name, type, custom_headers=None, raw=False, **operation_config): + """Checks that the database name is valid and is not already in use. + + :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 + :param name: Resource name. + :type name: str + :param type: The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + resource_name = models.CheckNameRequest(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(resource_name, 'CheckNameRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} + + def list_by_cluster( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Returns the list of databases of the given Kusto cluster. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Database + :rtype: + ~azure.mgmt.kusto.models.DatabasePaged[~azure.mgmt.kusto.models.Database] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} + + def get( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, **operation_config): + """Returns a database. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Database or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.Database or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Database') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a database. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the + CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Database or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.Database] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.Database]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(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}'} + + + def _update_initial( + self, resource_group_name, cluster_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Database') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, cluster_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a database. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the Update + operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Database or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.Database] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.Database]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the database with the given name. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def list_principals( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, **operation_config): + """Returns a list of database principals of the given Kusto cluster and + database. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatabasePrincipal + :rtype: + ~azure.mgmt.kusto.models.DatabasePrincipalPaged[~azure.mgmt.kusto.models.DatabasePrincipal] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_principals.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DatabasePrincipalPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DatabasePrincipalPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} + + def add_principals( + self, resource_group_name, cluster_name, database_name, value=None, custom_headers=None, raw=False, **operation_config): + """Add Database principals permissions. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabasePrincipalListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + database_principals_to_add = models.DatabasePrincipalListRequest(value=value) + + # Construct URL + url = self.add_principals.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(database_principals_to_add, 'DatabasePrincipalListRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} + + def remove_principals( + self, resource_group_name, cluster_name, database_name, value=None, custom_headers=None, raw=False, **operation_config): + """Remove Database principals permissions. + + :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 + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabasePrincipalListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + database_principals_to_remove = models.DatabasePrincipalListRequest(value=value) + + # Construct URL + url = self.remove_principals.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(database_principals_to_remove, 'DatabasePrincipalListRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + remove_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py new file mode 100644 index 000000000000..88bc178e823c --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py @@ -0,0 +1,98 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-01-21". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-21" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists available operations for the Microsoft.Kusto provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.kusto.models.OperationPaged[~azure.mgmt.kusto.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} diff --git a/sdk/azure-mgmt-kusto/azure/mgmt/kusto/version.py b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/sdk/azure-mgmt-kusto/azure/mgmt/kusto/version.py @@ -0,0 +1,13 @@ +# 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" +