diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py b/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py index 69437bed699b..dd5f05cad90e 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/kusto_management_client.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.clusters_operations import ClustersOperations from .operations.databases_operations import DatabasesOperations +from .operations.event_hub_connections_operations import EventHubConnectionsOperations from .operations.operations import Operations from . import models @@ -63,6 +64,8 @@ class KustoManagementClient(SDKClient): :vartype clusters: azure.mgmt.kusto.operations.ClustersOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations + :ivar event_hub_connections: EventHubConnections operations + :vartype event_hub_connections: azure.mgmt.kusto.operations.EventHubConnectionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.kusto.operations.Operations @@ -83,7 +86,7 @@ def __init__( 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 = '2017-09-07-privatepreview' + self.api_version = '2018-09-07-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -91,5 +94,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) + self.event_hub_connections = EventHubConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py index 31108c7330d1..142da6f8acf2 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py @@ -10,47 +10,115 @@ # -------------------------------------------------------------------------- try: + from .trusted_external_tenant_py3 import TrustedExternalTenant + from .azure_sku_py3 import AzureSku + from .azure_capacity_py3 import AzureCapacity + from .azure_resource_sku_py3 import AzureResourceSku + from .database_statistics_py3 import DatabaseStatistics + from .event_hub_connection_validation_py3 import EventHubConnectionValidation from .cluster_py3 import Cluster from .cluster_update_py3 import ClusterUpdate from .database_py3 import Database from .database_update_py3 import DatabaseUpdate + from .database_principal_py3 import DatabasePrincipal + from .event_hub_connection_update_py3 import EventHubConnectionUpdate + from .event_hub_connection_py3 import EventHubConnection + from .event_hub_connection_validation_result_py3 import EventHubConnectionValidationResult + from .database_principal_list_result_py3 import DatabasePrincipalListResult + from .database_principal_list_request_py3 import DatabasePrincipalListRequest + from .event_hub_connection_validation_list_result_py3 import EventHubConnectionValidationListResult + from .cluster_check_name_request_py3 import ClusterCheckNameRequest + from .database_check_name_request_py3 import DatabaseCheckNameRequest + from .check_name_result_py3 import CheckNameResult from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation - from .proxy_resource_py3 import ProxyResource 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 .azure_sku import AzureSku + from .azure_capacity import AzureCapacity + from .azure_resource_sku import AzureResourceSku + from .database_statistics import DatabaseStatistics + from .event_hub_connection_validation import EventHubConnectionValidation from .cluster import Cluster from .cluster_update import ClusterUpdate from .database import Database from .database_update import DatabaseUpdate + from .database_principal import DatabasePrincipal + from .event_hub_connection_update import EventHubConnectionUpdate + from .event_hub_connection import EventHubConnection + from .event_hub_connection_validation_result import EventHubConnectionValidationResult + from .database_principal_list_result import DatabasePrincipalListResult + from .database_principal_list_request import DatabasePrincipalListRequest + from .event_hub_connection_validation_list_result import EventHubConnectionValidationListResult + from .cluster_check_name_request import ClusterCheckNameRequest + from .database_check_name_request import DatabaseCheckNameRequest + from .check_name_result import CheckNameResult from .operation_display import OperationDisplay from .operation import Operation - from .proxy_resource import ProxyResource from .tracked_resource import TrackedResource from .azure_entity_resource import AzureEntityResource from .resource import Resource + from .proxy_resource import ProxyResource from .cluster_paged import ClusterPaged +from .azure_sku_paged import AzureSkuPaged +from .azure_resource_sku_paged import AzureResourceSkuPaged from .database_paged import DatabasePaged +from .database_principal_paged import DatabasePrincipalPaged +from .event_hub_connection_paged import EventHubConnectionPaged from .operation_paged import OperationPaged from .kusto_management_client_enums import ( + State, ProvisioningState, + AzureSkuName, + AzureScaleType, + DataFormat, + DatabasePrincipalRole, + DatabasePrincipalType, ) __all__ = [ + 'TrustedExternalTenant', + 'AzureSku', + 'AzureCapacity', + 'AzureResourceSku', + 'DatabaseStatistics', + 'EventHubConnectionValidation', 'Cluster', 'ClusterUpdate', 'Database', 'DatabaseUpdate', + 'DatabasePrincipal', + 'EventHubConnectionUpdate', + 'EventHubConnection', + 'EventHubConnectionValidationResult', + 'DatabasePrincipalListResult', + 'DatabasePrincipalListRequest', + 'EventHubConnectionValidationListResult', + 'ClusterCheckNameRequest', + 'DatabaseCheckNameRequest', + 'CheckNameResult', 'OperationDisplay', 'Operation', - 'ProxyResource', 'TrackedResource', 'AzureEntityResource', 'Resource', + 'ProxyResource', 'ClusterPaged', + 'AzureSkuPaged', + 'AzureResourceSkuPaged', 'DatabasePaged', + 'DatabasePrincipalPaged', + 'EventHubConnectionPaged', 'OperationPaged', + 'State', 'ProvisioningState', + 'AzureSkuName', + 'AzureScaleType', + 'DataFormat', + 'DatabasePrincipalRole', + 'DatabasePrincipalType', ] diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity.py new file mode 100644 index 000000000000..996a04ad0574 --- /dev/null +++ b/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): + """AzureCapacity. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_capacity_py3.py new file mode 100644 index 000000000000..d1477ff108f0 --- /dev/null +++ b/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): + """AzureCapacity. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku.py new file mode 100644 index 000000000000..54d0db505db1 --- /dev/null +++ b/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): + """AzureResourceSku. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_paged.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_paged.py new file mode 100644 index 000000000000..8e65487f9d19 --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_resource_sku_py3.py new file mode 100644 index 000000000000..5fcf74caa2b2 --- /dev/null +++ b/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): + """AzureResourceSku. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku.py new file mode 100644 index 000000000000..5de991656244 --- /dev/null +++ b/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): + """AzureSku. + + 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. SKU name. Possible values include: 'KC8', 'KC16', + 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: SKU capacity. + :type capacity: int + :ivar tier: Required. SKU tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + tier = "Standard" + + def __init__(self, **kwargs): + super(AzureSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_paged.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_paged.py new file mode 100644 index 000000000000..e98163c92ebd --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_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 AzureSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureSku]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureSkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/azure_sku_py3.py new file mode 100644 index 000000000000..29e0d0801bfe --- /dev/null +++ b/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): + """AzureSku. + + 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. SKU name. Possible values include: 'KC8', 'KC16', + 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: SKU capacity. + :type capacity: int + :ivar tier: Required. SKU tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + tier = "Standard" + + def __init__(self, *, name, capacity: int=None, **kwargs) -> None: + super(AzureSku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.py new file mode 100644 index 000000000000..4b92ce6d06b3 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result.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 CheckNameResult(Model): + """CheckNameResult. + + :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 + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', '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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_py3.py new file mode 100644 index 000000000000..761d51be7406 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/check_name_result_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 CheckNameResult(Model): + """CheckNameResult. + + :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 + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, name: str=None, message: str=None, **kwargs) -> None: + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = name_available + self.name = name + self.message = message diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py index e3e4eb57e3bf..4711cce20082 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster.py @@ -32,12 +32,25 @@ class Cluster(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str - :ivar etag: An etag of the resource created + :ivar etag: An ETag of the resource created. :vartype etag: 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' + :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' :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] """ _validation = { @@ -46,7 +59,11 @@ class Cluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, } _attribute_map = { @@ -56,10 +73,20 @@ class Cluster(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag', '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]'}, } def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.etag = 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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request.py new file mode 100644 index 000000000000..b311edbb982c --- /dev/null +++ b/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): + """ClusterCheckNameRequest. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_check_name_request_py3.py new file mode 100644 index 000000000000..bcb12262943e --- /dev/null +++ b/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): + """ClusterCheckNameRequest. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py index c0a842f5b2f9..e4fcdc1bb8cf 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_py3.py @@ -32,12 +32,25 @@ class Cluster(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str - :ivar etag: An etag of the resource created + :ivar etag: An ETag of the resource created. :vartype etag: 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' + :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' :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] """ _validation = { @@ -46,7 +59,11 @@ class Cluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'etag': {'readonly': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, } _attribute_map = { @@ -56,10 +73,20 @@ class Cluster(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag', '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]'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, tags=None, trusted_external_tenants=None, **kwargs) -> None: super(Cluster, self).__init__(tags=tags, location=location, **kwargs) self.etag = None + 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 diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py index db697b6af82c..50c854672d7b 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update.py @@ -26,30 +26,65 @@ class ClusterUpdate(Resource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Resource location + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. :type location: str + :ivar etag: An ETag of the resource updated. + :vartype etag: 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' + :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' :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] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', '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]'}, } def __init__(self, **kwargs): super(ClusterUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) + self.etag = 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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py index 0474a4493010..15946c48e8fe 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/cluster_update_py3.py @@ -26,30 +26,65 @@ class ClusterUpdate(Resource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Resource location + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. :type location: str + :ivar etag: An ETag of the resource updated. + :vartype etag: 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' + :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' :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] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'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'}, + 'etag': {'key': 'etag', '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]'}, } - def __init__(self, *, location: str=None, **kwargs) -> None: + def __init__(self, *, tags=None, location: str=None, sku=None, trusted_external_tenants=None, **kwargs) -> None: super(ClusterUpdate, self).__init__(**kwargs) + self.tags = tags self.location = location + self.etag = None + 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 diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py index 4c6d2f361bfb..630029df41d0 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database.py @@ -32,7 +32,7 @@ class Database(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str - :ivar etag: An etag of the resource created + :ivar etag: An ETag of the resource created. :vartype etag: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed' @@ -41,6 +41,11 @@ class Database(TrackedResource): :param soft_delete_period_in_days: Required. The number of days data should be kept before it stops being accessible to queries. :type soft_delete_period_in_days: int + :param hot_cache_period_in_days: The number of days of data that should be + kept in cache for fast queries. + :type hot_cache_period_in_days: int + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics """ _validation = { @@ -62,6 +67,8 @@ class Database(TrackedResource): 'etag': {'key': 'etag', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'soft_delete_period_in_days': {'key': 'properties.softDeletePeriodInDays', 'type': 'int'}, + 'hot_cache_period_in_days': {'key': 'properties.hotCachePeriodInDays', 'type': 'int'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, } def __init__(self, **kwargs): @@ -69,3 +76,5 @@ def __init__(self, **kwargs): self.etag = None self.provisioning_state = None self.soft_delete_period_in_days = kwargs.get('soft_delete_period_in_days', None) + self.hot_cache_period_in_days = kwargs.get('hot_cache_period_in_days', None) + self.statistics = kwargs.get('statistics', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request.py new file mode 100644 index 000000000000..085a3908e895 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request.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 DatabaseCheckNameRequest(Model): + """DatabaseCheckNameRequest. + + 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. Database name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases. Default value: + "Microsoft.Kusto/clusters/databases" . + :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" + + def __init__(self, **kwargs): + super(DatabaseCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request_py3.py new file mode 100644 index 000000000000..49a9937d9876 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_check_name_request_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 DatabaseCheckNameRequest(Model): + """DatabaseCheckNameRequest. + + 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. Database name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases. Default value: + "Microsoft.Kusto/clusters/databases" . + :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" + + def __init__(self, *, name: str, **kwargs) -> None: + super(DatabaseCheckNameRequest, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal.py new file mode 100644 index 000000000000..18d1f206a08e --- /dev/null +++ b/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): + """DatabasePrincipal. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request.py new file mode 100644 index 000000000000..f4f220f63e6f --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_request_py3.py new file mode 100644 index 000000000000..2c6c03a3cf4d --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result.py new file mode 100644 index 000000000000..015b4b5106b3 --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_list_result_py3.py new file mode 100644 index 000000000000..b1b800e73dc5 --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_paged.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_paged.py new file mode 100644 index 000000000000..ebecbcab0ad4 --- /dev/null +++ b/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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_principal_py3.py new file mode 100644 index 000000000000..15294f2d8955 --- /dev/null +++ b/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): + """DatabasePrincipal. + + 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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py index 1e5aacd37d19..dd3beb52eb78 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_py3.py @@ -32,7 +32,7 @@ class Database(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives :type location: str - :ivar etag: An etag of the resource created + :ivar etag: An ETag of the resource created. :vartype etag: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed' @@ -41,6 +41,11 @@ class Database(TrackedResource): :param soft_delete_period_in_days: Required. The number of days data should be kept before it stops being accessible to queries. :type soft_delete_period_in_days: int + :param hot_cache_period_in_days: The number of days of data that should be + kept in cache for fast queries. + :type hot_cache_period_in_days: int + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics """ _validation = { @@ -62,10 +67,14 @@ class Database(TrackedResource): 'etag': {'key': 'etag', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'soft_delete_period_in_days': {'key': 'properties.softDeletePeriodInDays', 'type': 'int'}, + 'hot_cache_period_in_days': {'key': 'properties.hotCachePeriodInDays', 'type': 'int'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, } - def __init__(self, *, location: str, soft_delete_period_in_days: int, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, soft_delete_period_in_days: int, tags=None, hot_cache_period_in_days: int=None, statistics=None, **kwargs) -> None: super(Database, self).__init__(tags=tags, location=location, **kwargs) self.etag = None self.provisioning_state = None self.soft_delete_period_in_days = soft_delete_period_in_days + self.hot_cache_period_in_days = hot_cache_period_in_days + self.statistics = statistics diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics.py new file mode 100644 index 000000000000..3612f2559e58 --- /dev/null +++ b/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): + """DatabaseStatistics. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_statistics_py3.py new file mode 100644 index 000000000000..fa652d1693e3 --- /dev/null +++ b/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): + """DatabaseStatistics. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update.py index bdd5b7c79379..d0812c949eb3 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update.py @@ -28,8 +28,10 @@ class DatabaseUpdate(Resource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Resource location + :param location: Resource location. :type location: str + :ivar etag: An ETag of the resource updated. + :vartype etag: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed' :vartype provisioning_state: str or @@ -37,12 +39,18 @@ class DatabaseUpdate(Resource): :param soft_delete_period_in_days: Required. The number of days data should be kept before it stops being accessible to queries. :type soft_delete_period_in_days: int + :param hot_cache_period_in_days: The number of days of data that should be + kept in cache for fast queries. + :type hot_cache_period_in_days: int + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'soft_delete_period_in_days': {'required': True}, } @@ -52,12 +60,18 @@ class DatabaseUpdate(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'soft_delete_period_in_days': {'key': 'properties.softDeletePeriodInDays', 'type': 'int'}, + 'hot_cache_period_in_days': {'key': 'properties.hotCachePeriodInDays', 'type': 'int'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, } def __init__(self, **kwargs): super(DatabaseUpdate, self).__init__(**kwargs) self.location = kwargs.get('location', None) + self.etag = None self.provisioning_state = None self.soft_delete_period_in_days = kwargs.get('soft_delete_period_in_days', None) + self.hot_cache_period_in_days = kwargs.get('hot_cache_period_in_days', None) + self.statistics = kwargs.get('statistics', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update_py3.py index 5a4f73ca458a..9eb90c068a67 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update_py3.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/database_update_py3.py @@ -28,8 +28,10 @@ class DatabaseUpdate(Resource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Resource location + :param location: Resource location. :type location: str + :ivar etag: An ETag of the resource updated. + :vartype etag: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed' :vartype provisioning_state: str or @@ -37,12 +39,18 @@ class DatabaseUpdate(Resource): :param soft_delete_period_in_days: Required. The number of days data should be kept before it stops being accessible to queries. :type soft_delete_period_in_days: int + :param hot_cache_period_in_days: The number of days of data that should be + kept in cache for fast queries. + :type hot_cache_period_in_days: int + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'soft_delete_period_in_days': {'required': True}, } @@ -52,12 +60,18 @@ class DatabaseUpdate(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'soft_delete_period_in_days': {'key': 'properties.softDeletePeriodInDays', 'type': 'int'}, + 'hot_cache_period_in_days': {'key': 'properties.hotCachePeriodInDays', 'type': 'int'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, } - def __init__(self, *, soft_delete_period_in_days: int, location: str=None, **kwargs) -> None: + def __init__(self, *, soft_delete_period_in_days: int, location: str=None, hot_cache_period_in_days: int=None, statistics=None, **kwargs) -> None: super(DatabaseUpdate, self).__init__(**kwargs) self.location = location + self.etag = None self.provisioning_state = None self.soft_delete_period_in_days = soft_delete_period_in_days + self.hot_cache_period_in_days = hot_cache_period_in_days + self.statistics = statistics diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection.py new file mode 100644 index 000000000000..9da5e1dc4229 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection.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 .proxy_resource import ProxyResource + + +class EventHubConnection(ProxyResource): + """Class representing an event hub 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 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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'}, + '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(EventHubConnection, self).__init__(**kwargs) + self.location = kwargs.get('location', 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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_paged.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_paged.py new file mode 100644 index 000000000000..11ae7b77cdc9 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_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 EventHubConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`EventHubConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventHubConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(EventHubConnectionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_py3.py new file mode 100644 index 000000000000..185b618983c9 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_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 .proxy_resource_py3 import ProxyResource + + +class EventHubConnection(ProxyResource): + """Class representing an event hub 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 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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'}, + '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(EventHubConnection, self).__init__(**kwargs) + self.location = location + 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 diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update.py new file mode 100644 index 000000000000..d64c0f4fc6e4 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update.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 .proxy_resource import ProxyResource + + +class EventHubConnectionUpdate(ProxyResource): + """Class representing an update to event hub 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 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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'}, + '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(EventHubConnectionUpdate, self).__init__(**kwargs) + self.location = kwargs.get('location', 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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update_py3.py new file mode 100644 index 000000000000..b50e1639be3b --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_update_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 .proxy_resource_py3 import ProxyResource + + +class EventHubConnectionUpdate(ProxyResource): + """Class representing an update to event hub 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 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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'}, + '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(EventHubConnectionUpdate, self).__init__(**kwargs) + self.location = location + 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 diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation.py new file mode 100644 index 000000000000..0e958caa80df --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation.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 EventHubConnectionValidation(Model): + """Class representing an event hub connection validation. + + All required parameters must be populated in order to send to Azure. + + :param eventhub_connection_name: The name of the event hub connection. + :type eventhub_connection_name: 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + } + + _attribute_map = { + 'eventhub_connection_name': {'key': 'eventhubConnectionName', '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(EventHubConnectionValidation, self).__init__(**kwargs) + self.eventhub_connection_name = kwargs.get('eventhub_connection_name', 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) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_result.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_result.py new file mode 100644 index 000000000000..de53b92956ec --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_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 EventHubConnectionValidationListResult(Model): + """The list Kusto event hub connection validation result. + + :param value: The list of Kusto event hub connection validation errors. + :type value: + list[~azure.mgmt.kusto.models.EventHubConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventHubConnectionValidationResult]'}, + } + + def __init__(self, **kwargs): + super(EventHubConnectionValidationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_result_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_result_py3.py new file mode 100644 index 000000000000..ad79e47b5c6f --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_list_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 EventHubConnectionValidationListResult(Model): + """The list Kusto event hub connection validation result. + + :param value: The list of Kusto event hub connection validation errors. + :type value: + list[~azure.mgmt.kusto.models.EventHubConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventHubConnectionValidationResult]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EventHubConnectionValidationListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_py3.py new file mode 100644 index 000000000000..ed3485f548d5 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_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 EventHubConnectionValidation(Model): + """Class representing an event hub connection validation. + + All required parameters must be populated in order to send to Azure. + + :param eventhub_connection_name: The name of the event hub connection. + :type eventhub_connection_name: 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' + :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + """ + + _validation = { + 'event_hub_resource_id': {'required': True}, + 'consumer_group': {'required': True}, + } + + _attribute_map = { + 'eventhub_connection_name': {'key': 'eventhubConnectionName', '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, eventhub_connection_name: str=None, table_name: str=None, mapping_rule_name: str=None, data_format=None, **kwargs) -> None: + super(EventHubConnectionValidation, self).__init__(**kwargs) + self.eventhub_connection_name = eventhub_connection_name + 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 diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result.py new file mode 100644 index 000000000000..5aa6a79bdab5 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_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 EventHubConnectionValidationResult(Model): + """EventHubConnectionValidationResult. + + :param error_message: A message which indicates a problem in event hub + connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubConnectionValidationResult, self).__init__(**kwargs) + self.error_message = kwargs.get('error_message', None) diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result_py3.py new file mode 100644 index 000000000000..e51f0d23b757 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_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 EventHubConnectionValidationResult(Model): + """EventHubConnectionValidationResult. + + :param error_message: A message which indicates a problem in event hub + connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, error_message: str=None, **kwargs) -> None: + super(EventHubConnectionValidationResult, self).__init__(**kwargs) + self.error_message = error_message diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py index 411375e9cce7..ee31f67aa804 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/kusto_management_client_enums.py @@ -12,6 +12,18 @@ from enum import Enum +class State(str, Enum): + + creating = "Creating" + unavailable = "Unavailable" + running = "Running" + deleting = "Deleting" + deleted = "Deleted" + stopping = "Stopping" + stopped = "Stopped" + starting = "Starting" + + class ProvisioningState(str, Enum): running = "Running" @@ -19,3 +31,46 @@ class ProvisioningState(str, Enum): deleting = "Deleting" succeeded = "Succeeded" failed = "Failed" + + +class AzureSkuName(str, Enum): + + kc8 = "KC8" + kc16 = "KC16" + ks8 = "KS8" + ks16 = "KS16" + d13_v2 = "D13_v2" + d14_v2 = "D14_v2" + l8 = "L8" + l16 = "L16" + + +class AzureScaleType(str, Enum): + + automatic = "automatic" + manual = "manual" + none = "none" + + +class DataFormat(str, Enum): + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + + +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" diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py index a2fb1cc9353d..e06852a9f611 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/operation.py @@ -16,7 +16,7 @@ class Operation(Model): """A REST API operation. :param name: The operation name. This is of the format - {provider}/{resource}/{operation} + {provider}/{resource}/{operation}. :type name: str :param display: The object that describes the operation. :type display: ~azure.mgmt.kusto.models.OperationDisplay diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py index 50308e732f38..158551734c9b 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/models/operation_py3.py @@ -16,7 +16,7 @@ class Operation(Model): """A REST API operation. :param name: The operation name. This is of the format - {provider}/{resource}/{operation} + {provider}/{resource}/{operation}. :type name: str :param display: The object that describes the operation. :type display: ~azure.mgmt.kusto.models.OperationDisplay diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant.py new file mode 100644 index 000000000000..21903e2886dc --- /dev/null +++ b/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): + """TrustedExternalTenant. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant_py3.py b/azure-mgmt-kusto/azure/mgmt/kusto/models/trusted_external_tenant_py3.py new file mode 100644 index 000000000000..b8dcd125fef9 --- /dev/null +++ b/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): + """TrustedExternalTenant. + + :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/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py b/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py index 3e3275672746..63b84f781b6b 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py @@ -11,10 +11,12 @@ from .clusters_operations import ClustersOperations from .databases_operations import DatabasesOperations +from .event_hub_connections_operations import EventHubConnectionsOperations from .operations import Operations __all__ = [ 'ClustersOperations', 'DatabasesOperations', + 'EventHubConnectionsOperations', 'Operations', ] diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py b/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py index 9de601a448de..a971e132f9bb 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/operations/clusters_operations.py @@ -25,7 +25,7 @@ class ClustersOperations(object): :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: "2017-09-07-privatepreview". + :ivar api_version: Client API Version. Constant value: "2018-09-07-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-09-07-privatepreview" + self.api_version = "2018-09-07-preview" self.config = config @@ -104,9 +104,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, cluster_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Cluster(tags=tags, location=location) - + 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 = { @@ -157,7 +155,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, cluster_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 @@ -165,10 +163,9 @@ def create_or_update( :type resource_group_name: str :param cluster_name: The name of the Kusto cluster. :type cluster_name: str - :param location: The geo-location where the resource lives - :type location: str - :param tags: Resource tags. - :type tags: dict[str, 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 @@ -185,8 +182,7 @@ def create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - location=location, - tags=tags, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -212,9 +208,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, cluster_name, location=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ClusterUpdate(location=location) - + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -265,7 +259,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, cluster_name, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 @@ -273,8 +267,9 @@ def update( :type resource_group_name: str :param cluster_name: The name of the Kusto cluster. :type cluster_name: str - :param location: Resource location - :type location: 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 @@ -291,7 +286,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - location=location, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -395,6 +390,166 @@ def get_long_running_output(response): 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_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists all Kusto clusters within a resource group. @@ -526,3 +681,205 @@ def internal_paging(next_link=None, raw=False): 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 AzureSku + :rtype: + ~azure.mgmt.kusto.models.AzureSkuPaged[~azure.mgmt.kusto.models.AzureSku] + :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.AzureSkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AzureSkuPaged(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/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py b/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py index 993f4e3b09e7..829dd5930b88 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/operations/databases_operations.py @@ -25,7 +25,7 @@ class DatabasesOperations(object): :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: "2017-09-07-privatepreview". + :ivar api_version: Client API Version. Constant value: "2018-09-07-preview". """ models = models @@ -35,10 +35,81 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-09-07-privatepreview" + self.api_version = "2018-09-07-preview" self.config = config + def check_name_availability( + self, resource_group_name, cluster_name, name, 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: Database 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` + """ + database_name = models.DatabaseCheckNameRequest(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'), + '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_name, 'DatabaseCheckNameRequest') + + # 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. @@ -286,9 +357,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, cluster_name, database_name, soft_delete_period_in_days, location=None, custom_headers=None, raw=False, **operation_config): - parameters = models.DatabaseUpdate(location=location, soft_delete_period_in_days=soft_delete_period_in_days) - + 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 = { @@ -340,7 +409,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, cluster_name, database_name, soft_delete_period_in_days, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 @@ -350,11 +419,9 @@ def update( :type cluster_name: str :param database_name: The name of the database in the Kusto cluster. :type database_name: str - :param soft_delete_period_in_days: The number of days data should be - kept before it stops being accessible to queries. - :type soft_delete_period_in_days: int - :param location: Resource location - :type location: str + :param parameters: The database parameters supplied to the Update + operation. + :type parameters: ~azure.mgmt.kusto.models.DatabaseUpdate :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 @@ -372,8 +439,7 @@ def update( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, - soft_delete_period_in_days=soft_delete_period_in_days, - location=location, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -480,3 +546,226 @@ def get_long_running_output(response): 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/azure-mgmt-kusto/azure/mgmt/kusto/operations/event_hub_connections_operations.py b/azure-mgmt-kusto/azure/mgmt/kusto/operations/event_hub_connections_operations.py new file mode 100644 index 000000000000..643d6787ecf4 --- /dev/null +++ b/azure-mgmt-kusto/azure/mgmt/kusto/operations/event_hub_connections_operations.py @@ -0,0 +1,575 @@ +# 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 EventHubConnectionsOperations(object): + """EventHubConnectionsOperations 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: "2018-09-07-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-07-preview" + + 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 Event Hub 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 EventHubConnection + :rtype: + ~azure.mgmt.kusto.models.EventHubConnectionPaged[~azure.mgmt.kusto.models.EventHubConnection] + :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.EventHubConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventHubConnectionPaged(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}/eventhubconnections'} + + def eventhub_connection_validation( + self, resource_group_name, cluster_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + """Checks that the Event Hub 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 parameters: The Event Hub connection parameters supplied to the + CreateOrUpdate operation. + :type parameters: + ~azure.mgmt.kusto.models.EventHubConnectionValidation + :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: EventHubConnectionValidationListResult or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.kusto.models.EventHubConnectionValidationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.eventhub_connection_validation.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, 'EventHubConnectionValidation') + + # 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('EventHubConnectionValidationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + eventhub_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubConnectionValidation'} + + def get( + self, resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers=None, raw=False, **operation_config): + """Returns an Event Hub 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 event_hub_connection_name: The name of the event hub + connection. + :type event_hub_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: EventHubConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.EventHubConnection 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'), + 'eventHubConnectionName': self._serialize.url("event_hub_connection_name", event_hub_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('EventHubConnection', 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}/eventhubconnections/{eventHubConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, database_name, event_hub_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'), + 'eventHubConnectionName': self._serialize.url("event_hub_connection_name", event_hub_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, 'EventHubConnection') + + # 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('EventHubConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('EventHubConnection', 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, event_hub_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a Event Hub 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 event_hub_connection_name: The name of the event hub + connection. + :type event_hub_connection_name: str + :param parameters: The Event Hub connection parameters supplied to the + CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.EventHubConnection + :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 EventHubConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.EventHubConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.EventHubConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + event_hub_connection_name=event_hub_connection_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EventHubConnection', 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}/eventhubconnections/{eventHubConnectionName}'} + + + def _update_initial( + self, resource_group_name, cluster_name, database_name, event_hub_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'), + 'eventHubConnectionName': self._serialize.url("event_hub_connection_name", event_hub_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, 'EventHubConnectionUpdate') + + # 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('EventHubConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('EventHubConnection', 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, event_hub_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a Event Hub 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 event_hub_connection_name: The name of the event hub + connection. + :type event_hub_connection_name: str + :param parameters: The Event Hub connection parameters supplied to the + Update operation. + :type parameters: ~azure.mgmt.kusto.models.EventHubConnectionUpdate + :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 EventHubConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.EventHubConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.EventHubConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + event_hub_connection_name=event_hub_connection_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EventHubConnection', 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}/eventhubconnections/{eventHubConnectionName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, database_name, event_hub_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'), + 'eventHubConnectionName': self._serialize.url("event_hub_connection_name", event_hub_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, event_hub_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the Event Hub 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 event_hub_connection_name: The name of the event hub + connection. + :type event_hub_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, + event_hub_connection_name=event_hub_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}/eventhubconnections/{eventHubConnectionName}'} diff --git a/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py b/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py index 37750b3f7aa9..bd7d7da96415 100644 --- a/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py +++ b/azure-mgmt-kusto/azure/mgmt/kusto/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :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: "2017-09-07-privatepreview". + :ivar api_version: Client API Version. Constant value: "2018-09-07-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-09-07-privatepreview" + self.api_version = "2018-09-07-preview" self.config = config