diff --git a/src/kusto/azext_kusto/__init__.py b/src/kusto/azext_kusto/__init__.py index 5a12fc226b3..87ad305c2dc 100644 --- a/src/kusto/azext_kusto/__init__.py +++ b/src/kusto/azext_kusto/__init__.py @@ -20,8 +20,8 @@ def __init__(self, cli_ctx=None): kusto_custom = CliCommandType( operations_tmpl='azext_kusto.custom#{}', client_factory=cf_kusto) - super(KustoManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=kusto_custom) + parent = super(KustoManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=kusto_custom) def load_command_table(self, args): from azext_kusto.generated.commands import load_command_table diff --git a/src/kusto/azext_kusto/generated/_help.py b/src/kusto/azext_kusto/generated/_help.py index c319c0cdaf0..b488ea0616d 100644 --- a/src/kusto/azext_kusto/generated/_help.py +++ b/src/kusto/azext_kusto/generated/_help.py @@ -32,29 +32,113 @@ examples: - name: KustoClustersGet text: |- - az kusto cluster show --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto cluster show --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster create'] = """ type: command short-summary: Create or update a Kusto cluster. + parameters: + - name: --sku + short-summary: The SKU of the cluster. + long-summary: | + Usage: --sku name=XX capacity=XX tier=XX + + name: Required. SKU name. + capacity: The number of instances of the cluster. + tier: Required. SKU tier. + - name: --trusted-external-tenants + short-summary: The cluster's external tenants. + long-summary: | + Usage: --trusted-external-tenants value=XX + + value: GUID representing an external tenant. + + Multiple actions can be specified by using more than one --trusted-external-tenants argument. + - name: --optimized-autoscale + short-summary: Optimized auto scale definition. + long-summary: | + Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX + + version: Required. The version of the template defined, for instance 1. + is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. + minimum: Required. Minimum allowed instances count. + maximum: Required. Maximum allowed instances count. + - name: --virtual-network-configuration + short-summary: Virtual network definition. + long-summary: | + Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX + + subnet-id: Required. The subnet resource id. + engine-public-ip-id: Required. Engine service's public IP address resource id. + data-management-public-ip-id: Required. Data management's service public IP address resource id. + - name: --key-vault-properties + short-summary: KeyVault properties for the cluster encryption. + long-summary: | + Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX + + key-name: Required. The name of the key vault key. + key-version: Required. The version of the key vault key. + key-vault-uri: Required. The Uri of the key vault. examples: - name: KustoClustersCreateOrUpdate text: |- - az kusto cluster create --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ - "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="" key-vault-uri="" key-ve\ -rsion="" --sku name="Standard_L8s" capacity=2 tier="Standard" --resource-group "kustorptest" + az kusto cluster create --name "kustoclusterrptest4" --identity-type "SystemAssigned" --location "westus\ +" --enable-double-encryption false --enable-purge true --enable-streaming-ingest true --sku name="Standard_L8s" capacit\ +y=2 tier="Standard" --resource-group "kustorptest" """ helps['kusto cluster update'] = """ type: command short-summary: Update a Kusto cluster. + parameters: + - name: --sku + short-summary: The SKU of the cluster. + long-summary: | + Usage: --sku name=XX capacity=XX tier=XX + + name: Required. SKU name. + capacity: The number of instances of the cluster. + tier: Required. SKU tier. + - name: --trusted-external-tenants + short-summary: The cluster's external tenants. + long-summary: | + Usage: --trusted-external-tenants value=XX + + value: GUID representing an external tenant. + + Multiple actions can be specified by using more than one --trusted-external-tenants argument. + - name: --optimized-autoscale + short-summary: Optimized auto scale definition. + long-summary: | + Usage: --optimized-autoscale version=XX is-enabled=XX minimum=XX maximum=XX + + version: Required. The version of the template defined, for instance 1. + is-enabled: Required. A boolean value that indicate if the optimized autoscale feature is enabled or not. + minimum: Required. Minimum allowed instances count. + maximum: Required. Maximum allowed instances count. + - name: --virtual-network-configuration + short-summary: Virtual network definition. + long-summary: | + Usage: --virtual-network-configuration subnet-id=XX engine-public-ip-id=XX data-management-public-ip-id=XX + + subnet-id: Required. The subnet resource id. + engine-public-ip-id: Required. Engine service's public IP address resource id. + data-management-public-ip-id: Required. Data management's service public IP address resource id. + - name: --key-vault-properties + short-summary: KeyVault properties for the cluster encryption. + long-summary: | + Usage: --key-vault-properties key-name=XX key-version=XX key-vault-uri=XX + + key-name: Required. The name of the key vault key. + key-version: Required. The version of the key vault key. + key-vault-uri: Required. The Uri of the key vault. examples: - name: KustoClustersUpdate text: |- - az kusto cluster update --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ - "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" key-vault-uri="h\ -ttps://dummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" + az kusto cluster update --name "kustoclusterrptest4" --identity-type "SystemAssigned" --location "westus\ +" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" key-vault-uri="https://d\ +ummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" """ helps['kusto cluster delete'] = """ @@ -63,17 +147,26 @@ examples: - name: KustoClustersDelete text: |- - az kusto cluster delete --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto cluster delete --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster add-language-extension'] = """ type: command short-summary: Add a list of language extensions that can run within KQL queries. + parameters: + - name: --value + short-summary: The list of language extensions. + long-summary: | + Usage: --value language-extension-name=XX + + language-extension-name: The language extension name. + + Multiple actions can be specified by using more than one --value argument. examples: - name: KustoClusterAddLanguageExtensions text: |- - az kusto cluster add-language-extension --cluster-name "KustoClusterRPTest4" --value language-extension-\ -name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" + az kusto cluster add-language-extension --name "kustoclusterrptest4" --value language-extension-name="PY\ +THON" --value language-extension-name="R" --resource-group "kustorptest" """ helps['kusto cluster detach-follower-database'] = """ @@ -82,9 +175,9 @@ examples: - name: KustoClusterDetachFollowerDatabases text: |- - az kusto cluster detach-follower-database --cluster-name "KustoClusterRPTest4" --attached-database-confi\ -guration-name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789\ -098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" + az kusto cluster detach-follower-database --name "kustoclusterrptest4" --attached-database-configuration\ +-name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/reso\ +urceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" """ helps['kusto cluster diagnose-virtual-network'] = """ @@ -93,8 +186,7 @@ examples: - name: KustoClusterDiagnoseVirtualNetwork text: |- - az kusto cluster diagnose-virtual-network --cluster-name "KustoClusterRPTest4" --resource-group "kustorp\ -test" + az kusto cluster diagnose-virtual-network --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster list-follower-database'] = """ @@ -103,8 +195,7 @@ examples: - name: KustoClusterListFollowerDatabases text: |- - az kusto cluster list-follower-database --cluster-name "KustoClusterRPTest4" --resource-group "kustorpte\ -st" + az kusto cluster list-follower-database --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster list-language-extension'] = """ @@ -113,8 +204,7 @@ examples: - name: KustoClusterListLanguageExtensions text: |- - az kusto cluster list-language-extension --cluster-name "KustoClusterRPTest4" --resource-group "kustorpt\ -est" + az kusto cluster list-language-extension --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster list-sku'] = """ @@ -123,17 +213,26 @@ examples: - name: KustoClustersListResourceSkus text: |- - az kusto cluster list-sku --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto cluster list-sku --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster remove-language-extension'] = """ type: command short-summary: Remove a list of language extensions that can run within KQL queries. + parameters: + - name: --value + short-summary: The list of language extensions. + long-summary: | + Usage: --value language-extension-name=XX + + language-extension-name: The language extension name. + + Multiple actions can be specified by using more than one --value argument. examples: - name: KustoClusterRemoveLanguageExtensions text: |- - az kusto cluster remove-language-extension --cluster-name "KustoClusterRPTest4" --value language-extensi\ -on-name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" + az kusto cluster remove-language-extension --name "kustoclusterrptest4" --value language-extension-name=\ +"PYTHON" --value language-extension-name="R" --resource-group "kustorptest" """ helps['kusto cluster start'] = """ @@ -142,7 +241,7 @@ examples: - name: KustoClustersStart text: |- - az kusto cluster start --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto cluster start --name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto cluster stop'] = """ @@ -151,7 +250,22 @@ examples: - name: KustoClustersStop text: |- - az kusto cluster stop --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto cluster stop --name "kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto cluster wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto cluster is met. + examples: + - name: Pause executing next line of CLI script until the kusto cluster is successfully created. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto cluster is successfully updated. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto cluster is successfully deleted. + text: |- + az kusto cluster wait --name "kustoclusterrptest4" --resource-group "kustorptest" --deleted """ helps['kusto cluster-principal-assignment'] = """ @@ -211,6 +325,22 @@ -name "kustoprincipal1" --resource-group "kustorptest" """ +helps['kusto cluster-principal-assignment wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto cluster-principal-assignment is met. + examples: + - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully crea\ +ted. + text: |- + az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" --principal-assignment-n\ +ame "kustoprincipal1" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto cluster-principal-assignment is successfully dele\ +ted. + text: |- + az kusto cluster-principal-assignment wait --cluster-name "kustoclusterrptest4" --principal-assignment-n\ +ame "kustoprincipal1" --resource-group "kustorptest" --deleted +""" + helps['kusto database'] = """ type: group short-summary: kusto database @@ -222,7 +352,7 @@ examples: - name: KustoDatabasesListByCluster text: |- - az kusto database list --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto database list --cluster-name "kustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto database show'] = """ @@ -231,28 +361,66 @@ examples: - name: KustoDatabasesGet text: |- - az kusto database show --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resource-\ + az kusto database show --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ group "kustorptest" """ helps['kusto database create'] = """ type: command short-summary: Creates or updates a database. + parameters: + - name: --read-write-database + short-summary: Class representing a read write database. + long-summary: | + Usage: --read-write-database soft-delete-period=XX hot-cache-period=XX location=XX kind=XX + + soft-delete-period: The time the data should be kept before it stops being accessible to queries in TimeSpa\ +n. + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + - name: --read-only-following-database + short-summary: Class representing a read only following database. + long-summary: | + Usage: --read-only-following-database hot-cache-period=XX location=XX kind=XX + + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database examples: - name: KustoDatabasesCreateOrUpdate text: |- - az kusto database create --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ -ite-database location="westus" soft-delete-period="P1D" --resource-group "kustorptest" + az kusto database create --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --paramet\ +ers "{\\"location\\":\\"westus\\",\\"properties\\":{\\"softDeletePeriod\\":\\"P1D\\"}}" --resource-group "kustorptest" """ helps['kusto database update'] = """ type: command short-summary: Updates a database. + parameters: + - name: --read-write-database + short-summary: Class representing a read write database. + long-summary: | + Usage: --read-write-database soft-delete-period=XX hot-cache-period=XX location=XX kind=XX + + soft-delete-period: The time the data should be kept before it stops being accessible to queries in TimeSpa\ +n. + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database + - name: --read-only-following-database + short-summary: Class representing a read only following database. + long-summary: | + Usage: --read-only-following-database hot-cache-period=XX location=XX kind=XX + + hot-cache-period: The time the data should be kept in cache for fast queries in TimeSpan. + location: Resource location. + kind: Required. Kind of the database examples: - name: KustoDatabasesUpdate text: |- - az kusto database update --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ -ite-database soft-delete-period="P1D" --resource-group "kustorptest" + az kusto database update --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --paramet\ +ers "{\\"properties\\":{\\"softDeletePeriod\\":\\"P1D\\"}}" --resource-group "kustorptest" """ helps['kusto database delete'] = """ @@ -261,21 +429,35 @@ examples: - name: KustoDatabasesDelete text: |- - az kusto database delete --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resourc\ + az kusto database delete --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resourc\ e-group "kustorptest" """ helps['kusto database add-principal'] = """ type: command short-summary: Add Database principals permissions. + parameters: + - name: --value + short-summary: The list of Kusto database principals. + long-summary: | + Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX + + role: Required. Database principal role. + name: Required. Database principal name. + type: Required. Database principal type. + fqn: Database principal fully qualified name. + email: Database principal email if exists. + app-id: Application id - relevant only for application principal type. + + Multiple actions can be specified by using more than one --value argument. examples: - name: KustoDatabaseAddPrincipals text: |- - az kusto database add-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" --v\ -alue name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value nam\ -e="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="SomeA\ -pp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kustorpt\ -est" + az kusto database add-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --\ +value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value na\ +me="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="Some\ +App" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kustorp\ +test" """ helps['kusto database list-principal'] = """ @@ -284,21 +466,53 @@ examples: - name: KustoDatabaseListPrincipals text: |- - az kusto database list-principal --cluster-name "KustoClusterRPTest4" --database-name "Kustodatabase8" -\ + az kusto database list-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" -\ -resource-group "kustorptest" """ helps['kusto database remove-principal'] = """ type: command short-summary: Remove Database principals permissions. + parameters: + - name: --value + short-summary: The list of Kusto database principals. + long-summary: | + Usage: --value role=XX name=XX type=XX fqn=XX email=XX app-id=XX + + role: Required. Database principal role. + name: Required. Database principal name. + type: Required. Database principal type. + fqn: Database principal fully qualified name. + email: Database principal email if exists. + app-id: Application id - relevant only for application principal type. + + Multiple actions can be specified by using more than one --value argument. examples: - name: KustoDatabaseRemovePrincipals text: |- - az kusto database remove-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" \ ---value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value \ -name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="So\ -meApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kusto\ -rptest" + az kusto database remove-principal --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8"\ + --value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value\ + name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="S\ +omeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kust\ +orptest" +""" + +helps['kusto database wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto database is met. + examples: + - name: Pause executing next line of CLI script until the kusto database is successfully created. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ +group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto database is successfully updated. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ +group "kustorptest" --updated + - name: Pause executing next line of CLI script until the kusto database is successfully deleted. + text: |- + az kusto database wait --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-\ +group "kustorptest" --deleted """ helps['kusto database-principal-assignment'] = """ @@ -358,6 +572,23 @@ odatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" """ +helps['kusto database-principal-assignment wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto database-principal-assignment is met\ +. + examples: + - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully cre\ +ated. + text: |- + az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto database-principal-assignment is successfully del\ +eted. + text: |- + az kusto database-principal-assignment wait --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" --deleted +""" + helps['kusto attached-database-configuration'] = """ type: group short-summary: kusto attached-database-configuration @@ -369,7 +600,7 @@ examples: - name: KustoAttachedDatabaseConfigurationsListByCluster text: |- - az kusto attached-database-configuration list --cluster-name "KustoClusterRPTest4" --resource-group "kus\ + az kusto attached-database-configuration list --cluster-name "kustoclusterrptest4" --resource-group "kus\ torptest" """ @@ -379,8 +610,8 @@ examples: - name: AttachedDatabaseConfigurationsGet text: |- - az kusto attached-database-configuration show --attached-database-configuration-name "attachedDatabaseCo\ -nfigurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto attached-database-configuration show --name "attachedDatabaseConfigurations1" --cluster-name "k\ +ustoclusterrptest4" --resource-group "kustorptest" """ helps['kusto attached-database-configuration create'] = """ @@ -389,10 +620,10 @@ examples: - name: AttachedDatabaseConfigurationsCreateOrUpdate text: |- - az kusto attached-database-configuration create --attached-database-configuration-name "attachedDatabase\ -Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ -8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ -ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" + az kusto attached-database-configuration create --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --location "westus" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/re\ +sourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --database-name "kustodatabase" --defau\ +lt-principals-modification-kind "Union" --resource-group "kustorptest" """ helps['kusto attached-database-configuration update'] = """ @@ -401,10 +632,10 @@ examples: - name: AttachedDatabaseConfigurationsCreateOrUpdate text: |- - az kusto attached-database-configuration update --attached-database-configuration-name "attachedDatabase\ -Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ -8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ -ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" + az kusto attached-database-configuration update --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --location "westus" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/re\ +sourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --database-name "kustodatabase" --defau\ +lt-principals-modification-kind "Union" --resource-group "kustorptest" """ helps['kusto attached-database-configuration delete'] = """ @@ -413,8 +644,25 @@ examples: - name: AttachedDatabaseConfigurationsDelete text: |- - az kusto attached-database-configuration delete --attached-database-configuration-name "attachedDatabase\ -Configurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" + az kusto attached-database-configuration delete --name "attachedDatabaseConfigurations1" --cluster-name \ +"kustoclusterrptest4" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto attached-database-configuration is m\ +et. + examples: + - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully c\ +reated. + text: |- + az kusto attached-database-configuration wait --name "attachedDatabaseConfigurations1" --cluster-name "k\ +ustoclusterrptest4" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto attached-database-configuration is successfully d\ +eleted. + text: |- + az kusto attached-database-configuration wait --name "attachedDatabaseConfigurations1" --cluster-name "k\ +ustoclusterrptest4" --resource-group "kustorptest" --deleted """ helps['kusto data-connection'] = """ @@ -428,7 +676,7 @@ examples: - name: KustoDatabasesListByCluster text: |- - az kusto data-connection list --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --re\ + az kusto data-connection list --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --re\ source-group "kustorptest" """ @@ -438,8 +686,8 @@ examples: - name: KustoDataConnectionsGet text: |- - az kusto data-connection show --cluster-name "KustoClusterRPTest4" --data-connection-name "DataConnectio\ -ns8" --database-name "KustoDatabase8" --resource-group "kustorptest" + az kusto data-connection show --cluster-name "kustoclusterrptest4" --name "DataConnections8" --database-\ +name "KustoDatabase8" --resource-group "kustorptest" """ helps['kusto data-connection event-grid'] = """ @@ -463,10 +711,10 @@ examples: - name: KustoDataConnectionsCreateOrUpdate text: |- - az kusto data-connection event-hub create --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ -ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ --resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ -ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" + az kusto data-connection event-hub create --cluster-name "kustoclusterrptest4" --name "DataConnections8"\ + --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ +ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ +enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" """ helps['kusto data-connection iot-hub'] = """ @@ -490,10 +738,10 @@ examples: - name: KustoDataConnectionsUpdate text: |- - az kusto data-connection event-hub update --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ -ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ --resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ -ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" + az kusto data-connection event-hub update --cluster-name "kustoclusterrptest4" --name "DataConnections8"\ + --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ +ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ +enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" """ helps['kusto data-connection iot-hub update'] = """ @@ -507,8 +755,8 @@ examples: - name: KustoDataConnectionsDelete text: |- - az kusto data-connection delete --cluster-name "KustoClusterRPTest4" --data-connection-name "kustoeventh\ -ubconnection1" --database-name "KustoDatabase8" --resource-group "kustorptest" + az kusto data-connection delete --cluster-name "kustoclusterrptest4" --name "kustoeventhubconnection1" -\ +-database-name "KustoDatabase8" --resource-group "kustorptest" """ helps['kusto data-connection event-grid data-connection-validation'] = """ @@ -522,10 +770,10 @@ examples: - name: KustoDataConnectionValidation text: |- - az kusto data-connection event-hub data-connection-validation --cluster-name "KustoClusterRPTest4" --dat\ -abase-name "KustoDatabase8" --data-connection-name "DataConnections8" --consumer-group "testConsumerGroup1" --event-hub\ --resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ -ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" + az kusto data-connection event-hub data-connection-validation --cluster-name "kustoclusterrptest4" --dat\ +abase-name "KustoDatabase8" --name "DataConnections8" --consumer-group "testConsumerGroup1" --event-hub-resource-id "/s\ +ubscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/ev\ +enthubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" """ helps['kusto data-connection iot-hub data-connection-validation'] = """ @@ -533,26 +781,16 @@ short-summary: Checks that the data connection parameters are valid. """ -helps['kusto attached-database-configuration wait'] = """ -type: command -short-summary: Wait for a managed Kusto cluster to reach a desired state. -long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. -""" - -helps['kusto cluster-principal-assignment wait'] = """ -type: command -short-summary: Wait for a managed Kusto cluster to reach a desired state. -long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. -""" - helps['kusto data-connection wait'] = """ -type: command -short-summary: Wait for a managed Kusto cluster to reach a desired state. -long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. -""" - -helps['kusto database-principal-assignment wait'] = """ -type: command -short-summary: Wait for a managed Kusto cluster to reach a desired state. -long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. + type: command + short-summary: Place the CLI in a waiting state until a condition of the kusto data-connection is met. + examples: + - name: Pause executing next line of CLI script until the kusto data-connection is successfully created. + text: |- + az kusto data-connection wait --cluster-name "kustoclusterrptest4" --name "DataConnections8" --database-\ +name "KustoDatabase8" --resource-group "kustorptest" --created + - name: Pause executing next line of CLI script until the kusto data-connection is successfully deleted. + text: |- + az kusto data-connection wait --cluster-name "kustoclusterrptest4" --name "DataConnections8" --database-\ +name "KustoDatabase8" --resource-group "kustorptest" --deleted """ diff --git a/src/kusto/azext_kusto/generated/_params.py b/src/kusto/azext_kusto/generated/_params.py index ff17d49df18..727a5d7107b 100644 --- a/src/kusto/azext_kusto/generated/_params.py +++ b/src/kusto/azext_kusto/generated/_params.py @@ -25,10 +25,10 @@ AddOptimizedAutoscale, AddVirtualNetworkConfiguration, AddKeyVaultProperties, - AddLanguageExtensionsValue, + AddClustersValue, AddReadWriteDatabase, AddReadOnlyFollowingDatabase, - AddValue + AddDatabasesValue ) @@ -39,83 +39,86 @@ def load_arguments(self, _): with self.argument_context('kusto cluster show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') with self.argument_context('kusto cluster create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.') c.argument('tags', tags_type) c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) - c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster. Expect value: KEY1=VALUE1 KEY2=VALUE2' - ' ... , available KEYs are: name, capacity, tier.') - c.argument('zones', nargs='+', help='The availability zones of the cluster. Expected value: json-string/@json-f' - 'ile.') + c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster.') + c.argument('zones', nargs='+', help='The availability zones of the cluster.') c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' - 'al tenants. Expect value: value=xx.') + 'al tenants.') c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' - 'n. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: version, is-enabled, minimum, ma' - 'ximum.') + 'n.') c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' 'he cluster\'s disks are encrypted.') c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' 'the streaming ingest is enabled.') c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' - 'work definition. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: subnet-id, engine-' - 'public-ip-id, data-management-public-ip-id.') + 'work definition.') c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' - 'luster encryption. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: key-name, key-ve' - 'rsion, key-vault-uri.') + 'luster encryption.') c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' 'perations are enabled.') - c.argument('language_extensions_value', action=AddLanguageExtensionsValue, nargs='+', help='The list of languag' - 'e extensions. Expect value: language-extension-name=xx.') + c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if' + ' double encryption is enabled.') c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') - c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigned-identities'], help='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}\'. Expected value: json-string/@json-file.')) + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with the Kusto cluster. The user ident' + 'ity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionI' + 'd}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{i' + 'dentityName}\'. Expected value: json-string/@json-file.')) with self.argument_context('kusto cluster update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') c.argument('tags', tags_type) c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) - c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster. Expect value: KEY1=VALUE1 KEY2=VALUE2' - ' ... , available KEYs are: name, capacity, tier.') + c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster.') c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' - 'al tenants. Expect value: value=xx.') + 'al tenants.') c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' - 'n. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: version, is-enabled, minimum, ma' - 'ximum.') + 'n.') c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' 'he cluster\'s disks are encrypted.') c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' 'the streaming ingest is enabled.') c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' - 'work definition. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: subnet-id, engine-' - 'public-ip-id, data-management-public-ip-id.') + 'work definition.') c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' - 'luster encryption. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: key-name, key-ve' - 'rsion, key-vault-uri.') + 'luster encryption.') c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' 'perations are enabled.') - c.argument('language_extensions_value', action=AddLanguageExtensionsValue, nargs='+', help='The list of languag' - 'e extensions. Expect value: language-extension-name=xx.') + c.argument('enable_double_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if' + ' double encryption is enabled.') c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') - c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigned-identities'], help='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}\'. Expected value: json-string/@json-file.')) + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with the Kusto cluster. The user ident' + 'ity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionI' + 'd}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{i' + 'dentityName}\'. Expected value: json-string/@json-file.')) with self.argument_context('kusto cluster delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') with self.argument_context('kusto cluster add-language-extension') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('value', action=AddLanguageExtensionsValue, nargs='+', help='The list of language extensions. Expect' - ' value: language-extension-name=xx.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') + c.argument('value', action=AddClustersValue, nargs='+', help='The list of language extensions.') with self.argument_context('kusto cluster detach-follower-database') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') c.argument('cluster_resource_id', help='Resource id of the cluster that follows a database owned by this cluste' 'r.') c.argument('attached_database_configuration_name', help='Resource name of the attached database configuration i' @@ -123,33 +126,41 @@ def load_arguments(self, _): with self.argument_context('kusto cluster diagnose-virtual-network') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') with self.argument_context('kusto cluster list-follower-database') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.') with self.argument_context('kusto cluster list-language-extension') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.') with self.argument_context('kusto cluster list-sku') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.') with self.argument_context('kusto cluster remove-language-extension') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('value', action=AddLanguageExtensionsValue, nargs='+', help='The list of language extensions. Expect' - ' value: language-extension-name=xx.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') + c.argument('value', action=AddClustersValue, nargs='+', help='The list of language extensions.') with self.argument_context('kusto cluster start') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') with self.argument_context('kusto cluster stop') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') + + with self.argument_context('kusto cluster wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', options_list=['--name', '-n'], help='The name of the Kusto cluster.', + id_part='name') with self.argument_context('kusto cluster-principal-assignment list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -157,8 +168,9 @@ def load_arguments(self, _): with self.argument_context('kusto cluster-principal-assignment show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '1') with self.argument_context('kusto cluster-principal-assignment create') as c: c.argument('resource_group_name', resource_group_name_type) @@ -173,8 +185,9 @@ def load_arguments(self, _): with self.argument_context('kusto cluster-principal-assignment update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '1') c.argument('principal_id', help='The principal ID assigned to the cluster principal. It can be a user email, ap' 'plication ID, or security group name.') c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster principal' @@ -184,8 +197,15 @@ def load_arguments(self, _): with self.argument_context('kusto cluster-principal-assignment delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '1') + + with self.argument_context('kusto cluster-principal-assignment wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '1') with self.argument_context('kusto database list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -193,42 +213,37 @@ def load_arguments(self, _): with self.argument_context('kusto database show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') with self.argument_context('kusto database create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('cluster_name', help='The name of the Kusto cluster.') c.argument('database_name', help='The name of the database in the Kusto cluster.') c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' - ' database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: soft-delete-period, hot-' - 'cache-period, location.', arg_group='Parameters') + ' database.', arg_group='Parameters') c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' - 'ting a read only following database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are' - ': hot-cache-period, location.', arg_group='Parameters') + 'ting a read only following database.', arg_group='Parameters') with self.argument_context('kusto database update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' - ' database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: soft-delete-period, hot-' - 'cache-period, location.', arg_group='Parameters') + ' database.', arg_group='Parameters') c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' - 'ting a read only following database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are' - ': hot-cache-period, location.', arg_group='Parameters') + 'ting a read only following database.', arg_group='Parameters') with self.argument_context('kusto database delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') with self.argument_context('kusto database add-principal') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('value', action=AddValue, nargs='+', help='The list of Kusto database principals. Expect value: KEY1' - '=VALUE1 KEY2=VALUE2 ... , available KEYs are: role, name, type, fqn, email, app-id.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('value', action=AddDatabasesValue, nargs='+', help='The list of Kusto database principals.') with self.argument_context('kusto database list-principal') as c: c.argument('resource_group_name', resource_group_name_type) @@ -237,10 +252,14 @@ def load_arguments(self, _): with self.argument_context('kusto database remove-principal') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('value', action=AddValue, nargs='+', help='The list of Kusto database principals. Expect value: KEY1' - '=VALUE1 KEY2=VALUE2 ... , available KEYs are: role, name, type, fqn, email, app-id.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('value', action=AddDatabasesValue, nargs='+', help='The list of Kusto database principals.') + + with self.argument_context('kusto database wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') with self.argument_context('kusto database-principal-assignment list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -249,9 +268,10 @@ def load_arguments(self, _): with self.argument_context('kusto database-principal-assignment show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '2') with self.argument_context('kusto database-principal-assignment create') as c: c.argument('resource_group_name', resource_group_name_type) @@ -267,9 +287,10 @@ def load_arguments(self, _): with self.argument_context('kusto database-principal-assignment update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '2') c.argument('principal_id', help='The principal ID assigned to the database principal. It can be a user email, a' 'pplication ID, or security group name.') c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'View' @@ -279,9 +300,17 @@ def load_arguments(self, _): with self.argument_context('kusto database-principal-assignment delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '2') + + with self.argument_context('kusto database-principal-assignment wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.', id_part='child_name_' + '2') with self.argument_context('kusto attached-database-configuration list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -289,37 +318,49 @@ def load_arguments(self, _): with self.argument_context('kusto attached-database-configuration show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n'], help='The name of the attache' + 'd database configuration.', id_part='child_name_1') with self.argument_context('kusto attached-database-configuration create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('attached_database_configuration_name', options_list=['--name', '-n'], help='The name of the attache' + 'd database configuration.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' ' follow all current and future databases.') c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' 'tach reside.') - c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help= + 'The default principals modification kind') with self.argument_context('kusto attached-database-configuration update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n'], help='The name of the attache' + 'd database configuration.', id_part='child_name_1') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' ' follow all current and future databases.') c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' 'tach reside.') - c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help= + 'The default principals modification kind') with self.argument_context('kusto attached-database-configuration delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n'], help='The name of the attache' + 'd database configuration.', id_part='child_name_1') + + with self.argument_context('kusto attached-database-configuration wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('attached_database_configuration_name', options_list=['--name', '-n'], help='The name of the attache' + 'd database configuration.', id_part='child_name_1') with self.argument_context('kusto data-connection list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -328,15 +369,16 @@ def load_arguments(self, _): with self.argument_context('kusto data-connection show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') with self.argument_context('kusto data-connection event-grid create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('cluster_name', help='The name of the Kusto cluster.') c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('storage_account_resource_id', @@ -348,14 +390,18 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' + 'ge.BlobRenamed']), help='The name of blob storage event type to process.') with self.argument_context('kusto data-connection event-hub create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('cluster_name', help='The name of the Kusto cluster.') c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' @@ -366,10 +412,9 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' - 'string/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub') c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' 'pe') @@ -377,7 +422,7 @@ def load_arguments(self, _): c.argument('resource_group_name', resource_group_name_type) c.argument('cluster_name', help='The name of the Kusto cluster.') c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('iot_hub_resource_id', @@ -388,17 +433,17 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' - 'ring/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') c.argument('shared_access_policy_name', help='The name of the share access policy') with self.argument_context('kusto data-connection event-grid update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('storage_account_resource_id', @@ -410,14 +455,19 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' + 'ge.BlobRenamed']), help='The name of blob storage event type to process.') with self.argument_context('kusto data-connection event-hub update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' @@ -428,18 +478,18 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' - 'string/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub') c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' 'pe') with self.argument_context('kusto data-connection iot-hub update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('iot_hub_resource_id', @@ -450,23 +500,23 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' - 'ring/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') c.argument('shared_access_policy_name', help='The name of the share access policy') with self.argument_context('kusto data-connection delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') with self.argument_context('kusto data-connection event-grid data-connection-validation') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('storage_account_resource_id', @@ -478,14 +528,18 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('ignore_first_record', arg_type=get_three_state_flag(), help='A Boolean value that, if set to true, ' + 'indicates that ingestion should ignore the first record of every file') + c.argument('blob_storage_event_type', arg_type=get_enum_type(['Microsoft.Storage.BlobCreated', 'Microsoft.Stora' + 'ge.BlobRenamed']), help='The name of blob storage event type to process.') with self.argument_context('kusto data-connection event-hub data-connection-validation') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' @@ -496,18 +550,17 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' - 'string/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub') c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' 'pe') with self.argument_context('kusto data-connection iot-hub data-connection-validation') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('cluster_name', help='The name of the Kusto cluster.') - c.argument('database_name', help='The name of the database in the Kusto cluster.') - c.argument('data_connection_name', help='The name of the data connection.') + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.') c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) c.argument('iot_hub_resource_id', @@ -518,8 +571,14 @@ def load_arguments(self, _): c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' 'formation can be added to each message.') c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' - 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' - ' Optionally the data format can be added to each message.') - c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' - 'ring/@json-file.') + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE']), help='The' + ' data format of the message. Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub') c.argument('shared_access_policy_name', help='The name of the share access policy') + + with self.argument_context('kusto data-connection wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.', id_part='name') + c.argument('database_name', help='The name of the database in the Kusto cluster.', id_part='child_name_1') + c.argument('data_connection_name', options_list=['--name', '-n'], help='The name of the data connection.', + id_part='child_name_2') diff --git a/src/kusto/azext_kusto/generated/_validators.py b/src/kusto/azext_kusto/generated/_validators.py index 7536d0531ea..e5ac7838677 100644 --- a/src/kusto/azext_kusto/generated/_validators.py +++ b/src/kusto/azext_kusto/generated/_validators.py @@ -7,17 +7,3 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- - - -def example_name_or_id_validator(cmd, namespace): - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id - if namespace.storage_account: - if not is_valid_resource_id(namespace.RESOURCE): - namespace.storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account - ) diff --git a/src/kusto/azext_kusto/generated/action.py b/src/kusto/azext_kusto/generated/action.py index c5c7ef27a7c..54127f7e785 100644 --- a/src/kusto/azext_kusto/generated/action.py +++ b/src/kusto/azext_kusto/generated/action.py @@ -142,10 +142,10 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use return d -class AddLanguageExtensionsValue(argparse._AppendAction): +class AddClustersValue(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddLanguageExtensionsValue, self).__call__(parser, namespace, action, option_string) + super(AddClustersValue, self).__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -216,10 +216,10 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use return d -class AddValue(argparse._AppendAction): +class AddDatabasesValue(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddValue, self).__call__(parser, namespace, action, option_string) + super(AddDatabasesValue, self).__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/kusto/azext_kusto/generated/commands.py b/src/kusto/azext_kusto/generated/commands.py index 3058e404f8a..ab108067a0f 100644 --- a/src/kusto/azext_kusto/generated/commands.py +++ b/src/kusto/azext_kusto/generated/commands.py @@ -33,7 +33,7 @@ def load_command_table(self, _): supports_no_wait=True) g.custom_command('start', 'kusto_cluster_start', supports_no_wait=True) g.custom_command('stop', 'kusto_cluster_stop', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'kusto_cluster_show') from azext_kusto.generated._client_factory import cf_cluster_principal_assignment kusto_cluster_principal_assignment = CliCommandType( @@ -47,7 +47,7 @@ def load_command_table(self, _): g.custom_command('create', 'kusto_cluster_principal_assignment_create', supports_no_wait=True) g.custom_command('update', 'kusto_cluster_principal_assignment_update', supports_no_wait=True) g.custom_command('delete', 'kusto_cluster_principal_assignment_delete', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'kusto_cluster_principal_assignment_show') from azext_kusto.generated._client_factory import cf_database kusto_database = CliCommandType( @@ -62,7 +62,7 @@ def load_command_table(self, _): g.custom_command('add-principal', 'kusto_database_add_principal') g.custom_command('list-principal', 'kusto_database_list_principal') g.custom_command('remove-principal', 'kusto_database_remove_principal') - g.wait_command('wait') + g.custom_wait_command('wait', 'kusto_database_show') from azext_kusto.generated._client_factory import cf_database_principal_assignment kusto_database_principal_assignment = CliCommandType( @@ -76,7 +76,7 @@ def load_command_table(self, _): g.custom_command('create', 'kusto_database_principal_assignment_create', supports_no_wait=True) g.custom_command('update', 'kusto_database_principal_assignment_update', supports_no_wait=True) g.custom_command('delete', 'kusto_database_principal_assignment_delete', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'kusto_database_principal_assignment_show') from azext_kusto.generated._client_factory import cf_attached_database_configuration kusto_attached_database_configuration = CliCommandType( @@ -90,7 +90,7 @@ def load_command_table(self, _): g.custom_command('create', 'kusto_attached_database_configuration_create', supports_no_wait=True) g.custom_command('update', 'kusto_attached_database_configuration_update', supports_no_wait=True) g.custom_command('delete', 'kusto_attached_database_configuration_delete', supports_no_wait=True) - g.wait_command('wait') + g.custom_wait_command('wait', 'kusto_attached_database_configuration_show') from azext_kusto.generated._client_factory import cf_data_connection kusto_data_connection = CliCommandType( @@ -109,9 +109,9 @@ def load_command_table(self, _): g.custom_command('iot-hub update', 'kusto_data_connection_iot_hub_update', supports_no_wait=True) g.custom_command('delete', 'kusto_data_connection_delete', supports_no_wait=True) g.custom_command('event-grid data-connection-validation', 'kusto_data_connection_event_grid_data_connection_val' - 'idation') + 'idation', supports_no_wait=True) g.custom_command('event-hub data-connection-validation', 'kusto_data_connection_event_hub_data_connection_valid' - 'ation') + 'ation', supports_no_wait=True) g.custom_command('iot-hub data-connection-validation', 'kusto_data_connection_iot_hub_data_connection_validatio' - 'n') - g.wait_command('wait') + 'n', supports_no_wait=True) + g.custom_wait_command('wait', 'kusto_data_connection_show') diff --git a/src/kusto/azext_kusto/generated/custom.py b/src/kusto/azext_kusto/generated/custom.py index 7e9cc01e8d8..64f9833e85a 100644 --- a/src/kusto/azext_kusto/generated/custom.py +++ b/src/kusto/azext_kusto/generated/custom.py @@ -7,16 +7,16 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: disable=line-too-long # pylint: disable=too-many-lines import json from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait def kusto_cluster_list(client, resource_group_name=None): - if resource_group_name is not None: + if resource_group_name: return client.list_by_resource_group(resource_group_name=resource_group_name) return client.list() @@ -42,29 +42,36 @@ def kusto_cluster_create(client, virtual_network_configuration=None, key_vault_properties=None, enable_purge=None, - language_extensions_value=None, + enable_double_encryption=None, identity_type=None, - identity_user_assigned_identities=None): - if isinstance(zones, str): - zones = json.loads(zones) + identity_user_assigned_identities=None, + no_wait=False): + if enable_streaming_ingest == None: + enable_streaming_ingest = False + if enable_purge == None: + enable_purge = False + if enable_double_encryption == None: + enable_double_encryption = False if isinstance(identity_user_assigned_identities, str): identity_user_assigned_identities = json.loads(identity_user_assigned_identities) - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - zones=zones, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - value=language_extensions_value, - type=identity_type, - user_assigned_identities=identity_user_assigned_identities) + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) def kusto_cluster_update(client, @@ -80,60 +87,81 @@ def kusto_cluster_update(client, virtual_network_configuration=None, key_vault_properties=None, enable_purge=None, - language_extensions_value=None, + enable_double_encryption=None, identity_type=None, - identity_user_assigned_identities=None): + identity_user_assigned_identities=None, + no_wait=False): + if enable_streaming_ingest == None: + enable_streaming_ingest = False + if enable_purge == None: + enable_purge = False + if enable_double_encryption == None: + enable_double_encryption = False if isinstance(identity_user_assigned_identities, str): identity_user_assigned_identities = json.loads(identity_user_assigned_identities) - return client.begin_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - tags=tags, - location=location, - sku=sku, - trusted_external_tenants=trusted_external_tenants, - optimized_autoscale=optimized_autoscale, - enable_disk_encryption=enable_disk_encryption, - enable_streaming_ingest=enable_streaming_ingest, - virtual_network_configuration=virtual_network_configuration, - key_vault_properties=key_vault_properties, - enable_purge=enable_purge, - value=language_extensions_value, - type=identity_type, - user_assigned_identities=identity_user_assigned_identities) + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + enable_double_encryption=enable_double_encryption, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) def kusto_cluster_delete(client, resource_group_name, - cluster_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name) + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name) def kusto_cluster_add_language_extension(client, resource_group_name, cluster_name, - value=None): - return client.begin_add_language_extension(resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value) + value=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_add_language_extension, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) def kusto_cluster_detach_follower_database(client, resource_group_name, cluster_name, cluster_resource_id, - attached_database_configuration_name): - return client.begin_detach_follower_database(resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_resource_id=cluster_resource_id, - attached_database_configuration_name=attached_database_configuration_name) + attached_database_configuration_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_detach_follower_database, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name) def kusto_cluster_diagnose_virtual_network(client, resource_group_name, - cluster_name): - return client.begin_diagnose_virtual_network(resource_group_name=resource_group_name, - cluster_name=cluster_name) + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_diagnose_virtual_network, + resource_group_name=resource_group_name, + cluster_name=cluster_name) def kusto_cluster_list_follower_database(client, @@ -153,7 +181,7 @@ def kusto_cluster_list_language_extension(client, def kusto_cluster_list_sku(client, resource_group_name=None, cluster_name=None): - if resource_group_name is not None and cluster_name is not None: + if resource_group_name and cluster_name is not None: return client.list_sku_by_resource(resource_group_name=resource_group_name, cluster_name=cluster_name) return client.list_sku() @@ -162,24 +190,33 @@ def kusto_cluster_list_sku(client, def kusto_cluster_remove_language_extension(client, resource_group_name, cluster_name, - value=None): - return client.begin_remove_language_extension(resource_group_name=resource_group_name, - cluster_name=cluster_name, - value=value) + value=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_remove_language_extension, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) def kusto_cluster_start(client, resource_group_name, - cluster_name): - return client.begin_start(resource_group_name=resource_group_name, - cluster_name=cluster_name) + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_start, + resource_group_name=resource_group_name, + cluster_name=cluster_name) def kusto_cluster_stop(client, resource_group_name, - cluster_name): - return client.begin_stop(resource_group_name=resource_group_name, - cluster_name=cluster_name) + cluster_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_stop, + resource_group_name=resource_group_name, + cluster_name=cluster_name) def kusto_cluster_principal_assignment_list(client, @@ -205,14 +242,17 @@ def kusto_cluster_principal_assignment_create(client, principal_id=None, role=None, tenant_id=None, - principal_type=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) def kusto_cluster_principal_assignment_update(client, @@ -222,23 +262,29 @@ def kusto_cluster_principal_assignment_update(client, principal_id=None, role=None, tenant_id=None, - principal_type=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) def kusto_cluster_principal_assignment_delete(client, resource_group_name, cluster_name, - principal_assignment_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name, - principal_assignment_name=principal_assignment_name) + principal_assignment_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name) def kusto_database_list(client, @@ -262,7 +308,8 @@ def kusto_database_create(client, cluster_name, database_name, read_write_database=None, - read_only_following_database=None): + read_only_following_database=None, + no_wait=False): all_parameters = [] if read_write_database is not None: all_parameters.append(read_write_database) @@ -274,10 +321,12 @@ def kusto_database_create(client, raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' 'ed!') parameters = all_parameters[0] if len(all_parameters) == 1 else None - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) def kusto_database_update(client, @@ -285,7 +334,8 @@ def kusto_database_update(client, cluster_name, database_name, read_write_database=None, - read_only_following_database=None): + read_only_following_database=None, + no_wait=False): all_parameters = [] if read_write_database is not None: all_parameters.append(read_write_database) @@ -297,19 +347,24 @@ def kusto_database_update(client, raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' 'ed!') parameters = all_parameters[0] if len(all_parameters) == 1 else None - return client.begin_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) def kusto_database_delete(client, resource_group_name, cluster_name, - database_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name) + database_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) def kusto_database_add_principal(client, @@ -371,15 +426,18 @@ def kusto_database_principal_assignment_create(client, principal_id=None, role=None, tenant_id=None, - principal_type=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) def kusto_database_principal_assignment_update(client, @@ -390,26 +448,32 @@ def kusto_database_principal_assignment_update(client, principal_id=None, role=None, tenant_id=None, - principal_type=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name, - principal_id=principal_id, - role=role, - tenant_id=tenant_id, - principal_type=principal_type) + principal_type=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) def kusto_database_principal_assignment_delete(client, resource_group_name, cluster_name, database_name, - principal_assignment_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - principal_assignment_name=principal_assignment_name) + principal_assignment_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name) def kusto_attached_database_configuration_list(client, @@ -435,14 +499,17 @@ def kusto_attached_database_configuration_create(client, location=None, database_name=None, cluster_resource_id=None, - default_principals_modification_kind=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind) + default_principals_modification_kind=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) def kusto_attached_database_configuration_update(client, @@ -452,23 +519,29 @@ def kusto_attached_database_configuration_update(client, location=None, database_name=None, cluster_resource_id=None, - default_principals_modification_kind=None): - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name, - location=location, - database_name=database_name, - cluster_resource_id=cluster_resource_id, - default_principals_modification_kind=default_principals_modification_kind) + default_principals_modification_kind=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) def kusto_attached_database_configuration_delete(client, resource_group_name, cluster_name, - attached_database_configuration_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name, - attached_database_configuration_name=attached_database_configuration_name) + attached_database_configuration_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name) def kusto_data_connection_list(client, @@ -502,7 +575,10 @@ def kusto_data_connection_event_grid_create(client, consumer_group=None, table_name=None, mapping_rule_name=None, - data_format=None): + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'EventGrid' @@ -512,11 +588,15 @@ def kusto_data_connection_event_grid_create(client, parameters['table_name'] = table_name parameters['mapping_rule_name'] = mapping_rule_name parameters['data_format'] = data_format - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + parameters['ignore_first_record'] = ignore_first_record + parameters['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_event_hub_create(client, @@ -531,9 +611,8 @@ def kusto_data_connection_event_hub_create(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - compression=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + compression=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'EventHub' @@ -544,11 +623,13 @@ def kusto_data_connection_event_hub_create(client, parameters['data_format'] = data_format parameters['event_system_properties'] = event_system_properties parameters['compression'] = compression - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_iot_hub_create(client, @@ -563,9 +644,8 @@ def kusto_data_connection_iot_hub_create(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - shared_access_policy_name=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + shared_access_policy_name=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'IotHub' @@ -576,11 +656,13 @@ def kusto_data_connection_iot_hub_create(client, parameters['data_format'] = data_format parameters['event_system_properties'] = event_system_properties parameters['shared_access_policy_name'] = shared_access_policy_name - return client.begin_create_or_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_event_grid_update(client, @@ -594,7 +676,10 @@ def kusto_data_connection_event_grid_update(client, consumer_group=None, table_name=None, mapping_rule_name=None, - data_format=None): + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'EventGrid' @@ -604,11 +689,15 @@ def kusto_data_connection_event_grid_update(client, parameters['table_name'] = table_name parameters['mapping_rule_name'] = mapping_rule_name parameters['data_format'] = data_format - return client.begin_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + parameters['ignore_first_record'] = ignore_first_record + parameters['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_event_hub_update(client, @@ -623,9 +712,8 @@ def kusto_data_connection_event_hub_update(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - compression=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + compression=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'EventHub' @@ -636,11 +724,13 @@ def kusto_data_connection_event_hub_update(client, parameters['data_format'] = data_format parameters['event_system_properties'] = event_system_properties parameters['compression'] = compression - return client.begin_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_iot_hub_update(client, @@ -655,9 +745,8 @@ def kusto_data_connection_iot_hub_update(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - shared_access_policy_name=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + shared_access_policy_name=None, + no_wait=False): parameters = {} parameters['location'] = location parameters['kind'] = 'IotHub' @@ -668,22 +757,27 @@ def kusto_data_connection_iot_hub_update(client, parameters['data_format'] = data_format parameters['event_system_properties'] = event_system_properties parameters['shared_access_policy_name'] = shared_access_policy_name - return client.begin_update(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - parameters=parameters) + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) def kusto_data_connection_delete(client, resource_group_name, cluster_name, database_name, - data_connection_name): - return client.begin_delete(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name) + data_connection_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name) def kusto_data_connection_event_grid_data_connection_validation(client, @@ -697,7 +791,10 @@ def kusto_data_connection_event_grid_data_connection_validation(client, consumer_group=None, table_name=None, mapping_rule_name=None, - data_format=None): + data_format=None, + ignore_first_record=None, + blob_storage_event_type=None, + no_wait=False): properties = {} properties['location'] = location properties['kind'] = 'EventGrid' @@ -707,11 +804,15 @@ def kusto_data_connection_event_grid_data_connection_validation(client, properties['table_name'] = table_name properties['mapping_rule_name'] = mapping_rule_name properties['data_format'] = data_format - return client.data_connection_validation(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) + properties['ignore_first_record'] = ignore_first_record + properties['blob_storage_event_type'] = blob_storage_event_type + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) def kusto_data_connection_event_hub_data_connection_validation(client, @@ -726,9 +827,8 @@ def kusto_data_connection_event_hub_data_connection_validation(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - compression=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + compression=None, + no_wait=False): properties = {} properties['location'] = location properties['kind'] = 'EventHub' @@ -739,11 +839,13 @@ def kusto_data_connection_event_hub_data_connection_validation(client, properties['data_format'] = data_format properties['event_system_properties'] = event_system_properties properties['compression'] = compression - return client.data_connection_validation(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) def kusto_data_connection_iot_hub_data_connection_validation(client, @@ -758,9 +860,8 @@ def kusto_data_connection_iot_hub_data_connection_validation(client, mapping_rule_name=None, data_format=None, event_system_properties=None, - shared_access_policy_name=None): - if isinstance(event_system_properties, str): - event_system_properties = json.loads(event_system_properties) + shared_access_policy_name=None, + no_wait=False): properties = {} properties['location'] = location properties['kind'] = 'IotHub' @@ -771,8 +872,10 @@ def kusto_data_connection_iot_hub_data_connection_validation(client, properties['data_format'] = data_format properties['event_system_properties'] = event_system_properties properties['shared_access_policy_name'] = shared_access_policy_name - return client.data_connection_validation(resource_group_name=resource_group_name, - cluster_name=cluster_name, - database_name=database_name, - data_connection_name=data_connection_name, - properties=properties) + return sdk_no_wait(no_wait, + client.begin_data_connection_validation, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) diff --git a/src/kusto/azext_kusto/tests/__init__.py b/src/kusto/azext_kusto/tests/__init__.py index 9a6531122f6..5f8f1fd97ad 100644 --- a/src/kusto/azext_kusto/tests/__init__.py +++ b/src/kusto/azext_kusto/tests/__init__.py @@ -10,9 +10,14 @@ # -------------------------------------------------------------------------- import inspect import os +import sys +import traceback +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError __path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] def try_manual(func): @@ -34,6 +39,7 @@ def get_func_to_call(): func_to_call = func try: func_to_call = import_manual_function(func) + print("Found manual override for {}(...)".format(func.__name__)) except (ImportError, AttributeError): pass return func_to_call @@ -41,8 +47,25 @@ def get_func_to_call(): def wrapper(*args, **kwargs): func_to_call = get_func_to_call() print("running {}()...".format(func.__name__)) - return func_to_call(*args, **kwargs) + try: + return func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: + print("--------------------------------------") + print("step exception: ", e) + print("--------------------------------------", file=sys.stderr) + print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) + traceback.print_exc() + exceptions.append((func.__name__, sys.exc_info())) if inspect.isclass(func): return get_func_to_call() return wrapper + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/kusto/azext_kusto/tests/latest/preparers.py b/src/kusto/azext_kusto/tests/latest/preparers.py index 93cae98db6b..4702355b2bd 100644 --- a/src/kusto/azext_kusto/tests/latest/preparers.py +++ b/src/kusto/azext_kusto/tests/latest/preparers.py @@ -10,14 +10,16 @@ import os from datetime import datetime -from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure.cli.testsdk.exceptions import CliTestError from azure.cli.testsdk.reverse_dependency import get_dummy_cli + KEY_RESOURCE_GROUP = 'rg' KEY_VIRTUAL_NETWORK = 'vnet' KEY_VNET_SUBNET = 'subnet' +KEY_VNET_NIC = 'nic' class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): @@ -39,7 +41,7 @@ def __init__(self, name_prefix='clitest.vn', self.resource_group_key = resource_group_key self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): if self.dev_setting_name: return {self.parameter_name: self.dev_setting_name, } @@ -55,62 +57,103 @@ def create_resource(self, name, **kwargs): tags['job'] = os.environ['ENV_JOB_NAME'] tags = ' '.join(['{}={}'.format(key, value) for key, value in tags.items()]) - template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + template = 'az network vnet create --resource-group {} --name {} --subnet-name default --tag ' + tags self.live_only_execute(self.cli_ctx, template.format( self.resource_group_name, name)) self.test_class_instance.kwargs[self.key] = name return {self.parameter_name: name} - def remove_resource(self, name, **kwargs): + def remove_resource(self, name, **_): # delete vnet if test is being recorded and if the vnet is not a dev rg if not self.dev_setting_name: self.live_only_execute( - self.cli_ctx, 'az network vnet delete --name {} --resource-group {}' - .format(name, self.resource_group_name)) + self.cli_ctx, + 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest.vn', parameter_name='subnet', - resource_group_name=None, resource_group_key=KEY_RESOURCE_GROUP, - vnet_name=None, vnet_key=KEY_VIRTUAL_NETWORK, address_prefixes="11.0.0.0/24", dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', - random_name_length=24, key=KEY_VNET_SUBNET): + key=KEY_VNET_SUBNET): if ' ' in name_prefix: raise CliTestError( 'Error: Space character in name prefix \'%s\'' % name_prefix) - super(VnetSubnetPreparer, self).__init__( - name_prefix, random_name_length) + super(VnetSubnetPreparer, self).__init__(name_prefix, 15) self.cli_ctx = get_dummy_cli() self.parameter_name = parameter_name self.key = key - self.resource_group_name = resource_group_name - self.resource_group_key = resource_group_key - self.vnet_name = vnet_name - self.vnet_key = vnet_key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] self.address_prefixes = address_prefixes self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): if self.dev_setting_name: return {self.parameter_name: self.dev_setting_name, } - if not self.resource_group_name: - self.resource_group_name = self.test_class_instance.kwargs.get( - self.resource_group_key) - if not self.resource_group_name: + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: raise CliTestError("Error: No resource group configured!") - if not self.vnet_name: - self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) - if not self.vnet_name: + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: raise CliTestError("Error: No vnet configured!") self.test_class_instance.kwargs[self.key] = 'default' return {self.parameter_name: name} - def remove_resource(self, name, **kwargs): + def remove_resource(self, name, **_): pass + + +class VnetNicPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.nic', + parameter_name='subnet', + resource_group_key=KEY_RESOURCE_GROUP, + vnet_key=KEY_VIRTUAL_NETWORK, + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_NIC_NAME', + key=KEY_VNET_NIC): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetNicPreparer, self).__init__(name_prefix, 15) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: + raise CliTestError("Error: No resource group configured!") + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: + raise CliTestError("Error: No vnet configured!") + + template = 'az network nic create --resource-group {} --name {} --vnet-name {} --subnet default ' + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group[1], name, self.vnet[1])) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, + 'az network nic delete --name {} --resource-group {}'.format(name, self.resource_group[1])) diff --git a/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py index 4747812c0b2..80397fc3f3b 100644 --- a/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py +++ b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py @@ -9,11 +9,8 @@ # -------------------------------------------------------------------------- import os -import unittest - -from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest -from .. import try_manual +from .. import try_manual, raise_if from azure.cli.testsdk import ResourceGroupPreparer @@ -25,170 +22,369 @@ def setup(test, rg): pass -# EXAMPLE: kustoclusterscreateorupdate +# EXAMPLE: KustoClustersCreateOrUpdate @try_manual def step_kustoclusterscreateorupdate(test, rg): test.cmd('az kusto cluster create ' - '--cluster-name "{Clusters_3}" ' + '--name "{Clusters_3}" ' '--identity-type "SystemAssigned" ' '--location "westus" ' + '--enable-double-encryption false ' '--enable-purge true ' '--enable-streaming-ingest true ' - '--key-vault-properties key-name="" key-vault-uri="" key-version="" ' '--sku name="Standard_L8s" capacity=2 tier="Standard" ' '--resource-group "{rg}"', checks=[]) test.cmd('az kusto cluster wait --created ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesCreateOrUpdate +@try_manual +def step_kustodatabasescreateorupdate(test, rg): + test.cmd('az kusto database create ' '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--parameters "{{\\"location\\":\\"westus\\",\\"properties\\":{{\\"softDeletePeriod\\":\\"P1D\\"}}}}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterschecknameavailability +# EXAMPLE: KustoDataConnectionsCreateOrUpdate @try_manual -def step_kustoclusterschecknameavailability(test, rg): - # EXAMPLE NOT FOUND! - pass +def step_kustodataconnectionscreateorupdate(test, rg): + test.cmd('az kusto data-connection event-hub create ' + '--cluster-name "{Clusters_3}" ' + '--name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' + '--location "westus" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' + '--resource-group "{rg}"', + checks=[]) -# EXAMPLE: kustoclustersget +# EXAMPLE: AttachedDatabaseConfigurationsCreateOrUpdate @try_manual -def step_kustoclustersget(test, rg): - test.cmd('az kusto cluster show ' +def step_attacheddatabaseconfigurationscreateorupdate(test, rg): + test.cmd('az kusto attached-database-configuration create ' + '--name "{attachedDatabaseConfigurations1}" ' '--cluster-name "{Clusters_3}" ' + '--location "westus" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/Clu' + 'sters/{Clusters_2}" ' + '--database-name "kustodatabase" ' + '--default-principals-modification-kind "Union" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto attached-database-configuration wait --created ' + '--name "{attachedDatabaseConfigurations1}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterslist +# EXAMPLE: AttachedDatabaseConfigurationsGet @try_manual -def step_kustoclusterslist(test, rg): - test.cmd('az kusto cluster list', +def step_attacheddatabaseconfigurationsget(test, rg): + test.cmd('az kusto attached-database-configuration show ' + '--name "{attachedDatabaseConfigurations1}" ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterslistbyresourcegroup +# EXAMPLE: KustoDataConnectionsGet @try_manual -def step_kustoclusterslistbyresourcegroup(test, rg): - test.cmd('az kusto cluster list ' +def step_kustodataconnectionsget(test, rg): + test.cmd('az kusto data-connection show ' + '--cluster-name "{Clusters_3}" ' + '--name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclustersstop +# EXAMPLE: KustoDatabasesListByCluster @try_manual -def step_kustoclustersstop(test, rg): - test.cmd('az kusto cluster stop ' +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' '--cluster-name "{Clusters_3}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclustersstart +# EXAMPLE: KustoAttachedDatabaseConfigurationsListByCluster @try_manual -def step_kustoclustersstart(test, rg): - test.cmd('az kusto cluster start ' +def step_kustoattacheddatabaseconfigurationslistbycluster(test, rg): + test.cmd('az kusto attached-database-configuration list ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesGet +@try_manual +def step_kustodatabasesget(test, rg): + test.cmd('az kusto database show ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasesListByCluster +@try_manual +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' '--cluster-name "{Clusters_3}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterslistresourceskus +# EXAMPLE: KustoClustersListResourceSkus @try_manual def step_kustoclusterslistresourceskus(test, rg): test.cmd('az kusto cluster list-sku ' - '--cluster-name "{Clusters_3}" ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersGet +@try_manual +def step_kustoclustersget(test, rg): + test.cmd('az kusto cluster show ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersListByResourceGroup +@try_manual +def step_kustoclusterslistbyresourcegroup(test, rg): + test.cmd('az kusto cluster list ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterslistskus +# EXAMPLE: KustoClustersList +@try_manual +def step_kustoclusterslist(test, rg): + test.cmd('az kusto cluster list ' + '-g ""', + checks=[]) + + +# EXAMPLE: KustoClustersListSkus @try_manual def step_kustoclusterslistskus(test, rg): - test.cmd('az kusto cluster list-sku', + test.cmd('az kusto cluster list-sku ' + '-g ""', checks=[]) -# EXAMPLE: kustodatabasescreateorupdate +# EXAMPLE: KustoOperationsList @try_manual -def step_kustodatabasescreateorupdate(test, rg): - test.cmd('az kusto database create ' +def step_kustooperationslist(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: KustoDataConnectionsUpdate +@try_manual +def step_kustodataconnectionsupdate(test, rg): + test.cmd('az kusto data-connection event-hub update ' '--cluster-name "{Clusters_3}" ' + '--name "{DataConnections8}" ' '--database-name "KustoDatabase8" ' - '--read-write-database location="westus" soft-delete-period="P1D" ' + '--location "westus" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabasechecknameavailability +# EXAMPLE: KustoDataConnectionValidation @try_manual -def step_kustodatabasechecknameavailability(test, rg): +def step_kustodataconnectionvalidation(test, rg): + test.cmd('az kusto data-connection event-hub data-connection-validation ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--name "{DataConnections8}" ' + '--consumer-group "testConsumerGroup1" ' + '--event-hub-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.EventHu' + 'b/namespaces/eventhubTestns1/eventhubs/eventhubTest1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsCheckNameAvailability +@try_manual +def step_kustodataconnectionschecknameavailability(test, rg): # EXAMPLE NOT FOUND! pass -# EXAMPLE: kustodatabaseslistbycluster +# EXAMPLE: KustoDatabaseRemovePrincipals @try_manual -def step_kustodatabaseslistbycluster(test, rg): - test.cmd('az kusto database list ' +def step_kustodatabaseremoveprincipals(test, rg): + test.cmd('az kusto database remove-principal ' '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' + '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' + '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabasesget +# EXAMPLE: KustoDatabaseListPrincipals @try_manual -def step_kustodatabasesget(test, rg): - test.cmd('az kusto database show ' +def step_kustodatabaselistprincipals(test, rg): + test.cmd('az kusto database list-principal ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabaseAddPrincipals +@try_manual +def step_kustodatabaseaddprincipals(test, rg): + test.cmd('az kusto database add-principal ' '--cluster-name "{Clusters_3}" ' '--database-name "KustoDatabase8" ' + '--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser role="Admin" ' + '--value name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup role="Viewer" ' + '--value name="SomeApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp role="Admin" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabasesupdate +# EXAMPLE: KustoDatabasesUpdate @try_manual def step_kustodatabasesupdate(test, rg): test.cmd('az kusto database update ' '--cluster-name "{Clusters_3}" ' '--database-name "KustoDatabase8" ' - '--read-write-database soft-delete-period="P1D" ' + '--parameters "{{\\"properties\\":{{\\"softDeletePeriod\\":\\"P1D\\"}}}}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabaseprincipalassignmentscreateorupdate +# EXAMPLE: KustoClusterDetachFollowerDatabases @try_manual -def step_kustodatabaseprincipalassignmentscreateorupdate(test, rg): - test.cmd('az kusto database-principal-assignment create ' +def step_kustoclusterdetachfollowerdatabases(test, rg): + test.cmd('az kusto cluster detach-follower-database ' + '--name "{Clusters_3}" ' + '--attached-database-configuration-name "{AttachedDatabaseConfigurations_2}" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/clu' + 'sters/{leader4}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabaseCheckNameAvailability +@try_manual +def step_kustodatabasechecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: KustoClusterListFollowerDatabases +@try_manual +def step_kustoclusterlistfollowerdatabases(test, rg): + test.cmd('az kusto cluster list-follower-database ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersStart +@try_manual +def step_kustoclustersstart(test, rg): + test.cmd('az kusto cluster start ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersStop +@try_manual +def step_kustoclustersstop(test, rg): + test.cmd('az kusto cluster stop ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersUpdate +@try_manual +def step_kustoclustersupdate(test, rg): + test.cmd('az kusto cluster update ' + '--name "{Clusters_3}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--key-vault-properties key-name="keyName" key-vault-uri="https://dummy.keyvault.com" key-version="keyVers' + 'ion" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoClustersCheckNameAvailability +@try_manual +def step_kustoclusterschecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: AttachedDatabaseConfigurationsDelete +@try_manual +def step_attacheddatabaseconfigurationsdelete(test, rg): + test.cmd('az kusto attached-database-configuration delete ' + '--name "{attachedDatabaseConfigurations1}" ' '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' - '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' - '--principal-type "App" ' - '--role "Admin" ' - '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' - '--principal-assignment-name "kustoprincipal1" ' '--resource-group "{rg}"', checks=[]) - test.cmd('az kusto database-principal-assignment wait --created ' + + +# EXAMPLE: KustoDataConnectionsDelete +@try_manual +def step_kustodataconnectionsdelete(test, rg): + test.cmd('az kusto data-connection delete ' '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' - '--principal-assignment-name "kustoprincipal1" ' + '--name "{DataConnections_2}" ' + '--database-name "KustoDatabase8" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabaselistprincipals +# EXAMPLE: KustoDatabasesDelete @try_manual -def step_kustodatabaselistprincipals(test, rg): - test.cmd('az kusto database list-principal ' +def step_kustodatabasesdelete(test, rg): + test.cmd('az kusto database delete ' '--cluster-name "{Clusters_3}" ' - '--database-name "Kustodatabase8" ' + '--database-name "KustoDatabase8" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustodatabaseprincipalassignmentsget +# EXAMPLE: KustoClustersDelete +@try_manual +def step_kustoclustersdelete(test, rg): + test.cmd('az kusto cluster delete ' + '--name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDatabasePrincipalAssignmentsGet @try_manual def step_kustodatabaseprincipalassignmentsget(test, rg): test.cmd('az kusto database-principal-assignment show ' @@ -199,37 +395,33 @@ def step_kustodatabaseprincipalassignmentsget(test, rg): checks=[]) -# EXAMPLE: kustodatabaseprincipalassignmentsdelete +# EXAMPLE: KustoDatabasePrincipalAssignmentsCreateOrUpdate @try_manual -def step_kustodatabaseprincipalassignmentsdelete(test, rg): - test.cmd('az kusto database-principal-assignment delete ' +def step_kustodatabaseprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto database-principal-assignment create ' '--cluster-name "{Clusters_3}" ' '--database-name "Kustodatabase8" ' + '--principal-id "87654321-1234-1234-1234-123456789123" ' + '--principal-type "App" ' + '--role "Admin" ' + '--tenant-id "12345678-1234-1234-1234-123456789123" ' '--principal-assignment-name "kustoprincipal1" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterprincipalassignmentscreateorupdate +# EXAMPLE: KustoDatabasePrincipalAssignmentsDelete @try_manual -def step_kustoclusterprincipalassignmentscreateorupdate(test, rg): - test.cmd('az kusto cluster-principal-assignment create ' +def step_kustodatabaseprincipalassignmentsdelete(test, rg): + test.cmd('az kusto database-principal-assignment delete ' '--cluster-name "{Clusters_3}" ' - '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' - '--principal-type "App" ' - '--role "AllDatabasesViewer" ' - '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' - '--principal-assignment-name "kustoprincipal1" ' - '--resource-group "{rg}"', - checks=[]) - test.cmd('az kusto cluster-principal-assignment wait --created ' + '--database-name "Kustodatabase8" ' '--principal-assignment-name "kustoprincipal1" ' - '--cluster-name "{Clusters_3}" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclusterprincipalassignmentsget +# EXAMPLE: KustoClusterPrincipalAssignmentsGet @try_manual def step_kustoclusterprincipalassignmentsget(test, rg): test.cmd('az kusto cluster-principal-assignment show ' @@ -239,28 +431,26 @@ def step_kustoclusterprincipalassignmentsget(test, rg): checks=[]) -# EXAMPLE: kustooperationslist -@try_manual -def step_kustooperationslist(test, rg): - # EXAMPLE NOT FOUND! - pass - - -# EXAMPLE: kustodatabasesdelete +# EXAMPLE: KustoClusterPrincipalAssignmentsCreateOrUpdate @try_manual -def step_kustodatabasesdelete(test, rg): - test.cmd('az kusto database delete ' +def step_kustoclusterprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto cluster-principal-assignment create ' '--cluster-name "{Clusters_3}" ' - '--database-name "KustoDatabase8" ' + '--principal-id "87654321-1234-1234-1234-123456789123" ' + '--principal-type "App" ' + '--role "AllDatabasesAdmin" ' + '--tenant-id "12345678-1234-1234-1234-123456789123" ' + '--principal-assignment-name "kustoprincipal1" ' '--resource-group "{rg}"', checks=[]) -# EXAMPLE: kustoclustersdelete +# EXAMPLE: KustoClusterPrincipalAssignmentsDelete @try_manual -def step_kustoclustersdelete(test, rg): - test.cmd('az kusto cluster delete ' +def step_kustoclusterprincipalassignmentsdelete(test, rg): + test.cmd('az kusto cluster-principal-assignment delete ' '--cluster-name "{Clusters_3}" ' + '--principal-assignment-name "kustoprincipal1" ' '--resource-group "{rg}"', checks=[]) @@ -274,28 +464,45 @@ def cleanup(test, rg): def call_scenario(test, rg): setup(test, rg) step_kustoclusterscreateorupdate(test, rg) - step_kustoclusterschecknameavailability(test, rg) - step_kustoclustersget(test, rg) - step_kustoclusterslist(test, rg) - step_kustoclusterslistbyresourcegroup(test, rg) - step_kustoclustersstop(test, rg) - step_kustoclustersstart(test, rg) - step_kustoclusterslistresourceskus(test, rg) - step_kustoclusterslistskus(test, rg) step_kustodatabasescreateorupdate(test, rg) - step_kustodatabasechecknameavailability(test, rg) + step_kustodataconnectionscreateorupdate(test, rg) + step_attacheddatabaseconfigurationscreateorupdate(test, rg) + step_attacheddatabaseconfigurationsget(test, rg) + step_kustodataconnectionsget(test, rg) step_kustodatabaseslistbycluster(test, rg) + step_kustoattacheddatabaseconfigurationslistbycluster(test, rg) step_kustodatabasesget(test, rg) - step_kustodatabasesupdate(test, rg) - step_kustodatabaseprincipalassignmentscreateorupdate(test, rg) + step_kustodatabaseslistbycluster(test, rg) + step_kustoclusterslistresourceskus(test, rg) + step_kustoclustersget(test, rg) + step_kustoclusterslistbyresourcegroup(test, rg) + step_kustoclusterslist(test, rg) + step_kustoclusterslistskus(test, rg) + step_kustooperationslist(test, rg) + step_kustodataconnectionsupdate(test, rg) + step_kustodataconnectionvalidation(test, rg) + step_kustodataconnectionschecknameavailability(test, rg) + step_kustodatabaseremoveprincipals(test, rg) step_kustodatabaselistprincipals(test, rg) + step_kustodatabaseaddprincipals(test, rg) + step_kustodatabasesupdate(test, rg) + step_kustoclusterdetachfollowerdatabases(test, rg) + step_kustodatabasechecknameavailability(test, rg) + step_kustoclusterlistfollowerdatabases(test, rg) + step_kustoclustersstart(test, rg) + step_kustoclustersstop(test, rg) + step_kustoclustersupdate(test, rg) + step_kustoclusterschecknameavailability(test, rg) + step_attacheddatabaseconfigurationsdelete(test, rg) + step_kustodataconnectionsdelete(test, rg) + step_kustodatabasesdelete(test, rg) + step_kustoclustersdelete(test, rg) step_kustodatabaseprincipalassignmentsget(test, rg) + step_kustodatabaseprincipalassignmentscreateorupdate(test, rg) step_kustodatabaseprincipalassignmentsdelete(test, rg) - step_kustoclusterprincipalassignmentscreateorupdate(test, rg) step_kustoclusterprincipalassignmentsget(test, rg) - step_kustooperationslist(test, rg) - step_kustodatabasesdelete(test, rg) - step_kustoclustersdelete(test, rg) + step_kustoclusterprincipalassignmentscreateorupdate(test, rg) + step_kustoclusterprincipalassignmentsdelete(test, rg) cleanup(test, rg) @@ -310,14 +517,16 @@ def test_kusto(self, rg): }) self.kwargs.update({ - 'Clusters_5': 'Clusters_5', - 'AttachedDatabaseConfigurations_3': 'AttachedDatabaseConfigurations_3', + 'Clusters_4': 'default', + 'AttachedDatabaseConfigurations_3': 'default', 'leader4': 'leader4', - 'Clusters_2': 'testcli2', - 'Clusters_3': 'clitestcluster1', - 'Clusters_4': 'Clusters_4', - 'attachedDatabaseConfigurations_1': 'attachedDatabaseConfigurations2', - 'AttachedDatabaseConfigurations_2': 'AttachedDatabaseConfigurations_2', + 'Clusters_2': 'KustoClusterLeader', + 'Clusters_3': 'kustoclusterrptest4', + 'attachedDatabaseConfigurations1': 'attachedDatabaseConfigurations1', + 'AttachedDatabaseConfigurations_2': 'myAttachedDatabaseConfiguration', + 'DataConnections8': 'DataConnections8', + 'DataConnections_2': 'kustoeventhubconnection1', }) call_scenario(self, rg) + raise_if() diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py index b4ef76736c1..1400c9fa9c1 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py @@ -7,13 +7,10 @@ # -------------------------------------------------------------------------- from ._kusto_management_client import KustoManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['KustoManagementClient'] try: - from .patch import patch_sdk + from ._patch import patch_sdk patch_sdk() except ImportError: pass diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py index 2e2c7a15d75..ee4c2c9c9ac 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py @@ -11,14 +11,13 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class KustoManagementClientConfiguration(Configuration): """Configuration for KustoManagementClient. @@ -47,9 +46,10 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-02-15" + self.api_version = "2020-06-14" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'kustomanagementclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py index ec0cbd5ae63..d801def53bd 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py @@ -15,6 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional + from azure.core.credentials import TokenCredential + from ._configuration import KustoManagementClientConfiguration from .operations import ClusterOperations from .operations import ClusterPrincipalAssignmentOperations @@ -30,24 +32,25 @@ class KustoManagementClient(object): """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. :ivar cluster: ClusterOperations operations - :vartype cluster: azure.mgmt.kusto.operations.ClusterOperations + :vartype cluster: kusto_management_client.operations.ClusterOperations :ivar cluster_principal_assignment: ClusterPrincipalAssignmentOperations operations - :vartype cluster_principal_assignment: azure.mgmt.kusto.operations.ClusterPrincipalAssignmentOperations + :vartype cluster_principal_assignment: kusto_management_client.operations.ClusterPrincipalAssignmentOperations :ivar database: DatabaseOperations operations - :vartype database: azure.mgmt.kusto.operations.DatabaseOperations + :vartype database: kusto_management_client.operations.DatabaseOperations :ivar database_principal_assignment: DatabasePrincipalAssignmentOperations operations - :vartype database_principal_assignment: azure.mgmt.kusto.operations.DatabasePrincipalAssignmentOperations + :vartype database_principal_assignment: kusto_management_client.operations.DatabasePrincipalAssignmentOperations :ivar attached_database_configuration: AttachedDatabaseConfigurationOperations operations - :vartype attached_database_configuration: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationOperations + :vartype attached_database_configuration: kusto_management_client.operations.AttachedDatabaseConfigurationOperations :ivar data_connection: DataConnectionOperations operations - :vartype data_connection: azure.mgmt.kusto.operations.DataConnectionOperations + :vartype data_connection: kusto_management_client.operations.DataConnectionOperations :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.kusto.operations.OperationOperations + :vartype operation: kusto_management_client.operations.OperationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py deleted file mode 100644 index eae7c95b6fb..00000000000 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py index e8322c1d173..e1c166820e5 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py @@ -11,12 +11,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential + from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class KustoManagementClientConfiguration(Configuration): """Configuration for KustoManagementClient. @@ -44,9 +43,10 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-02-15" + self.api_version = "2020-06-14" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'kustomanagementclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py index 15a0a57d813..cd74af7f704 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py @@ -6,11 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any, Optional, TYPE_CHECKING from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + from ._configuration_async import KustoManagementClientConfiguration from .operations_async import ClusterOperations from .operations_async import ClusterPrincipalAssignmentOperations @@ -26,24 +30,25 @@ class KustoManagementClient(object): """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. :ivar cluster: ClusterOperations operations - :vartype cluster: azure.mgmt.kusto.aio.operations_async.ClusterOperations + :vartype cluster: kusto_management_client.aio.operations_async.ClusterOperations :ivar cluster_principal_assignment: ClusterPrincipalAssignmentOperations operations - :vartype cluster_principal_assignment: azure.mgmt.kusto.aio.operations_async.ClusterPrincipalAssignmentOperations + :vartype cluster_principal_assignment: kusto_management_client.aio.operations_async.ClusterPrincipalAssignmentOperations :ivar database: DatabaseOperations operations - :vartype database: azure.mgmt.kusto.aio.operations_async.DatabaseOperations + :vartype database: kusto_management_client.aio.operations_async.DatabaseOperations :ivar database_principal_assignment: DatabasePrincipalAssignmentOperations operations - :vartype database_principal_assignment: azure.mgmt.kusto.aio.operations_async.DatabasePrincipalAssignmentOperations + :vartype database_principal_assignment: kusto_management_client.aio.operations_async.DatabasePrincipalAssignmentOperations :ivar attached_database_configuration: AttachedDatabaseConfigurationOperations operations - :vartype attached_database_configuration: azure.mgmt.kusto.aio.operations_async.AttachedDatabaseConfigurationOperations + :vartype attached_database_configuration: kusto_management_client.aio.operations_async.AttachedDatabaseConfigurationOperations :ivar data_connection: DataConnectionOperations operations - :vartype data_connection: azure.mgmt.kusto.aio.operations_async.DataConnectionOperations + :vartype data_connection: kusto_management_client.aio.operations_async.DataConnectionOperations :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.kusto.aio.operations_async.OperationOperations + :vartype operation: kusto_management_client.aio.operations_async.OperationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py index cb1fd41a1b2..f42d9b81c9c 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class AttachedDatabaseConfigurationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -48,7 +48,7 @@ def list_by_cluster( resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.AttachedDatabaseConfigurationListResult": + ) -> AsyncIterable["models.AttachedDatabaseConfigurationListResult"]: """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. @@ -56,31 +56,32 @@ def list_by_cluster( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AttachedDatabaseConfigurationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult + :return: An iterator like instance of either AttachedDatabaseConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.AttachedDatabaseConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfigurationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_cluster.metadata['url'] + url = self.list_by_cluster.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -111,7 +112,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} # type: ignore async def get( self, @@ -129,16 +130,17 @@ async def get( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AttachedDatabaseConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :return: AttachedDatabaseConfiguration, or the result of cls(response) + :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -167,10 +169,10 @@ async def get( deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore async def _create_or_update_initial( self, @@ -184,14 +186,15 @@ async def _create_or_update_initial( **kwargs ) -> "models.AttachedDatabaseConfiguration": cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.AttachedDatabaseConfiguration(location=location, database_name=database_name, cluster_resource_id=cluster_resource_id, default_principals_modification_kind=default_principals_modification_kind) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -233,10 +236,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore async def create_or_update( self, @@ -266,18 +269,22 @@ async def create_or_update( to attach reside. :type cluster_resource_id: str :param default_principals_modification_kind: The default principals modification kind. - :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :type default_principals_modification_kind: str or ~kusto_management_client.models.DefaultPrincipalsModificationKind :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns AttachedDatabaseConfiguration - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: AttachedDatabaseConfiguration, or the result of cls(response) + :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -290,6 +297,9 @@ async def create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) @@ -297,15 +307,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore async def _delete_initial( self, @@ -315,11 +321,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -345,9 +352,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore async def delete( self, @@ -368,13 +375,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -383,16 +394,15 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py index 4df01ed2005..382ed19396a 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class ClusterOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,16 +56,17 @@ async def get( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.Cluster + :return: Cluster, or the result of cls(response) + :rtype: ~kusto_management_client.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -93,10 +94,10 @@ async def get( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _create_or_update_initial( self, @@ -106,27 +107,28 @@ async def _create_or_update_initial( sku: "models.AzureSku", tags: Optional[Dict[str, str]] = None, zones: Optional[List[str]] = None, - trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + trusted_external_tenants: Optional[List["models.TrustedExternalTenant"]] = None, optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, enable_disk_encryption: Optional[bool] = None, enable_streaming_ingest: Optional[bool] = False, virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["models.KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type: Optional[Union[str, "models.IdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ) -> "models.Cluster": cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) - api_version = "2020-02-15" + _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, enable_double_encryption=enable_double_encryption, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -164,10 +166,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def create_or_update( self, @@ -177,16 +179,16 @@ async def create_or_update( sku: "models.AzureSku", tags: Optional[Dict[str, str]] = None, zones: Optional[List[str]] = None, - trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + trusted_external_tenants: Optional[List["models.TrustedExternalTenant"]] = None, optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, enable_disk_encryption: Optional[bool] = None, enable_streaming_ingest: Optional[bool] = False, virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["models.KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type: Optional[Union[str, "models.IdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ) -> "models.Cluster": """Create or update a Kusto cluster. @@ -198,15 +200,15 @@ async def create_or_update( :param location: The geo-location where the resource lives. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param tags: Resource tags. :type tags: dict[str, str] :param zones: The availability zones of the cluster. :type zones: list[str] :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -214,30 +216,35 @@ async def create_or_update( enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :param type: The identity type. - :type type: str or ~azure.mgmt.kusto.models.IdentityType + :type type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Cluster - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Cluster, or the result of cls(response) + :rtype: ~kusto_management_client.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -252,13 +259,16 @@ async def create_or_update( virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, - value=value, + enable_double_encryption=enable_double_encryption, type=type, user_assigned_identities=user_assigned_identities, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Cluster', pipeline_response) @@ -266,15 +276,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _update_initial( self, @@ -283,27 +289,28 @@ async def _update_initial( tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, sku: Optional["models.AzureSku"] = None, - trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + trusted_external_tenants: Optional[List["models.TrustedExternalTenant"]] = None, optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, enable_disk_encryption: Optional[bool] = None, enable_streaming_ingest: Optional[bool] = False, virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["models.KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type: Optional[Union[str, "models.IdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ) -> "models.Cluster": cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) - api_version = "2020-02-15" + _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, enable_double_encryption=enable_double_encryption, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -344,10 +351,10 @@ async def _update_initial( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def update( self, @@ -356,16 +363,16 @@ async def update( tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, sku: Optional["models.AzureSku"] = None, - trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + trusted_external_tenants: Optional[List["models.TrustedExternalTenant"]] = None, optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, enable_disk_encryption: Optional[bool] = None, enable_streaming_ingest: Optional[bool] = False, virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["models.KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type: Optional[Union[str, "models.IdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ) -> "models.Cluster": """Update a Kusto cluster. @@ -379,11 +386,11 @@ async def update( :param location: Resource location. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -391,30 +398,35 @@ async def update( enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :param type: The identity type. - :type type: str or ~azure.mgmt.kusto.models.IdentityType + :type type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Cluster - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Cluster, or the result of cls(response) + :rtype: ~kusto_management_client.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -428,13 +440,16 @@ async def update( virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, - value=value, + enable_double_encryption=enable_double_encryption, type=type, user_assigned_identities=user_assigned_identities, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Cluster', pipeline_response) @@ -442,15 +457,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _delete_initial( self, @@ -459,11 +470,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -488,9 +500,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def delete( self, @@ -508,13 +520,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -522,19 +538,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore async def _stop_initial( self, @@ -543,11 +558,12 @@ async def _stop_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._stop_initial.metadata['url'] + url = self._stop_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -572,9 +588,9 @@ async def _stop_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore async def stop( self, @@ -592,13 +608,17 @@ async def stop( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._stop_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -606,19 +626,18 @@ async def stop( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore async def _start_initial( self, @@ -627,11 +646,12 @@ async def _start_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._start_initial.metadata['url'] + url = self._start_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -656,9 +676,9 @@ async def _start_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore async def start( self, @@ -676,13 +696,17 @@ async def start( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._start_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -690,26 +714,25 @@ async def start( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore def list_follower_database( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.FollowerDatabaseListResult": + ) -> AsyncIterable["models.FollowerDatabaseListResult"]: """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. @@ -717,31 +740,32 @@ def list_follower_database( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: FollowerDatabaseListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.FollowerDatabaseListResult + :return: An iterator like instance of either FollowerDatabaseListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.FollowerDatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.FollowerDatabaseListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_follower_database.metadata['url'] + url = self.list_follower_database.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -772,7 +796,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} # type: ignore async def _detach_follower_database_initial( self, @@ -783,14 +807,15 @@ async def _detach_follower_database_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _follower_database_to_remove = models.FollowerDatabaseDefinition(cluster_resource_id=cluster_resource_id, attached_database_configuration_name=attached_database_configuration_name) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._detach_follower_database_initial.metadata['url'] + url = self._detach_follower_database_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -820,9 +845,9 @@ async def _detach_follower_database_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore async def detach_follower_database( self, @@ -848,13 +873,17 @@ async def detach_follower_database( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._detach_follower_database_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -864,19 +893,18 @@ async def detach_follower_database( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore async def _diagnose_virtual_network_initial( self, @@ -885,11 +913,12 @@ async def _diagnose_virtual_network_initial( **kwargs ) -> "models.DiagnoseVirtualNetworkResult": cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._diagnose_virtual_network_initial.metadata['url'] + url = self._diagnose_virtual_network_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -919,10 +948,10 @@ async def _diagnose_virtual_network_initial( deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore async def diagnose_virtual_network( self, @@ -940,13 +969,17 @@ async def diagnose_virtual_network( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns DiagnoseVirtualNetworkResult - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: DiagnoseVirtualNetworkResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DiagnoseVirtualNetworkResult :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._diagnose_virtual_network_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -954,6 +987,9 @@ async def diagnose_virtual_network( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) @@ -961,50 +997,47 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ClusterListResult": + ) -> AsyncIterable["models.ClusterListResult"]: """Lists all Kusto clusters within a resource group. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1035,38 +1068,39 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} # type: ignore def list( self, **kwargs - ) -> "models.ClusterListResult": + ) -> AsyncIterable["models.ClusterListResult"]: """Lists all Kusto clusters within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1097,38 +1131,39 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} # type: ignore def list_sku( self, **kwargs - ) -> "models.SkuDescriptionList": + ) -> AsyncIterable["models.SkuDescriptionList"]: """Lists eligible SKUs for Kusto resource provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: SkuDescriptionList or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.SkuDescriptionList + :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.SkuDescriptionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SkuDescriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_sku.metadata['url'] + url = self.list_sku.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1159,7 +1194,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} # type: ignore async def check_name_availability( self, @@ -1175,21 +1210,22 @@ async def check_name_availability( :param name: Cluster name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _cluster_name = models.ClusterCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str'), @@ -1221,17 +1257,17 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} # type: ignore def list_sku_by_resource( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.ListResourceSkusResult": + ) -> AsyncIterable["models.ListResourceSkusResult"]: """Returns the SKUs available for the provided resource. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1239,31 +1275,32 @@ def list_sku_by_resource( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListResourceSkusResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ListResourceSkusResult + :return: An iterator like instance of either ListResourceSkusResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ListResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListResourceSkusResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_sku_by_resource.metadata['url'] + url = self.list_sku_by_resource.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1294,14 +1331,14 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} + list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} # type: ignore def list_language_extension( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.LanguageExtensionsList": + ) -> AsyncIterable["models.LanguageExtensionsList"]: """Returns a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1309,31 +1346,32 @@ def list_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: LanguageExtensionsList or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.LanguageExtensionsList + :return: An iterator like instance of either LanguageExtensionsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.LanguageExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LanguageExtensionsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_language_extension.metadata['url'] + url = self.list_language_extension.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1364,24 +1402,25 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} + list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} # type: ignore async def _add_language_extension_initial( self, resource_group_name: str, cluster_name: str, - value: Optional[List["LanguageExtension"]] = None, + value: Optional[List["models.LanguageExtension"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _language_extensions_to_add = models.LanguageExtensionsList(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._add_language_extension_initial.metadata['url'] + url = self._add_language_extension_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1411,15 +1450,15 @@ async def _add_language_extension_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore async def add_language_extension( self, resource_group_name: str, cluster_name: str, - value: Optional[List["LanguageExtension"]] = None, + value: Optional[List["models.LanguageExtension"]] = None, **kwargs ) -> None: """Add a list of language extensions that can run within KQL queries. @@ -1429,18 +1468,22 @@ async def add_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._add_language_extension_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -1449,36 +1492,36 @@ async def add_language_extension( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore async def _remove_language_extension_initial( self, resource_group_name: str, cluster_name: str, - value: Optional[List["LanguageExtension"]] = None, + value: Optional[List["models.LanguageExtension"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _language_extensions_to_remove = models.LanguageExtensionsList(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._remove_language_extension_initial.metadata['url'] + url = self._remove_language_extension_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1508,15 +1551,15 @@ async def _remove_language_extension_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore async def remove_language_extension( self, resource_group_name: str, cluster_name: str, - value: Optional[List["LanguageExtension"]] = None, + value: Optional[List["models.LanguageExtension"]] = None, **kwargs ) -> None: """Remove a list of language extensions that can run within KQL queries. @@ -1526,18 +1569,22 @@ async def remove_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._remove_language_extension_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -1546,16 +1593,15 @@ async def remove_language_extension( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py index 7a71deffb4f..9c35c6bb8c0 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class ClusterPrincipalAssignmentOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,21 +60,22 @@ async def check_name_availability( :param name: Principal Assignment resource name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/principalAssignments. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _principal_assignment_name = models.ClusterPrincipalAssignmentCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -107,10 +108,10 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} # type: ignore async def get( self, @@ -128,16 +129,17 @@ async def get( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterPrincipalAssignment or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment + :return: ClusterPrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -166,10 +168,10 @@ async def get( deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _create_or_update_initial( self, @@ -183,14 +185,15 @@ async def _create_or_update_initial( **kwargs ) -> "models.ClusterPrincipalAssignment": cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ClusterPrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -229,10 +232,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def create_or_update( self, @@ -257,22 +260,26 @@ async def create_or_update( email, application ID, or security group name. :type principal_id: str :param role: Cluster principal role. - :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :type role: str or ~kusto_management_client.models.ClusterPrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns ClusterPrincipalAssignment - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ClusterPrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -285,6 +292,9 @@ async def create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) @@ -292,15 +302,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _delete_initial( self, @@ -310,11 +316,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -340,9 +347,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def delete( self, @@ -363,13 +370,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -378,26 +389,25 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.ClusterPrincipalAssignmentListResult": + ) -> AsyncIterable["models.ClusterPrincipalAssignmentListResult"]: """Lists all Kusto cluster principalAssignments. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -405,31 +415,32 @@ def list( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterPrincipalAssignmentListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult + :return: An iterator like instance of either ClusterPrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterPrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignmentListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -460,4 +471,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py index 6b9ddbd68f6..b4a7b8ff101 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class DataConnectionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,7 +49,7 @@ def list_by_database( cluster_name: str, database_name: str, **kwargs - ) -> "models.DataConnectionListResult": + ) -> AsyncIterable["models.DataConnectionListResult"]: """Returns the list of data connections of the given Kusto database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -59,18 +59,19 @@ def list_by_database( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnectionListResult + :return: An iterator like instance of either DataConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DataConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_database.metadata['url'] + url = self.list_by_database.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -78,13 +79,13 @@ def prepare_request(next_link=None): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -115,9 +116,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} # type: ignore - async def data_connection_validation( + async def _data_connection_validation_initial( self, resource_group_name: str, cluster_name: str, @@ -126,32 +127,16 @@ async def data_connection_validation( properties: Optional["models.DataConnection"] = None, **kwargs ) -> "models.DataConnectionValidationListResult": - """Checks that the data connection parameters are valid. - - :param resource_group_name: The name of the resource group containing the Kusto cluster. - :type resource_group_name: str - :param cluster_name: The name of the Kusto cluster. - :type cluster_name: str - :param database_name: The name of the database in the Kusto cluster. - :type database_name: str - :param data_connection_name: The name of the data connection. - :type data_connection_name: str - :param properties: The data connection properties to validate. - :type properties: ~azure.mgmt.kusto.models.DataConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnectionValidationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnectionValidationListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.DataConnectionValidation(data_connection_name=data_connection_name, properties=properties) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.data_connection_validation.metadata['url'] + url = self._data_connection_validation_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -178,17 +163,81 @@ async def data_connection_validation( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} + _data_connection_validation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + + async def data_connection_validation( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: Optional[str] = None, + properties: Optional["models.DataConnection"] = None, + **kwargs + ) -> "models.DataConnectionValidationListResult": + """Checks that the data connection parameters are valid. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~kusto_management_client.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: DataConnectionValidationListResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DataConnectionValidationListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + raw_result = await self._data_connection_validation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore async def check_name_availability( self, @@ -210,21 +259,22 @@ async def check_name_availability( :param name: Data Connection name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _data_connection_name = models.DataConnectionCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -258,10 +308,10 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} # type: ignore async def get( self, @@ -282,16 +332,17 @@ async def get( :param data_connection_name: The name of the data connection. :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnection or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnection + :return: DataConnection, or the result of cls(response) + :rtype: ~kusto_management_client.models.DataConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -321,10 +372,10 @@ async def get( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def _create_or_update_initial( self, @@ -336,12 +387,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.DataConnection": cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -384,10 +436,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def create_or_update( self, @@ -409,18 +461,22 @@ async def create_or_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.kusto.models.DataConnection + :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns DataConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: DataConnection, or the result of cls(response) + :rtype: ~kusto_management_client.models.DataConnection :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -431,6 +487,9 @@ async def create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DataConnection', pipeline_response) @@ -438,15 +497,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def _update_initial( self, @@ -458,12 +513,13 @@ async def _update_initial( **kwargs ) -> "models.DataConnection": cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -506,10 +562,10 @@ async def _update_initial( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def update( self, @@ -531,18 +587,22 @@ async def update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.kusto.models.DataConnection + :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns DataConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: DataConnection, or the result of cls(response) + :rtype: ~kusto_management_client.models.DataConnection :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -553,6 +613,9 @@ async def update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DataConnection', pipeline_response) @@ -560,15 +623,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def _delete_initial( self, @@ -579,11 +638,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -610,9 +670,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore async def delete( self, @@ -636,13 +696,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -652,16 +716,15 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py index 95d28aefc80..340064db262 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class DatabaseOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,21 +60,22 @@ async def check_name_availability( :param name: Resource name. :type name: str :param type: The type of resource, for instance Microsoft.Kusto/clusters/databases. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _resource_name = models.CheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -107,17 +108,17 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} # type: ignore def list_by_cluster( self, resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.DatabaseListResult": + ) -> AsyncIterable["models.DatabaseListResult"]: """Returns the list of databases of the given Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -125,31 +126,32 @@ def list_by_cluster( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabaseListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabaseListResult + :return: An iterator like instance of either DatabaseListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabaseListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_cluster.metadata['url'] + url = self.list_by_cluster.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -180,7 +182,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} # type: ignore async def get( self, @@ -198,16 +200,17 @@ async def get( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Database or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.Database + :return: Database, or the result of cls(response) + :rtype: ~kusto_management_client.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -236,10 +239,10 @@ async def get( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def _create_or_update_initial( self, @@ -250,12 +253,13 @@ async def _create_or_update_initial( **kwargs ) -> "models.Database": cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -297,10 +301,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def create_or_update( self, @@ -319,18 +323,22 @@ async def create_or_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.kusto.models.Database + :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Database - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Database, or the result of cls(response) + :rtype: ~kusto_management_client.models.Database :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -340,6 +348,9 @@ async def create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Database', pipeline_response) @@ -347,15 +358,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def _update_initial( self, @@ -366,12 +373,13 @@ async def _update_initial( **kwargs ) -> "models.Database": cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -413,10 +421,10 @@ async def _update_initial( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def update( self, @@ -435,18 +443,22 @@ async def update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.kusto.models.Database + :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Database - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Database, or the result of cls(response) + :rtype: ~kusto_management_client.models.Database :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -456,6 +468,9 @@ async def update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Database', pipeline_response) @@ -463,15 +478,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def _delete_initial( self, @@ -481,11 +492,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -511,9 +523,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore async def delete( self, @@ -534,13 +546,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -549,19 +565,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def list_principal( self, @@ -569,7 +584,7 @@ def list_principal( cluster_name: str, database_name: str, **kwargs - ) -> "models.DatabasePrincipalListResult": + ) -> AsyncIterable["models.DatabasePrincipalListResult"]: """Returns a list of database principals of the given Kusto cluster and database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -579,18 +594,19 @@ def list_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: An iterator like instance of either DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabasePrincipalListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_principal.metadata['url'] + url = self.list_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -598,13 +614,13 @@ def prepare_request(next_link=None): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -635,14 +651,14 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} + list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} # type: ignore async def add_principal( self, resource_group_name: str, cluster_name: str, database_name: str, - value: Optional[List["DatabasePrincipal"]] = None, + value: Optional[List["models.DatabasePrincipal"]] = None, **kwargs ) -> "models.DatabasePrincipalListResult": """Add Database principals permissions. @@ -654,21 +670,22 @@ async def add_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: DatabasePrincipalListResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _database_principals_to_add = models.DatabasePrincipalListRequest(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.add_principal.metadata['url'] + url = self.add_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -702,17 +719,17 @@ async def add_principal( deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} + add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} # type: ignore async def remove_principal( self, resource_group_name: str, cluster_name: str, database_name: str, - value: Optional[List["DatabasePrincipal"]] = None, + value: Optional[List["models.DatabasePrincipal"]] = None, **kwargs ) -> "models.DatabasePrincipalListResult": """Remove Database principals permissions. @@ -724,21 +741,22 @@ async def remove_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: DatabasePrincipalListResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _database_principals_to_remove = models.DatabasePrincipalListRequest(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.remove_principal.metadata['url'] + url = self.remove_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -772,7 +790,7 @@ async def remove_principal( deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} + remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py index bf6348e6a3d..4a483658e04 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,7 +28,7 @@ class DatabasePrincipalAssignmentOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,21 +63,22 @@ async def check_name_availability( :param name: Principal Assignment resource name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _principal_assignment_name = models.DatabasePrincipalAssignmentCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -111,10 +112,10 @@ async def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} # type: ignore async def get( self, @@ -135,16 +136,17 @@ async def get( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalAssignment or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment + :return: DatabasePrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -174,10 +176,10 @@ async def get( deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _create_or_update_initial( self, @@ -192,14 +194,15 @@ async def _create_or_update_initial( **kwargs ) -> "models.DatabasePrincipalAssignment": cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.DatabasePrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -239,10 +242,10 @@ async def _create_or_update_initial( deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def create_or_update( self, @@ -270,22 +273,26 @@ async def create_or_update( email, application ID, or security group name. :type principal_id: str :param role: Database principal role. - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns DatabasePrincipalAssignment - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: DatabasePrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -299,6 +306,9 @@ async def create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) @@ -306,15 +316,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def _delete_initial( self, @@ -325,11 +331,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -356,9 +363,9 @@ async def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore async def delete( self, @@ -382,13 +389,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -398,19 +409,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, @@ -418,7 +428,7 @@ def list( cluster_name: str, database_name: str, **kwargs - ) -> "models.DatabasePrincipalAssignmentListResult": + ) -> AsyncIterable["models.DatabasePrincipalAssignmentListResult"]: """Lists all Kusto cluster database principalAssignments. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -428,18 +438,19 @@ def list( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalAssignmentListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult + :return: An iterator like instance of either DatabasePrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabasePrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignmentListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -447,13 +458,13 @@ def prepare_request(next_link=None): 'databaseName': self._serialize.url("database_name", database_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -484,4 +495,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py index bc31ebca19b..d8d07749184 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class OperationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,29 +44,30 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> "models.OperationListResult": + ) -> AsyncIterable["models.OperationListResult"]: """Lists available operations for the Microsoft.Kusto provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.OperationListResult + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -97,4 +98,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} + list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py index f8bfbe3e4df..3ab71bc3631 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py @@ -123,6 +123,7 @@ AzureScaleType, AzureSkuName, AzureSkuTier, + BlobStorageEventType, ClusterPrincipalRole, Compression, DatabasePrincipalRole, @@ -201,6 +202,7 @@ 'AzureScaleType', 'AzureSkuName', 'AzureSkuTier', + 'BlobStorageEventType', 'ClusterPrincipalRole', 'Compression', 'DatabasePrincipalRole', diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py index 0d69900464b..c3c671d73ac 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py @@ -21,7 +21,7 @@ class AzureSkuName(str, Enum): """ standard_ds13_v2_1_tb_ps = "Standard_DS13_v2+1TB_PS" - standard_ds13_v2_tb_ps = "Standard_DS13_v2+2TB_PS" + standard_ds13_v2_2_tb_ps = "Standard_DS13_v2+2TB_PS" standard_ds14_v2_3_tb_ps = "Standard_DS14_v2+3TB_PS" standard_ds14_v2_4_tb_ps = "Standard_DS14_v2+4TB_PS" standard_d13_v2 = "Standard_D13_v2" @@ -39,7 +39,7 @@ class AzureSkuName(str, Enum): standard_e8_as_v4_1_tb_ps = "Standard_E8as_v4+1TB_PS" standard_e8_as_v4_2_tb_ps = "Standard_E8as_v4+2TB_PS" standard_e16_as_v4_3_tb_ps = "Standard_E16as_v4+3TB_PS" - standard_e16_as_v4_tb_ps = "Standard_E16as_v4+4TB_PS" + standard_e16_as_v4_4_tb_ps = "Standard_E16as_v4+4TB_PS" dev_no_sla_standard_e2_a_v4 = "Dev(No SLA)_Standard_E2a_v4" class AzureSkuTier(str, Enum): @@ -49,6 +49,13 @@ class AzureSkuTier(str, Enum): basic = "Basic" standard = "Standard" +class BlobStorageEventType(str, Enum): + """The name of blob storage event type to process. + """ + + microsoft_storage_blob_created = "Microsoft.Storage.BlobCreated" + microsoft_storage_blob_renamed = "Microsoft.Storage.BlobRenamed" + class ClusterPrincipalRole(str, Enum): """Cluster principal role. """ @@ -108,6 +115,8 @@ class EventGridDataFormat(str, Enum): tsve = "TSVE" parquet = "PARQUET" orc = "ORC" + apacheavro = "APACHEAVRO" + w3_clogfile = "W3CLOGFILE" class EventHubDataFormat(str, Enum): """The data format of the message. Optionally the data format can be added to each message. @@ -127,6 +136,8 @@ class EventHubDataFormat(str, Enum): tsve = "TSVE" parquet = "PARQUET" orc = "ORC" + apacheavro = "APACHEAVRO" + w3_clogfile = "W3CLOGFILE" class IdentityType(str, Enum): """The identity type. @@ -153,6 +164,8 @@ class IotHubDataFormat(str, Enum): tsve = "TSVE" parquet = "PARQUET" orc = "ORC" + apacheavro = "APACHEAVRO" + w3_clogfile = "W3CLOGFILE" class Kind(str, Enum): """Kind of the database diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py index c38a705e717..c3b64c97b95 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py @@ -46,41 +46,7 @@ def __init__( self.type = 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) - - -class AttachedDatabaseConfiguration(ProxyResource): +class AttachedDatabaseConfiguration(Resource): """Class representing an attached database configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -97,7 +63,7 @@ class AttachedDatabaseConfiguration(ProxyResource): :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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :param database_name: 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 @@ -110,7 +76,7 @@ class AttachedDatabaseConfiguration(ProxyResource): :param default_principals_modification_kind: The default principals modification kind. Possible values include: "Union", "Replace", "None". :type default_principals_modification_kind: str or - ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + ~kusto_management_client.models.DefaultPrincipalsModificationKind """ _validation = { @@ -150,7 +116,7 @@ class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): """The list attached database configurations operation response. :param value: The list of attached database configurations. - :type value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + :type value: list[~kusto_management_client.models.AttachedDatabaseConfiguration] """ _attribute_map = { @@ -172,7 +138,7 @@ class AzureCapacity(msrest.serialization.Model): :param scale_type: Required. Scale type. Possible values include: "automatic", "manual", "none". - :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :type scale_type: str or ~kusto_management_client.models.AzureScaleType :param minimum: Required. Minimum allowed capacity. :type minimum: int :param maximum: Required. Maximum allowed capacity. @@ -212,9 +178,9 @@ class AzureResourceSku(msrest.serialization.Model): :param resource_type: Resource Namespace and Type. :type resource_type: str :param sku: The SKU details. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param capacity: The number of instances of the cluster. - :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + :type capacity: ~kusto_management_client.models.AzureCapacity """ _attribute_map = { @@ -245,11 +211,11 @@ class AzureSku(msrest.serialization.Model): "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No SLA)_Standard_E2a_v4". - :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :type name: str or ~kusto_management_client.models.AzureSkuName :param capacity: The number of instances of the cluster. :type capacity: int :param tier: Required. SKU tier. Possible values include: "Basic", "Standard". - :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + :type tier: str or ~kusto_management_client.models.AzureSkuTier """ _validation = { @@ -286,7 +252,7 @@ class CheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -320,7 +286,7 @@ class CheckNameResult(msrest.serialization.Model): :type message: str :param reason: Message providing the reason why the given name is invalid. Possible values include: "Invalid", "AlreadyExists". - :type reason: str or ~azure.mgmt.kusto.models.Reason + :type reason: str or ~kusto_management_client.models.Reason """ _attribute_map = { @@ -354,7 +320,7 @@ class CloudErrorBody(msrest.serialization.Model): error. :type target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.kusto.models.CloudErrorBody] + :type details: list[~kusto_management_client.models.CloudErrorBody] """ _attribute_map = { @@ -440,15 +406,15 @@ class Cluster(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param sku: Required. The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param zones: The availability zones of the cluster. :type zones: list[str] :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~azure.mgmt.kusto.models.State + :vartype state: str or ~kusto_management_client.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -456,9 +422,9 @@ class Cluster(TrackedResource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -466,25 +432,29 @@ class Cluster(TrackedResource): enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: + ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar language_extensions: List of the cluster's language extensions. + :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :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_identity_type: The identity type. Possible values include: "None", "SystemAssigned". - :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :type type_identity_type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -498,6 +468,7 @@ class Cluster(TrackedResource): 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, 'state_reason': {'readonly': True}, + 'language_extensions': {'readonly': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -522,7 +493,8 @@ class Cluster(TrackedResource): 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, - 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'language_extensions': {'key': 'properties.languageExtensions', 'type': 'LanguageExtensionsList'}, + 'enable_double_encryption': {'key': 'properties.enableDoubleEncryption', 'type': 'bool'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, @@ -548,7 +520,8 @@ def __init__( self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.key_vault_properties = kwargs.get('key_vault_properties', None) self.enable_purge = kwargs.get('enable_purge', False) - self.value = kwargs.get('value', None) + self.language_extensions = None + self.enable_double_encryption = kwargs.get('enable_double_encryption', False) self.principal_id = None self.tenant_id = None self.type_identity_type = kwargs.get('type_identity_type', None) @@ -568,7 +541,7 @@ class ClusterCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -594,7 +567,7 @@ class ClusterListResult(msrest.serialization.Model): """The list Kusto clusters operation response. :param value: The list of Kusto clusters. - :type value: list[~azure.mgmt.kusto.models.Cluster] + :type value: list[~kusto_management_client.models.Cluster] """ _attribute_map = { @@ -609,7 +582,7 @@ def __init__( self.value = kwargs.get('value', None) -class ClusterPrincipalAssignment(ProxyResource): +class ClusterPrincipalAssignment(Resource): """Class representing a cluster principal assignment. Variables are only populated by the server, and will be ignored when sending a request. @@ -627,18 +600,18 @@ class ClusterPrincipalAssignment(ProxyResource): :type principal_id: str :param role: Cluster principal role. Possible values include: "AllDatabasesAdmin", "AllDatabasesViewer". - :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :type role: str or ~kusto_management_client.models.ClusterPrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. Possible values include: "App", "Group", "User". - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: 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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState """ _validation = { @@ -690,7 +663,7 @@ class ClusterPrincipalAssignmentCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -716,7 +689,7 @@ class ClusterPrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto cluster principal assignments operation response. :param value: The list of Kusto cluster principal assignments. - :type value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + :type value: list[~kusto_management_client.models.ClusterPrincipalAssignment] """ _attribute_map = { @@ -749,13 +722,13 @@ class ClusterUpdate(Resource): :param location: Resource location. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~azure.mgmt.kusto.models.State + :vartype state: str or ~kusto_management_client.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -763,9 +736,9 @@ class ClusterUpdate(Resource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -773,25 +746,29 @@ class ClusterUpdate(Resource): enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: + ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar language_extensions: List of the cluster's language extensions. + :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :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_identity_type: The identity type. Possible values include: "None", "SystemAssigned". - :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :type type_identity_type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -803,6 +780,7 @@ class ClusterUpdate(Resource): 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, 'state_reason': {'readonly': True}, + 'language_extensions': {'readonly': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -826,7 +804,8 @@ class ClusterUpdate(Resource): 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, - 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'language_extensions': {'key': 'properties.languageExtensions', 'type': 'LanguageExtensionsList'}, + 'enable_double_encryption': {'key': 'properties.enableDoubleEncryption', 'type': 'bool'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, @@ -853,7 +832,8 @@ def __init__( self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.key_vault_properties = kwargs.get('key_vault_properties', None) self.enable_purge = kwargs.get('enable_purge', False) - self.value = kwargs.get('value', None) + self.language_extensions = None + self.enable_double_encryption = kwargs.get('enable_double_encryption', False) self.principal_id = None self.tenant_id = None self.type_identity_type = kwargs.get('type_identity_type', None) @@ -890,7 +870,7 @@ def __init__( self.client_id = None -class Database(ProxyResource): +class Database(Resource): """Class representing a Kusto database. You probably want to use the sub-classes and not this class directly. Known @@ -912,7 +892,7 @@ class Database(ProxyResource): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind """ _validation = { @@ -947,7 +927,7 @@ class DatabaseListResult(msrest.serialization.Model): """The list Kusto databases operation response. :param value: The list of Kusto databases. - :type value: list[~azure.mgmt.kusto.models.Database] + :type value: list[~kusto_management_client.models.Database] """ _attribute_map = { @@ -971,12 +951,12 @@ class DatabasePrincipal(msrest.serialization.Model): :param role: Required. Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewers", "Viewer". - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param name: Required. Database principal name. :type name: str :param type: Required. Database principal type. Possible values include: "App", "Group", "User". - :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :type type: str or ~kusto_management_client.models.DatabasePrincipalType :param fqn: Database principal fully qualified name. :type fqn: str :param email: Database principal email if exists. @@ -1018,7 +998,7 @@ def __init__( self.tenant_name = None -class DatabasePrincipalAssignment(ProxyResource): +class DatabasePrincipalAssignment(Resource): """Class representing a database principal assignment. Variables are only populated by the server, and will be ignored when sending a request. @@ -1036,18 +1016,18 @@ class DatabasePrincipalAssignment(ProxyResource): :type principal_id: str :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewers", "Viewer". - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. Possible values include: "App", "Group", "User". - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: 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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState """ _validation = { @@ -1100,7 +1080,7 @@ class DatabasePrincipalAssignmentCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -1126,7 +1106,7 @@ class DatabasePrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto database principal assignments operation response. :param value: The list of Kusto database principal assignments. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + :type value: list[~kusto_management_client.models.DatabasePrincipalAssignment] """ _attribute_map = { @@ -1145,7 +1125,7 @@ class DatabasePrincipalListRequest(msrest.serialization.Model): """The list Kusto database principals operation request. :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] """ _attribute_map = { @@ -1164,7 +1144,7 @@ class DatabasePrincipalListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] """ _attribute_map = { @@ -1198,7 +1178,7 @@ def __init__( self.size = kwargs.get('size', None) -class DataConnection(ProxyResource): +class DataConnection(Resource): """Class representing an data connection. You probably want to use the sub-classes and not this class directly. Known @@ -1220,7 +1200,7 @@ class DataConnection(ProxyResource): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind """ _validation = { @@ -1265,7 +1245,7 @@ class DataConnectionCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -1291,7 +1271,7 @@ class DataConnectionListResult(msrest.serialization.Model): """The list Kusto data connections operation response. :param value: The list of Kusto data connections. - :type value: list[~azure.mgmt.kusto.models.DataConnection] + :type value: list[~kusto_management_client.models.DataConnection] """ _attribute_map = { @@ -1312,7 +1292,7 @@ class DataConnectionValidation(msrest.serialization.Model): :param data_connection_name: The name of the data connection. :type data_connection_name: str :param properties: The data connection properties to validate. - :type properties: ~azure.mgmt.kusto.models.DataConnection + :type properties: ~kusto_management_client.models.DataConnection """ _attribute_map = { @@ -1333,7 +1313,7 @@ class DataConnectionValidationListResult(msrest.serialization.Model): """The list Kusto data connection validation result. :param value: The list of Kusto data connection validation errors. - :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + :type value: list[~kusto_management_client.models.DataConnectionValidationResult] """ _attribute_map = { @@ -1405,7 +1385,7 @@ class EventGridDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param storage_account_resource_id: The resource ID of the storage account where the data resides. :type storage_account_resource_id: str @@ -1422,8 +1402,15 @@ class EventGridDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.EventGridDataFormat + :param ignore_first_record: A Boolean value that, if set to true, indicates that ingestion + should ignore the first record of every file. + :type ignore_first_record: bool + :param blob_storage_event_type: The name of blob storage event type to process. Possible values + include: "Microsoft.Storage.BlobCreated", "Microsoft.Storage.BlobRenamed". + :type blob_storage_event_type: str or ~kusto_management_client.models.BlobStorageEventType """ _validation = { @@ -1445,6 +1432,8 @@ class EventGridDataConnection(DataConnection): 'table_name': {'key': 'properties.tableName', 'type': 'str'}, 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'ignore_first_record': {'key': 'properties.ignoreFirstRecord', 'type': 'bool'}, + 'blob_storage_event_type': {'key': 'properties.blobStorageEventType', 'type': 'str'}, } def __init__( @@ -1459,6 +1448,8 @@ def __init__( self.table_name = kwargs.get('table_name', None) self.mapping_rule_name = kwargs.get('mapping_rule_name', None) self.data_format = kwargs.get('data_format', None) + self.ignore_first_record = kwargs.get('ignore_first_record', None) + self.blob_storage_event_type = kwargs.get('blob_storage_event_type', None) class EventHubDataConnection(DataConnection): @@ -1480,7 +1471,7 @@ class EventHubDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param event_hub_resource_id: The resource ID of the event hub to be used to create a data connection. :type event_hub_resource_id: str @@ -1494,13 +1485,14 @@ class EventHubDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.EventHubDataFormat :param event_system_properties: System properties of the event hub. :type event_system_properties: list[str] :param compression: The event hub messages compression type. Possible values include: "None", "GZip". - :type compression: str or ~azure.mgmt.kusto.models.Compression + :type compression: str or ~kusto_management_client.models.Compression """ _validation = { @@ -1584,7 +1576,7 @@ class FollowerDatabaseListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :param value: The list of follower database result. - :type value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] + :type value: list[~kusto_management_client.models.FollowerDatabaseDefinition] """ _attribute_map = { @@ -1618,7 +1610,7 @@ class IotHubDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param iot_hub_resource_id: The resource ID of the Iot hub to be used to create a data connection. :type iot_hub_resource_id: str @@ -1632,8 +1624,9 @@ class IotHubDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.IotHubDataFormat :param event_system_properties: System properties of the iot hub. :type event_system_properties: list[str] :param shared_access_policy_name: The name of the share access policy. @@ -1717,7 +1710,7 @@ class LanguageExtension(msrest.serialization.Model): :param language_extension_name: The language extension name. Possible values include: "PYTHON", "R". - :type language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName + :type language_extension_name: str or ~kusto_management_client.models.LanguageExtensionName """ _attribute_map = { @@ -1736,7 +1729,7 @@ class LanguageExtensionsList(msrest.serialization.Model): """The list of language extension objects. :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] """ _attribute_map = { @@ -1755,7 +1748,7 @@ class ListResourceSkusResult(msrest.serialization.Model): """List of available SKUs for a Kusto Cluster. :param value: The collection of available SKUs for an existing resource. - :type value: list[~azure.mgmt.kusto.models.AzureResourceSku] + :type value: list[~kusto_management_client.models.AzureResourceSku] """ _attribute_map = { @@ -1776,7 +1769,7 @@ class Operation(msrest.serialization.Model): :param name: This is of the format {provider}/{resource}/{operation}. :type name: str :param display: The object that describes the operation. - :type display: ~azure.mgmt.kusto.models.OperationDisplay + :type display: ~kusto_management_client.models.OperationDisplay :param origin: The intended executor of the operation. :type origin: str :param properties: Any object. @@ -1836,7 +1829,7 @@ class OperationListResult(msrest.serialization.Model): """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. :param value: The list of operations supported by the resource provider. - :type value: list[~azure.mgmt.kusto.models.Operation] + :type value: list[~kusto_management_client.models.Operation] :param next_link: The URL to get the next set of operation list results if there are any. :type next_link: str """ @@ -1896,6 +1889,40 @@ def __init__( self.maximum = kwargs['maximum'] +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) + + class ReadOnlyFollowingDatabase(Database): """Class representing a read only following database. @@ -1915,10 +1942,10 @@ class ReadOnlyFollowingDatabase(Database): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :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 + :vartype provisioning_state: str or ~kusto_management_client.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: ~datetime.timedelta @@ -1926,7 +1953,7 @@ class ReadOnlyFollowingDatabase(Database): TimeSpan. :type hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :vartype statistics: ~kusto_management_client.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 @@ -1935,7 +1962,7 @@ class ReadOnlyFollowingDatabase(Database): :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 + ~kusto_management_client.models.PrincipalsModificationKind """ _validation = { @@ -2000,10 +2027,10 @@ class ReadWriteDatabase(Database): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :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 + :vartype provisioning_state: str or ~kusto_management_client.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: ~datetime.timedelta @@ -2011,9 +2038,9 @@ class ReadWriteDatabase(Database): TimeSpan. :type hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :vartype statistics: ~kusto_management_client.models.DatabaseStatistics :ivar is_followed: Indicates whether the database is followed. - :vartype is_followed: str + :vartype is_followed: bool """ _validation = { @@ -2036,7 +2063,7 @@ class ReadWriteDatabase(Database): 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'bool'}, } def __init__( @@ -2066,7 +2093,7 @@ class SkuDescription(msrest.serialization.Model): :ivar locations: The set of locations that the SKU is available. :vartype locations: list[str] :ivar location_info: Locations and zones. - :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :vartype location_info: list[~kusto_management_client.models.SkuLocationInfoItem] :ivar restrictions: The restrictions because of which SKU cannot be used. :vartype restrictions: list[object] """ @@ -2108,7 +2135,7 @@ class SkuDescriptionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: SKU descriptions. - :vartype value: list[~azure.mgmt.kusto.models.SkuDescription] + :vartype value: list[~kusto_management_client.models.SkuDescription] """ _validation = { diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py index c0114c710a3..8088db1deaa 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py @@ -11,6 +11,8 @@ import msrest.serialization +from ._kusto_management_client_enums import * + class Resource(msrest.serialization.Model): """Resource. @@ -49,41 +51,7 @@ def __init__( self.type = 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) - - -class AttachedDatabaseConfiguration(ProxyResource): +class AttachedDatabaseConfiguration(Resource): """Class representing an attached database configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -100,7 +68,7 @@ class AttachedDatabaseConfiguration(ProxyResource): :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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :param database_name: 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 @@ -113,7 +81,7 @@ class AttachedDatabaseConfiguration(ProxyResource): :param default_principals_modification_kind: The default principals modification kind. Possible values include: "Union", "Replace", "None". :type default_principals_modification_kind: str or - ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + ~kusto_management_client.models.DefaultPrincipalsModificationKind """ _validation = { @@ -158,7 +126,7 @@ class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): """The list attached database configurations operation response. :param value: The list of attached database configurations. - :type value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + :type value: list[~kusto_management_client.models.AttachedDatabaseConfiguration] """ _attribute_map = { @@ -182,7 +150,7 @@ class AzureCapacity(msrest.serialization.Model): :param scale_type: Required. Scale type. Possible values include: "automatic", "manual", "none". - :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :type scale_type: str or ~kusto_management_client.models.AzureScaleType :param minimum: Required. Minimum allowed capacity. :type minimum: int :param maximum: Required. Maximum allowed capacity. @@ -227,9 +195,9 @@ class AzureResourceSku(msrest.serialization.Model): :param resource_type: Resource Namespace and Type. :type resource_type: str :param sku: The SKU details. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param capacity: The number of instances of the cluster. - :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + :type capacity: ~kusto_management_client.models.AzureCapacity """ _attribute_map = { @@ -264,11 +232,11 @@ class AzureSku(msrest.serialization.Model): "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No SLA)_Standard_E2a_v4". - :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :type name: str or ~kusto_management_client.models.AzureSkuName :param capacity: The number of instances of the cluster. :type capacity: int :param tier: Required. SKU tier. Possible values include: "Basic", "Standard". - :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + :type tier: str or ~kusto_management_client.models.AzureSkuTier """ _validation = { @@ -309,7 +277,7 @@ class CheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -346,7 +314,7 @@ class CheckNameResult(msrest.serialization.Model): :type message: str :param reason: Message providing the reason why the given name is invalid. Possible values include: "Invalid", "AlreadyExists". - :type reason: str or ~azure.mgmt.kusto.models.Reason + :type reason: str or ~kusto_management_client.models.Reason """ _attribute_map = { @@ -385,7 +353,7 @@ class CloudErrorBody(msrest.serialization.Model): error. :type target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.kusto.models.CloudErrorBody] + :type details: list[~kusto_management_client.models.CloudErrorBody] """ _attribute_map = { @@ -479,15 +447,15 @@ class Cluster(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param sku: Required. The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param zones: The availability zones of the cluster. :type zones: list[str] :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~azure.mgmt.kusto.models.State + :vartype state: str or ~kusto_management_client.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -495,9 +463,9 @@ class Cluster(TrackedResource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -505,25 +473,29 @@ class Cluster(TrackedResource): enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: + ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar language_extensions: List of the cluster's language extensions. + :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :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_identity_type: The identity type. Possible values include: "None", "SystemAssigned". - :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :type type_identity_type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -537,6 +509,7 @@ class Cluster(TrackedResource): 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, 'state_reason': {'readonly': True}, + 'language_extensions': {'readonly': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -561,7 +534,8 @@ class Cluster(TrackedResource): 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, - 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'language_extensions': {'key': 'properties.languageExtensions', 'type': 'LanguageExtensionsList'}, + 'enable_double_encryption': {'key': 'properties.enableDoubleEncryption', 'type': 'bool'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, @@ -582,7 +556,7 @@ def __init__( virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type_identity_type: Optional[Union[str, "IdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs @@ -602,7 +576,8 @@ def __init__( self.virtual_network_configuration = virtual_network_configuration self.key_vault_properties = key_vault_properties self.enable_purge = enable_purge - self.value = value + self.language_extensions = None + self.enable_double_encryption = enable_double_encryption self.principal_id = None self.tenant_id = None self.type_identity_type = type_identity_type @@ -622,7 +597,7 @@ class ClusterCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -651,7 +626,7 @@ class ClusterListResult(msrest.serialization.Model): """The list Kusto clusters operation response. :param value: The list of Kusto clusters. - :type value: list[~azure.mgmt.kusto.models.Cluster] + :type value: list[~kusto_management_client.models.Cluster] """ _attribute_map = { @@ -668,7 +643,7 @@ def __init__( self.value = value -class ClusterPrincipalAssignment(ProxyResource): +class ClusterPrincipalAssignment(Resource): """Class representing a cluster principal assignment. Variables are only populated by the server, and will be ignored when sending a request. @@ -686,18 +661,18 @@ class ClusterPrincipalAssignment(ProxyResource): :type principal_id: str :param role: Cluster principal role. Possible values include: "AllDatabasesAdmin", "AllDatabasesViewer". - :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :type role: str or ~kusto_management_client.models.ClusterPrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. Possible values include: "App", "Group", "User". - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: 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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState """ _validation = { @@ -754,7 +729,7 @@ class ClusterPrincipalAssignmentCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -783,7 +758,7 @@ class ClusterPrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto cluster principal assignments operation response. :param value: The list of Kusto cluster principal assignments. - :type value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + :type value: list[~kusto_management_client.models.ClusterPrincipalAssignment] """ _attribute_map = { @@ -818,13 +793,13 @@ class ClusterUpdate(Resource): :param location: Resource location. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~azure.mgmt.kusto.models.State + :vartype state: str or ~kusto_management_client.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -832,9 +807,9 @@ class ClusterUpdate(Resource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -842,25 +817,29 @@ class ClusterUpdate(Resource): enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: + ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar language_extensions: List of the cluster's language extensions. + :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :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_identity_type: The identity type. Possible values include: "None", "SystemAssigned". - :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :type type_identity_type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -872,6 +851,7 @@ class ClusterUpdate(Resource): 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, 'state_reason': {'readonly': True}, + 'language_extensions': {'readonly': True}, 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } @@ -895,7 +875,8 @@ class ClusterUpdate(Resource): 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, - 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'language_extensions': {'key': 'properties.languageExtensions', 'type': 'LanguageExtensionsList'}, + 'enable_double_encryption': {'key': 'properties.enableDoubleEncryption', 'type': 'bool'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, @@ -915,7 +896,7 @@ def __init__( virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, key_vault_properties: Optional["KeyVaultProperties"] = None, enable_purge: Optional[bool] = False, - value: Optional[List["LanguageExtension"]] = None, + enable_double_encryption: Optional[bool] = False, type_identity_type: Optional[Union[str, "IdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs @@ -936,7 +917,8 @@ def __init__( self.virtual_network_configuration = virtual_network_configuration self.key_vault_properties = key_vault_properties self.enable_purge = enable_purge - self.value = value + self.language_extensions = None + self.enable_double_encryption = enable_double_encryption self.principal_id = None self.tenant_id = None self.type_identity_type = type_identity_type @@ -973,7 +955,7 @@ def __init__( self.client_id = None -class Database(ProxyResource): +class Database(Resource): """Class representing a Kusto database. You probably want to use the sub-classes and not this class directly. Known @@ -995,7 +977,7 @@ class Database(ProxyResource): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind """ _validation = { @@ -1025,14 +1007,14 @@ def __init__( ): super(Database, self).__init__(**kwargs) self.location = location - self.kind = 'Database' + self.kind: str = 'Database' class DatabaseListResult(msrest.serialization.Model): """The list Kusto databases operation response. :param value: The list of Kusto databases. - :type value: list[~azure.mgmt.kusto.models.Database] + :type value: list[~kusto_management_client.models.Database] """ _attribute_map = { @@ -1058,12 +1040,12 @@ class DatabasePrincipal(msrest.serialization.Model): :param role: Required. Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewers", "Viewer". - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param name: Required. Database principal name. :type name: str :param type: Required. Database principal type. Possible values include: "App", "Group", "User". - :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :type type: str or ~kusto_management_client.models.DatabasePrincipalType :param fqn: Database principal fully qualified name. :type fqn: str :param email: Database principal email if exists. @@ -1112,7 +1094,7 @@ def __init__( self.tenant_name = None -class DatabasePrincipalAssignment(ProxyResource): +class DatabasePrincipalAssignment(Resource): """Class representing a database principal assignment. Variables are only populated by the server, and will be ignored when sending a request. @@ -1130,18 +1112,18 @@ class DatabasePrincipalAssignment(ProxyResource): :type principal_id: str :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewers", "Viewer". - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. Possible values include: "App", "Group", "User". - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: 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 + :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState """ _validation = { @@ -1199,7 +1181,7 @@ class DatabasePrincipalAssignmentCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -1228,7 +1210,7 @@ class DatabasePrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto database principal assignments operation response. :param value: The list of Kusto database principal assignments. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + :type value: list[~kusto_management_client.models.DatabasePrincipalAssignment] """ _attribute_map = { @@ -1249,7 +1231,7 @@ class DatabasePrincipalListRequest(msrest.serialization.Model): """The list Kusto database principals operation request. :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] """ _attribute_map = { @@ -1270,7 +1252,7 @@ class DatabasePrincipalListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] """ _attribute_map = { @@ -1308,7 +1290,7 @@ def __init__( self.size = size -class DataConnection(ProxyResource): +class DataConnection(Resource): """Class representing an data connection. You probably want to use the sub-classes and not this class directly. Known @@ -1330,7 +1312,7 @@ class DataConnection(ProxyResource): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind """ _validation = { @@ -1360,7 +1342,7 @@ def __init__( ): super(DataConnection, self).__init__(**kwargs) self.location = location - self.kind = 'DataConnection' + self.kind: str = 'DataConnection' class DataConnectionCheckNameRequest(msrest.serialization.Model): @@ -1377,7 +1359,7 @@ class DataConnectionCheckNameRequest(msrest.serialization.Model): "Microsoft.Kusto/clusters/principalAssignments", "Microsoft.Kusto/clusters/databases/dataConnections", "Microsoft.Kusto/clusters/databases/principalAssignments". - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type """ _validation = { @@ -1406,7 +1388,7 @@ class DataConnectionListResult(msrest.serialization.Model): """The list Kusto data connections operation response. :param value: The list of Kusto data connections. - :type value: list[~azure.mgmt.kusto.models.DataConnection] + :type value: list[~kusto_management_client.models.DataConnection] """ _attribute_map = { @@ -1429,7 +1411,7 @@ class DataConnectionValidation(msrest.serialization.Model): :param data_connection_name: The name of the data connection. :type data_connection_name: str :param properties: The data connection properties to validate. - :type properties: ~azure.mgmt.kusto.models.DataConnection + :type properties: ~kusto_management_client.models.DataConnection """ _attribute_map = { @@ -1453,7 +1435,7 @@ class DataConnectionValidationListResult(msrest.serialization.Model): """The list Kusto data connection validation result. :param value: The list of Kusto data connection validation errors. - :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + :type value: list[~kusto_management_client.models.DataConnectionValidationResult] """ _attribute_map = { @@ -1531,7 +1513,7 @@ class EventGridDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param storage_account_resource_id: The resource ID of the storage account where the data resides. :type storage_account_resource_id: str @@ -1548,8 +1530,15 @@ class EventGridDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.EventGridDataFormat + :param ignore_first_record: A Boolean value that, if set to true, indicates that ingestion + should ignore the first record of every file. + :type ignore_first_record: bool + :param blob_storage_event_type: The name of blob storage event type to process. Possible values + include: "Microsoft.Storage.BlobCreated", "Microsoft.Storage.BlobRenamed". + :type blob_storage_event_type: str or ~kusto_management_client.models.BlobStorageEventType """ _validation = { @@ -1571,6 +1560,8 @@ class EventGridDataConnection(DataConnection): 'table_name': {'key': 'properties.tableName', 'type': 'str'}, 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'ignore_first_record': {'key': 'properties.ignoreFirstRecord', 'type': 'bool'}, + 'blob_storage_event_type': {'key': 'properties.blobStorageEventType', 'type': 'str'}, } def __init__( @@ -1583,16 +1574,20 @@ def __init__( table_name: Optional[str] = None, mapping_rule_name: Optional[str] = None, data_format: Optional[Union[str, "EventGridDataFormat"]] = None, + ignore_first_record: Optional[bool] = None, + blob_storage_event_type: Optional[Union[str, "BlobStorageEventType"]] = None, **kwargs ): super(EventGridDataConnection, self).__init__(location=location, **kwargs) - self.kind = 'EventGrid' + self.kind: str = 'EventGrid' self.storage_account_resource_id = storage_account_resource_id self.event_hub_resource_id = event_hub_resource_id self.consumer_group = consumer_group self.table_name = table_name self.mapping_rule_name = mapping_rule_name self.data_format = data_format + self.ignore_first_record = ignore_first_record + self.blob_storage_event_type = blob_storage_event_type class EventHubDataConnection(DataConnection): @@ -1614,7 +1609,7 @@ class EventHubDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param event_hub_resource_id: The resource ID of the event hub to be used to create a data connection. :type event_hub_resource_id: str @@ -1628,13 +1623,14 @@ class EventHubDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.EventHubDataFormat :param event_system_properties: System properties of the event hub. :type event_system_properties: list[str] :param compression: The event hub messages compression type. Possible values include: "None", "GZip". - :type compression: str or ~azure.mgmt.kusto.models.Compression + :type compression: str or ~kusto_management_client.models.Compression """ _validation = { @@ -1673,7 +1669,7 @@ def __init__( **kwargs ): super(EventHubDataConnection, self).__init__(location=location, **kwargs) - self.kind = 'EventHub' + self.kind: str = 'EventHub' self.event_hub_resource_id = event_hub_resource_id self.consumer_group = consumer_group self.table_name = table_name @@ -1730,7 +1726,7 @@ class FollowerDatabaseListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :param value: The list of follower database result. - :type value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] + :type value: list[~kusto_management_client.models.FollowerDatabaseDefinition] """ _attribute_map = { @@ -1766,7 +1762,7 @@ class IotHubDataConnection(DataConnection): :type location: str :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :param iot_hub_resource_id: The resource ID of the Iot hub to be used to create a data connection. :type iot_hub_resource_id: str @@ -1780,8 +1776,9 @@ class IotHubDataConnection(DataConnection): :type mapping_rule_name: str :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", - "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". - :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", + "W3CLOGFILE". + :type data_format: str or ~kusto_management_client.models.IotHubDataFormat :param event_system_properties: System properties of the iot hub. :type event_system_properties: list[str] :param shared_access_policy_name: The name of the share access policy. @@ -1824,7 +1821,7 @@ def __init__( **kwargs ): super(IotHubDataConnection, self).__init__(location=location, **kwargs) - self.kind = 'IotHub' + self.kind: str = 'IotHub' self.iot_hub_resource_id = iot_hub_resource_id self.consumer_group = consumer_group self.table_name = table_name @@ -1878,7 +1875,7 @@ class LanguageExtension(msrest.serialization.Model): :param language_extension_name: The language extension name. Possible values include: "PYTHON", "R". - :type language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName + :type language_extension_name: str or ~kusto_management_client.models.LanguageExtensionName """ _attribute_map = { @@ -1899,7 +1896,7 @@ class LanguageExtensionsList(msrest.serialization.Model): """The list of language extension objects. :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] """ _attribute_map = { @@ -1920,7 +1917,7 @@ class ListResourceSkusResult(msrest.serialization.Model): """List of available SKUs for a Kusto Cluster. :param value: The collection of available SKUs for an existing resource. - :type value: list[~azure.mgmt.kusto.models.AzureResourceSku] + :type value: list[~kusto_management_client.models.AzureResourceSku] """ _attribute_map = { @@ -1943,7 +1940,7 @@ class Operation(msrest.serialization.Model): :param name: This is of the format {provider}/{resource}/{operation}. :type name: str :param display: The object that describes the operation. - :type display: ~azure.mgmt.kusto.models.OperationDisplay + :type display: ~kusto_management_client.models.OperationDisplay :param origin: The intended executor of the operation. :type origin: str :param properties: Any object. @@ -2013,7 +2010,7 @@ class OperationListResult(msrest.serialization.Model): """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. :param value: The list of operations supported by the resource provider. - :type value: list[~azure.mgmt.kusto.models.Operation] + :type value: list[~kusto_management_client.models.Operation] :param next_link: The URL to get the next set of operation list results if there are any. :type next_link: str """ @@ -2081,6 +2078,40 @@ def __init__( self.maximum = maximum +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) + + class ReadOnlyFollowingDatabase(Database): """Class representing a read only following database. @@ -2100,10 +2131,10 @@ class ReadOnlyFollowingDatabase(Database): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :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 + :vartype provisioning_state: str or ~kusto_management_client.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: ~datetime.timedelta @@ -2111,7 +2142,7 @@ class ReadOnlyFollowingDatabase(Database): TimeSpan. :type hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :vartype statistics: ~kusto_management_client.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 @@ -2120,7 +2151,7 @@ class ReadOnlyFollowingDatabase(Database): :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 + ~kusto_management_client.models.PrincipalsModificationKind """ _validation = { @@ -2159,7 +2190,7 @@ def __init__( **kwargs ): super(ReadOnlyFollowingDatabase, self).__init__(location=location, **kwargs) - self.kind = 'ReadOnlyFollowing' + self.kind: str = 'ReadOnlyFollowing' self.provisioning_state = None self.soft_delete_period = None self.hot_cache_period = hot_cache_period @@ -2188,10 +2219,10 @@ class ReadWriteDatabase(Database): :type location: str :param kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". - :type kind: str or ~azure.mgmt.kusto.models.Kind + :type kind: str or ~kusto_management_client.models.Kind :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 + :vartype provisioning_state: str or ~kusto_management_client.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: ~datetime.timedelta @@ -2199,9 +2230,9 @@ class ReadWriteDatabase(Database): TimeSpan. :type hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :vartype statistics: ~kusto_management_client.models.DatabaseStatistics :ivar is_followed: Indicates whether the database is followed. - :vartype is_followed: str + :vartype is_followed: bool """ _validation = { @@ -2224,7 +2255,7 @@ class ReadWriteDatabase(Database): 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, - 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'bool'}, } def __init__( @@ -2236,7 +2267,7 @@ def __init__( **kwargs ): super(ReadWriteDatabase, self).__init__(location=location, **kwargs) - self.kind = 'ReadWrite' + self.kind: str = 'ReadWrite' self.provisioning_state = None self.soft_delete_period = soft_delete_period self.hot_cache_period = hot_cache_period @@ -2258,7 +2289,7 @@ class SkuDescription(msrest.serialization.Model): :ivar locations: The set of locations that the SKU is available. :vartype locations: list[str] :ivar location_info: Locations and zones. - :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :vartype location_info: list[~kusto_management_client.models.SkuLocationInfoItem] :ivar restrictions: The restrictions because of which SKU cannot be used. :vartype restrictions: list[object] """ @@ -2300,7 +2331,7 @@ class SkuDescriptionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: SKU descriptions. - :vartype value: list[~azure.mgmt.kusto.models.SkuDescription] + :vartype value: list[~kusto_management_client.models.SkuDescription] """ _validation = { diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py index b3d7d5b634b..403fd151411 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class AttachedDatabaseConfigurationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ def list_by_cluster( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AttachedDatabaseConfigurationListResult" + # type: (...) -> Iterable["models.AttachedDatabaseConfigurationListResult"] """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. @@ -61,31 +61,32 @@ def list_by_cluster( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AttachedDatabaseConfigurationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult + :return: An iterator like instance of either AttachedDatabaseConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.AttachedDatabaseConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfigurationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_cluster.metadata['url'] + url = self.list_by_cluster.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -116,7 +117,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} # type: ignore def get( self, @@ -135,16 +136,17 @@ def get( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AttachedDatabaseConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :return: AttachedDatabaseConfiguration, or the result of cls(response) + :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -173,10 +175,10 @@ def get( deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore def _create_or_update_initial( self, @@ -191,14 +193,15 @@ def _create_or_update_initial( ): # type: (...) -> "models.AttachedDatabaseConfiguration" cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.AttachedDatabaseConfiguration(location=location, database_name=database_name, cluster_resource_id=cluster_resource_id, default_principals_modification_kind=default_principals_modification_kind) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -240,10 +243,10 @@ def _create_or_update_initial( deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore def begin_create_or_update( self, @@ -256,7 +259,7 @@ def begin_create_or_update( default_principals_modification_kind=None, # type: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] **kwargs # type: Any ): - # type: (...) -> "models.AttachedDatabaseConfiguration" + # type: (...) -> LROPoller """Creates or updates an attached database configuration. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -274,18 +277,22 @@ def begin_create_or_update( to attach reside. :type cluster_resource_id: str :param default_principals_modification_kind: The default principals modification kind. - :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :type default_principals_modification_kind: str or ~kusto_management_client.models.DefaultPrincipalsModificationKind :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns AttachedDatabaseConfiguration - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AttachedDatabaseConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.AttachedDatabaseConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -298,6 +305,9 @@ def begin_create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) @@ -305,15 +315,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore def _delete_initial( self, @@ -324,11 +330,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -354,9 +361,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore def begin_delete( self, @@ -365,7 +372,7 @@ def begin_delete( attached_database_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes the attached database configuration with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -378,13 +385,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -393,16 +404,15 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py index c3f93184c5c..fbcfe420468 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ClusterOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,16 +61,17 @@ def get( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.Cluster + :return: Cluster, or the result of cls(response) + :rtype: ~kusto_management_client.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -98,10 +99,10 @@ def get( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _create_or_update_initial( self, @@ -111,28 +112,29 @@ def _create_or_update_initial( sku, # type: "models.AzureSku" tags=None, # type: Optional[Dict[str, str]] zones=None, # type: Optional[List[str]] - trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] enable_disk_encryption=None, # type: Optional[bool] enable_streaming_ingest=False, # type: Optional[bool] virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] enable_purge=False, # type: Optional[bool] - value=None, # type: Optional[List["LanguageExtension"]] + enable_double_encryption=False, # type: Optional[bool] type=None, # type: Optional[Union[str, "models.IdentityType"]] - user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): # type: (...) -> "models.Cluster" cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) - api_version = "2020-02-15" + _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, enable_double_encryption=enable_double_encryption, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -170,10 +172,10 @@ def _create_or_update_initial( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def begin_create_or_update( self, @@ -183,19 +185,19 @@ def begin_create_or_update( sku, # type: "models.AzureSku" tags=None, # type: Optional[Dict[str, str]] zones=None, # type: Optional[List[str]] - trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] enable_disk_encryption=None, # type: Optional[bool] enable_streaming_ingest=False, # type: Optional[bool] virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] enable_purge=False, # type: Optional[bool] - value=None, # type: Optional[List["LanguageExtension"]] + enable_double_encryption=False, # type: Optional[bool] type=None, # type: Optional[Union[str, "models.IdentityType"]] - user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): - # type: (...) -> "models.Cluster" + # type: (...) -> LROPoller """Create or update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -205,15 +207,15 @@ def begin_create_or_update( :param location: The geo-location where the resource lives. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param tags: Resource tags. :type tags: dict[str, str] :param zones: The availability zones of the cluster. :type zones: list[str] :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -221,30 +223,35 @@ def begin_create_or_update( enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :param type: The identity type. - :type type: str or ~azure.mgmt.kusto.models.IdentityType + :type type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Cluster - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -259,13 +266,16 @@ def begin_create_or_update( virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, - value=value, + enable_double_encryption=enable_double_encryption, type=type, user_assigned_identities=user_assigned_identities, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Cluster', pipeline_response) @@ -273,15 +283,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _update_initial( self, @@ -290,28 +296,29 @@ def _update_initial( tags=None, # type: Optional[Dict[str, str]] location=None, # type: Optional[str] sku=None, # type: Optional["models.AzureSku"] - trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] enable_disk_encryption=None, # type: Optional[bool] enable_streaming_ingest=False, # type: Optional[bool] virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] enable_purge=False, # type: Optional[bool] - value=None, # type: Optional[List["LanguageExtension"]] + enable_double_encryption=False, # type: Optional[bool] type=None, # type: Optional[Union[str, "models.IdentityType"]] - user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): # type: (...) -> "models.Cluster" cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) - api_version = "2020-02-15" + _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, enable_double_encryption=enable_double_encryption, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -352,10 +359,10 @@ def _update_initial( deserialized = self._deserialize('Cluster', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def begin_update( self, @@ -364,19 +371,19 @@ def begin_update( tags=None, # type: Optional[Dict[str, str]] location=None, # type: Optional[str] sku=None, # type: Optional["models.AzureSku"] - trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + trusted_external_tenants=None, # type: Optional[List["models.TrustedExternalTenant"]] optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] enable_disk_encryption=None, # type: Optional[bool] enable_streaming_ingest=False, # type: Optional[bool] virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] enable_purge=False, # type: Optional[bool] - value=None, # type: Optional[List["LanguageExtension"]] + enable_double_encryption=False, # type: Optional[bool] type=None, # type: Optional[Union[str, "models.IdentityType"]] - user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + user_assigned_identities=None, # type: Optional[Dict[str, "models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] **kwargs # type: Any ): - # type: (...) -> "models.Cluster" + # type: (...) -> LROPoller """Update a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -388,11 +395,11 @@ def begin_update( :param location: Resource location. :type location: str :param sku: The SKU of the cluster. - :type sku: ~azure.mgmt.kusto.models.AzureSku + :type sku: ~kusto_management_client.models.AzureSku :param trusted_external_tenants: The cluster's external tenants. - :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :type trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] :param optimized_autoscale: Optimized auto scale definition. - :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :type optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :type enable_disk_encryption: bool @@ -400,30 +407,35 @@ def begin_update( enabled. :type enable_streaming_ingest: bool :param virtual_network_configuration: Virtual network definition. - :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :type virtual_network_configuration: ~kusto_management_client.models.VirtualNetworkConfiguration :param key_vault_properties: KeyVault properties for the cluster encryption. - :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :type key_vault_properties: ~kusto_management_client.models.KeyVaultProperties :param enable_purge: A boolean value that indicates if the purge operations are enabled. :type enable_purge: bool - :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param enable_double_encryption: A boolean value that indicates if double encryption is + enabled. + :type enable_double_encryption: bool :param type: The identity type. - :type type: str or ~azure.mgmt.kusto.models.IdentityType + :type type: str or ~kusto_management_client.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.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :type user_assigned_identities: dict[str, ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Cluster - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -437,13 +449,16 @@ def begin_update( virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, - value=value, + enable_double_encryption=enable_double_encryption, type=type, user_assigned_identities=user_assigned_identities, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Cluster', pipeline_response) @@ -451,15 +466,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _delete_initial( self, @@ -469,11 +480,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -498,9 +510,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def begin_delete( self, @@ -508,7 +520,7 @@ def begin_delete( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -519,13 +531,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -533,19 +549,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore def _stop_initial( self, @@ -555,11 +570,12 @@ def _stop_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._stop_initial.metadata['url'] + url = self._stop_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -584,9 +600,9 @@ def _stop_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore def begin_stop( self, @@ -594,7 +610,7 @@ def begin_stop( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Stops a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -605,13 +621,17 @@ def begin_stop( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._stop_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -619,19 +639,18 @@ def begin_stop( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore def _start_initial( self, @@ -641,11 +660,12 @@ def _start_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._start_initial.metadata['url'] + url = self._start_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -670,9 +690,9 @@ def _start_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore def begin_start( self, @@ -680,7 +700,7 @@ def begin_start( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Starts a Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -691,13 +711,17 @@ def begin_start( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._start_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -705,19 +729,18 @@ def begin_start( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore def list_follower_database( self, @@ -725,7 +748,7 @@ def list_follower_database( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FollowerDatabaseListResult" + # type: (...) -> Iterable["models.FollowerDatabaseListResult"] """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. @@ -733,31 +756,32 @@ def list_follower_database( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: FollowerDatabaseListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.FollowerDatabaseListResult + :return: An iterator like instance of either FollowerDatabaseListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.FollowerDatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.FollowerDatabaseListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_follower_database.metadata['url'] + url = self.list_follower_database.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -788,7 +812,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} # type: ignore def _detach_follower_database_initial( self, @@ -800,14 +824,15 @@ def _detach_follower_database_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _follower_database_to_remove = models.FollowerDatabaseDefinition(cluster_resource_id=cluster_resource_id, attached_database_configuration_name=attached_database_configuration_name) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._detach_follower_database_initial.metadata['url'] + url = self._detach_follower_database_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -837,9 +862,9 @@ def _detach_follower_database_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore def begin_detach_follower_database( self, @@ -849,7 +874,7 @@ def begin_detach_follower_database( attached_database_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Detaches all followers of a database owned by this cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -866,13 +891,17 @@ def begin_detach_follower_database( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._detach_follower_database_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -882,19 +911,18 @@ def begin_detach_follower_database( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + begin_detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore def _diagnose_virtual_network_initial( self, @@ -904,11 +932,12 @@ def _diagnose_virtual_network_initial( ): # type: (...) -> "models.DiagnoseVirtualNetworkResult" cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._diagnose_virtual_network_initial.metadata['url'] + url = self._diagnose_virtual_network_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -938,10 +967,10 @@ def _diagnose_virtual_network_initial( deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore def begin_diagnose_virtual_network( self, @@ -949,7 +978,7 @@ def begin_diagnose_virtual_network( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnoseVirtualNetworkResult" + # type: (...) -> LROPoller """Diagnoses network connectivity status for external resources on which the service is dependent on. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -960,13 +989,17 @@ def begin_diagnose_virtual_network( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns DiagnoseVirtualNetworkResult - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DiagnoseVirtualNetworkResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DiagnoseVirtualNetworkResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._diagnose_virtual_network_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -974,6 +1007,9 @@ def begin_diagnose_virtual_network( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) @@ -981,51 +1017,48 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore def list_by_resource_group( self, resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ClusterListResult" + # type: (...) -> Iterable["models.ClusterListResult"] """Lists all Kusto clusters within a resource group. :param resource_group_name: The name of the resource group containing the Kusto cluster. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1056,39 +1089,40 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} # type: ignore def list( self, **kwargs # type: Any ): - # type: (...) -> "models.ClusterListResult" + # type: (...) -> Iterable["models.ClusterListResult"] """Lists all Kusto clusters within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1119,39 +1153,40 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} # type: ignore def list_sku( self, **kwargs # type: Any ): - # type: (...) -> "models.SkuDescriptionList" + # type: (...) -> Iterable["models.SkuDescriptionList"] """Lists eligible SKUs for Kusto resource provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: SkuDescriptionList or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.SkuDescriptionList + :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.SkuDescriptionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SkuDescriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_sku.metadata['url'] + url = self.list_sku.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1182,7 +1217,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} # type: ignore def check_name_availability( self, @@ -1199,21 +1234,22 @@ def check_name_availability( :param name: Cluster name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _cluster_name = models.ClusterCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str'), @@ -1245,10 +1281,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} # type: ignore def list_sku_by_resource( self, @@ -1256,7 +1292,7 @@ def list_sku_by_resource( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListResourceSkusResult" + # type: (...) -> Iterable["models.ListResourceSkusResult"] """Returns the SKUs available for the provided resource. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1264,31 +1300,32 @@ def list_sku_by_resource( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListResourceSkusResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ListResourceSkusResult + :return: An iterator like instance of either ListResourceSkusResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ListResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ListResourceSkusResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_sku_by_resource.metadata['url'] + url = self.list_sku_by_resource.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1319,7 +1356,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} + list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} # type: ignore def list_language_extension( self, @@ -1327,7 +1364,7 @@ def list_language_extension( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LanguageExtensionsList" + # type: (...) -> Iterable["models.LanguageExtensionsList"] """Returns a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1335,31 +1372,32 @@ def list_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: LanguageExtensionsList or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.LanguageExtensionsList + :return: An iterator like instance of either LanguageExtensionsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.LanguageExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LanguageExtensionsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_language_extension.metadata['url'] + url = self.list_language_extension.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -1390,25 +1428,26 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} + list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} # type: ignore def _add_language_extension_initial( self, resource_group_name, # type: str cluster_name, # type: str - value=None, # type: Optional[List["LanguageExtension"]] + value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _language_extensions_to_add = models.LanguageExtensionsList(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._add_language_extension_initial.metadata['url'] + url = self._add_language_extension_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1438,18 +1477,18 @@ def _add_language_extension_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore def begin_add_language_extension( self, resource_group_name, # type: str cluster_name, # type: str - value=None, # type: Optional[List["LanguageExtension"]] + value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Add a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1457,18 +1496,22 @@ def begin_add_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._add_language_extension_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -1477,37 +1520,37 @@ def begin_add_language_extension( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + begin_add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore def _remove_language_extension_initial( self, resource_group_name, # type: str cluster_name, # type: str - value=None, # type: Optional[List["LanguageExtension"]] + value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _language_extensions_to_remove = models.LanguageExtensionsList(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._remove_language_extension_initial.metadata['url'] + url = self._remove_language_extension_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1537,18 +1580,18 @@ def _remove_language_extension_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore def begin_remove_language_extension( self, resource_group_name, # type: str cluster_name, # type: str - value=None, # type: Optional[List["LanguageExtension"]] + value=None, # type: Optional[List["models.LanguageExtension"]] **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Remove a list of language extensions that can run within KQL queries. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -1556,18 +1599,22 @@ def begin_remove_language_extension( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param value: The list of language extensions. - :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :type value: list[~kusto_management_client.models.LanguageExtension] :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._remove_language_extension_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -1576,16 +1623,15 @@ def begin_remove_language_extension( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + begin_remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py index 4bb9028c622..78025b3f58f 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ClusterPrincipalAssignmentOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,21 +65,22 @@ def check_name_availability( :param name: Principal Assignment resource name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/principalAssignments. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _principal_assignment_name = models.ClusterPrincipalAssignmentCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -112,10 +113,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} # type: ignore def get( self, @@ -134,16 +135,17 @@ def get( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterPrincipalAssignment or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment + :return: ClusterPrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -172,10 +174,10 @@ def get( deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _create_or_update_initial( self, @@ -190,14 +192,15 @@ def _create_or_update_initial( ): # type: (...) -> "models.ClusterPrincipalAssignment" cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.ClusterPrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -236,10 +239,10 @@ def _create_or_update_initial( deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def begin_create_or_update( self, @@ -252,7 +255,7 @@ def begin_create_or_update( principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] **kwargs # type: Any ): - # type: (...) -> "models.ClusterPrincipalAssignment" + # type: (...) -> LROPoller """Create a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -265,22 +268,26 @@ def begin_create_or_update( email, application ID, or security group name. :type principal_id: str :param role: Cluster principal role. - :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :type role: str or ~kusto_management_client.models.ClusterPrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns ClusterPrincipalAssignment - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ClusterPrincipalAssignment or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.ClusterPrincipalAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -293,6 +300,9 @@ def begin_create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) @@ -300,15 +310,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _delete_initial( self, @@ -319,11 +325,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -349,9 +356,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def begin_delete( self, @@ -360,7 +367,7 @@ def begin_delete( principal_assignment_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes a Kusto cluster principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -373,13 +380,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -388,19 +399,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, @@ -408,7 +418,7 @@ def list( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ClusterPrincipalAssignmentListResult" + # type: (...) -> Iterable["models.ClusterPrincipalAssignmentListResult"] """Lists all Kusto cluster principalAssignments. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -416,31 +426,32 @@ def list( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ClusterPrincipalAssignmentListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult + :return: An iterator like instance of either ClusterPrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterPrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignmentListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -471,4 +482,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py index 781c8811769..d8ba89afeff 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DataConnectionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def list_by_database( database_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DataConnectionListResult" + # type: (...) -> Iterable["models.DataConnectionListResult"] """Returns the list of data connections of the given Kusto database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -64,18 +64,19 @@ def list_by_database( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnectionListResult + :return: An iterator like instance of either DataConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DataConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_database.metadata['url'] + url = self.list_by_database.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -83,13 +84,13 @@ def prepare_request(next_link=None): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -120,9 +121,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} # type: ignore - def data_connection_validation( + def _data_connection_validation_initial( self, resource_group_name, # type: str cluster_name, # type: str @@ -132,32 +133,16 @@ def data_connection_validation( **kwargs # type: Any ): # type: (...) -> "models.DataConnectionValidationListResult" - """Checks that the data connection parameters are valid. - - :param resource_group_name: The name of the resource group containing the Kusto cluster. - :type resource_group_name: str - :param cluster_name: The name of the Kusto cluster. - :type cluster_name: str - :param database_name: The name of the database in the Kusto cluster. - :type database_name: str - :param data_connection_name: The name of the data connection. - :type data_connection_name: str - :param properties: The data connection properties to validate. - :type properties: ~azure.mgmt.kusto.models.DataConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnectionValidationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnectionValidationListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.DataConnectionValidation(data_connection_name=data_connection_name, properties=properties) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.data_connection_validation.metadata['url'] + url = self._data_connection_validation_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -184,17 +169,82 @@ def data_connection_validation( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} + _data_connection_validation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + + def begin_data_connection_validation( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name=None, # type: Optional[str] + properties=None, # type: Optional["models.DataConnection"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller + """Checks that the data connection parameters are valid. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~kusto_management_client.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DataConnectionValidationListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnectionValidationListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + raw_result = self._data_connection_validation_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore def check_name_availability( self, @@ -217,21 +267,22 @@ def check_name_availability( :param name: Data Connection name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _data_connection_name = models.DataConnectionCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -265,10 +316,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} # type: ignore def get( self, @@ -290,16 +341,17 @@ def get( :param data_connection_name: The name of the data connection. :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataConnection or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DataConnection + :return: DataConnection, or the result of cls(response) + :rtype: ~kusto_management_client.models.DataConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -329,10 +381,10 @@ def get( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def _create_or_update_initial( self, @@ -345,12 +397,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.DataConnection" cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -393,10 +446,10 @@ def _create_or_update_initial( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def begin_create_or_update( self, @@ -407,7 +460,7 @@ def begin_create_or_update( parameters, # type: "models.DataConnection" **kwargs # type: Any ): - # type: (...) -> "models.DataConnection" + # type: (...) -> LROPoller """Creates or updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -419,18 +472,22 @@ def begin_create_or_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.kusto.models.DataConnection + :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns DataConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DataConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -441,6 +498,9 @@ def begin_create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DataConnection', pipeline_response) @@ -448,15 +508,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def _update_initial( self, @@ -469,12 +525,13 @@ def _update_initial( ): # type: (...) -> "models.DataConnection" cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -517,10 +574,10 @@ def _update_initial( deserialized = self._deserialize('DataConnection', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def begin_update( self, @@ -531,7 +588,7 @@ def begin_update( parameters, # type: "models.DataConnection" **kwargs # type: Any ): - # type: (...) -> "models.DataConnection" + # type: (...) -> LROPoller """Updates a data connection. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -543,18 +600,22 @@ def begin_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.kusto.models.DataConnection + :type parameters: ~kusto_management_client.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns DataConnection - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DataConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -565,6 +626,9 @@ def begin_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DataConnection', pipeline_response) @@ -572,15 +636,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def _delete_initial( self, @@ -592,11 +652,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -623,9 +684,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore def begin_delete( self, @@ -635,7 +696,7 @@ def begin_delete( data_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes the data connection with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -650,13 +711,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -666,16 +731,15 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py index 355d5fd9cbc..848c2c3b5e8 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DatabaseOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,21 +65,22 @@ def check_name_availability( :param name: Resource name. :type name: str :param type: The type of resource, for instance Microsoft.Kusto/clusters/databases. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _resource_name = models.CheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -112,10 +113,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} # type: ignore def list_by_cluster( self, @@ -123,7 +124,7 @@ def list_by_cluster( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DatabaseListResult" + # type: (...) -> Iterable["models.DatabaseListResult"] """Returns the list of databases of the given Kusto cluster. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -131,31 +132,32 @@ def list_by_cluster( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabaseListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabaseListResult + :return: An iterator like instance of either DatabaseListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabaseListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_cluster.metadata['url'] + url = self.list_by_cluster.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -186,7 +188,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} # type: ignore def get( self, @@ -205,16 +207,17 @@ def get( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Database or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.Database + :return: Database, or the result of cls(response) + :rtype: ~kusto_management_client.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -243,10 +246,10 @@ def get( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def _create_or_update_initial( self, @@ -258,12 +261,13 @@ def _create_or_update_initial( ): # type: (...) -> "models.Database" cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -305,10 +309,10 @@ def _create_or_update_initial( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def begin_create_or_update( self, @@ -318,7 +322,7 @@ def begin_create_or_update( parameters, # type: "models.Database" **kwargs # type: Any ): - # type: (...) -> "models.Database" + # type: (...) -> LROPoller """Creates or updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -328,18 +332,22 @@ def begin_create_or_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.kusto.models.Database + :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Database - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Database or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -349,6 +357,9 @@ def begin_create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Database', pipeline_response) @@ -356,15 +367,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def _update_initial( self, @@ -376,12 +383,13 @@ def _update_initial( ): # type: (...) -> "models.Database" cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._update_initial.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -423,10 +431,10 @@ def _update_initial( deserialized = self._deserialize('Database', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def begin_update( self, @@ -436,7 +444,7 @@ def begin_update( parameters, # type: "models.Database" **kwargs # type: Any ): - # type: (...) -> "models.Database" + # type: (...) -> LROPoller """Updates a database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -446,18 +454,22 @@ def begin_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.kusto.models.Database + :type parameters: ~kusto_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Database - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Database or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -467,6 +479,9 @@ def begin_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Database', pipeline_response) @@ -474,15 +489,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def _delete_initial( self, @@ -493,11 +504,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -523,9 +535,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def begin_delete( self, @@ -534,7 +546,7 @@ def begin_delete( database_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes the database with the given name. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -547,13 +559,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -562,19 +578,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore def list_principal( self, @@ -583,7 +598,7 @@ def list_principal( database_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DatabasePrincipalListResult" + # type: (...) -> Iterable["models.DatabasePrincipalListResult"] """Returns a list of database principals of the given Kusto cluster and database. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -593,18 +608,19 @@ def list_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: An iterator like instance of either DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabasePrincipalListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_principal.metadata['url'] + url = self.list_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -612,13 +628,13 @@ def prepare_request(next_link=None): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -649,14 +665,14 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} + list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} # type: ignore def add_principal( self, resource_group_name, # type: str cluster_name, # type: str database_name, # type: str - value=None, # type: Optional[List["DatabasePrincipal"]] + value=None, # type: Optional[List["models.DatabasePrincipal"]] **kwargs # type: Any ): # type: (...) -> "models.DatabasePrincipalListResult" @@ -669,21 +685,22 @@ def add_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: DatabasePrincipalListResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _database_principals_to_add = models.DatabasePrincipalListRequest(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.add_principal.metadata['url'] + url = self.add_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -717,17 +734,17 @@ def add_principal( deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} + add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} # type: ignore def remove_principal( self, resource_group_name, # type: str cluster_name, # type: str database_name, # type: str - value=None, # type: Optional[List["DatabasePrincipal"]] + value=None, # type: Optional[List["models.DatabasePrincipal"]] **kwargs # type: Any ): # type: (...) -> "models.DatabasePrincipalListResult" @@ -740,21 +757,22 @@ def remove_principal( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param value: The list of Kusto database principals. - :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :type value: list[~kusto_management_client.models.DatabasePrincipal] :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :return: DatabasePrincipalListResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _database_principals_to_remove = models.DatabasePrincipalListRequest(value=value) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.remove_principal.metadata['url'] + url = self.remove_principal.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -788,7 +806,7 @@ def remove_principal( deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} + remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py index 4fe55c98aa3..724c19b1cc8 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DatabasePrincipalAssignmentOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,21 +68,22 @@ def check_name_availability( :param name: Principal Assignment resource name. :type name: str :param type: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. - :type type: str or ~azure.mgmt.kusto.models.Type + :type type: str or ~kusto_management_client.models.Type :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :return: CheckNameResult, or the result of cls(response) + :rtype: ~kusto_management_client.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _principal_assignment_name = models.DatabasePrincipalAssignmentCheckNameRequest(name=name, type=type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_name_availability.metadata['url'] + url = self.check_name_availability.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), @@ -116,10 +117,10 @@ def check_name_availability( deserialized = self._deserialize('CheckNameResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} # type: ignore def get( self, @@ -141,16 +142,17 @@ def get( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalAssignment or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment + :return: DatabasePrincipalAssignment, or the result of cls(response) + :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -180,10 +182,10 @@ def get( deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _create_or_update_initial( self, @@ -199,14 +201,15 @@ def _create_or_update_initial( ): # type: (...) -> "models.DatabasePrincipalAssignment" cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.DatabasePrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) - api_version = "2020-02-15" + api_version = "2020-06-14" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_or_update_initial.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -246,10 +249,10 @@ def _create_or_update_initial( deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def begin_create_or_update( self, @@ -263,7 +266,7 @@ def begin_create_or_update( principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] **kwargs # type: Any ): - # type: (...) -> "models.DatabasePrincipalAssignment" + # type: (...) -> LROPoller """Creates a Kusto cluster database principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -278,22 +281,26 @@ def begin_create_or_update( email, application ID, or security group name. :type principal_id: str :param role: Database principal role. - :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :type role: str or ~kusto_management_client.models.DatabasePrincipalRole :param tenant_id: The tenant id of the principal. :type tenant_id: str :param principal_type: Principal type. - :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :type principal_type: str or ~kusto_management_client.models.PrincipalType :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns DatabasePrincipalAssignment - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DatabasePrincipalAssignment or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DatabasePrincipalAssignment] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -307,6 +314,9 @@ def begin_create_or_update( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) @@ -314,15 +324,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def _delete_initial( self, @@ -334,11 +340,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -365,9 +372,9 @@ def _delete_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def begin_delete( self, @@ -377,7 +384,7 @@ def begin_delete( principal_assignment_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Deletes a Kusto principalAssignment. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -392,13 +399,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, @@ -408,19 +419,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore def list( self, @@ -429,7 +439,7 @@ def list( database_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DatabasePrincipalAssignmentListResult" + # type: (...) -> Iterable["models.DatabasePrincipalAssignmentListResult"] """Lists all Kusto cluster database principalAssignments. :param resource_group_name: The name of the resource group containing the Kusto cluster. @@ -439,18 +449,19 @@ def list( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatabasePrincipalAssignmentListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult + :return: An iterator like instance of either DatabasePrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabasePrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignmentListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -458,13 +469,13 @@ def prepare_request(next_link=None): 'databaseName': self._serialize.url("database_name", database_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -495,4 +506,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py index 0dccf9c0c3a..6a0f95858b9 100644 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class OperationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kusto.models + :type models: ~kusto_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,29 +49,30 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.OperationListResult" + # type: (...) -> Iterable["models.OperationListResult"] """Lists available operations for the Microsoft.Kusto provider. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.kusto.models.OperationListResult + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2020-02-15" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-14" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -102,4 +103,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} + list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} # type: ignore diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py b/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py deleted file mode 100644 index ef33e13c91d..00000000000 --- a/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -# coding: utf-8 - -from setuptools import setup, find_packages - -NAME = "kustomanagementclient" -VERSION = "0.1.0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] - -setup( - name=NAME, - version=VERSION, - description="KustoManagementClient", - author_email="", - url="", - keywords=["Swagger", "KustoManagementClient"], - install_requires=REQUIRES, - packages=find_packages(), - include_package_data=True, - long_description="""\ - The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. - """ -) diff --git a/src/kusto/report.md b/src/kusto/report.md new file mode 100644 index 00000000000..cc0809d3d39 --- /dev/null +++ b/src/kusto/report.md @@ -0,0 +1,576 @@ +# Azure CLI Module Creation Report + +### kusto attached-database-configuration create + +create a kusto attached-database-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| +|**--location**|string|Resource location.|location| +|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name| +|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id| +|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind| +### kusto attached-database-configuration delete + +delete a kusto attached-database-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| +### kusto attached-database-configuration list + +list a kusto attached-database-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto attached-database-configuration show + +show a kusto attached-database-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| +### kusto attached-database-configuration update + +create a kusto attached-database-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--attached-database-configuration-name**|string|The name of the attached database configuration.|attached_database_configuration_name| +|**--location**|string|Resource location.|location| +|**--database-name**|string|The name of the database which you would like to attach, use * if you want to follow all current and future databases.|database_name| +|**--cluster-resource-id**|string|The resource id of the cluster where the databases you would like to attach reside.|cluster_resource_id| +|**--default-principals-modification-kind**|choice|The default principals modification kind|default_principals_modification_kind| +### kusto cluster add-language-extension + +add-language-extension a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--value**|array|The list of language extensions.|value| +### kusto cluster create + +create a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--location**|string|The geo-location where the resource lives|location| +|**--sku**|object|The SKU of the cluster.|sku| +|**--tags**|dictionary|Resource tags.|tags| +|**--zones**|array|The availability zones of the cluster.|zones| +|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants| +|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale| +|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption| +|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest| +|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration| +|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties| +|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge| +|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|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}'.|user_assigned_identities| +### kusto cluster delete + +delete a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster detach-follower-database + +detach-follower-database a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--cluster-resource-id**|string|Resource id of the cluster that follows a database owned by this cluster.|cluster_resource_id| +|**--attached-database-configuration-name**|string|Resource name of the attached database configuration in the follower cluster.|attached_database_configuration_name| +### kusto cluster diagnose-virtual-network + +diagnose-virtual-network a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster list + +list a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +### kusto cluster list-follower-database + +list-follower-database a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster list-language-extension + +list-language-extension a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster list-sku + +list-sku a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster remove-language-extension + +remove-language-extension a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--value**|array|The list of language extensions.|value| +### kusto cluster show + +show a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster start + +start a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster stop + +stop a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster update + +update a kusto cluster. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--tags**|dictionary|Resource tags.|tags| +|**--location**|string|Resource location.|location| +|**--sku**|object|The SKU of the cluster.|sku| +|**--trusted-external-tenants**|array|The cluster's external tenants.|trusted_external_tenants| +|**--optimized-autoscale**|object|Optimized auto scale definition.|optimized_autoscale| +|**--enable-disk-encryption**|boolean|A boolean value that indicates if the cluster's disks are encrypted.|enable_disk_encryption| +|**--enable-streaming-ingest**|boolean|A boolean value that indicates if the streaming ingest is enabled.|enable_streaming_ingest| +|**--virtual-network-configuration**|object|Virtual network definition.|virtual_network_configuration| +|**--key-vault-properties**|object|KeyVault properties for the cluster encryption.|key_vault_properties| +|**--enable-purge**|boolean|A boolean value that indicates if the purge operations are enabled.|enable_purge| +|**--enable-double-encryption**|boolean|A boolean value that indicates if double encryption is enabled.|enable_double_encryption| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|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}'.|user_assigned_identities| +### kusto cluster-principal-assignment create + +create a kusto cluster-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id| +|**--role**|choice|Cluster principal role.|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id| +|**--principal-type**|choice|Principal type.|principal_type| +### kusto cluster-principal-assignment delete + +delete a kusto cluster-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +### kusto cluster-principal-assignment list + +list a kusto cluster-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto cluster-principal-assignment show + +show a kusto cluster-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +### kusto cluster-principal-assignment update + +create a kusto cluster-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +|**--principal-id**|string|The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.|principal_id| +|**--role**|choice|Cluster principal role.|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id| +|**--principal-type**|choice|Principal type.|principal_type| +### kusto data-connection delete + +delete a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +### kusto data-connection event-grid create + +event-grid create a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_grid_location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| +### kusto data-connection event-grid data-connection-validation + +event-grid data-connection-validation a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_grid_location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| +### kusto data-connection event-grid update + +event-grid update a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_grid_location| +|**--storage-account-resource-id**|string|The resource ID of the storage account where the data resides.|event_grid_storage_account_resource_id| +|**--event-hub-resource-id**|string|The resource ID where the event grid is configured to send events.|event_grid_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_grid_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_grid_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_grid_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_grid_data_format| +|**--ignore-first-record**|boolean|A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file|event_grid_ignore_first_record| +|**--blob-storage-event-type**|choice|The name of blob storage event type to process.|event_grid_blob_storage_event_type| +### kusto data-connection event-hub create + +event-hub create a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_hub_location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression| +### kusto data-connection event-hub data-connection-validation + +event-hub data-connection-validation a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_hub_location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression| +### kusto data-connection event-hub update + +event-hub update a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|event_hub_location| +|**--event-hub-resource-id**|string|The resource ID of the event hub to be used to create a data connection.|event_hub_event_hub_resource_id| +|**--consumer-group**|string|The event hub consumer group.|event_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|event_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|event_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|event_hub_data_format| +|**--event-system-properties**|array|System properties of the event hub|event_hub_event_system_properties| +|**--compression**|choice|The event hub messages compression type|event_hub_compression| +### kusto data-connection iot-hub create + +iot-hub create a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|iot_hub_location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| +### kusto data-connection iot-hub data-connection-validation + +iot-hub data-connection-validation a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|iot_hub_location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| +### kusto data-connection iot-hub update + +iot-hub update a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +|**--location**|string|Resource location.|iot_hub_location| +|**--iot-hub-resource-id**|string|The resource ID of the Iot hub to be used to create a data connection.|iot_hub_iot_hub_resource_id| +|**--consumer-group**|string|The iot hub consumer group.|iot_hub_consumer_group| +|**--table-name**|string|The table where the data should be ingested. Optionally the table information can be added to each message.|iot_hub_table_name| +|**--mapping-rule-name**|string|The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.|iot_hub_mapping_rule_name| +|**--data-format**|choice|The data format of the message. Optionally the data format can be added to each message.|iot_hub_data_format| +|**--event-system-properties**|array|System properties of the iot hub|iot_hub_event_system_properties| +|**--shared-access-policy-name**|string|The name of the share access policy|iot_hub_shared_access_policy_name| +### kusto data-connection list + +list a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +### kusto data-connection show + +show a kusto data-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--data-connection-name**|string|The name of the data connection.|data_connection_name| +### kusto database add-principal + +add-principal a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--value**|array|The list of Kusto database principals.|value| +### kusto database create + +create a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--read-write-database**|object|Class representing a read write database.|read_write_database| +|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database| +### kusto database delete + +delete a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +### kusto database list + +list a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +### kusto database list-principal + +list-principal a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +### kusto database remove-principal + +remove-principal a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--value**|array|The list of Kusto database principals.|value| +### kusto database show + +show a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +### kusto database update + +update a kusto database. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--read-write-database**|object|Class representing a read write database.|read_write_database| +|**--read-only-following-database**|object|Class representing a read only following database.|read_only_following_database| +### kusto database-principal-assignment create + +create a kusto database-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id| +|**--role**|choice|Database principal role.|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id| +|**--principal-type**|choice|Principal type.|principal_type| +### kusto database-principal-assignment delete + +delete a kusto database-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +### kusto database-principal-assignment list + +list a kusto database-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +### kusto database-principal-assignment show + +show a kusto database-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +### kusto database-principal-assignment update + +create a kusto database-principal-assignment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The name of the resource group containing the Kusto cluster.|resource_group_name| +|**--cluster-name**|string|The name of the Kusto cluster.|cluster_name| +|**--database-name**|string|The name of the database in the Kusto cluster.|database_name| +|**--principal-assignment-name**|string|The name of the Kusto principalAssignment.|principal_assignment_name| +|**--principal-id**|string|The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.|principal_id| +|**--role**|choice|Database principal role.|role| +|**--tenant-id**|string|The tenant id of the principal|tenant_id| +|**--principal-type**|choice|Principal type.|principal_type| \ No newline at end of file diff --git a/src/kusto/setup.py b/src/kusto/setup.py index 6bcb85dcd06..04222760879 100644 --- a/src/kusto/setup.py +++ b/src/kusto/setup.py @@ -9,9 +9,12 @@ from codecs import open from setuptools import setup, find_packages -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from .manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -27,8 +30,11 @@ 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass with open('README.md', 'r', encoding='utf-8') as f: README = f.read() @@ -39,11 +45,9 @@ name='kusto', version=VERSION, description='Microsoft Azure Command-Line Tools KustoManagementClient Extension', - # TODO: Update author and email, if applicable author='Microsoft Corporation', author_email='azpycli@microsoft.com', - # TODO: consider pointing directly to your source code instead of the generic repo - url='https://github.com/Azure/azure-cli-extensions', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/kusto', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,