diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AllAttachedDatabaseConfiguration.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AllAttachedDatabaseConfiguration.java new file mode 100644 index 000000000000..6548c67a2945 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AllAttachedDatabaseConfiguration.java @@ -0,0 +1,68 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AttachedDatabaseConfigurationInner; + +/** + * Class representing an attached database configuration for a all attached + * database kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("All") +@JsonFlatten +public class AllAttachedDatabaseConfiguration extends AttachedDatabaseConfigurationInner { + /** + * The list of current databases that are attached. + */ + @JsonProperty(value = "properties.databaseNames", access = JsonProperty.Access.WRITE_ONLY) + private List databaseNames; + + /** + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId", required = true) + private String clusterResourceId; + + /** + * Get the list of current databases that are attached. + * + * @return the databaseNames value + */ + public List databaseNames() { + return this.databaseNames; + } + + /** + * Get the resource id of the cluster where the databases you would like to attach reside. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the resource id of the cluster where the databases you would like to attach reside. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the AllAttachedDatabaseConfiguration object itself. + */ + public AllAttachedDatabaseConfiguration withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfiguration.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfiguration.java new file mode 100644 index 000000000000..5f8ebc5a7e17 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfiguration.java @@ -0,0 +1,157 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AttachedDatabaseConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import java.util.List; + +/** + * Type representing AttachedDatabaseConfiguration. + */ +public interface AttachedDatabaseConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the attachedDatabaseNames value. + */ + List attachedDatabaseNames(); + + /** + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AttachedDatabaseConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithClusterResourceId, DefinitionStages.WithDatabaseName, DefinitionStages.WithCreate { + } + + /** + * Grouping of AttachedDatabaseConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AttachedDatabaseConfiguration definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @return the next definition stage + */ + WithClusterResourceId withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify ClusterResourceId. + */ + interface WithClusterResourceId { + /** + * Specifies clusterResourceId. + * @param clusterResourceId The resource id of the cluster where the databases you would like to attach reside + * @return the next definition stage + */ + WithDatabaseName withClusterResourceId(String clusterResourceId); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify DatabaseName. + */ + interface WithDatabaseName { + /** + * Specifies databaseName. + * @param databaseName The name of the database which you would like to attach, use * if you want to follow all current and future databases + * @return the next definition stage + */ + WithCreate withDatabaseName(String databaseName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation { + } + } + /** + * The template for a AttachedDatabaseConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of AttachedDatabaseConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the attacheddatabaseconfiguration update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfigurations.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfigurations.java new file mode 100644 index 000000000000..dd052c8274c7 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AttachedDatabaseConfigurations.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AttachedDatabaseConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AttachedDatabaseConfigurations. + */ +public interface AttachedDatabaseConfigurations extends SupportsCreating, HasInner { + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(String resourceGroupName, String clusterName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java index 21d7062d3128..34be1939a494 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java @@ -8,28 +8,92 @@ package com.microsoft.azure.management.kusto.v2019_01_21; -import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; -import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AzureSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; /** - * Type representing AzureSku. + * Azure SKU definition. */ -public interface AzureSku extends HasInner, HasManager { +public class AzureSku { /** - * @return the capacity value. + * SKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', + * 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', + * 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', + * 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', + * 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2'. */ - Integer capacity(); + @JsonProperty(value = "name", required = true) + private AzureSkuName name; /** - * @return the name value. + * SKU capacity. */ - AzureSkuName name(); + @JsonProperty(value = "capacity") + private Integer capacity; /** - * @return the tier value. + * SKU tier. Possible values include: 'Basic', 'Standard'. */ - String tier(); + @JsonProperty(value = "tier", required = true) + private AzureSkuTier tier; + + /** + * Get sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2'. + * + * @return the name value + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2'. + * + * @param name the name value to set + * @return the AzureSku object itself. + */ + public AzureSku withName(AzureSkuName name) { + this.name = name; + return this; + } + + /** + * Get sKU capacity. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set sKU capacity. + * + * @param capacity the capacity value to set + * @return the AzureSku object itself. + */ + public AzureSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @return the tier value + */ + public AzureSkuTier tier() { + return this.tier; + } + + /** + * Set sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @param tier the tier value to set + * @return the AzureSku object itself. + */ + public AzureSku withTier(AzureSkuTier tier) { + this.tier = tier; + return this; + } } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java index e70908451a30..ded067a6b2d4 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java @@ -16,26 +16,41 @@ * Defines values for AzureSkuName. */ public final class AzureSkuName extends ExpandableStringEnum { - /** Static value D13_v2 for AzureSkuName. */ - public static final AzureSkuName D13_V2 = fromString("D13_v2"); + /** Static value Standard_DS13_v2+1TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V21TB_PS = fromString("Standard_DS13_v2+1TB_PS"); - /** Static value D14_v2 for AzureSkuName. */ - public static final AzureSkuName D14_V2 = fromString("D14_v2"); + /** Static value Standard_DS13_v2+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V22TB_PS = fromString("Standard_DS13_v2+2TB_PS"); - /** Static value L8 for AzureSkuName. */ - public static final AzureSkuName L8 = fromString("L8"); + /** Static value Standard_DS14_v2+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V23TB_PS = fromString("Standard_DS14_v2+3TB_PS"); - /** Static value L16 for AzureSkuName. */ - public static final AzureSkuName L16 = fromString("L16"); + /** Static value Standard_DS14_v2+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V24TB_PS = fromString("Standard_DS14_v2+4TB_PS"); - /** Static value D11_v2 for AzureSkuName. */ - public static final AzureSkuName D11_V2 = fromString("D11_v2"); + /** Static value Standard_D13_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D13_V2 = fromString("Standard_D13_v2"); - /** Static value D12_v2 for AzureSkuName. */ - public static final AzureSkuName D12_V2 = fromString("D12_v2"); + /** Static value Standard_D14_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D14_V2 = fromString("Standard_D14_v2"); - /** Static value L4 for AzureSkuName. */ - public static final AzureSkuName L4 = fromString("L4"); + /** Static value Standard_L8s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_L16s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_L4s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Dev(No SLA)_Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName DEV_NO_SLA_STANDARD_D11_V2 = fromString("Dev(No SLA)_Standard_D11_v2"); /** * Creates or finds a AzureSkuName from its string representation. diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuTier.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuTier.java new file mode 100644 index 000000000000..148ca156db4d --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuTier.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureSkuTier. + */ +public final class AzureSkuTier extends ExpandableStringEnum { + /** Static value Basic for AzureSkuTier. */ + public static final AzureSkuTier BASIC = fromString("Basic"); + + /** Static value Standard for AzureSkuTier. */ + public static final AzureSkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a AzureSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding AzureSkuTier + */ + @JsonCreator + public static AzureSkuTier fromString(String name) { + return fromString(name, AzureSkuTier.class); + } + + /** + * @return known AzureSkuTier values + */ + public static Collection values() { + return values(AzureSkuTier.class); + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameRequest.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameRequest.java new file mode 100644 index 000000000000..1b3d94f8b0d5 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameRequest.java @@ -0,0 +1,71 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a database check name availability request. + */ +public class CheckNameRequest { + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, for instance Microsoft.Kusto/clusters/databases. + * Possible values include: 'Microsoft.Kusto/clusters/databases', + * 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @return the type value + */ + public Type type() { + return this.type; + } + + /** + * Set the type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @param type the type value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(Type type) { + this.type = type; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java index e622597d6c71..0a117ea1f80b 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java @@ -18,7 +18,6 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; -import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AzureSkuInner; import java.util.List; import com.microsoft.azure.management.kusto.v2019_01_21.implementation.ClusterInner; @@ -31,6 +30,11 @@ public interface Cluster extends HasInner, Resource, GroupableReso */ String dataIngestionUri(); + /** + * @return the intelligentAutoscale value. + */ + IntelligentAutoscale intelligentAutoscale(); + /** * @return the provisioningState value. */ @@ -87,7 +91,19 @@ interface WithSku { * @param sku The SKU of the cluster * @return the next definition stage */ - WithCreate withSku(AzureSkuInner sku); + WithCreate withSku(AzureSku sku); + } + + /** + * The stage of the cluster definition allowing to specify IntelligentAutoscale. + */ + interface WithIntelligentAutoscale { + /** + * Specifies intelligentAutoscale. + * @param intelligentAutoscale Intelligent auto scale definition + * @return the next definition stage + */ + WithCreate withIntelligentAutoscale(IntelligentAutoscale intelligentAutoscale); } /** @@ -107,19 +123,31 @@ interface WithTrustedExternalTenants { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithTrustedExternalTenants { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIntelligentAutoscale, DefinitionStages.WithTrustedExternalTenants { } } /** * The template for a Cluster update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku, UpdateStages.WithTrustedExternalTenants { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIntelligentAutoscale, UpdateStages.WithSku, UpdateStages.WithTrustedExternalTenants { } /** * Grouping of Cluster update stages. */ interface UpdateStages { + /** + * The stage of the cluster update allowing to specify IntelligentAutoscale. + */ + interface WithIntelligentAutoscale { + /** + * Specifies intelligentAutoscale. + * @param intelligentAutoscale Intelligent auto scale definition + * @return the next update stage + */ + Update withIntelligentAutoscale(IntelligentAutoscale intelligentAutoscale); + } + /** * The stage of the cluster update allowing to specify Sku. */ @@ -129,7 +157,7 @@ interface WithSku { * @param sku The SKU of the cluster * @return the next update stage */ - Update withSku(AzureSkuInner sku); + Update withSku(AzureSku sku); } /** diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java index 79b7de86ac99..cd7cffce6746 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.kusto.v2019_01_21; import java.util.Map; -import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AzureSkuInner; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -36,7 +35,7 @@ public class ClusterUpdate extends ProxyResource { * The SKU of the cluster. */ @JsonProperty(value = "sku") - private AzureSkuInner sku; + private AzureSku sku; /** * The state of the resource. Possible values include: 'Creating', @@ -48,7 +47,7 @@ public class ClusterUpdate extends ProxyResource { /** * The provisioned state of the resource. Possible values include: - * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; @@ -71,6 +70,12 @@ public class ClusterUpdate extends ProxyResource { @JsonProperty(value = "properties.trustedExternalTenants") private List trustedExternalTenants; + /** + * Intelligent auto scale definition. + */ + @JsonProperty(value = "properties.intelligentAutoscale") + private IntelligentAutoscale intelligentAutoscale; + /** * Get resource tags. * @@ -116,7 +121,7 @@ public ClusterUpdate withLocation(String location) { * * @return the sku value */ - public AzureSkuInner sku() { + public AzureSku sku() { return this.sku; } @@ -126,7 +131,7 @@ public AzureSkuInner sku() { * @param sku the sku value to set * @return the ClusterUpdate object itself. */ - public ClusterUpdate withSku(AzureSkuInner sku) { + public ClusterUpdate withSku(AzureSku sku) { this.sku = sku; return this; } @@ -141,7 +146,7 @@ public State state() { } /** - * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. * * @return the provisioningState value */ @@ -187,4 +192,24 @@ public ClusterUpdate withTrustedExternalTenants(List trus return this; } + /** + * Get intelligent auto scale definition. + * + * @return the intelligentAutoscale value + */ + public IntelligentAutoscale intelligentAutoscale() { + return this.intelligentAutoscale; + } + + /** + * Set intelligent auto scale definition. + * + * @param intelligentAutoscale the intelligentAutoscale value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withIntelligentAutoscale(IntelligentAutoscale intelligentAutoscale) { + this.intelligentAutoscale = intelligentAutoscale; + return this; + } + } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java index 317d1c1362a9..6f6621baa6f6 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java @@ -44,6 +44,27 @@ public interface Clusters extends SupportsCreating listFollowerDatabasesAsync(String resourceGroupName, String clusterName); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabasesToRemove List of follower databases to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove); + /** * Checks that the cluster name is valid and is not already in use. * @@ -70,6 +91,6 @@ public interface Clusters extends SupportsCreating listSkusAsync(); + Observable listSkusAsync(); } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java index 9aa16dfad242..85e8c559d4f4 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java @@ -17,17 +17,11 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; -import org.joda.time.Period; /** * Type representing Database. */ public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { - /** - * @return the hotCachePeriod value. - */ - Period hotCachePeriod(); - /** * @return the id value. */ @@ -43,21 +37,6 @@ public interface Database extends HasInner, Indexable, Refreshabl */ String name(); - /** - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * @return the softDeletePeriod value. - */ - Period softDeletePeriod(); - - /** - * @return the statistics value. - */ - DatabaseStatistics statistics(); - /** * @return the type value. */ @@ -92,18 +71,6 @@ interface WithCluster { WithCreate withExistingCluster(String resourceGroupName, String clusterName); } - /** - * The stage of the database definition allowing to specify HotCachePeriod. - */ - interface WithHotCachePeriod { - /** - * Specifies hotCachePeriod. - * @param hotCachePeriod The time the data that should be kept in cache for fast queries in TimeSpan - * @return the next definition stage - */ - WithCreate withHotCachePeriod(Period hotCachePeriod); - } - /** * The stage of the database definition allowing to specify Location. */ @@ -116,60 +83,24 @@ interface WithLocation { WithCreate withLocation(String location); } - /** - * The stage of the database definition allowing to specify SoftDeletePeriod. - */ - interface WithSoftDeletePeriod { - /** - * Specifies softDeletePeriod. - * @param softDeletePeriod The time the data should be kept before it stops being accessible to queries in TimeSpan - * @return the next definition stage - */ - WithCreate withSoftDeletePeriod(Period softDeletePeriod); - } - - /** - * The stage of the database definition allowing to specify Statistics. - */ - interface WithStatistics { - /** - * Specifies statistics. - * @param statistics The statistics of the database - * @return the next definition stage - */ - WithCreate withStatistics(DatabaseStatistics statistics); - } - /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, DefinitionStages.WithHotCachePeriod, DefinitionStages.WithLocation, DefinitionStages.WithSoftDeletePeriod, DefinitionStages.WithStatistics { + interface WithCreate extends Creatable, DefinitionStages.WithLocation { } } /** * The template for a Database update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithHotCachePeriod, UpdateStages.WithLocation, UpdateStages.WithSoftDeletePeriod, UpdateStages.WithStatistics { + interface Update extends Appliable, UpdateStages.WithLocation { } /** * Grouping of Database update stages. */ interface UpdateStages { - /** - * The stage of the database update allowing to specify HotCachePeriod. - */ - interface WithHotCachePeriod { - /** - * Specifies hotCachePeriod. - * @param hotCachePeriod The time the data that should be kept in cache for fast queries in TimeSpan - * @return the next update stage - */ - Update withHotCachePeriod(Period hotCachePeriod); - } - /** * The stage of the database update allowing to specify Location. */ @@ -182,29 +113,5 @@ interface WithLocation { Update withLocation(String location); } - /** - * The stage of the database update allowing to specify SoftDeletePeriod. - */ - interface WithSoftDeletePeriod { - /** - * Specifies softDeletePeriod. - * @param softDeletePeriod The time the data should be kept before it stops being accessible to queries in TimeSpan - * @return the next update stage - */ - Update withSoftDeletePeriod(Period softDeletePeriod); - } - - /** - * The stage of the database update allowing to specify Statistics. - */ - interface WithStatistics { - /** - * Specifies statistics. - * @param statistics The statistics of the database - * @return the next update stage - */ - Update withStatistics(DatabaseStatistics statistics); - } - } } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java index 61b6fd53689e..9005c84f1277 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java @@ -88,10 +88,10 @@ public interface Databases extends SupportsCreating checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name); + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName); } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseRequest.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseRequest.java new file mode 100644 index 000000000000..7d2e2f10d6bc --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseRequest.java @@ -0,0 +1,71 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing follower database request. + */ +public class FollowerDatabaseRequest { + /** + * Resource id of the cluster that follows a database owned by this + * cluster. + */ + @JsonProperty(value = "clusterResourceId", required = true) + private String clusterResourceId; + + /** + * The database name owned by this cluster that was followed. * in case + * following all databases. + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /** + * Get resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set resource id of the cluster that follows a database owned by this cluster. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the FollowerDatabaseRequest object itself. + */ + public FollowerDatabaseRequest withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the database name owned by this cluster that was followed. * in case following all databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the database name owned by this cluster that was followed. * in case following all databases. + * + * @param databaseName the databaseName value to set + * @return the FollowerDatabaseRequest object itself. + */ + public FollowerDatabaseRequest withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseResult.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseResult.java new file mode 100644 index 000000000000..8abe2d8c41fd --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/FollowerDatabaseResult.java @@ -0,0 +1,31 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.FollowerDatabaseResultInner; +import java.util.List; + +/** + * Type representing FollowerDatabaseResult. + */ +public interface FollowerDatabaseResult extends HasInner, HasManager { + /** + * @return the clusterResourceId value. + */ + List clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/IntelligentAutoscale.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/IntelligentAutoscale.java new file mode 100644 index 000000000000..c06c7f94f069 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/IntelligentAutoscale.java @@ -0,0 +1,95 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains the intelligent auto scale definition. + */ +public class IntelligentAutoscale { + /** + * The version of the template defined, for instance 1. + */ + @JsonProperty(value = "version", required = true) + private int version; + + /** + * Minimum allowed capacity. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /** + * Maximum allowed capacity. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * Get the version of the template defined, for instance 1. + * + * @return the version value + */ + public int version() { + return this.version; + } + + /** + * Set the version of the template defined, for instance 1. + * + * @param version the version value to set + * @return the IntelligentAutoscale object itself. + */ + public IntelligentAutoscale withVersion(int version) { + this.version = version; + return this; + } + + /** + * Get minimum allowed capacity. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set minimum allowed capacity. + * + * @param minimum the minimum value to set + * @return the IntelligentAutoscale object itself. + */ + public IntelligentAutoscale withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get maximum allowed capacity. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set maximum allowed capacity. + * + * @param maximum the maximum value to set + * @return the IntelligentAutoscale object itself. + */ + public IntelligentAutoscale withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Kind.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Kind.java new file mode 100644 index 000000000000..c1603196e3b9 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Kind.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Kind. + */ +public final class Kind extends ExpandableStringEnum { + /** Static value All for Kind. */ + public static final Kind ALL = fromString("All"); + + /** Static value Specific for Kind. */ + public static final Kind SPECIFIC = fromString("Specific"); + + /** + * Creates or finds a Kind from its string representation. + * @param name a name to look for + * @return the corresponding Kind + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * @return known Kind values + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java index 13f118a93fff..d308d2fdaa34 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java @@ -31,6 +31,9 @@ public final class ProvisioningState extends ExpandableStringEnum, HasManager { + /** + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SkuLocationInfoItem.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SkuLocationInfoItem.java new file mode 100644 index 000000000000..f10485efe336 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SkuLocationInfoItem.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The locations and zones info for SKU. + */ +public class SkuLocationInfoItem { + /** + * The available location of the SKU. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The available zone of the SKU. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the available location of the SKU. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the available location of the SKU. + * + * @param location the location value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the available zone of the SKU. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the available zone of the SKU. + * + * @param zones the zones value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SpecificAttachedDatabaseConfiguration.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SpecificAttachedDatabaseConfiguration.java new file mode 100644 index 000000000000..f0117681716f --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/SpecificAttachedDatabaseConfiguration.java @@ -0,0 +1,78 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AttachedDatabaseConfigurationInner; + +/** + * Class representing an attached database configuration for a specific + * attached database kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Specific") +@JsonFlatten +public class SpecificAttachedDatabaseConfiguration extends AttachedDatabaseConfigurationInner { + /** + * The name of the database which you would like to attach. + */ + @JsonProperty(value = "properties.databaseName", required = true) + private String databaseName; + + /** + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId", required = true) + private String clusterResourceId; + + /** + * Get the name of the database which you would like to attach. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the name of the database which you would like to attach. + * + * @param databaseName the databaseName value to set + * @return the SpecificAttachedDatabaseConfiguration object itself. + */ + public SpecificAttachedDatabaseConfiguration withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the resource id of the cluster where the databases you would like to attach reside. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the resource id of the cluster where the databases you would like to attach reside. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the SpecificAttachedDatabaseConfiguration object itself. + */ + public SpecificAttachedDatabaseConfiguration withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Type.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Type.java new file mode 100644 index 000000000000..ce4a671dd990 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Type.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Type. + */ +public enum Type { + /** Enum value Microsoft.Kusto/clusters/databases. */ + MICROSOFT_KUSTOCLUSTERSDATABASES("Microsoft.Kusto/clusters/databases"), + + /** Enum value Microsoft.Kusto/clusters/attachedDatabaseConfigurations. */ + MICROSOFT_KUSTOCLUSTERSATTACHED_DATABASE_CONFIGURATIONS("Microsoft.Kusto/clusters/attachedDatabaseConfigurations"); + + /** The actual serialized value for a Type instance. */ + private String value; + + Type(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Type instance. + * + * @param value the serialized value to parse. + * @return the parsed Type object, or null if unable to parse. + */ + @JsonCreator + public static Type fromString(String value) { + Type[] items = Type.values(); + for (Type item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationImpl.java new file mode 100644 index 000000000000..c496062cd50b --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationImpl.java @@ -0,0 +1,133 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; + +class AttachedDatabaseConfigurationImpl extends CreatableUpdatableImpl implements AttachedDatabaseConfiguration, AttachedDatabaseConfiguration.Definition, AttachedDatabaseConfiguration.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String attachedDatabaseConfigurationName; + + AttachedDatabaseConfigurationImpl(String name, KustoManager manager) { + super(name, new AttachedDatabaseConfigurationInner()); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = name; + // + } + + AttachedDatabaseConfigurationImpl(AttachedDatabaseConfigurationInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.attachedDatabaseConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "attachedDatabaseConfigurations"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List attachedDatabaseNames() { + return this.inner().attachedDatabaseNames(); + } + + @Override + public String clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AttachedDatabaseConfigurationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withClusterResourceId(String clusterResourceId) { + this.inner().withClusterResourceId(clusterResourceId); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withDatabaseName(String databaseName) { + this.inner().withDatabaseName(databaseName); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationInner.java new file mode 100644 index 000000000000..d06c65fd8a72 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationInner.java @@ -0,0 +1,117 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an attached database configuration. + */ +@JsonFlatten +public class AttachedDatabaseConfigurationInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The name of the database which you would like to attach, use * if you + * want to follow all current and future databases. + */ + @JsonProperty(value = "properties.databaseName", required = true) + private String databaseName; + + /** + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId", required = true) + private String clusterResourceId; + + /** + * The list of databases from the clusterResourceId which are currently + * attached to the cluster. + */ + @JsonProperty(value = "properties.attachedDatabaseNames", access = JsonProperty.Access.WRITE_ONLY) + private List attachedDatabaseNames; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the name of the database which you would like to attach, use * if you want to follow all current and future databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the name of the database which you would like to attach, use * if you want to follow all current and future databases. + * + * @param databaseName the databaseName value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the resource id of the cluster where the databases you would like to attach reside. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the resource id of the cluster where the databases you would like to attach reside. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the list of databases from the clusterResourceId which are currently attached to the cluster. + * + * @return the attachedDatabaseNames value + */ + public List attachedDatabaseNames() { + return this.attachedDatabaseNames; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsImpl.java new file mode 100644 index 000000000000..88b6e63d7aab --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfiguration; + +class AttachedDatabaseConfigurationsImpl extends WrapperImpl implements AttachedDatabaseConfigurations { + private final KustoManager manager; + + AttachedDatabaseConfigurationsImpl(KustoManager manager) { + super(manager.inner().attachedDatabaseConfigurations()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public AttachedDatabaseConfigurationImpl define(String name) { + return wrapModel(name); + } + + private AttachedDatabaseConfigurationImpl wrapModel(AttachedDatabaseConfigurationInner inner) { + return new AttachedDatabaseConfigurationImpl(inner, manager()); + } + + private AttachedDatabaseConfigurationImpl wrapModel(String name) { + return new AttachedDatabaseConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByClusterAsync(String resourceGroupName, String clusterName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AttachedDatabaseConfiguration call(AttachedDatabaseConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName) + .map(new Func1() { + @Override + public AttachedDatabaseConfiguration call(AttachedDatabaseConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toCompletable(); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsInner.java new file mode 100644 index 000000000000..8c33ab65e663 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AttachedDatabaseConfigurationsInner.java @@ -0,0 +1,625 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AttachedDatabaseConfigurations. + */ +public class AttachedDatabaseConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private AttachedDatabaseConfigurationsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of AttachedDatabaseConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AttachedDatabaseConfigurationsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(AttachedDatabaseConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AttachedDatabaseConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface AttachedDatabaseConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations") + Observable> listByCluster(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AttachedDatabaseConfigurationInner> object if successful. + */ + public List listByCluster(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable> listByClusterAsync(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner get(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner createOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().last().body(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java index 5ae0a8f54335..ab8cee538fac 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java @@ -41,12 +41,7 @@ public String resourceType() { @Override public AzureSku sku() { - AzureSkuInner inner = this.inner().sku(); - if (inner != null) { - return new AzureSkuImpl(inner, manager()); - } else { - return null; - } + return this.inner().sku(); } } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java index de7c75727853..f7fa44ad9353 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.kusto.v2019_01_21.implementation; +import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; import com.microsoft.azure.management.kusto.v2019_01_21.AzureCapacity; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,7 +26,7 @@ public class AzureResourceSkuInner { * The SKU details. */ @JsonProperty(value = "sku") - private AzureSkuInner sku; + private AzureSku sku; /** * The SKU capacity. @@ -58,7 +59,7 @@ public AzureResourceSkuInner withResourceType(String resourceType) { * * @return the sku value */ - public AzureSkuInner sku() { + public AzureSku sku() { return this.sku; } @@ -68,7 +69,7 @@ public AzureSkuInner sku() { * @param sku the sku value to set * @return the AzureResourceSkuInner object itself. */ - public AzureResourceSkuInner withSku(AzureSkuInner sku) { + public AzureResourceSkuInner withSku(AzureSku sku) { this.sku = sku; return this; } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java index 5d324029972d..97a6ecacb059 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java @@ -13,10 +13,11 @@ import rx.Observable; import com.microsoft.azure.management.kusto.v2019_01_21.ClusterUpdate; import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; import com.microsoft.azure.management.kusto.v2019_01_21.State; import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; import com.microsoft.azure.management.kusto.v2019_01_21.TrustedExternalTenant; -import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; +import com.microsoft.azure.management.kusto.v2019_01_21.IntelligentAutoscale; import rx.functions.Func1; class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { @@ -74,6 +75,11 @@ public String dataIngestionUri() { return this.inner().dataIngestionUri(); } + @Override + public IntelligentAutoscale intelligentAutoscale() { + return this.inner().intelligentAutoscale(); + } + @Override public ProvisioningState provisioningState() { return this.inner().provisioningState(); @@ -81,12 +87,7 @@ public ProvisioningState provisioningState() { @Override public AzureSku sku() { - AzureSkuInner inner = this.inner().sku(); - if (inner != null) { - return new AzureSkuImpl(inner, manager()); - } else { - return null; - } + return this.inner().sku(); } @Override @@ -105,7 +106,7 @@ public String uri() { } @Override - public ClusterImpl withSku(AzureSkuInner sku) { + public ClusterImpl withSku(AzureSku sku) { if (isInCreateMode()) { this.inner().withSku(sku); } else { @@ -114,6 +115,16 @@ public ClusterImpl withSku(AzureSkuInner sku) { return this; } + @Override + public ClusterImpl withIntelligentAutoscale(IntelligentAutoscale intelligentAutoscale) { + if (isInCreateMode()) { + this.inner().withIntelligentAutoscale(intelligentAutoscale); + } else { + this.updateParameter.withIntelligentAutoscale(intelligentAutoscale); + } + return this; + } + @Override public ClusterImpl withTrustedExternalTenants(List trustedExternalTenants) { if (isInCreateMode()) { diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java index ad0d0b14ad98..c2141d66fcdb 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java @@ -8,10 +8,12 @@ package com.microsoft.azure.management.kusto.v2019_01_21.implementation; +import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; import com.microsoft.azure.management.kusto.v2019_01_21.State; import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; import java.util.List; import com.microsoft.azure.management.kusto.v2019_01_21.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2019_01_21.IntelligentAutoscale; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -25,7 +27,7 @@ public class ClusterInner extends Resource { * The SKU of the cluster. */ @JsonProperty(value = "sku", required = true) - private AzureSkuInner sku; + private AzureSku sku; /** * The state of the resource. Possible values include: 'Creating', @@ -37,7 +39,7 @@ public class ClusterInner extends Resource { /** * The provisioned state of the resource. Possible values include: - * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; @@ -60,12 +62,18 @@ public class ClusterInner extends Resource { @JsonProperty(value = "properties.trustedExternalTenants") private List trustedExternalTenants; + /** + * Intelligent auto scale definition. + */ + @JsonProperty(value = "properties.intelligentAutoscale") + private IntelligentAutoscale intelligentAutoscale; + /** * Get the SKU of the cluster. * * @return the sku value */ - public AzureSkuInner sku() { + public AzureSku sku() { return this.sku; } @@ -75,7 +83,7 @@ public AzureSkuInner sku() { * @param sku the sku value to set * @return the ClusterInner object itself. */ - public ClusterInner withSku(AzureSkuInner sku) { + public ClusterInner withSku(AzureSku sku) { this.sku = sku; return this; } @@ -90,7 +98,7 @@ public State state() { } /** - * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. * * @return the provisioningState value */ @@ -136,4 +144,24 @@ public ClusterInner withTrustedExternalTenants(List trust return this; } + /** + * Get intelligent auto scale definition. + * + * @return the intelligentAutoscale value + */ + public IntelligentAutoscale intelligentAutoscale() { + return this.intelligentAutoscale; + } + + /** + * Set intelligent auto scale definition. + * + * @param intelligentAutoscale the intelligentAutoscale value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIntelligentAutoscale(IntelligentAutoscale intelligentAutoscale) { + this.intelligentAutoscale = intelligentAutoscale; + return this; + } + } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java index bbe052ebaf87..2c216d728129 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java @@ -23,9 +23,11 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.FollowerDatabaseResult; +import com.microsoft.azure.management.kusto.v2019_01_21.FollowerDatabaseRequest; import com.microsoft.azure.management.kusto.v2019_01_21.CheckNameResult; import com.microsoft.azure.management.kusto.v2019_01_21.AzureResourceSku; -import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; +import com.microsoft.azure.management.kusto.v2019_01_21.SkuDescription; class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { protected ClustersImpl(KustoManager manager) { @@ -141,6 +143,42 @@ public Completable startAsync(String resourceGroupName, String clusterName) { return client.startAsync(resourceGroupName, clusterName).toCompletable(); } + @Override + public Observable listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listFollowerDatabasesAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FollowerDatabaseResult call(FollowerDatabaseResultInner inner) { + return new FollowerDatabaseResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove) { + ClustersInner client = this.inner(); + return client.detachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabasesToRemove) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FollowerDatabaseResult call(FollowerDatabaseResultInner inner) { + return new FollowerDatabaseResultImpl(inner, manager()); + } + }); + } + @Override protected ClusterImpl wrapModel(ClusterInner inner) { return new ClusterImpl(inner.name(), inner, manager()); @@ -186,19 +224,19 @@ public AzureResourceSku call(AzureResourceSkuInner inner) { } @Override - public Observable listSkusAsync() { + public Observable listSkusAsync() { ClustersInner client = this.inner(); return client.listSkusAsync() - .flatMap(new Func1, Observable>() { + .flatMap(new Func1, Observable>() { @Override - public Observable call(List innerList) { + public Observable call(List innerList) { return Observable.from(innerList); } }) - .map(new Func1() { + .map(new Func1() { @Override - public AzureSku call(AzureSkuInner inner) { - return new AzureSkuImpl(inner, manager()); + public SkuDescription call(SkuDescriptionInner inner) { + return new SkuDescriptionImpl(inner, manager()); } }); } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java index c9110183d7dc..3d40855e9f4e 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.management.kusto.v2019_01_21.ClusterCheckNameRequest; import com.microsoft.azure.management.kusto.v2019_01_21.ClusterUpdate; +import com.microsoft.azure.management.kusto.v2019_01_21.FollowerDatabaseRequest; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -109,6 +110,14 @@ interface ClustersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Clusters listFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases") + Observable> listFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Clusters detachFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") + Observable> detachFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FollowerDatabaseRequest followerDatabasesToRemove, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Clusters listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters") Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1024,6 +1033,196 @@ private ServiceResponse beginStartDelegate(Response response .build(response); } + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FollowerDatabaseResultInner> object if successful. + */ + public List listFollowerDatabases(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listFollowerDatabasesAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseResultInner> object + */ + public Observable> listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseResultInner> object + */ + public Observable>> listFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listFollowerDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listFollowerDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabasesToRemove List of follower databases to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FollowerDatabaseResultInner> object if successful. + */ + public List detachFollowerDatabases(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove) { + return detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabasesToRemove).toBlocking().single().body(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabasesToRemove List of follower databases to remove. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabasesToRemove), serviceCallback); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabasesToRemove List of follower databases to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseResultInner> object + */ + public Observable> detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove) { + return detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabasesToRemove).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabasesToRemove List of follower databases to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseResultInner> object + */ + public Observable>> detachFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName, FollowerDatabaseRequest followerDatabasesToRemove) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (followerDatabasesToRemove == null) { + throw new IllegalArgumentException("Parameter followerDatabasesToRemove is required and cannot be null."); + } + Validator.validate(followerDatabasesToRemove); + return service.detachFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), followerDatabasesToRemove, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = detachFollowerDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> detachFollowerDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Lists all Kusto clusters within a resource group. * @@ -1195,9 +1394,9 @@ private ServiceResponse> listDelegate(Response listSkus() { + public List listSkus() { return listSkusWithServiceResponseAsync().toBlocking().single().body(); } @@ -1208,7 +1407,7 @@ public List listSkus() { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listSkusAsync(final ServiceCallback> serviceCallback) { + public ServiceFuture> listSkusAsync(final ServiceCallback> serviceCallback) { return ServiceFuture.fromResponse(listSkusWithServiceResponseAsync(), serviceCallback); } @@ -1216,12 +1415,12 @@ public ServiceFuture> listSkusAsync(final ServiceCallback
  • > listSkusAsync() { - return listSkusWithServiceResponseAsync().map(new Func1>, List>() { + public Observable> listSkusAsync() { + return listSkusWithServiceResponseAsync().map(new Func1>, List>() { @Override - public List call(ServiceResponse> response) { + public List call(ServiceResponse> response) { return response.body(); } }); @@ -1231,9 +1430,9 @@ public List call(ServiceResponse> response) { * Lists eligible SKUs for Kusto resource provider. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<AzureSkuInner> object + * @return the observable to the List<SkuDescriptionInner> object */ - public Observable>> listSkusWithServiceResponseAsync() { + public Observable>> listSkusWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1241,16 +1440,16 @@ public Observable>> listSkusWithServiceRespo throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listSkus(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listSkusDelegate(response); - List items = null; + ServiceResponse> result = listSkusDelegate(response); + List items = null; if (result.body() != null) { items = result.body().items(); } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1259,9 +1458,9 @@ public Observable>> call(Response> listSkusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listSkusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java index 388319df717e..fbda4d9ece9a 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java @@ -11,18 +11,12 @@ import com.microsoft.azure.management.kusto.v2019_01_21.Database; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; -import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseUpdate; -import org.joda.time.Period; -import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; -import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseStatistics; -import rx.functions.Func1; class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { private final KustoManager manager; private String resourceGroupName; private String clusterName; private String databaseName; - private DatabaseUpdate updateParameter; DatabaseImpl(String name, KustoManager manager) { super(name, new DatabaseInner()); @@ -30,7 +24,6 @@ class DatabaseImpl extends CreatableUpdatableImpl createResourceAsync() { DatabasesInner client = this.manager().inner().databases(); return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) - .map(new Func1() { - @Override - public DatabaseInner call(DatabaseInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { DatabasesInner client = this.manager().inner().databases(); - return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.updateParameter) - .map(new Func1() { - @Override - public DatabaseInner call(DatabaseInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) .map(innerToFluentMap(this)); } @@ -90,14 +68,6 @@ public boolean isInCreateMode() { return this.inner().id() == null; } - private void resetCreateUpdateParameters() { - this.updateParameter = new DatabaseUpdate(); - } - - @Override - public Period hotCachePeriod() { - return this.inner().hotCachePeriod(); - } @Override public String id() { @@ -114,21 +84,6 @@ public String name() { return this.inner().name(); } - @Override - public ProvisioningState provisioningState() { - return this.inner().provisioningState(); - } - - @Override - public Period softDeletePeriod() { - return this.inner().softDeletePeriod(); - } - - @Override - public DatabaseStatistics statistics() { - return this.inner().statistics(); - } - @Override public String type() { return this.inner().type(); @@ -141,43 +96,9 @@ public DatabaseImpl withExistingCluster(String resourceGroupName, String cluster return this; } - @Override - public DatabaseImpl withHotCachePeriod(Period hotCachePeriod) { - if (isInCreateMode()) { - this.inner().withHotCachePeriod(hotCachePeriod); - } else { - this.updateParameter.withHotCachePeriod(hotCachePeriod); - } - return this; - } - @Override public DatabaseImpl withLocation(String location) { - if (isInCreateMode()) { - this.inner().withLocation(location); - } else { - this.updateParameter.withLocation(location); - } - return this; - } - - @Override - public DatabaseImpl withSoftDeletePeriod(Period softDeletePeriod) { - if (isInCreateMode()) { - this.inner().withSoftDeletePeriod(softDeletePeriod); - } else { - this.updateParameter.withSoftDeletePeriod(softDeletePeriod); - } - return this; - } - - @Override - public DatabaseImpl withStatistics(DatabaseStatistics statistics) { - if (isInCreateMode()) { - this.inner().withStatistics(statistics); - } else { - this.updateParameter.withStatistics(statistics); - } + this.inner().withLocation(location); return this; } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java index 35401551b270..6d198827ac88 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java @@ -8,17 +8,21 @@ package com.microsoft.azure.management.kusto.v2019_01_21.implementation; -import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; -import org.joda.time.Period; -import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseStatistics; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.microsoft.azure.ProxyResource; /** * Class representing a Kusto database. */ -@JsonFlatten +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Database") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ReadWrite", value = ReadWriteDatabase.class), + @JsonSubTypes.Type(name = "ReadOnlyAttached", value = ReadOnlyAttachedDatabase.class) +}) public class DatabaseInner extends ProxyResource { /** * Resource location. @@ -26,33 +30,6 @@ public class DatabaseInner extends ProxyResource { @JsonProperty(value = "location") private String location; - /** - * The provisioned state of the resource. Possible values include: - * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * The time the data should be kept before it stops being accessible to - * queries in TimeSpan. - */ - @JsonProperty(value = "properties.softDeletePeriod") - private Period softDeletePeriod; - - /** - * The time the data that should be kept in cache for fast queries in - * TimeSpan. - */ - @JsonProperty(value = "properties.hotCachePeriod") - private Period hotCachePeriod; - - /** - * The statistics of the database. - */ - @JsonProperty(value = "properties.statistics") - private DatabaseStatistics statistics; - /** * Get resource location. * @@ -73,73 +50,4 @@ public DatabaseInner withLocation(String location) { return this; } - /** - * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. - * - * @return the provisioningState value - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the time the data should be kept before it stops being accessible to queries in TimeSpan. - * - * @return the softDeletePeriod value - */ - public Period softDeletePeriod() { - return this.softDeletePeriod; - } - - /** - * Set the time the data should be kept before it stops being accessible to queries in TimeSpan. - * - * @param softDeletePeriod the softDeletePeriod value to set - * @return the DatabaseInner object itself. - */ - public DatabaseInner withSoftDeletePeriod(Period softDeletePeriod) { - this.softDeletePeriod = softDeletePeriod; - return this; - } - - /** - * Get the time the data that should be kept in cache for fast queries in TimeSpan. - * - * @return the hotCachePeriod value - */ - public Period hotCachePeriod() { - return this.hotCachePeriod; - } - - /** - * Set the time the data that should be kept in cache for fast queries in TimeSpan. - * - * @param hotCachePeriod the hotCachePeriod value to set - * @return the DatabaseInner object itself. - */ - public DatabaseInner withHotCachePeriod(Period hotCachePeriod) { - this.hotCachePeriod = hotCachePeriod; - return this; - } - - /** - * Get the statistics of the database. - * - * @return the statistics value - */ - public DatabaseStatistics statistics() { - return this.statistics; - } - - /** - * Set the statistics of the database. - * - * @param statistics the statistics value to set - * @return the DatabaseInner object itself. - */ - public DatabaseInner withStatistics(DatabaseStatistics statistics) { - this.statistics = statistics; - return this; - } - } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java index cd2541744604..80cde55ba3f6 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalListResult; import com.microsoft.azure.management.kusto.v2019_01_21.Database; import com.microsoft.azure.management.kusto.v2019_01_21.CheckNameResult; +import com.microsoft.azure.management.kusto.v2019_01_21.CheckNameRequest; class DatabasesImpl extends WrapperImpl implements Databases { private final KustoManager manager; @@ -124,9 +125,9 @@ public Completable deleteAsync(String resourceGroupName, String clusterName, Str } @Override - public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { DatabasesInner client = this.inner(); - return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, name) + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName) .map(new Func1() { @Override public CheckNameResult call(CheckNameResultInner inner) { diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java index 88ecf9e860d9..65e3f191ed8a 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java @@ -11,9 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; -import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseCheckNameRequest; +import com.microsoft.azure.management.kusto.v2019_01_21.CheckNameRequest; import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalListRequest; -import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseUpdate; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -63,7 +62,7 @@ public DatabasesInner(Retrofit retrofit, KustoManagementClientImpl client) { interface DatabasesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Databases checkNameAvailability" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability") - Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseCheckNameRequest databaseName, @Header("User-Agent") String userAgent); + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body CheckNameRequest resourceName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Databases listByCluster" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases") @@ -83,11 +82,11 @@ interface DatabasesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Databases update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Databases beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") - Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.Databases delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", method = "DELETE", hasBody = true) @@ -116,14 +115,14 @@ interface DatabasesService { * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. - * @param name Database name. + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CheckNameResultInner object if successful. */ - public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String name) { - return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).toBlocking().single().body(); + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).toBlocking().single().body(); } /** @@ -131,13 +130,13 @@ public CheckNameResultInner checkNameAvailability(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. - * @param name Database name. + * @param resourceName The name of the resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name), serviceCallback); + public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName), serviceCallback); } /** @@ -145,12 +144,12 @@ public ServiceFuture checkNameAvailabilityAsync(String res * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. - * @param name Database name. + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CheckNameResultInner object */ - public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { - return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).map(new Func1, CheckNameResultInner>() { + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).map(new Func1, CheckNameResultInner>() { @Override public CheckNameResultInner call(ServiceResponse response) { return response.body(); @@ -163,11 +162,11 @@ public CheckNameResultInner call(ServiceResponse response) * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. - * @param name Database name. + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CheckNameResultInner object */ - public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String name) { + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -180,12 +179,11 @@ public Observable> checkNameAvailabilityWi if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); } - DatabaseCheckNameRequest databaseName = new DatabaseCheckNameRequest(); - databaseName.withName(name); - return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databaseName, this.client.userAgent()) + Validator.validate(resourceName); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), resourceName, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -589,7 +587,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); } @@ -618,7 +616,7 @@ public ServiceFuture updateAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override public DatabaseInner call(ServiceResponse response) { @@ -637,7 +635,7 @@ public DatabaseInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -673,7 +671,7 @@ public Observable> updateWithServiceResponseAsync * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseInner object if successful. */ - public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { + public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); } @@ -688,7 +686,7 @@ public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); } @@ -702,7 +700,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override public DatabaseInner call(ServiceResponse response) { @@ -721,7 +719,7 @@ public DatabaseInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultImpl.java new file mode 100644 index 000000000000..426070891c0a --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultImpl.java @@ -0,0 +1,37 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.FollowerDatabaseResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class FollowerDatabaseResultImpl extends WrapperImpl implements FollowerDatabaseResult { + private final KustoManager manager; + FollowerDatabaseResultImpl(FollowerDatabaseResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultInner.java new file mode 100644 index 000000000000..a5916eb50467 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/FollowerDatabaseResultInner.java @@ -0,0 +1,72 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing database principal entity. + */ +public class FollowerDatabaseResultInner { + /** + * List of resource ids of clusters that are following the database owned + * by this cluster. + */ + @JsonProperty(value = "clusterResourceId") + private List clusterResourceId; + + /** + * The database name owned by this cluster that was followed. * in case + * following all databases. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Get list of resource ids of clusters that are following the database owned by this cluster. + * + * @return the clusterResourceId value + */ + public List clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set list of resource ids of clusters that are following the database owned by this cluster. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the FollowerDatabaseResultInner object itself. + */ + public FollowerDatabaseResultInner withClusterResourceId(List clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the database name owned by this cluster that was followed. * in case following all databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the database name owned by this cluster that was followed. * in case following all databases. + * + * @param databaseName the databaseName value to set + * @return the FollowerDatabaseResultInner object itself. + */ + public FollowerDatabaseResultInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java index 0b06b0773d99..82169f2c22a8 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java @@ -158,6 +158,19 @@ public DatabasesInner databases() { return this.databases; } + /** + * The AttachedDatabaseConfigurationsInner object to access its operations. + */ + private AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsInner object to access its operations. + * @return the AttachedDatabaseConfigurationsInner object. + */ + public AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + /** * The DataConnectionsInner object to access its operations. */ @@ -221,6 +234,7 @@ protected void initialize() { this.generateClientRequestId = true; this.clusters = new ClustersInner(restClient().retrofit(), this); this.databases = new DatabasesInner(restClient().retrofit(), this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsInner(restClient().retrofit(), this); this.dataConnections = new DataConnectionsInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java index 3b738182ef98..162246b89a4f 100644 --- a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java @@ -18,6 +18,7 @@ import com.microsoft.rest.RestClient; import com.microsoft.azure.management.kusto.v2019_01_21.Clusters; import com.microsoft.azure.management.kusto.v2019_01_21.Databases; +import com.microsoft.azure.management.kusto.v2019_01_21.AttachedDatabaseConfigurations; import com.microsoft.azure.management.kusto.v2019_01_21.DataConnections; import com.microsoft.azure.management.kusto.v2019_01_21.Operations; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; @@ -29,6 +30,7 @@ public final class KustoManager extends ManagerCore { private Clusters clusters; private Databases databases; + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; private DataConnections dataConnections; private Operations operations; /** @@ -98,6 +100,16 @@ public Databases databases() { return this.databases; } + /** + * @return Entry point to manage AttachedDatabaseConfigurations. + */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsImpl(this); + } + return this.attachedDatabaseConfigurations; + } + /** * @return Entry point to manage DataConnections. */ diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionImpl.java new file mode 100644 index 000000000000..02925fd88d5a --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionImpl.java @@ -0,0 +1,58 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.SkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.SkuLocationInfoItem; + +class SkuDescriptionImpl extends WrapperImpl implements SkuDescription { + private final KustoManager manager; + SkuDescriptionImpl(SkuDescriptionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List locationInfo() { + return this.inner().locationInfo(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionInner.java new file mode 100644 index 000000000000..d1618603d07b --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/SkuDescriptionInner.java @@ -0,0 +1,109 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Kusto SKU description of given resource type. + */ +public class SkuDescriptionInner { + /** + * The resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of the SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The tier of the SKU. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * Locations and zones. + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /** + * The restrictions because of which SKU cannot be used. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resource type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get locations and zones. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions because of which SKU cannot be used. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +}