From 305ee516d9476f0574514839405ba7b1da1907ad Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 22 Mar 2021 07:35:42 +0000 Subject: [PATCH] CodeGen from PR 13306 in Azure/azure-rest-api-specs Merge e170dfee8e000b875dcb7dc6f13270e1efdc078b into e10fd5f5f0b3444e589cd816321fce7036e33554 --- .../azure/mgmt/kusto/_configuration.py | 2 +- .../mgmt/kusto/_kusto_management_client.py | 10 + .../azure/mgmt/kusto/_metadata.json | 8 +- .../azure/mgmt/kusto/_version.py | 2 +- .../azure/mgmt/kusto/aio/_configuration.py | 2 +- .../kusto/aio/_kusto_management_client.py | 10 + .../mgmt/kusto/aio/operations/__init__.py | 4 + ...ched_database_configurations_operations.py | 8 +- ...luster_principal_assignments_operations.py | 10 +- .../aio/operations/_clusters_operations.py | 62 +- .../_data_connections_operations.py | 14 +- ...tabase_principal_assignments_operations.py | 10 +- .../aio/operations/_databases_operations.py | 18 +- .../mgmt/kusto/aio/operations/_operations.py | 2 +- .../_operations_results_operations.py | 99 +++ .../aio/operations/_scripts_operations.py | 667 +++++++++++++++++ .../azure/mgmt/kusto/models/__init__.py | 22 + .../models/_kusto_management_client_enums.py | 23 +- .../azure/mgmt/kusto/models/_models.py | 290 +++++++- .../azure/mgmt/kusto/models/_models_py3.py | 323 ++++++++- .../azure/mgmt/kusto/operations/__init__.py | 4 + ...ched_database_configurations_operations.py | 8 +- ...luster_principal_assignments_operations.py | 10 +- .../kusto/operations/_clusters_operations.py | 62 +- .../_data_connections_operations.py | 14 +- ...tabase_principal_assignments_operations.py | 10 +- .../kusto/operations/_databases_operations.py | 18 +- .../mgmt/kusto/operations/_operations.py | 2 +- .../_operations_results_operations.py | 104 +++ .../kusto/operations/_scripts_operations.py | 680 ++++++++++++++++++ 30 files changed, 2379 insertions(+), 119 deletions(-) create mode 100644 sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py create mode 100644 sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py create mode 100644 sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py create mode 100644 sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py index 1460adffc35ec..55ac8d3b7f553 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-09-18" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py index f164d7cde911e..3014882369fab 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py @@ -22,9 +22,11 @@ from .operations import ClusterPrincipalAssignmentsOperations from .operations import DatabasesOperations from .operations import DatabasePrincipalAssignmentsOperations +from .operations import ScriptsOperations from .operations import AttachedDatabaseConfigurationsOperations from .operations import DataConnectionsOperations from .operations import Operations +from .operations import OperationsResultsOperations from . import models @@ -39,12 +41,16 @@ class KustoManagementClient(object): :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations :ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations :vartype database_principal_assignments: azure.mgmt.kusto.operations.DatabasePrincipalAssignmentsOperations + :ivar scripts: ScriptsOperations operations + :vartype scripts: azure.mgmt.kusto.operations.ScriptsOperations :ivar attached_database_configurations: AttachedDatabaseConfigurationsOperations operations :vartype attached_database_configurations: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations :ivar data_connections: DataConnectionsOperations operations :vartype data_connections: azure.mgmt.kusto.operations.DataConnectionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.kusto.operations.Operations + :ivar operations_results: OperationsResultsOperations operations + :vartype operations_results: azure.mgmt.kusto.operations.OperationsResultsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -78,12 +84,16 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.database_principal_assignments = DatabasePrincipalAssignmentsOperations( self._client, self._config, self._serialize, self._deserialize) + self.scripts = ScriptsOperations( + self._client, self._config, self._serialize, self._deserialize) self.attached_database_configurations = AttachedDatabaseConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize) self.data_connections = DataConnectionsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.operations_results = OperationsResultsOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json index 9c8f38598ca4c..f569a4d109403 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2020-09-18", - "total_api_version_list": ["2020-09-18"], + "chosen_version": "2021-01-01", + "total_api_version_list": ["2021-01-01"], "client": { "name": "KustoManagementClient", "filename": "_kusto_management_client", @@ -56,9 +56,11 @@ "cluster_principal_assignments": "ClusterPrincipalAssignmentsOperations", "databases": "DatabasesOperations", "database_principal_assignments": "DatabasePrincipalAssignmentsOperations", + "scripts": "ScriptsOperations", "attached_database_configurations": "AttachedDatabaseConfigurationsOperations", "data_connections": "DataConnectionsOperations", - "operations": "Operations" + "operations": "Operations", + "operations_results": "OperationsResultsOperations" }, "operation_mixins": { }, diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py index c47f66669f1bf..eae7c95b6fbdb 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.1.0" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py index d4fda3662edf6..87f64ac0cefcd 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-09-18" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py index 281c3962b07d7..e01cd6c256883 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py @@ -20,9 +20,11 @@ from .operations import ClusterPrincipalAssignmentsOperations from .operations import DatabasesOperations from .operations import DatabasePrincipalAssignmentsOperations +from .operations import ScriptsOperations from .operations import AttachedDatabaseConfigurationsOperations from .operations import DataConnectionsOperations from .operations import Operations +from .operations import OperationsResultsOperations from .. import models @@ -37,12 +39,16 @@ class KustoManagementClient(object): :vartype databases: azure.mgmt.kusto.aio.operations.DatabasesOperations :ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations :vartype database_principal_assignments: azure.mgmt.kusto.aio.operations.DatabasePrincipalAssignmentsOperations + :ivar scripts: ScriptsOperations operations + :vartype scripts: azure.mgmt.kusto.aio.operations.ScriptsOperations :ivar attached_database_configurations: AttachedDatabaseConfigurationsOperations operations :vartype attached_database_configurations: azure.mgmt.kusto.aio.operations.AttachedDatabaseConfigurationsOperations :ivar data_connections: DataConnectionsOperations operations :vartype data_connections: azure.mgmt.kusto.aio.operations.DataConnectionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.kusto.aio.operations.Operations + :ivar operations_results: OperationsResultsOperations operations + :vartype operations_results: azure.mgmt.kusto.aio.operations.OperationsResultsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -75,12 +81,16 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.database_principal_assignments = DatabasePrincipalAssignmentsOperations( self._client, self._config, self._serialize, self._deserialize) + self.scripts = ScriptsOperations( + self._client, self._config, self._serialize, self._deserialize) self.attached_database_configurations = AttachedDatabaseConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize) self.data_connections = DataConnectionsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.operations_results = OperationsResultsOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/__init__.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/__init__.py index fb6fa59538660..27917c1aa7d51 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/__init__.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/__init__.py @@ -10,16 +10,20 @@ from ._cluster_principal_assignments_operations import ClusterPrincipalAssignmentsOperations from ._databases_operations import DatabasesOperations from ._database_principal_assignments_operations import DatabasePrincipalAssignmentsOperations +from ._scripts_operations import ScriptsOperations from ._attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations from ._data_connections_operations import DataConnectionsOperations from ._operations import Operations +from ._operations_results_operations import OperationsResultsOperations __all__ = [ 'ClustersOperations', 'ClusterPrincipalAssignmentsOperations', 'DatabasesOperations', 'DatabasePrincipalAssignmentsOperations', + 'ScriptsOperations', 'AttachedDatabaseConfigurationsOperations', 'DataConnectionsOperations', 'Operations', + 'OperationsResultsOperations', ] diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py index a9891ec0975c4..92fe31778b0ca 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py @@ -65,7 +65,7 @@ def list_by_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -192,7 +192,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -329,7 +329,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py index 3302449d1fd31..4019180e8c365 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py @@ -68,7 +68,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -134,7 +134,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -184,7 +184,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -319,7 +319,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -444,7 +444,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py index 32090944b443d..73018579828cb 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py @@ -65,7 +65,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -106,6 +106,8 @@ async def _create_or_update_initial( resource_group_name: str, cluster_name: str, parameters: "_models.Cluster", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, **kwargs ) -> "_models.Cluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -113,7 +115,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -132,6 +134,10 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') @@ -163,6 +169,8 @@ async def begin_create_or_update( resource_group_name: str, cluster_name: str, parameters: "_models.Cluster", + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, **kwargs ) -> AsyncLROPoller["_models.Cluster"]: """Create or update a Kusto cluster. @@ -173,6 +181,13 @@ async def begin_create_or_update( :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the CreateOrUpdate operation. :type parameters: ~azure.mgmt.kusto.models.Cluster + :param if_match: The ETag of the cluster. Omit this value to always overwrite the current + cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new cluster to be created, but to prevent updating + an existing cluster. Other values will result in a 412 Pre-condition Failed response. + :type if_none_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -195,6 +210,8 @@ async def begin_create_or_update( resource_group_name=resource_group_name, cluster_name=cluster_name, parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, cls=lambda x,y,z: x, **kwargs ) @@ -234,6 +251,7 @@ async def _update_initial( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterUpdate", + if_match: Optional[str] = None, **kwargs ) -> "_models.Cluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -241,7 +259,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -260,6 +278,8 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') @@ -294,6 +314,7 @@ async def begin_update( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterUpdate", + if_match: Optional[str] = None, **kwargs ) -> AsyncLROPoller["_models.Cluster"]: """Update a Kusto cluster. @@ -304,6 +325,10 @@ async def begin_update( :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the Update operation. :type parameters: ~azure.mgmt.kusto.models.ClusterUpdate + :param if_match: The ETag of the cluster. Omit this value to always overwrite the current + cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + changes. + :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -326,6 +351,7 @@ async def begin_update( resource_group_name=resource_group_name, cluster_name=cluster_name, parameters=parameters, + if_match=if_match, cls=lambda x,y,z: x, **kwargs ) @@ -371,7 +397,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -479,7 +505,7 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -587,7 +613,7 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -707,7 +733,7 @@ def list_follower_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -771,7 +797,7 @@ async def _detach_follower_databases_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -888,7 +914,7 @@ async def _diagnose_virtual_network_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -1013,7 +1039,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1080,7 +1106,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1146,7 +1172,7 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1204,7 +1230,7 @@ async def check_name_availability( ) -> "_models.CheckNameResult": """Checks that the cluster name is valid and is not already in use. - :param location: Azure location. + :param location: Azure location (region) name. :type location: str :param cluster_name: The name of the cluster. :type cluster_name: ~azure.mgmt.kusto.models.ClusterCheckNameRequest @@ -1218,7 +1244,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1280,7 +1306,7 @@ def list_skus_by_resource( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1354,7 +1380,7 @@ def list_language_extensions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1418,7 +1444,7 @@ async def _add_language_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1536,7 +1562,7 @@ async def _remove_language_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py index 1474292f2b57f..f701045a34662 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py @@ -68,7 +68,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -134,7 +134,7 @@ async def _data_connection_validation_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -282,7 +282,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -352,7 +352,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -404,7 +404,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -549,7 +549,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -693,7 +693,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py index 6a7c800fc1645..1b2ddbe474873 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py @@ -71,7 +71,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -141,7 +141,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -193,7 +193,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -334,7 +334,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -468,7 +468,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py index f12c0ed87e362..ae4bbf6ee4eee 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py @@ -68,7 +68,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -131,7 +131,7 @@ def list_by_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -208,7 +208,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -258,7 +258,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -396,7 +396,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -533,7 +533,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -661,7 +661,7 @@ def list_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -742,7 +742,7 @@ async def add_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -812,7 +812,7 @@ async def remove_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py index dd22452828d5a..1a9a99b188e97 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py new file mode 100644 index 0000000000000..c4492e6961e16 --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py @@ -0,0 +1,99 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsResultsOperations: + """OperationsResultsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location: str, + operation_id: str, + **kwargs + ) -> "_models.OperationResult": + """Returns operation results. + + :param location: Azure location (region) name. + :type location: str + :param operation_id: The Guid of the operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.OperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationresults/{operationId}'} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py new file mode 100644 index 0000000000000..6c939d40ed651 --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py @@ -0,0 +1,667 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ScriptsOperations: + """ScriptsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_database( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> AsyncIterable["_models.ScriptListResult"]: + """Returns the list of database scripts for given 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScriptListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ScriptListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScriptListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + **kwargs + ) -> "_models.Script": + """Gets a Kusto cluster database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Script, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Script + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + parameters: "_models.Script", + **kwargs + ) -> "_models.Script": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Script') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + parameters: "_models.Script", + **kwargs + ) -> AsyncLROPoller["_models.Script"]: + """Creates a Kusto database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :param parameters: The Kusto Script parameters contains the KQL to run. + :type parameters: ~azure.mgmt.kusto.models.Script + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Script or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Script] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + parameters: "_models.Script", + **kwargs + ) -> "_models.Script": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Script') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + parameters: "_models.Script", + **kwargs + ) -> AsyncLROPoller["_models.Script"]: + """Updates a database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :param parameters: The Kusto Script parameters contains to the KQL to run. + :type parameters: ~azure.mgmt.kusto.models.Script + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Script or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Script] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a Kusto principalAssignment. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + async def check_name_availability( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + script_name: "_models.ScriptCheckNameRequest", + **kwargs + ) -> "_models.CheckNameResult": + """Checks that the script name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param script_name: The name of the script. + :type script_name: ~azure.mgmt.kusto.models.ScriptCheckNameRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(script_name, 'ScriptCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability'} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py index 4bad7da941c0c..0d487db49251b 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py @@ -52,14 +52,20 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult + from ._models_py3 import OperationResult from ._models_py3 import OptimizedAutoscale from ._models_py3 import ProxyResource from ._models_py3 import ReadOnlyFollowingDatabase from ._models_py3 import ReadWriteDatabase from ._models_py3 import Resource + from ._models_py3 import Script + from ._models_py3 import ScriptCheckNameRequest + from ._models_py3 import ScriptListResult from ._models_py3 import SkuDescription from ._models_py3 import SkuDescriptionList from ._models_py3 import SkuLocationInfoItem + from ._models_py3 import SystemData + from ._models_py3 import TableLevelSharingProperties from ._models_py3 import TrackedResource from ._models_py3 import TrustedExternalTenant from ._models_py3 import VirtualNetworkConfiguration @@ -109,14 +115,20 @@ from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore + from ._models import OperationResult # type: ignore from ._models import OptimizedAutoscale # type: ignore from ._models import ProxyResource # type: ignore from ._models import ReadOnlyFollowingDatabase # type: ignore from ._models import ReadWriteDatabase # type: ignore from ._models import Resource # type: ignore + from ._models import Script # type: ignore + from ._models import ScriptCheckNameRequest # type: ignore + from ._models import ScriptListResult # type: ignore from ._models import SkuDescription # type: ignore from ._models import SkuDescriptionList # type: ignore from ._models import SkuLocationInfoItem # type: ignore + from ._models import SystemData # type: ignore + from ._models import TableLevelSharingProperties # type: ignore from ._models import TrackedResource # type: ignore from ._models import TrustedExternalTenant # type: ignore from ._models import VirtualNetworkConfiguration # type: ignore @@ -128,6 +140,7 @@ BlobStorageEventType, ClusterPrincipalRole, Compression, + CreatedByType, DataConnectionKind, DatabasePrincipalRole, DatabasePrincipalType, @@ -144,6 +157,7 @@ ProvisioningState, Reason, State, + Status, Type, ) @@ -193,14 +207,20 @@ 'Operation', 'OperationDisplay', 'OperationListResult', + 'OperationResult', 'OptimizedAutoscale', 'ProxyResource', 'ReadOnlyFollowingDatabase', 'ReadWriteDatabase', 'Resource', + 'Script', + 'ScriptCheckNameRequest', + 'ScriptListResult', 'SkuDescription', 'SkuDescriptionList', 'SkuLocationInfoItem', + 'SystemData', + 'TableLevelSharingProperties', 'TrackedResource', 'TrustedExternalTenant', 'VirtualNetworkConfiguration', @@ -210,6 +230,7 @@ 'BlobStorageEventType', 'ClusterPrincipalRole', 'Compression', + 'CreatedByType', 'DataConnectionKind', 'DatabasePrincipalRole', 'DatabasePrincipalType', @@ -226,5 +247,6 @@ 'ProvisioningState', 'Reason', 'State', + 'Status', 'Type', ] diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py index 103e2cc4b75a8..38869eaa64fd6 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py @@ -46,11 +46,14 @@ class AzureSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): STANDARD_D14_V2 = "Standard_D14_v2" STANDARD_L8_S = "Standard_L8s" STANDARD_L16_S = "Standard_L16s" + STANDARD_L8_S_V2 = "Standard_L8s_v2" + STANDARD_L16_S_V2 = "Standard_L16s_v2" STANDARD_D11_V2 = "Standard_D11_v2" STANDARD_D12_V2 = "Standard_D12_v2" STANDARD_L4_S = "Standard_L4s" DEV_NO_SLA_STANDARD_D11_V2 = "Dev(No SLA)_Standard_D11_v2" STANDARD_E64_I_V3 = "Standard_E64i_v3" + STANDARD_E80_IDS_V4 = "Standard_E80ids_v4" STANDARD_E2_A_V4 = "Standard_E2a_v4" STANDARD_E4_A_V4 = "Standard_E4a_v4" STANDARD_E8_A_V4 = "Standard_E8a_v4" @@ -89,6 +92,15 @@ class Compression(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" G_ZIP = "GZip" +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class DatabasePrincipalRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Database principal role. """ @@ -97,7 +109,7 @@ class DatabasePrincipalRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) INGESTOR = "Ingestor" MONITOR = "Monitor" USER = "User" - UNRESTRICTED_VIEWERS = "UnrestrictedViewers" + UNRESTRICTED_VIEWER = "UnrestrictedViewer" VIEWER = "Viewer" class DatabasePrincipalType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -267,6 +279,15 @@ class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): STARTING = "Starting" UPDATING = "Updating" +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of operation. + """ + + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + RUNNING = "Running" + class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of resource, for instance Microsoft.Kusto/clusters/databases. """ diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py index e1bf5be51aed6..35716a430c6e0 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py @@ -77,6 +77,8 @@ class AttachedDatabaseConfiguration(Resource): values include: "Union", "Replace", "None". :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :param table_level_sharing_properties: Table level sharing specifications. + :type table_level_sharing_properties: ~azure.mgmt.kusto.models.TableLevelSharingProperties """ _validation = { @@ -97,6 +99,7 @@ class AttachedDatabaseConfiguration(Resource): 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + 'table_level_sharing_properties': {'key': 'properties.tableLevelSharingProperties', 'type': 'TableLevelSharingProperties'}, } def __init__( @@ -110,6 +113,7 @@ def __init__( self.cluster_resource_id = kwargs.get('cluster_resource_id', None) self.attached_database_names = None self.default_principals_modification_kind = kwargs.get('default_principals_modification_kind', None) + self.table_level_sharing_properties = kwargs.get('table_level_sharing_properties', None) class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): @@ -206,11 +210,12 @@ class AzureSku(msrest.serialization.Model): :param name: Required. SKU name. Possible values include: "Standard_DS13_v2+1TB_PS", "Standard_DS13_v2+2TB_PS", "Standard_DS14_v2+3TB_PS", "Standard_DS14_v2+4TB_PS", - "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_D11_v2", - "Standard_D12_v2", "Standard_L4s", "Dev(No SLA)_Standard_D11_v2", "Standard_E64i_v3", - "Standard_E2a_v4", "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", - "Standard_E8as_v4+1TB_PS", "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", - "Standard_E16as_v4+4TB_PS", "Dev(No SLA)_Standard_E2a_v4". + "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_L8s_v2", + "Standard_L16s_v2", "Standard_D11_v2", "Standard_D12_v2", "Standard_L4s", "Dev(No + SLA)_Standard_D11_v2", "Standard_E64i_v3", "Standard_E80ids_v4", "Standard_E2a_v4", + "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", + "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No + SLA)_Standard_E2a_v4". :type name: str or ~azure.mgmt.kusto.models.AzureSkuName :param capacity: The number of instances of the cluster. :type capacity: int @@ -408,6 +413,8 @@ class Cluster(TrackedResource): :type zones: list[str] :param identity: The identity of the cluster, if configured. :type identity: ~azure.mgmt.kusto.models.Identity + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". :vartype state: str or ~azure.mgmt.kusto.models.State @@ -451,6 +458,7 @@ class Cluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'sku': {'required': True}, + 'etag': {'readonly': True}, 'state': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, @@ -468,6 +476,7 @@ class Cluster(TrackedResource): 'sku': {'key': 'sku', 'type': 'AzureSku'}, 'zones': {'key': 'zones', 'type': '[str]'}, 'identity': {'key': 'identity', 'type': 'Identity'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -493,6 +502,7 @@ def __init__( self.sku = kwargs['sku'] self.zones = kwargs.get('zones', None) self.identity = kwargs.get('identity', None) + self.etag = None self.state = None self.provisioning_state = None self.uri = None @@ -915,7 +925,7 @@ class DatabasePrincipal(msrest.serialization.Model): 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". + "Monitor", "User", "UnrestrictedViewer", "Viewer". :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :param name: Required. Database principal name. :type name: str @@ -980,7 +990,7 @@ class DatabasePrincipalAssignment(Resource): email, application ID, or security group name. :type principal_id: str :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", - "User", "UnrestrictedViewers", "Viewer". + "User", "UnrestrictedViewer", "Viewer". :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str @@ -1464,6 +1474,9 @@ class EventHubDataConnection(DataConnection): :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param managed_identity_resource_id: The resource ID of a managed identity (system or user + assigned) to be used to authenticate with event hub. + :type managed_identity_resource_id: str """ _validation = { @@ -1488,6 +1501,7 @@ class EventHubDataConnection(DataConnection): 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, 'compression': {'key': 'properties.compression', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_identity_resource_id': {'key': 'properties.managedIdentityResourceId', 'type': 'str'}, } def __init__( @@ -1504,6 +1518,7 @@ def __init__( self.event_system_properties = kwargs.get('event_system_properties', None) self.compression = kwargs.get('compression', None) self.provisioning_state = None + self.managed_identity_resource_id = kwargs.get('managed_identity_resource_id', None) class FollowerDatabaseDefinition(msrest.serialization.Model): @@ -1878,6 +1893,71 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class OperationResult(msrest.serialization.Model): + """Operation Result Entity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar status: status of the Operation result. Possible values include: "Succeeded", "Canceled", + "Failed", "Running". + :vartype status: str or ~azure.mgmt.kusto.models.Status + :param start_time: The operation start time. + :type start_time: ~datetime.datetime + :param end_time: The operation end time. + :type end_time: ~datetime.datetime + :param percent_complete: Percentage completed. + :type percent_complete: float + :param code: The code of the error. + :type code: str + :param message: The error message. + :type message: str + :param operation_kind: The kind of the operation. + :type operation_kind: str + :param operation_state: The state of the operation. + :type operation_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'percent_complete': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, + 'code': {'key': 'error.code', 'type': 'str'}, + 'message': {'key': 'error.message', 'type': 'str'}, + 'operation_kind': {'key': 'properties.operationKind', 'type': 'str'}, + 'operation_state': {'key': 'properties.operationState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.percent_complete = kwargs.get('percent_complete', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.operation_kind = kwargs.get('operation_kind', None) + self.operation_state = kwargs.get('operation_state', None) + + class OptimizedAutoscale(msrest.serialization.Model): """A class that contains the optimized auto scale definition. @@ -2109,6 +2189,120 @@ def __init__( self.is_followed = None +class Script(Resource): + """Class representing a database script. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kusto.models.SystemData + :param script_url: The url to the KQL script blob file. + :type script_url: str + :param script_url_sas_token: The SaS token. + :type script_url_sas_token: str + :param force_update_tag: A unique string. If changed the script will be applied again. + :type force_update_tag: str + :param continue_on_errors: Flag that indicates whether to continue if one of the command fails. + :type continue_on_errors: bool + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'script_url': {'key': 'properties.scriptUrl', 'type': 'str'}, + 'script_url_sas_token': {'key': 'properties.scriptUrlSasToken', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'continue_on_errors': {'key': 'properties.continueOnErrors', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Script, self).__init__(**kwargs) + self.system_data = None + self.script_url = kwargs.get('script_url', None) + self.script_url_sas_token = kwargs.get('script_url_sas_token', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.continue_on_errors = kwargs.get('continue_on_errors', None) + self.provisioning_state = None + + +class ScriptCheckNameRequest(msrest.serialization.Model): + """A script name availability request. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Script name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Kusto/clusters/databases/scripts. Default + value: "Microsoft.Kusto/clusters/databases/scripts". + :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/scripts" + + def __init__( + self, + **kwargs + ): + super(ScriptCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class ScriptListResult(msrest.serialization.Model): + """The list Kusto database script operation response. + + :param value: The list of Kusto scripts. + :type value: list[~azure.mgmt.kusto.models.Script] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Script]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScriptListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class SkuDescription(msrest.serialization.Model): """The Kusto SKU description of given resource type. @@ -2213,6 +2407,88 @@ def __init__( self.zones = kwargs.get('zones', None) +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.kusto.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.kusto.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TableLevelSharingProperties(msrest.serialization.Model): + """Tables that will be included and excluded in the follower database. + + :param tables_to_include: List of tables to include in the follower database. + :type tables_to_include: list[str] + :param tables_to_exclude: List of tables to exclude from the follower database. + :type tables_to_exclude: list[str] + :param external_tables_to_include: List of external tables to include in the follower database. + :type external_tables_to_include: list[str] + :param external_tables_to_exclude: List of external tables exclude from the follower database. + :type external_tables_to_exclude: list[str] + :param materialized_views_to_include: List of materialized views to include in the follower + database. + :type materialized_views_to_include: list[str] + :param materialized_views_to_exclude: List of materialized views exclude from the follower + database. + :type materialized_views_to_exclude: list[str] + """ + + _attribute_map = { + 'tables_to_include': {'key': 'tablesToInclude', 'type': '[str]'}, + 'tables_to_exclude': {'key': 'tablesToExclude', 'type': '[str]'}, + 'external_tables_to_include': {'key': 'externalTablesToInclude', 'type': '[str]'}, + 'external_tables_to_exclude': {'key': 'externalTablesToExclude', 'type': '[str]'}, + 'materialized_views_to_include': {'key': 'materializedViewsToInclude', 'type': '[str]'}, + 'materialized_views_to_exclude': {'key': 'materializedViewsToExclude', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(TableLevelSharingProperties, self).__init__(**kwargs) + self.tables_to_include = kwargs.get('tables_to_include', None) + self.tables_to_exclude = kwargs.get('tables_to_exclude', None) + self.external_tables_to_include = kwargs.get('external_tables_to_include', None) + self.external_tables_to_exclude = kwargs.get('external_tables_to_exclude', None) + self.materialized_views_to_include = kwargs.get('materialized_views_to_include', None) + self.materialized_views_to_exclude = kwargs.get('materialized_views_to_exclude', None) + + class TrustedExternalTenant(msrest.serialization.Model): """Represents a tenant ID that is trusted by the cluster. diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py index 80c5f085c894a..52b06bcf8ea66 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py @@ -82,6 +82,8 @@ class AttachedDatabaseConfiguration(Resource): values include: "Union", "Replace", "None". :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :param table_level_sharing_properties: Table level sharing specifications. + :type table_level_sharing_properties: ~azure.mgmt.kusto.models.TableLevelSharingProperties """ _validation = { @@ -102,6 +104,7 @@ class AttachedDatabaseConfiguration(Resource): 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + 'table_level_sharing_properties': {'key': 'properties.tableLevelSharingProperties', 'type': 'TableLevelSharingProperties'}, } def __init__( @@ -111,6 +114,7 @@ def __init__( database_name: Optional[str] = None, cluster_resource_id: Optional[str] = None, default_principals_modification_kind: Optional[Union[str, "DefaultPrincipalsModificationKind"]] = None, + table_level_sharing_properties: Optional["TableLevelSharingProperties"] = None, **kwargs ): super(AttachedDatabaseConfiguration, self).__init__(**kwargs) @@ -120,6 +124,7 @@ def __init__( self.cluster_resource_id = cluster_resource_id self.attached_database_names = None self.default_principals_modification_kind = default_principals_modification_kind + self.table_level_sharing_properties = table_level_sharing_properties class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): @@ -227,11 +232,12 @@ class AzureSku(msrest.serialization.Model): :param name: Required. SKU name. Possible values include: "Standard_DS13_v2+1TB_PS", "Standard_DS13_v2+2TB_PS", "Standard_DS14_v2+3TB_PS", "Standard_DS14_v2+4TB_PS", - "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_D11_v2", - "Standard_D12_v2", "Standard_L4s", "Dev(No SLA)_Standard_D11_v2", "Standard_E64i_v3", - "Standard_E2a_v4", "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", - "Standard_E8as_v4+1TB_PS", "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", - "Standard_E16as_v4+4TB_PS", "Dev(No SLA)_Standard_E2a_v4". + "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_L8s_v2", + "Standard_L16s_v2", "Standard_D11_v2", "Standard_D12_v2", "Standard_L4s", "Dev(No + SLA)_Standard_D11_v2", "Standard_E64i_v3", "Standard_E80ids_v4", "Standard_E2a_v4", + "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", + "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No + SLA)_Standard_E2a_v4". :type name: str or ~azure.mgmt.kusto.models.AzureSkuName :param capacity: The number of instances of the cluster. :type capacity: int @@ -449,6 +455,8 @@ class Cluster(TrackedResource): :type zones: list[str] :param identity: The identity of the cluster, if configured. :type identity: ~azure.mgmt.kusto.models.Identity + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". :vartype state: str or ~azure.mgmt.kusto.models.State @@ -492,6 +500,7 @@ class Cluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'sku': {'required': True}, + 'etag': {'readonly': True}, 'state': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, @@ -509,6 +518,7 @@ class Cluster(TrackedResource): 'sku': {'key': 'sku', 'type': 'AzureSku'}, 'zones': {'key': 'zones', 'type': '[str]'}, 'identity': {'key': 'identity', 'type': 'Identity'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -549,6 +559,7 @@ def __init__( self.sku = sku self.zones = zones self.identity = identity + self.etag = None self.state = None self.provisioning_state = None self.uri = None @@ -1002,7 +1013,7 @@ class DatabasePrincipal(msrest.serialization.Model): 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". + "Monitor", "User", "UnrestrictedViewer", "Viewer". :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :param name: Required. Database principal name. :type name: str @@ -1074,7 +1085,7 @@ class DatabasePrincipalAssignment(Resource): email, application ID, or security group name. :type principal_id: str :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", - "User", "UnrestrictedViewers", "Viewer". + "User", "UnrestrictedViewer", "Viewer". :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str @@ -1598,6 +1609,9 @@ class EventHubDataConnection(DataConnection): :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param managed_identity_resource_id: The resource ID of a managed identity (system or user + assigned) to be used to authenticate with event hub. + :type managed_identity_resource_id: str """ _validation = { @@ -1622,6 +1636,7 @@ class EventHubDataConnection(DataConnection): 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, 'compression': {'key': 'properties.compression', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_identity_resource_id': {'key': 'properties.managedIdentityResourceId', 'type': 'str'}, } def __init__( @@ -1635,6 +1650,7 @@ def __init__( data_format: Optional[Union[str, "EventHubDataFormat"]] = None, event_system_properties: Optional[List[str]] = None, compression: Optional[Union[str, "Compression"]] = None, + managed_identity_resource_id: Optional[str] = None, **kwargs ): super(EventHubDataConnection, self).__init__(location=location, **kwargs) @@ -1647,6 +1663,7 @@ def __init__( self.event_system_properties = event_system_properties self.compression = compression self.provisioning_state = None + self.managed_identity_resource_id = managed_identity_resource_id class FollowerDatabaseDefinition(msrest.serialization.Model): @@ -2062,6 +2079,79 @@ def __init__( self.next_link = next_link +class OperationResult(msrest.serialization.Model): + """Operation Result Entity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar status: status of the Operation result. Possible values include: "Succeeded", "Canceled", + "Failed", "Running". + :vartype status: str or ~azure.mgmt.kusto.models.Status + :param start_time: The operation start time. + :type start_time: ~datetime.datetime + :param end_time: The operation end time. + :type end_time: ~datetime.datetime + :param percent_complete: Percentage completed. + :type percent_complete: float + :param code: The code of the error. + :type code: str + :param message: The error message. + :type message: str + :param operation_kind: The kind of the operation. + :type operation_kind: str + :param operation_state: The state of the operation. + :type operation_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'percent_complete': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, + 'code': {'key': 'error.code', 'type': 'str'}, + 'message': {'key': 'error.message', 'type': 'str'}, + 'operation_kind': {'key': 'properties.operationKind', 'type': 'str'}, + 'operation_state': {'key': 'properties.operationState', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + percent_complete: Optional[float] = None, + code: Optional[str] = None, + message: Optional[str] = None, + operation_kind: Optional[str] = None, + operation_state: Optional[str] = None, + **kwargs + ): + super(OperationResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = start_time + self.end_time = end_time + self.percent_complete = percent_complete + self.code = code + self.message = message + self.operation_kind = operation_kind + self.operation_state = operation_state + + class OptimizedAutoscale(msrest.serialization.Model): """A class that contains the optimized auto scale definition. @@ -2305,6 +2395,129 @@ def __init__( self.is_followed = None +class Script(Resource): + """Class representing a database script. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kusto.models.SystemData + :param script_url: The url to the KQL script blob file. + :type script_url: str + :param script_url_sas_token: The SaS token. + :type script_url_sas_token: str + :param force_update_tag: A unique string. If changed the script will be applied again. + :type force_update_tag: str + :param continue_on_errors: Flag that indicates whether to continue if one of the command fails. + :type continue_on_errors: bool + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'script_url': {'key': 'properties.scriptUrl', 'type': 'str'}, + 'script_url_sas_token': {'key': 'properties.scriptUrlSasToken', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'continue_on_errors': {'key': 'properties.continueOnErrors', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + script_url: Optional[str] = None, + script_url_sas_token: Optional[str] = None, + force_update_tag: Optional[str] = None, + continue_on_errors: Optional[bool] = None, + **kwargs + ): + super(Script, self).__init__(**kwargs) + self.system_data = None + self.script_url = script_url + self.script_url_sas_token = script_url_sas_token + self.force_update_tag = force_update_tag + self.continue_on_errors = continue_on_errors + self.provisioning_state = None + + +class ScriptCheckNameRequest(msrest.serialization.Model): + """A script name availability request. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Script name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Kusto/clusters/databases/scripts. Default + value: "Microsoft.Kusto/clusters/databases/scripts". + :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/scripts" + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(ScriptCheckNameRequest, self).__init__(**kwargs) + self.name = name + + +class ScriptListResult(msrest.serialization.Model): + """The list Kusto database script operation response. + + :param value: The list of Kusto scripts. + :type value: list[~azure.mgmt.kusto.models.Script] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Script]'}, + } + + def __init__( + self, + *, + value: Optional[List["Script"]] = None, + **kwargs + ): + super(ScriptListResult, self).__init__(**kwargs) + self.value = value + + class SkuDescription(msrest.serialization.Model): """The Kusto SKU description of given resource type. @@ -2412,6 +2625,102 @@ def __init__( self.zones = zones +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.kusto.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.kusto.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TableLevelSharingProperties(msrest.serialization.Model): + """Tables that will be included and excluded in the follower database. + + :param tables_to_include: List of tables to include in the follower database. + :type tables_to_include: list[str] + :param tables_to_exclude: List of tables to exclude from the follower database. + :type tables_to_exclude: list[str] + :param external_tables_to_include: List of external tables to include in the follower database. + :type external_tables_to_include: list[str] + :param external_tables_to_exclude: List of external tables exclude from the follower database. + :type external_tables_to_exclude: list[str] + :param materialized_views_to_include: List of materialized views to include in the follower + database. + :type materialized_views_to_include: list[str] + :param materialized_views_to_exclude: List of materialized views exclude from the follower + database. + :type materialized_views_to_exclude: list[str] + """ + + _attribute_map = { + 'tables_to_include': {'key': 'tablesToInclude', 'type': '[str]'}, + 'tables_to_exclude': {'key': 'tablesToExclude', 'type': '[str]'}, + 'external_tables_to_include': {'key': 'externalTablesToInclude', 'type': '[str]'}, + 'external_tables_to_exclude': {'key': 'externalTablesToExclude', 'type': '[str]'}, + 'materialized_views_to_include': {'key': 'materializedViewsToInclude', 'type': '[str]'}, + 'materialized_views_to_exclude': {'key': 'materializedViewsToExclude', 'type': '[str]'}, + } + + def __init__( + self, + *, + tables_to_include: Optional[List[str]] = None, + tables_to_exclude: Optional[List[str]] = None, + external_tables_to_include: Optional[List[str]] = None, + external_tables_to_exclude: Optional[List[str]] = None, + materialized_views_to_include: Optional[List[str]] = None, + materialized_views_to_exclude: Optional[List[str]] = None, + **kwargs + ): + super(TableLevelSharingProperties, self).__init__(**kwargs) + self.tables_to_include = tables_to_include + self.tables_to_exclude = tables_to_exclude + self.external_tables_to_include = external_tables_to_include + self.external_tables_to_exclude = external_tables_to_exclude + self.materialized_views_to_include = materialized_views_to_include + self.materialized_views_to_exclude = materialized_views_to_exclude + + class TrustedExternalTenant(msrest.serialization.Model): """Represents a tenant ID that is trusted by the cluster. diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py index fb6fa59538660..27917c1aa7d51 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py @@ -10,16 +10,20 @@ from ._cluster_principal_assignments_operations import ClusterPrincipalAssignmentsOperations from ._databases_operations import DatabasesOperations from ._database_principal_assignments_operations import DatabasePrincipalAssignmentsOperations +from ._scripts_operations import ScriptsOperations from ._attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations from ._data_connections_operations import DataConnectionsOperations from ._operations import Operations +from ._operations_results_operations import OperationsResultsOperations __all__ = [ 'ClustersOperations', 'ClusterPrincipalAssignmentsOperations', 'DatabasesOperations', 'DatabasePrincipalAssignmentsOperations', + 'ScriptsOperations', 'AttachedDatabaseConfigurationsOperations', 'DataConnectionsOperations', 'Operations', + 'OperationsResultsOperations', ] diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py index b381e2a3ab3c8..708c4a97011d0 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py @@ -70,7 +70,7 @@ def list_by_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -199,7 +199,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -338,7 +338,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py index f8483f33575f7..899990aca8698 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py @@ -73,7 +73,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -140,7 +140,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -191,7 +191,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -328,7 +328,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -455,7 +455,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py index 2027538981152..404bc040d4e97 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py @@ -70,7 +70,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -111,6 +111,8 @@ def _create_or_update_initial( resource_group_name, # type: str cluster_name, # type: str parameters, # type: "_models.Cluster" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "_models.Cluster" @@ -119,7 +121,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -138,6 +140,10 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') @@ -169,6 +175,8 @@ def begin_create_or_update( resource_group_name, # type: str cluster_name, # type: str parameters, # type: "_models.Cluster" + if_match=None, # type: Optional[str] + if_none_match=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> LROPoller["_models.Cluster"] @@ -180,6 +188,13 @@ def begin_create_or_update( :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the CreateOrUpdate operation. :type parameters: ~azure.mgmt.kusto.models.Cluster + :param if_match: The ETag of the cluster. Omit this value to always overwrite the current + cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + changes. + :type if_match: str + :param if_none_match: Set to '*' to allow a new cluster to be created, but to prevent updating + an existing cluster. Other values will result in a 412 Pre-condition Failed response. + :type if_none_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -202,6 +217,8 @@ def begin_create_or_update( resource_group_name=resource_group_name, cluster_name=cluster_name, parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, cls=lambda x,y,z: x, **kwargs ) @@ -241,6 +258,7 @@ def _update_initial( resource_group_name, # type: str cluster_name, # type: str parameters, # type: "_models.ClusterUpdate" + if_match=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "_models.Cluster" @@ -249,7 +267,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -268,6 +286,8 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') @@ -302,6 +322,7 @@ def begin_update( resource_group_name, # type: str cluster_name, # type: str parameters, # type: "_models.ClusterUpdate" + if_match=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> LROPoller["_models.Cluster"] @@ -313,6 +334,10 @@ def begin_update( :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the Update operation. :type parameters: ~azure.mgmt.kusto.models.ClusterUpdate + :param if_match: The ETag of the cluster. Omit this value to always overwrite the current + cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + changes. + :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -335,6 +360,7 @@ def begin_update( resource_group_name=resource_group_name, cluster_name=cluster_name, parameters=parameters, + if_match=if_match, cls=lambda x,y,z: x, **kwargs ) @@ -381,7 +407,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -491,7 +517,7 @@ def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -601,7 +627,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -723,7 +749,7 @@ def list_follower_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -788,7 +814,7 @@ def _detach_follower_databases_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -907,7 +933,7 @@ def _diagnose_virtual_network_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -1034,7 +1060,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1102,7 +1128,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1169,7 +1195,7 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1228,7 +1254,7 @@ def check_name_availability( # type: (...) -> "_models.CheckNameResult" """Checks that the cluster name is valid and is not already in use. - :param location: Azure location. + :param location: Azure location (region) name. :type location: str :param cluster_name: The name of the cluster. :type cluster_name: ~azure.mgmt.kusto.models.ClusterCheckNameRequest @@ -1242,7 +1268,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1305,7 +1331,7 @@ def list_skus_by_resource( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1380,7 +1406,7 @@ def list_language_extensions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -1445,7 +1471,7 @@ def _add_language_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1565,7 +1591,7 @@ def _remove_language_extensions_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py index 7c790ac9a9d27..b7004f44ee1d2 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py @@ -73,7 +73,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -140,7 +140,7 @@ def _data_connection_validation_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -290,7 +290,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -361,7 +361,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -414,7 +414,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -561,7 +561,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -707,7 +707,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py index 55982e7b204b9..3c8425338f1e9 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py @@ -76,7 +76,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -147,7 +147,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -200,7 +200,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -343,7 +343,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -479,7 +479,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py index a69e851b84a85..922e54f31d307 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py @@ -73,7 +73,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -137,7 +137,7 @@ def list_by_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -215,7 +215,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -266,7 +266,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -406,7 +406,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -545,7 +545,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -675,7 +675,7 @@ def list_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -757,7 +757,7 @@ def add_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -828,7 +828,7 @@ def remove_principals( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py index 1a8cae0d2eb16..f31beb271e5bc 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-18" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py new file mode 100644 index 0000000000000..82115fbd0309b --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py @@ -0,0 +1,104 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsResultsOperations(object): + """OperationsResultsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationResult" + """Returns operation results. + + :param location: Azure location (region) name. + :type location: str + :param operation_id: The Guid of the operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.OperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationresults/{operationId}'} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py new file mode 100644 index 0000000000000..8fbe0663584b9 --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py @@ -0,0 +1,680 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ScriptsOperations(object): + """ScriptsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_database( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ScriptListResult"] + """Returns the list of database scripts for given 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScriptListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ScriptListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ScriptListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Script" + """Gets a Kusto cluster database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Script, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Script + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + parameters, # type: "_models.Script" + **kwargs # type: Any + ): + # type: (...) -> "_models.Script" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Script') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + parameters, # type: "_models.Script" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Script"] + """Creates a Kusto database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :param parameters: The Kusto Script parameters contains the KQL to run. + :type parameters: ~azure.mgmt.kusto.models.Script + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Script or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Script] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + parameters, # type: "_models.Script" + **kwargs # type: Any + ): + # type: (...) -> "_models.Script" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Script') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Script', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + parameters, # type: "_models.Script" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Script"] + """Updates a database script. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :param parameters: The Kusto Script parameters contains to the KQL to run. + :type parameters: ~azure.mgmt.kusto.models.Script + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Script or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Script] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Script', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a Kusto principalAssignment. + + :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 script_name: The name of the Kusto database script. + :type script_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + script_name=script_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + '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'), + 'scriptName': self._serialize.url("script_name", script_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + + def check_name_availability( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + script_name, # type: "_models.ScriptCheckNameRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameResult" + """Checks that the script name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param script_name: The name of the script. + :type script_name: ~azure.mgmt.kusto.models.ScriptCheckNameRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult, or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(script_name, 'ScriptCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability'} # type: ignore