diff --git a/README.md b/README.md index 5c0a400d7cd3..ab4ffc7c446f 100644 --- a/README.md +++ b/README.md @@ -17,30 +17,30 @@ The client libraries are supported on Python 2.7 and 3.5.3 or later. ## Packages available Each service might have a number of libraries available from each of the following categories: -* [Client - July 2019 Preview](#Client-July-2019-Preview) -* [Client - Stable](#Client-Stable) +* [Client - November 2019 Releases](#Client-November-2019-Releases) +* [Client - Previous Versions](#Client-Previous-Versions) * [Management](#Management) -### Client: July 2019 Preview -New wave of packages that we are currently releasing in **Preview**. These libraries allow you to use and consume existing resources and interact with them, for example: upload a blob. These libraries share a number of core functionalities such as: retries, logging, transport protocols, authentication protocols, etc. that can be found in the [azure-core](./sdk/core/azure-core) library. You can learn more about these libraries by reading guidelines that they follow [here](https://azuresdkspecs.z5.web.core.windows.net/PythonSpec.html). +### Client: November 2019 Releases +New wave of packages that we are announcing as **GA** and several that are currently releasing in **preview**. These libraries allow you to use and consume existing resources and interact with them, for example: upload a blob. These libraries share a number of core functionalities such as: retries, logging, transport protocols, authentication protocols, etc. that can be found in the [azure-core](./sdk/core/azure-core) library. You can learn more about these libraries by reading guidelines that they follow [here](https://azure.github.io/azure-sdk/python_introduction.html). -The libraries released in July preview: - -- [azure-cosmos](./sdk/cosmos/azure-cosmos) -- [azure-eventhubs](./sdk/eventhub/azure-eventhubs) +The libraries released in the November 2019 GA release: - [azure-keyvault-keys](./sdk/keyvault/azure-keyvault-keys) - [azure-keyvault-secrets](./sdk/keyvault/azure-keyvault-secrets) - [azure-identity](./sdk/identity/azure-identity) - [azure-storage-blob](./sdk/storage/azure-storage-blob) -- [azure-storage-file](./sdk/storage/azure-storage-file-share) - [azure-storage-queue](./sdk/storage/azure-storage-queue) ->NOTE: If you need to ensure your code is ready for production use one of the stable libraries. +The libraries released in the November 2019 preview: +- [azure-cosmos](./sdk/cosmos/azure-cosmos) +- [azure-eventhubs](./sdk/eventhub/azure-eventhubs) +- [azure-storage-file-share](./sdk/storage/azure-storage-file-share) +> NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries. -### Client: Stable -Last stable versions of packages that have been provided for usage with Azure and are production-ready. These libraries provide you with similar functionalities to the Preview ones as they allow you to use and consume existing resources and interact with them, for example: upload a blob. +### Client: Previous Versions +Last stable versions of packages that have been provided for usage with Azure and are production-ready. These libraries provide you with similar functionalities to the Preview ones as they allow you to use and consume existing resources and interact with them, for example: upload a blob. They might not implement the [guidelines](https://azure.github.io/azure-sdk/python_introduction.html) or have the same feature set as the Novemeber releases. They do however offer wider coverage of services. ### Management Libraries which enable you to provision specific resources. They are responsible for directly mirroring and consuming Azure service's REST endpoints. The management libraries use the `azure-mgmt-` convention for their package names. diff --git a/samples/smoketest/key_vault_certificates.py b/common/smoketest/key_vault_certificates.py similarity index 85% rename from samples/smoketest/key_vault_certificates.py rename to common/smoketest/key_vault_certificates.py index f3772d599cef..4184ec9a9357 100644 --- a/samples/smoketest/key_vault_certificates.py +++ b/common/smoketest/key_vault_certificates.py @@ -22,13 +22,14 @@ def __init__(self): self.certificate_name = "cert-name-" + uuid.uuid1().hex def create_certificate(self): - self.certificate_client.begin_create_certificate(name=self.certificate_name, policy=CertificatePolicy.get_default()).wait() + print("creating certificate...") + self.certificate_client.create_certificate(name=self.certificate_name) print("\tdone") def get_certificate(self): print("Getting a certificate...") - certificate = self.certificate_client.get_certificate(name=self.certificate_name) - print(f"\tdone, certificate: {certificate.name}.") + certificate = self.certificate_client.get_certificate_with_policy(name=self.certificate_name) + print("\tdone, certificate: %s." % certificate.name) def delete_certificate(self): print("Deleting a certificate...") diff --git a/samples/smoketest/key_vault_certificates_async.py b/common/smoketest/key_vault_certificates_async.py similarity index 90% rename from samples/smoketest/key_vault_certificates_async.py rename to common/smoketest/key_vault_certificates_async.py index a969a98b231f..428ab678041c 100644 --- a/samples/smoketest/key_vault_certificates_async.py +++ b/common/smoketest/key_vault_certificates_async.py @@ -23,12 +23,13 @@ def __init__(self): self.certificate_name = "cert-name-" + uuid.uuid1().hex async def create_certificate(self): - await self.certificate_client.create_certificate(name=self.certificate_name, policy=CertificatePolicy.get_default()) + create_certificate_poller = await self.certificate_client.create_certificate(name=self.certificate_name) + await create_certificate_poller print("\tdone") async def get_certificate(self): print("Getting a certificate...") - certificate = await self.certificate_client.get_certificate(name=self.certificate_name) + certificate = await self.certificate_client.get_certificate_with_policy(name=self.certificate_name) print(f"\tdone, certificate: {certificate.name}.") async def delete_certificate(self): diff --git a/samples/smoketest/key_vault_keys.py b/common/smoketest/key_vault_keys.py similarity index 92% rename from samples/smoketest/key_vault_keys.py rename to common/smoketest/key_vault_keys.py index 43bee361050c..f8dfc69a106f 100644 --- a/samples/smoketest/key_vault_keys.py +++ b/common/smoketest/key_vault_keys.py @@ -23,17 +23,17 @@ def __init__(self): def create_rsa_key(self): print("Creating an RSA key...") - self.key_client.create_rsa_key(name=self.key_name, size=2048) + self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) print("\tdone") def get_key(self): print("Getting a key...") key = self.key_client.get_key(name=self.key_name) - print(f"\tdone, key: {key.name}.") + print("\tdone, key: %s." % key.name) def delete_key(self): print("Deleting a key...") - deleted_key = self.key_client.begin_delete_key(name=self.key_name).result() + deleted_key = self.key_client.delete_key(name=self.key_name) print("\tdone: " + deleted_key.name) def run(self): diff --git a/samples/smoketest/key_vault_keys_async.py b/common/smoketest/key_vault_keys_async.py similarity index 98% rename from samples/smoketest/key_vault_keys_async.py rename to common/smoketest/key_vault_keys_async.py index 8e910343484d..41562d4bccfb 100644 --- a/samples/smoketest/key_vault_keys_async.py +++ b/common/smoketest/key_vault_keys_async.py @@ -23,7 +23,7 @@ def __init__(self): async def create_rsa_key(self): print("Creating an RSA key...") - await self.key_client.create_rsa_key(name=self.key_name, size=2048) + await self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) print("\tdone") async def get_key(self): diff --git a/common/smoketest/program.py b/common/smoketest/program.py index 28511c3e316a..3d92de015960 100644 --- a/common/smoketest/program.py +++ b/common/smoketest/program.py @@ -2,8 +2,12 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ +import logging +logging.basicConfig() + import smoke_test + try: import smoke_test_async except SyntaxError: diff --git a/common/smoketest/requirements.txt b/common/smoketest/requirements.txt index e4abc709776c..4da24d4727de 100644 --- a/common/smoketest/requirements.txt +++ b/common/smoketest/requirements.txt @@ -3,6 +3,8 @@ azure-core==1.0.0b3 azure-cosmos==4.0.0b2 azure-eventhub==5.0.0b3 azure-identity==1.0.0b3 +azure-keyvault-certificates==4.0.0b3 +azure-keyvault-keys==4.0.0b3 azure-keyvault-secrets==4.0.0b3 azure-storage-blob==12.0.0b3 azure-storage-common==2.1.0 \ No newline at end of file diff --git a/common/smoketest/smoke_test.py b/common/smoketest/smoke_test.py index bf586ea691bc..eef8321f9fbb 100644 --- a/common/smoketest/smoke_test.py +++ b/common/smoketest/smoke_test.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ +from key_vault_certificates import KeyVaultCertificates +from key_vault_keys import KeyVaultKeys from key_vault_secrets import KeyVaultSecrets from storage_blob import StorageBlob from event_hubs import EventHub @@ -12,6 +14,8 @@ print(" AZURE TRACK 2 SDKs SMOKE TEST") print("==========================================") +KeyVaultCertificates().run() +KeyVaultKeys().run() KeyVaultSecrets().run() StorageBlob().run() EventHub().run() diff --git a/common/smoketest/smoke_test_async.py b/common/smoketest/smoke_test_async.py index b93893d8c1b7..1874bd971477 100644 --- a/common/smoketest/smoke_test_async.py +++ b/common/smoketest/smoke_test_async.py @@ -3,6 +3,8 @@ # Licensed under the MIT License. # ------------------------------------ import asyncio +from key_vault_certificates_async import KeyVaultCertificates +from key_vault_keys_async import KeyVaultKeys from key_vault_secrets_async import KeyVaultSecrets from event_hubs_async import EventHub @@ -13,6 +15,8 @@ async def main(): + await KeyVaultCertificates().run() + await KeyVaultKeys().run() await KeyVaultSecrets().run() await EventHub().run() diff --git a/eng/pipelines/smoke-test.yml b/eng/pipelines/smoke-test.yml index 2a444e222378..010ca3ebc0cd 100644 --- a/eng/pipelines/smoke-test.yml +++ b/eng/pipelines/smoke-test.yml @@ -5,8 +5,8 @@ jobs: - job: strategy: matrix: - Python_374: - PythonVersion: '3.7.4' + Python_37: + PythonVersion: '3.7' Python_27: PythonVersion: '2.7' InstallAsyncRequirements: false diff --git a/eng/tox/import_all.py b/eng/tox/import_all.py index 6841cd224c36..84ef6ad4b055 100644 --- a/eng/tox/import_all.py +++ b/eng/tox/import_all.py @@ -18,11 +18,7 @@ excluded_packages = [ "azure", "azure-mgmt", - "azure.core.tracing.opencensus", - "azure.eventhub.checkpointstoreblob.aio", - "azure.storage.fileshare", # Github issue 7879. - "azure.storage.filedatalake", # Github issue 7879. -] + ] def should_run_import_all(package_name): return not (package_name in excluded_packages or "nspkg" in package_name) @@ -42,17 +38,16 @@ def should_run_import_all(package_name): # get target package name from target package path pkg_dir = os.path.abspath(args.target_package) - pkg_name, _ = get_package_details(os.path.join(pkg_dir, 'setup.py')) - package_name = pkg_name.replace("-", ".") + package_name, namespace, _ = get_package_details(os.path.join(pkg_dir, 'setup.py')) if should_run_import_all(package_name): # import all modules from current package logging.info( - "Importing all modules from package [{0}] to verify dependency".format( - package_name + "Importing all modules from namespace [{0}] to verify dependency".format( + namespace ) ) - import_script_all = "from {0} import *".format(package_name) + import_script_all = "from {0} import *".format(namespace) exec(import_script_all) logging.info("Verified module dependency, no issues found") else: diff --git a/eng/tox/prep_sphinx_env.py b/eng/tox/prep_sphinx_env.py index 7d7866cb8e50..931e71e97579 100644 --- a/eng/tox/prep_sphinx_env.py +++ b/eng/tox/prep_sphinx_env.py @@ -44,12 +44,6 @@ root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", "..")) sphinx_conf = os.path.join(root_dir, "doc", "sphinx", "individual_build_conf.py") -# reference issue 8523 for eliminating this ridiculousness. -UNFRIENDLY_PACKAGE_TO_NAMESPACE = { - 'azure-storage-file-share': 'azure.storage.fileshare', - 'azure-core-tracing-opencensus': 'azure.core.tracing.ext.opencensus_span', - 'azure-eventhub-checkpointstoreblob-aio': 'azure.eventhub.extensions.checkpointstoreblobaio' -} def should_build_docs(package_name): return not ("nspkg" in package_name or package_name in ["azure", "azure-mgmt", "azure-keyvault", "azure-documentdb", "azure-mgmt-documentdb", "azure-servicemanagement-legacy"]) @@ -98,10 +92,10 @@ def copy_conf(doc_folder): shutil.copy(sphinx_conf, os.path.join(doc_folder, 'conf.py')) -def create_index(doc_folder, source_location, package_name): +def create_index(doc_folder, source_location, namespace): index_content = "" - package_rst = "{}.rst".format(package_name.replace("-", ".")) + package_rst = "{}.rst".format(namespace) content_destination = os.path.join(doc_folder, "index.rst") if not os.path.exists(doc_folder): @@ -117,7 +111,7 @@ def create_index(doc_folder, source_location, package_name): elif rst_readmes: index_content = create_index_file(rst_readmes[0], package_rst) else: - logging.warning("No readmes detected for this package {}".format(package_name)) + logging.warning("No readmes detected for this namespace {}".format(namespace)) index_content = RST_EXTENSION_FOR_INDEX.format(package_rst) # write index @@ -158,18 +152,15 @@ def write_version(site_folder, version): args = parser.parse_args() package_path = os.path.abspath(args.target_package) - package_name, package_version = get_package_details( + package_name, namespace, package_version = get_package_details( os.path.join(package_path, "setup.py") ) - if package_name in UNFRIENDLY_PACKAGE_TO_NAMESPACE.keys(): - package_name = UNFRIENDLY_PACKAGE_TO_NAMESPACE[package_name] - if should_build_docs(package_name): source_location = move_and_rename(unzip_sdist_to_directory(args.dist_dir)) doc_folder = os.path.join(source_location, "docgen") - create_index(doc_folder, source_location, package_name) + create_index(doc_folder, source_location, namespace) site_folder = os.path.join(args.dist_dir, "site") write_version(site_folder, package_version) diff --git a/eng/tox/run_sphinx_apidoc.py b/eng/tox/run_sphinx_apidoc.py index 45adce90a878..c23146846438 100644 --- a/eng/tox/run_sphinx_apidoc.py +++ b/eng/tox/run_sphinx_apidoc.py @@ -65,12 +65,12 @@ def sphinx_apidoc(working_directory): ) exit(1) -def mgmt_apidoc(working_directory, package_name): +def mgmt_apidoc(working_directory, namespace): command_array = [ sys.executable, generate_mgmt_script, "-p", - package_name.replace("-","."), + namespace, "-o", working_directory, "--verbose" @@ -117,11 +117,11 @@ def mgmt_apidoc(working_directory, package_name): package_dir = os.path.abspath(args.package_root) output_directory = os.path.join(target_dir, "unzipped/docgen") - pkg_name, pkg_version = get_package_details(os.path.join(package_dir, 'setup.py')) + pkg_name, namespace, pkg_version = get_package_details(os.path.join(package_dir, 'setup.py')) if should_build_docs(pkg_name): if is_mgmt_package(pkg_name): - mgmt_apidoc(output_directory, pkg_name) + mgmt_apidoc(output_directory, namespace) else: sphinx_apidoc(args.working_directory) else: diff --git a/eng/tox/run_sphinx_build.py b/eng/tox/run_sphinx_build.py index 51ac0f6e4330..369a32490e3e 100644 --- a/eng/tox/run_sphinx_build.py +++ b/eng/tox/run_sphinx_build.py @@ -107,7 +107,7 @@ def sphinx_build(target_dir, output_dir): target_dir = os.path.abspath(args.working_directory) package_dir = os.path.abspath(args.package_root) - package_name, pkg_version = get_package_details(os.path.join(package_dir, 'setup.py')) + package_name, _, pkg_version = get_package_details(os.path.join(package_dir, 'setup.py')) if should_build_docs(package_name): sphinx_build(target_dir, output_dir) diff --git a/eng/tox/tox_helper_tasks.py b/eng/tox/tox_helper_tasks.py index 51cba37f2fc8..99d75706e666 100644 --- a/eng/tox/tox_helper_tasks.py +++ b/eng/tox/tox_helper_tasks.py @@ -50,10 +50,15 @@ def setup(*args, **kwargs): os.chdir(current_dir) _, kwargs = global_vars["__setup_calls__"][0] - return kwargs["name"], kwargs["version"] + package_name = kwargs["name"] + # default namespace for the package + name_space = package_name.replace('-', '.') + if "packages" in kwargs.keys(): + packages = kwargs["packages"] + if packages: + name_space = packages[0] + logging.info("Namespaces found for package {0}: {1}".format(package_name, packages)) -def get_package_namespace(setup_filename): - # traverse until meeting an improperly formatted __init__ - pass + return package_name, name_space, kwargs["version"] diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/HISTORY.rst b/sdk/eventgrid/azure-mgmt-eventgrid/HISTORY.rst index 763f650f89c4..e54bb36eb88c 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/HISTORY.rst +++ b/sdk/eventgrid/azure-mgmt-eventgrid/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +3.0.0rc2 (2019-11-11) ++++++++++++++++++++++ + +**Features** + +- Model WebHookEventSubscriptionDestination has a new parameter azure_active_directory_tenant_id + 3.0.0rc1 (2019-10-24) +++++++++++++++++++++ diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py index 7d1ce7f6e9e1..b5f5182e765f 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py @@ -1600,9 +1600,13 @@ class WebHookEventSubscriptionDestination(EventSubscriptionDestination): :param preferred_batch_size_in_kilobytes: Preferred batch size in Kilobytes. :type preferred_batch_size_in_kilobytes: int - :param azure_active_directory_application_id_or_uri: The AAD application - ID or URI to get the access token that will be included as the bearer - token in delivery requests. + :param azure_active_directory_tenant_id: The Azure Active Directory Tenant + ID to get the access token that will be included as the bearer token in + delivery requests. + :type azure_active_directory_tenant_id: str + :param azure_active_directory_application_id_or_uri: The Azure Active + Directory Application ID or URI to get the access token that will be + included as the bearer token in delivery requests. :type azure_active_directory_application_id_or_uri: str """ @@ -1617,6 +1621,7 @@ class WebHookEventSubscriptionDestination(EventSubscriptionDestination): 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, + 'azure_active_directory_tenant_id': {'key': 'properties.azureActiveDirectoryTenantId', 'type': 'str'}, 'azure_active_directory_application_id_or_uri': {'key': 'properties.azureActiveDirectoryApplicationIdOrUri', 'type': 'str'}, } @@ -1626,5 +1631,6 @@ def __init__(self, **kwargs): self.endpoint_base_url = None self.max_events_per_batch = kwargs.get('max_events_per_batch', None) self.preferred_batch_size_in_kilobytes = kwargs.get('preferred_batch_size_in_kilobytes', None) + self.azure_active_directory_tenant_id = kwargs.get('azure_active_directory_tenant_id', None) self.azure_active_directory_application_id_or_uri = kwargs.get('azure_active_directory_application_id_or_uri', None) self.endpoint_type = 'WebHook' diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py index 9e078f5c2dd6..4b5b2d2cb210 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py @@ -1600,9 +1600,13 @@ class WebHookEventSubscriptionDestination(EventSubscriptionDestination): :param preferred_batch_size_in_kilobytes: Preferred batch size in Kilobytes. :type preferred_batch_size_in_kilobytes: int - :param azure_active_directory_application_id_or_uri: The AAD application - ID or URI to get the access token that will be included as the bearer - token in delivery requests. + :param azure_active_directory_tenant_id: The Azure Active Directory Tenant + ID to get the access token that will be included as the bearer token in + delivery requests. + :type azure_active_directory_tenant_id: str + :param azure_active_directory_application_id_or_uri: The Azure Active + Directory Application ID or URI to get the access token that will be + included as the bearer token in delivery requests. :type azure_active_directory_application_id_or_uri: str """ @@ -1617,14 +1621,16 @@ class WebHookEventSubscriptionDestination(EventSubscriptionDestination): 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, + 'azure_active_directory_tenant_id': {'key': 'properties.azureActiveDirectoryTenantId', 'type': 'str'}, 'azure_active_directory_application_id_or_uri': {'key': 'properties.azureActiveDirectoryApplicationIdOrUri', 'type': 'str'}, } - def __init__(self, *, endpoint_url: str=None, max_events_per_batch: int=None, preferred_batch_size_in_kilobytes: int=None, azure_active_directory_application_id_or_uri: str=None, **kwargs) -> None: + def __init__(self, *, endpoint_url: str=None, max_events_per_batch: int=None, preferred_batch_size_in_kilobytes: int=None, azure_active_directory_tenant_id: str=None, azure_active_directory_application_id_or_uri: str=None, **kwargs) -> None: super(WebHookEventSubscriptionDestination, self).__init__(**kwargs) self.endpoint_url = endpoint_url self.endpoint_base_url = None self.max_events_per_batch = max_events_per_batch self.preferred_batch_size_in_kilobytes = preferred_batch_size_in_kilobytes + self.azure_active_directory_tenant_id = azure_active_directory_tenant_id self.azure_active_directory_application_id_or_uri = azure_active_directory_application_id_or_uri self.endpoint_type = 'WebHook' diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py index 55097d5cae62..3a65e38d32c2 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0rc1" - +VERSION = "3.0.0rc2" diff --git a/sdk/kusto/azure-mgmt-kusto/HISTORY.rst b/sdk/kusto/azure-mgmt-kusto/HISTORY.rst index 4593f2ff145b..168247174c38 100644 --- a/sdk/kusto/azure-mgmt-kusto/HISTORY.rst +++ b/sdk/kusto/azure-mgmt-kusto/HISTORY.rst @@ -3,6 +3,28 @@ Release History =============== +0.5.0 (2019-11-11) +++++++++++++++++++ + +**Features** + +- Model ClusterUpdate has a new parameter key_vault_properties +- Model ClusterUpdate has a new parameter identity +- Model Cluster has a new parameter key_vault_properties +- Model Cluster has a new parameter identity +- Added operation ClustersOperations.detach_follower_databases +- Added operation ClustersOperations.list_follower_databases +- Added operation group AttachedDatabaseConfigurationsOperations + +**Breaking changes** + +- Operation DatabasesOperations.check_name_availability has a new signature +- Model Database no longer has parameter soft_delete_period +- Model Database no longer has parameter hot_cache_period +- Model Database no longer has parameter statistics +- Model Database no longer has parameter provisioning_state +- Model Database has a new required parameter kind + 0.4.0 (2019-08-27) ++++++++++++++++++ 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 0bbf38cf54bc..9015ffbf96eb 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 @@ -15,6 +15,7 @@ from ._configuration import KustoManagementClientConfiguration from .operations import ClustersOperations from .operations import DatabasesOperations +from .operations import AttachedDatabaseConfigurationsOperations from .operations import DataConnectionsOperations from .operations import Operations from . import models @@ -30,6 +31,8 @@ class KustoManagementClient(SDKClient): :vartype clusters: azure.mgmt.kusto.operations.ClustersOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations + :ivar attached_database_configurations: AttachedDatabaseConfigurations operations + :vartype attached_database_configurations: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations :ivar data_connections: DataConnections operations :vartype data_connections: azure.mgmt.kusto.operations.DataConnectionsOperations :ivar operations: Operations operations @@ -52,7 +55,7 @@ def __init__( super(KustoManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-05-15' + self.api_version = '2019-09-07' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -60,6 +63,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) + self.attached_database_configurations = AttachedDatabaseConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) self.data_connections = DataConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( 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 a109d343c275..8bb2947d1ab8 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 @@ -10,21 +10,21 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AttachedDatabaseConfiguration from ._models_py3 import AzureCapacity from ._models_py3 import AzureEntityResource from ._models_py3 import AzureResourceSku from ._models_py3 import AzureSku + from ._models_py3 import CheckNameRequest from ._models_py3 import CheckNameResult from ._models_py3 import Cluster from ._models_py3 import ClusterCheckNameRequest from ._models_py3 import ClusterUpdate from ._models_py3 import Database - from ._models_py3 import DatabaseCheckNameRequest from ._models_py3 import DatabasePrincipal from ._models_py3 import DatabasePrincipalListRequest from ._models_py3 import DatabasePrincipalListResult from ._models_py3 import DatabaseStatistics - from ._models_py3 import DatabaseUpdate from ._models_py3 import DataConnection from ._models_py3 import DataConnectionCheckNameRequest from ._models_py3 import DataConnectionValidation @@ -32,11 +32,17 @@ from ._models_py3 import DataConnectionValidationResult from ._models_py3 import EventGridDataConnection from ._models_py3 import EventHubDataConnection + from ._models_py3 import FollowerDatabaseDefinition + from ._models_py3 import Identity + from ._models_py3 import IdentityUserAssignedIdentitiesValue from ._models_py3 import IotHubDataConnection + from ._models_py3 import KeyVaultProperties from ._models_py3 import Operation from ._models_py3 import OperationDisplay 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 SkuDescription from ._models_py3 import SkuLocationInfoItem @@ -44,21 +50,21 @@ from ._models_py3 import TrustedExternalTenant from ._models_py3 import VirtualNetworkConfiguration except (SyntaxError, ImportError): + from ._models import AttachedDatabaseConfiguration from ._models import AzureCapacity from ._models import AzureEntityResource from ._models import AzureResourceSku from ._models import AzureSku + from ._models import CheckNameRequest from ._models import CheckNameResult from ._models import Cluster from ._models import ClusterCheckNameRequest from ._models import ClusterUpdate from ._models import Database - from ._models import DatabaseCheckNameRequest from ._models import DatabasePrincipal from ._models import DatabasePrincipalListRequest from ._models import DatabasePrincipalListResult from ._models import DatabaseStatistics - from ._models import DatabaseUpdate from ._models import DataConnection from ._models import DataConnectionCheckNameRequest from ._models import DataConnectionValidation @@ -66,22 +72,30 @@ from ._models import DataConnectionValidationResult from ._models import EventGridDataConnection from ._models import EventHubDataConnection + from ._models import FollowerDatabaseDefinition + from ._models import Identity + from ._models import IdentityUserAssignedIdentitiesValue from ._models import IotHubDataConnection + from ._models import KeyVaultProperties from ._models import Operation from ._models import OperationDisplay from ._models import OptimizedAutoscale from ._models import ProxyResource + from ._models import ReadOnlyFollowingDatabase + from ._models import ReadWriteDatabase from ._models import Resource from ._models import SkuDescription from ._models import SkuLocationInfoItem from ._models import TrackedResource from ._models import TrustedExternalTenant from ._models import VirtualNetworkConfiguration +from ._paged_models import AttachedDatabaseConfigurationPaged from ._paged_models import AzureResourceSkuPaged from ._paged_models import ClusterPaged from ._paged_models import DatabasePaged from ._paged_models import DatabasePrincipalPaged from ._paged_models import DataConnectionPaged +from ._paged_models import FollowerDatabaseDefinitionPaged from ._paged_models import OperationPaged from ._paged_models import SkuDescriptionPaged from ._kusto_management_client_enums import ( @@ -90,28 +104,32 @@ AzureSkuName, AzureSkuTier, AzureScaleType, + DefaultPrincipalsModificationKind, + PrincipalsModificationKind, DataFormat, + IdentityType, DatabasePrincipalRole, DatabasePrincipalType, + Type, Reason, ) __all__ = [ + 'AttachedDatabaseConfiguration', 'AzureCapacity', 'AzureEntityResource', 'AzureResourceSku', 'AzureSku', + 'CheckNameRequest', 'CheckNameResult', 'Cluster', 'ClusterCheckNameRequest', 'ClusterUpdate', 'Database', - 'DatabaseCheckNameRequest', 'DatabasePrincipal', 'DatabasePrincipalListRequest', 'DatabasePrincipalListResult', 'DatabaseStatistics', - 'DatabaseUpdate', 'DataConnection', 'DataConnectionCheckNameRequest', 'DataConnectionValidation', @@ -119,22 +137,30 @@ 'DataConnectionValidationResult', 'EventGridDataConnection', 'EventHubDataConnection', + 'FollowerDatabaseDefinition', + 'Identity', + 'IdentityUserAssignedIdentitiesValue', 'IotHubDataConnection', + 'KeyVaultProperties', 'Operation', 'OperationDisplay', 'OptimizedAutoscale', 'ProxyResource', + 'ReadOnlyFollowingDatabase', + 'ReadWriteDatabase', 'Resource', 'SkuDescription', 'SkuLocationInfoItem', 'TrackedResource', 'TrustedExternalTenant', 'VirtualNetworkConfiguration', + 'FollowerDatabaseDefinitionPaged', 'ClusterPaged', 'SkuDescriptionPaged', 'AzureResourceSkuPaged', 'DatabasePaged', 'DatabasePrincipalPaged', + 'AttachedDatabaseConfigurationPaged', 'DataConnectionPaged', 'OperationPaged', 'State', @@ -142,8 +168,12 @@ 'AzureSkuName', 'AzureSkuTier', 'AzureScaleType', + 'DefaultPrincipalsModificationKind', + 'PrincipalsModificationKind', 'DataFormat', + 'IdentityType', 'DatabasePrincipalRole', 'DatabasePrincipalType', + 'Type', 'Reason', ] 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 20490930677a..8f34ce88248b 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 @@ -64,6 +64,20 @@ class AzureScaleType(str, Enum): none = "none" +class DefaultPrincipalsModificationKind(str, Enum): + + union = "Union" + replace = "Replace" + none = "None" + + +class PrincipalsModificationKind(str, Enum): + + union = "Union" + replace = "Replace" + none = "None" + + class DataFormat(str, Enum): multijson = "MULTIJSON" @@ -77,6 +91,13 @@ class DataFormat(str, Enum): raw = "RAW" singlejson = "SINGLEJSON" avro = "AVRO" + tsve = "TSVE" + + +class IdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" class DatabasePrincipalRole(str, Enum): @@ -96,6 +117,12 @@ class DatabasePrincipalType(str, Enum): user = "User" +class Type(str, Enum): + + microsoft_kustoclustersdatabases = "Microsoft.Kusto/clusters/databases" + microsoft_kustoclustersattached_database_configurations = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + + class Reason(str, Enum): invalid = "Invalid" 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 101c140126f3..22690e034688 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 @@ -13,46 +13,44 @@ from msrest.exceptions import HttpOperationError -class AzureCapacity(Model): - """Azure capacity definition. +class Resource(Model): + """Resource. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param scale_type: Required. Scale type. Possible values include: - 'automatic', 'manual', 'none' - :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType - :param minimum: Required. Minimum allowed capacity. - :type minimum: int - :param maximum: Required. Maximum allowed capacity. - :type maximum: int - :param default: Required. The default capacity that would be used. - :type default: int + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str """ _validation = { - 'scale_type': {'required': True}, - 'minimum': {'required': True}, - 'maximum': {'required': True}, - 'default': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): - super(AzureCapacity, self).__init__(**kwargs) - self.scale_type = kwargs.get('scale_type', None) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.default = kwargs.get('default', None) + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class Resource(Model): - """Resource. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. @@ -80,10 +78,118 @@ class Resource(Model): } def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ProxyResource, self).__init__(**kwargs) + + +class AttachedDatabaseConfiguration(ProxyResource): + """Class representing an attached database configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :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 database_name: Required. The name of the database which you would + like to attach, use * if you want to follow all current and future + databases. + :type database_name: str + :param cluster_resource_id: Required. The resource id of the cluster where + the databases you would like to attach reside. + :type cluster_resource_id: str + :ivar attached_database_names: The list of databases from the + clusterResourceId which are currently attached to the cluster. + :vartype attached_database_names: list[str] + :param default_principals_modification_kind: Required. The default + principals modification kind. Possible values include: 'Union', 'Replace', + 'None' + :type default_principals_modification_kind: str or + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'database_name': {'required': True}, + 'cluster_resource_id': {'required': True}, + 'attached_database_names': {'readonly': True}, + 'default_principals_modification_kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, + 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, + 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AttachedDatabaseConfiguration, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.provisioning_state = None + self.database_name = kwargs.get('database_name', None) + 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) + + +class AzureCapacity(Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: + 'automatic', 'manual', 'none' + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = kwargs.get('scale_type', None) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) class AzureEntityResource(Resource): @@ -184,6 +290,36 @@ def __init__(self, **kwargs): self.tier = kwargs.get('tier', None) +class CheckNameRequest(Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, **kwargs): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + class CheckNameResult(Model): """The result returned from a check name availability request. @@ -341,6 +477,8 @@ class Cluster(TrackedResource): :type sku: ~azure.mgmt.kusto.models.AzureSku :param zones: The availability zones of the cluster. :type zones: list[str] + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.kusto.models.Identity :ivar state: The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' @@ -368,6 +506,9 @@ class Cluster(TrackedResource): :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster + encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties """ _validation = { @@ -390,6 +531,7 @@ class Cluster(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AzureSku'}, 'zones': {'key': 'zones', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -399,12 +541,14 @@ class Cluster(TrackedResource): 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, } def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) self.zones = kwargs.get('zones', None) + self.identity = kwargs.get('identity', None) self.state = None self.provisioning_state = None self.uri = None @@ -414,6 +558,7 @@ def __init__(self, **kwargs): self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) self.enable_streaming_ingest = kwargs.get('enable_streaming_ingest', False) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) class ClusterCheckNameRequest(Model): @@ -468,6 +613,8 @@ class ClusterUpdate(Resource): :type location: str :param sku: The SKU of the cluster. :type sku: ~azure.mgmt.kusto.models.AzureSku + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.kusto.models.Identity :ivar state: The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' @@ -495,6 +642,9 @@ class ClusterUpdate(Resource): :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster + encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties """ _validation = { @@ -514,6 +664,7 @@ class ClusterUpdate(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -523,6 +674,7 @@ class ClusterUpdate(Resource): 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, } def __init__(self, **kwargs): @@ -530,6 +682,7 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) self.state = None self.provisioning_state = None self.uri = None @@ -539,47 +692,20 @@ def __init__(self, **kwargs): self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) self.enable_streaming_ingest = kwargs.get('enable_streaming_ingest', False) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) - - -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) + self.key_vault_properties = kwargs.get('key_vault_properties', None) class Database(ProxyResource): """Class representing a Kusto database. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadWriteDatabase, ReadOnlyFollowingDatabase + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -590,26 +716,15 @@ class Database(ProxyResource): :vartype type: str :param location: Resource location. :type location: str - :ivar provisioning_state: The provisioned state of the resource. Possible - values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', - 'Moving' - :vartype provisioning_state: str or - ~azure.mgmt.kusto.models.ProvisioningState - :param soft_delete_period: The time the data should be kept before it - stops being accessible to queries in TimeSpan. - :type soft_delete_period: timedelta - :param hot_cache_period: The time the data should be kept in cache for - fast queries in TimeSpan. - :type hot_cache_period: timedelta - :param statistics: The statistics of the database. - :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :param kind: Required. Constant filled by server. + :type kind: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -617,52 +732,18 @@ class Database(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, - 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, - 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - } - - def __init__(self, **kwargs): - super(Database, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.provisioning_state = None - self.soft_delete_period = kwargs.get('soft_delete_period', None) - self.hot_cache_period = kwargs.get('hot_cache_period', None) - self.statistics = kwargs.get('statistics', None) - - -class DatabaseCheckNameRequest(Model): - """The result returned from a database check name availability request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Database name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Kusto/clusters/databases. Default value: - "Microsoft.Kusto/clusters/databases" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, + 'kind': {'key': 'kind', 'type': 'str'}, } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + _subtype_map = { + 'kind': {'ReadWrite': 'ReadWriteDatabase', 'ReadOnlyFollowing': 'ReadOnlyFollowingDatabase'} } - type = "Microsoft.Kusto/clusters/databases" - def __init__(self, **kwargs): - super(DatabaseCheckNameRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + super(Database, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.kind = None + self.kind = 'Database' class DatabasePrincipal(Model): @@ -769,64 +850,6 @@ def __init__(self, **kwargs): self.size = kwargs.get('size', None) -class DatabaseUpdate(Resource): - """Class representing an update to a Kusto database. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param location: Resource location. - :type location: str - :ivar provisioning_state: The provisioned state of the resource. Possible - values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', - 'Moving' - :vartype provisioning_state: str or - ~azure.mgmt.kusto.models.ProvisioningState - :param soft_delete_period: The time the data should be kept before it - stops being accessible to queries in TimeSpan. - :type soft_delete_period: timedelta - :param hot_cache_period: The time the data should be kept in cache for - fast queries in TimeSpan. - :type hot_cache_period: timedelta - :param statistics: The statistics of the database. - :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, - 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, - 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - } - - def __init__(self, **kwargs): - super(DatabaseUpdate, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.provisioning_state = None - self.soft_delete_period = kwargs.get('soft_delete_period', None) - self.hot_cache_period = kwargs.get('hot_cache_period', None) - self.statistics = kwargs.get('statistics', None) - - class DataConnection(ProxyResource): """Class representing an data connection. @@ -1003,7 +1026,7 @@ class EventGridDataConnection(DataConnection): :param data_format: Required. The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', - 'SINGLEJSON', 'AVRO' + 'SINGLEJSON', 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat """ @@ -1078,7 +1101,7 @@ class EventHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO' + 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat :param event_system_properties: System properties of the event hub :type event_system_properties: list[str] @@ -1118,6 +1141,116 @@ def __init__(self, **kwargs): self.kind = 'EventHub' +class FollowerDatabaseDefinition(Model): + """A class representing follower database 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 cluster_resource_id: Required. Resource id of the cluster that + follows a database owned by this cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Required. Resource name of + the attached database configuration in the follower cluster. + :type attached_database_configuration_name: str + :ivar database_name: The database name owned by this cluster that was + followed. * in case following all databases. + :vartype database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'attached_database_configuration_name': {'required': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'attachedDatabaseConfigurationName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FollowerDatabaseDefinition, self).__init__(**kwargs) + self.cluster_resource_id = kwargs.get('cluster_resource_id', None) + self.attached_database_configuration_name = kwargs.get('attached_database_configuration_name', None) + self.database_name = None + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: 'None', + 'SystemAssigned' + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated + with the Kusto cluster. The user identity dictionary key references will + be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class IotHubDataConnection(DataConnection): """Class representing an iot hub data connection. @@ -1152,7 +1285,7 @@ class IotHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO' + 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat :param event_system_properties: System properties of the iot hub :type event_system_properties: list[str] @@ -1198,6 +1331,38 @@ def __init__(self, **kwargs): self.kind = 'IotHub' +class KeyVaultProperties(Model): + """Properties of the key vault. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the key vault key. + :type key_name: str + :param key_version: Required. The version of the key vault key. + :type key_version: str + :param key_vault_uri: Required. The Uri of the key vault. + :type key_vault_uri: str + """ + + _validation = { + 'key_name': {'required': True}, + 'key_version': {'required': True}, + 'key_vault_uri': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + class Operation(Model): """A REST API operation. @@ -1294,6 +1459,153 @@ def __init__(self, **kwargs): self.maximum = kwargs.get('maximum', None) +class ReadOnlyFollowingDatabase(Database): + """Class representing a read only following database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops + being accessible to queries in TimeSpan. + :vartype soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar leader_cluster_resource_id: The name of the leader cluster + :vartype leader_cluster_resource_id: str + :ivar attached_database_configuration_name: The name of the attached + database configuration cluster + :vartype attached_database_configuration_name: str + :ivar principals_modification_kind: The principals modification kind of + the database. Possible values include: 'Union', 'Replace', 'None' + :vartype principals_modification_kind: str or + ~azure.mgmt.kusto.models.PrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + 'leader_cluster_resource_id': {'readonly': True}, + 'attached_database_configuration_name': {'readonly': True}, + 'principals_modification_kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'leader_cluster_resource_id': {'key': 'properties.leaderClusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'properties.attachedDatabaseConfigurationName', 'type': 'str'}, + 'principals_modification_kind': {'key': 'properties.principalsModificationKind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReadOnlyFollowingDatabase, self).__init__(**kwargs) + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = kwargs.get('statistics', None) + self.leader_cluster_resource_id = None + self.attached_database_configuration_name = None + self.principals_modification_kind = None + self.kind = 'ReadOnlyFollowing' + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it + stops being accessible to queries in TimeSpan. + :type soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, **kwargs): + super(ReadWriteDatabase, self).__init__(**kwargs) + self.provisioning_state = None + self.soft_delete_period = kwargs.get('soft_delete_period', None) + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = kwargs.get('statistics', None) + self.kind = 'ReadWrite' + + class SkuDescription(Model): """The Kusto SKU description of given resource type. 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 3befd4da9920..888ba23cc2ed 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 @@ -13,46 +13,44 @@ from msrest.exceptions import HttpOperationError -class AzureCapacity(Model): - """Azure capacity definition. +class Resource(Model): + """Resource. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param scale_type: Required. Scale type. Possible values include: - 'automatic', 'manual', 'none' - :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType - :param minimum: Required. Minimum allowed capacity. - :type minimum: int - :param maximum: Required. Maximum allowed capacity. - :type maximum: int - :param default: Required. The default capacity that would be used. - :type default: int + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str """ _validation = { - 'scale_type': {'required': True}, - 'minimum': {'required': True}, - 'maximum': {'required': True}, - 'default': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, scale_type, minimum: int, maximum: int, default: int, **kwargs) -> None: - super(AzureCapacity, self).__init__(**kwargs) - self.scale_type = scale_type - self.minimum = minimum - self.maximum = maximum - self.default = default + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class Resource(Model): - """Resource. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. @@ -80,10 +78,118 @@ class Resource(Model): } def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ProxyResource, self).__init__(**kwargs) + + +class AttachedDatabaseConfiguration(ProxyResource): + """Class representing an attached database configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :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 database_name: Required. The name of the database which you would + like to attach, use * if you want to follow all current and future + databases. + :type database_name: str + :param cluster_resource_id: Required. The resource id of the cluster where + the databases you would like to attach reside. + :type cluster_resource_id: str + :ivar attached_database_names: The list of databases from the + clusterResourceId which are currently attached to the cluster. + :vartype attached_database_names: list[str] + :param default_principals_modification_kind: Required. The default + principals modification kind. Possible values include: 'Union', 'Replace', + 'None' + :type default_principals_modification_kind: str or + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'database_name': {'required': True}, + 'cluster_resource_id': {'required': True}, + 'attached_database_names': {'readonly': True}, + 'default_principals_modification_kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, + 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, + 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + } + + def __init__(self, *, database_name: str, cluster_resource_id: str, default_principals_modification_kind, location: str=None, **kwargs) -> None: + super(AttachedDatabaseConfiguration, self).__init__(**kwargs) + self.location = location + self.provisioning_state = None + self.database_name = database_name + self.cluster_resource_id = cluster_resource_id + self.attached_database_names = None + self.default_principals_modification_kind = default_principals_modification_kind + + +class AzureCapacity(Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: + 'automatic', 'manual', 'none' + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__(self, *, scale_type, minimum: int, maximum: int, default: int, **kwargs) -> None: + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = scale_type + self.minimum = minimum + self.maximum = maximum + self.default = default class AzureEntityResource(Resource): @@ -184,6 +290,36 @@ def __init__(self, *, name, tier, capacity: int=None, **kwargs) -> None: self.tier = tier +class CheckNameRequest(Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, *, name: str, type, **kwargs) -> None: + super(CheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + class CheckNameResult(Model): """The result returned from a check name availability request. @@ -341,6 +477,8 @@ class Cluster(TrackedResource): :type sku: ~azure.mgmt.kusto.models.AzureSku :param zones: The availability zones of the cluster. :type zones: list[str] + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.kusto.models.Identity :ivar state: The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' @@ -368,6 +506,9 @@ class Cluster(TrackedResource): :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster + encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties """ _validation = { @@ -390,6 +531,7 @@ class Cluster(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AzureSku'}, 'zones': {'key': 'zones', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -399,12 +541,14 @@ class Cluster(TrackedResource): 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, *, location: str, sku, tags=None, zones=None, trusted_external_tenants=None, optimized_autoscale=None, enable_disk_encryption: bool=None, enable_streaming_ingest: bool=False, virtual_network_configuration=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, tags=None, zones=None, identity=None, trusted_external_tenants=None, optimized_autoscale=None, enable_disk_encryption: bool=None, enable_streaming_ingest: bool=False, virtual_network_configuration=None, key_vault_properties=None, **kwargs) -> None: super(Cluster, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku self.zones = zones + self.identity = identity self.state = None self.provisioning_state = None self.uri = None @@ -414,6 +558,7 @@ def __init__(self, *, location: str, sku, tags=None, zones=None, trusted_externa self.enable_disk_encryption = enable_disk_encryption self.enable_streaming_ingest = enable_streaming_ingest self.virtual_network_configuration = virtual_network_configuration + self.key_vault_properties = key_vault_properties class ClusterCheckNameRequest(Model): @@ -468,6 +613,8 @@ class ClusterUpdate(Resource): :type location: str :param sku: The SKU of the cluster. :type sku: ~azure.mgmt.kusto.models.AzureSku + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.kusto.models.Identity :ivar state: The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' @@ -495,6 +642,9 @@ class ClusterUpdate(Resource): :param virtual_network_configuration: Virtual network definition. :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster + encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties """ _validation = { @@ -514,6 +664,7 @@ class ClusterUpdate(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, @@ -523,13 +674,15 @@ class ClusterUpdate(Resource): 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, *, tags=None, location: str=None, sku=None, trusted_external_tenants=None, optimized_autoscale=None, enable_disk_encryption: bool=None, enable_streaming_ingest: bool=False, virtual_network_configuration=None, **kwargs) -> None: + def __init__(self, *, tags=None, location: str=None, sku=None, identity=None, trusted_external_tenants=None, optimized_autoscale=None, enable_disk_encryption: bool=None, enable_streaming_ingest: bool=False, virtual_network_configuration=None, key_vault_properties=None, **kwargs) -> None: super(ClusterUpdate, self).__init__(**kwargs) self.tags = tags self.location = location self.sku = sku + self.identity = identity self.state = None self.provisioning_state = None self.uri = None @@ -539,47 +692,20 @@ def __init__(self, *, tags=None, location: str=None, sku=None, trusted_external_ self.enable_disk_encryption = enable_disk_encryption self.enable_streaming_ingest = enable_streaming_ingest self.virtual_network_configuration = virtual_network_configuration - - -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) + self.key_vault_properties = key_vault_properties class Database(ProxyResource): """Class representing a Kusto database. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadWriteDatabase, ReadOnlyFollowingDatabase + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -590,26 +716,15 @@ class Database(ProxyResource): :vartype type: str :param location: Resource location. :type location: str - :ivar provisioning_state: The provisioned state of the resource. Possible - values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', - 'Moving' - :vartype provisioning_state: str or - ~azure.mgmt.kusto.models.ProvisioningState - :param soft_delete_period: The time the data should be kept before it - stops being accessible to queries in TimeSpan. - :type soft_delete_period: timedelta - :param hot_cache_period: The time the data should be kept in cache for - fast queries in TimeSpan. - :type hot_cache_period: timedelta - :param statistics: The statistics of the database. - :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :param kind: Required. Constant filled by server. + :type kind: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + 'kind': {'required': True}, } _attribute_map = { @@ -617,52 +732,18 @@ class Database(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, - 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, - 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - } - - def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_period=None, statistics=None, **kwargs) -> None: - super(Database, self).__init__(**kwargs) - self.location = location - self.provisioning_state = None - self.soft_delete_period = soft_delete_period - self.hot_cache_period = hot_cache_period - self.statistics = statistics - - -class DatabaseCheckNameRequest(Model): - """The result returned from a database check name availability request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Database name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Kusto/clusters/databases. Default value: - "Microsoft.Kusto/clusters/databases" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, + 'kind': {'key': 'kind', 'type': 'str'}, } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + _subtype_map = { + 'kind': {'ReadWrite': 'ReadWriteDatabase', 'ReadOnlyFollowing': 'ReadOnlyFollowingDatabase'} } - type = "Microsoft.Kusto/clusters/databases" - - def __init__(self, *, name: str, **kwargs) -> None: - super(DatabaseCheckNameRequest, self).__init__(**kwargs) - self.name = name + def __init__(self, *, location: str=None, **kwargs) -> None: + super(Database, self).__init__(**kwargs) + self.location = location + self.kind = None + self.kind = 'Database' class DatabasePrincipal(Model): @@ -769,64 +850,6 @@ def __init__(self, *, size: float=None, **kwargs) -> None: self.size = size -class DatabaseUpdate(Resource): - """Class representing an update to a Kusto database. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param location: Resource location. - :type location: str - :ivar provisioning_state: The provisioned state of the resource. Possible - values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', - 'Moving' - :vartype provisioning_state: str or - ~azure.mgmt.kusto.models.ProvisioningState - :param soft_delete_period: The time the data should be kept before it - stops being accessible to queries in TimeSpan. - :type soft_delete_period: timedelta - :param hot_cache_period: The time the data should be kept in cache for - fast queries in TimeSpan. - :type hot_cache_period: timedelta - :param statistics: The statistics of the database. - :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, - 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, - 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - } - - def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_period=None, statistics=None, **kwargs) -> None: - super(DatabaseUpdate, self).__init__(**kwargs) - self.location = location - self.provisioning_state = None - self.soft_delete_period = soft_delete_period - self.hot_cache_period = hot_cache_period - self.statistics = statistics - - class DataConnection(ProxyResource): """Class representing an data connection. @@ -1003,7 +1026,7 @@ class EventGridDataConnection(DataConnection): :param data_format: Required. The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', - 'SINGLEJSON', 'AVRO' + 'SINGLEJSON', 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat """ @@ -1078,7 +1101,7 @@ class EventHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO' + 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat :param event_system_properties: System properties of the event hub :type event_system_properties: list[str] @@ -1118,6 +1141,116 @@ def __init__(self, *, event_hub_resource_id: str, consumer_group: str, location: self.kind = 'EventHub' +class FollowerDatabaseDefinition(Model): + """A class representing follower database 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 cluster_resource_id: Required. Resource id of the cluster that + follows a database owned by this cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Required. Resource name of + the attached database configuration in the follower cluster. + :type attached_database_configuration_name: str + :ivar database_name: The database name owned by this cluster that was + followed. * in case following all databases. + :vartype database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'attached_database_configuration_name': {'required': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'attachedDatabaseConfigurationName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, *, cluster_resource_id: str, attached_database_configuration_name: str, **kwargs) -> None: + super(FollowerDatabaseDefinition, self).__init__(**kwargs) + self.cluster_resource_id = cluster_resource_id + self.attached_database_configuration_name = attached_database_configuration_name + self.database_name = None + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: 'None', + 'SystemAssigned' + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated + with the Kusto cluster. The user identity dictionary key references will + be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, *, type, user_assigned_identities=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class IotHubDataConnection(DataConnection): """Class representing an iot hub data connection. @@ -1152,7 +1285,7 @@ class IotHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO' + 'AVRO', 'TSVE' :type data_format: str or ~azure.mgmt.kusto.models.DataFormat :param event_system_properties: System properties of the iot hub :type event_system_properties: list[str] @@ -1198,6 +1331,38 @@ def __init__(self, *, iot_hub_resource_id: str, consumer_group: str, shared_acce self.kind = 'IotHub' +class KeyVaultProperties(Model): + """Properties of the key vault. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the key vault key. + :type key_name: str + :param key_version: Required. The version of the key vault key. + :type key_version: str + :param key_vault_uri: Required. The Uri of the key vault. + :type key_vault_uri: str + """ + + _validation = { + 'key_name': {'required': True}, + 'key_version': {'required': True}, + 'key_vault_uri': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, key_version: str, key_vault_uri: str, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + class Operation(Model): """A REST API operation. @@ -1294,6 +1459,153 @@ def __init__(self, *, version: int, is_enabled: bool, minimum: int, maximum: int self.maximum = maximum +class ReadOnlyFollowingDatabase(Database): + """Class representing a read only following database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops + being accessible to queries in TimeSpan. + :vartype soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar leader_cluster_resource_id: The name of the leader cluster + :vartype leader_cluster_resource_id: str + :ivar attached_database_configuration_name: The name of the attached + database configuration cluster + :vartype attached_database_configuration_name: str + :ivar principals_modification_kind: The principals modification kind of + the database. Possible values include: 'Union', 'Replace', 'None' + :vartype principals_modification_kind: str or + ~azure.mgmt.kusto.models.PrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + 'leader_cluster_resource_id': {'readonly': True}, + 'attached_database_configuration_name': {'readonly': True}, + 'principals_modification_kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'leader_cluster_resource_id': {'key': 'properties.leaderClusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'properties.attachedDatabaseConfigurationName', 'type': 'str'}, + 'principals_modification_kind': {'key': 'properties.principalsModificationKind', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, hot_cache_period=None, statistics=None, **kwargs) -> None: + super(ReadOnlyFollowingDatabase, self).__init__(location=location, **kwargs) + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = hot_cache_period + self.statistics = statistics + self.leader_cluster_resource_id = None + self.attached_database_configuration_name = None + self.principals_modification_kind = None + self.kind = 'ReadOnlyFollowing' + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it + stops being accessible to queries in TimeSpan. + :type soft_delete_period: timedelta + :param hot_cache_period: The time the data should be kept in cache for + fast queries in TimeSpan. + :type hot_cache_period: timedelta + :param statistics: The statistics of the database. + :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + } + + def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_period=None, statistics=None, **kwargs) -> None: + super(ReadWriteDatabase, self).__init__(location=location, **kwargs) + self.provisioning_state = None + self.soft_delete_period = soft_delete_period + self.hot_cache_period = hot_cache_period + self.statistics = statistics + self.kind = 'ReadWrite' + + class SkuDescription(Model): """The Kusto SKU description of given resource type. diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py index f906cb2d1de8..326b581fd46b 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py @@ -12,6 +12,19 @@ from msrest.paging import Paged +class FollowerDatabaseDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`FollowerDatabaseDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FollowerDatabaseDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(FollowerDatabaseDefinitionPaged, self).__init__(*args, **kwargs) class ClusterPaged(Paged): """ A paging container for iterating over a list of :class:`Cluster ` object @@ -77,6 +90,19 @@ class DatabasePrincipalPaged(Paged): def __init__(self, *args, **kwargs): super(DatabasePrincipalPaged, self).__init__(*args, **kwargs) +class AttachedDatabaseConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`AttachedDatabaseConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AttachedDatabaseConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(AttachedDatabaseConfigurationPaged, self).__init__(*args, **kwargs) class DataConnectionPaged(Paged): """ A paging container for iterating over a list of :class:`DataConnection ` object 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 d0aeb8c19c4d..9f5475ee05e1 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 @@ -11,12 +11,14 @@ from ._clusters_operations import ClustersOperations from ._databases_operations import DatabasesOperations +from ._attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations from ._data_connections_operations import DataConnectionsOperations from ._operations import Operations __all__ = [ 'ClustersOperations', 'DatabasesOperations', + 'AttachedDatabaseConfigurationsOperations', 'DataConnectionsOperations', 'Operations', ] diff --git a/sdk/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 new file mode 100644 index 000000000000..05ff061d21e3 --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py @@ -0,0 +1,381 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AttachedDatabaseConfigurationsOperations(object): + """AttachedDatabaseConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2019-09-07". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-09-07" + + self.config = config + + def list_by_cluster( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Returns the list of attached database configurations of the given Kusto + cluster. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AttachedDatabaseConfiguration + :rtype: + ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationPaged[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AttachedDatabaseConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + + def get( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, **operation_config): + """Returns an attached database configuration. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AttachedDatabaseConfiguration or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, attached_database_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AttachedDatabaseConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + if response.status_code == 202: + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, attached_database_configuration_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an attached database configuration. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param parameters: The database parameters supplied to the + CreateOrUpdate operation. + :type parameters: + ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AttachedDatabaseConfiguration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AttachedDatabaseConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, attached_database_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the attached database configuration with the given name. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached + database configuration. + :type attached_database_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} diff --git a/sdk/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 f6f36d829cd1..91f51fd70e45 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 @@ -27,7 +27,7 @@ class ClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-05-15". + :ivar api_version: Client API Version. Constant value: "2019-09-07". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-15" + self.api_version = "2019-09-07" self.config = config @@ -241,7 +241,7 @@ def _update_initial( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -252,6 +252,8 @@ def _update_initial( deserialized = self._deserialize('Cluster', response) if response.status_code == 201: deserialized = self._deserialize('Cluster', response) + if response.status_code == 202: + deserialized = self._deserialize('Cluster', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -551,6 +553,174 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + def list_follower_databases( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Returns a list of databases that are owned by this cluster and were + followed by another cluster. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FollowerDatabaseDefinition + :rtype: + ~azure.mgmt.kusto.models.FollowerDatabaseDefinitionPaged[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_follower_databases.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.FollowerDatabaseDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + + + def _detach_follower_databases_initial( + self, resource_group_name, cluster_name, cluster_resource_id, attached_database_configuration_name, custom_headers=None, raw=False, **operation_config): + follower_database_to_remove = models.FollowerDatabaseDefinition(cluster_resource_id=cluster_resource_id, attached_database_configuration_name=attached_database_configuration_name) + + # Construct URL + url = self.detach_follower_databases.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(follower_database_to_remove, 'FollowerDatabaseDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def detach_follower_databases( + self, resource_group_name, cluster_name, cluster_resource_id, attached_database_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Detaches all followers of a database owned by this cluster. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param cluster_resource_id: Resource id of the cluster that follows a + database owned by this cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Resource name of the + attached database configuration in the follower cluster. + :type attached_database_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._detach_follower_databases_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + detach_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists all Kusto clusters within a resource group. 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 746d1ef28f9e..5fe2df10be1b 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 @@ -27,7 +27,7 @@ class DataConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-05-15". + :ivar api_version: Client API Version. Constant value: "2019-09-07". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-15" + self.api_version = "2019-09-07" self.config = config @@ -382,6 +382,8 @@ def _create_or_update_initial( deserialized = self._deserialize('DataConnection', response) if response.status_code == 201: deserialized = self._deserialize('DataConnection', response) + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -494,6 +496,8 @@ def _update_initial( deserialized = self._deserialize('DataConnection', response) if response.status_code == 201: deserialized = self._deserialize('DataConnection', response) + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) 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 3e81105fa0de..b206b2ec40f5 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 @@ -27,7 +27,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-05-15". + :ivar api_version: Client API Version. Constant value: "2019-09-07". """ models = models @@ -37,12 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-15" + self.api_version = "2019-09-07" self.config = config def check_name_availability( - self, resource_group_name, cluster_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, name, type, custom_headers=None, raw=False, **operation_config): """Checks that the database name is valid and is not already in use. :param resource_group_name: The name of the resource group containing @@ -50,8 +50,13 @@ def check_name_availability( :type resource_group_name: str :param cluster_name: The name of the Kusto cluster. :type cluster_name: str - :param name: Database name. + :param name: Resource name. :type name: str + :param type: The type of resource, for instance + Microsoft.Kusto/clusters/databases. Possible values include: + 'Microsoft.Kusto/clusters/databases', + 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations' + :type type: str or ~azure.mgmt.kusto.models.Type :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -62,7 +67,7 @@ def check_name_availability( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - database_name = models.DatabaseCheckNameRequest(name=name) + resource_name = models.CheckNameRequest(name=name, type=type) # Construct URL url = self.check_name_availability.metadata['url'] @@ -89,7 +94,7 @@ def check_name_availability( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(database_name, 'DatabaseCheckNameRequest') + body_content = self._serialize.body(resource_name, 'CheckNameRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -295,6 +300,8 @@ def _create_or_update_initial( deserialized = self._deserialize('Database', response) if response.status_code == 201: deserialized = self._deserialize('Database', response) + if response.status_code == 202: + deserialized = self._deserialize('Database', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -386,7 +393,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'DatabaseUpdate') + body_content = self._serialize.body(parameters, 'Database') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -403,6 +410,8 @@ def _update_initial( deserialized = self._deserialize('Database', response) if response.status_code == 201: deserialized = self._deserialize('Database', response) + if response.status_code == 202: + deserialized = self._deserialize('Database', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -423,7 +432,7 @@ def update( :type database_name: str :param parameters: The database parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.kusto.models.DatabaseUpdate + :type parameters: ~azure.mgmt.kusto.models.Database :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response 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 a0453a5f0852..482c43707c41 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 @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-05-15". + :ivar api_version: Client API Version. Constant value: "2019-09-07". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-15" + self.api_version = "2019-09-07" self.config = config 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 85da2c00c1a6..152c552babee 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/version.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.0" - +VERSION = "0.5.0" diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index 57e1ba6b9600..0fb01d875846 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -52,6 +52,7 @@ def create_resource(self, name, **kwargs): 'sku': {'name': self.sku}, 'location': self.location, 'kind': self.kind, + 'enable_https_traffic_only': True, } ) self.resource = storage_async_operation.result()