public static void ValidateSpecConversion(ClusterCreateParameters createParams) { //Convert spec. ClusterCreateParametersExtended extendedParams = CreateParametersConverter.GetExtendedClusterCreateParameters("testCluster", createParams); //Validate properties. Assert.Equal(createParams.Tags, extendedParams.Tags); Assert.Equal(createParams.Location, extendedParams.Location); Assert.Equal(createParams.ClusterType, extendedParams.Properties.ClusterDefinition.Kind); Assert.Equal(createParams.ComponentVersion, extendedParams.Properties.ClusterDefinition.ComponentVersion); Assert.Equal(createParams.ClusterTier, extendedParams.Properties.Tier); Assert.Equal(createParams.Version, extendedParams.Properties.ClusterVersion); Assert.Equal(OSType.Linux, extendedParams.Properties.OsType); Assert.Equal(createParams.SecurityProfile, extendedParams.Properties.SecurityProfile); ValidateStorageProfile(createParams.DefaultStorageInfo, extendedParams.Properties.StorageProfile); //Validate configurations. Dictionary <string, Dictionary <string, string> > configurations = extendedParams.Properties.ClusterDefinition.Configurations as Dictionary <string, Dictionary <string, string> >; Assert.NotNull(configurations); ValidateStorageConfigurations(configurations, createParams.DefaultStorageInfo, createParams.AdditionalStorageAccounts); ValidateClusterCredentialConfigurations(configurations); ValidateAdlConfigurations(configurations, createParams.Principal); ValidateHiveMetastoreConfigurations(configurations, createParams.HiveMetastore); ValidateOozieMetastoreConfigurations(configurations, createParams.OozieMetastore); //Validate roles. ValidateRoles(extendedParams.Properties.ComputeProfile.Roles, createParams); }
public virtual Cluster CreateNewCluster(string resourceGroupName, string clusterName, OSType osType, ClusterCreateParameters parameters) { var createParams = CreateParametersConverter.GetExtendedClusterCreateParameters(clusterName, parameters); createParams.Properties.OsType = osType; return(HdInsightManagementClient.Clusters.Create(resourceGroupName, clusterName, createParams)); }
public virtual Cluster CreateNewCluster(string resourceGroupName, string clusterName, OSType osType, ClusterCreateParameters parameters, string minSupportedTlsVersion = default(string), string cloudAadAuthority = default(string), string cloudDataLakeAudience = default(string), string PublicNetworkAccessType = default(string), string OutboundOnlyNetworkAccessType = default(string), bool?EnableEncryptionInTransit = default(bool?)) { var createParams = CreateParametersConverter.GetExtendedClusterCreateParameters(clusterName, parameters); createParams.Properties.OsType = osType; createParams.Properties.MinSupportedTlsVersion = minSupportedTlsVersion; ResetClusterIdentity(createParams, cloudAadAuthority, cloudDataLakeAudience); if (EnableEncryptionInTransit.HasValue) { createParams.Properties.EncryptionInTransitProperties = new EncryptionInTransitProperties() { IsEncryptionInTransitEnabled = EnableEncryptionInTransit }; } if (!string.IsNullOrEmpty(PublicNetworkAccessType) || !string.IsNullOrEmpty(OutboundOnlyNetworkAccessType)) { NetworkSettings networkSettings = new NetworkSettings() { PublicNetworkAccess = PublicNetworkAccessType, OutboundOnlyPublicNetworkAccessType = OutboundOnlyNetworkAccessType }; createParams.Properties.NetworkSettings = networkSettings; } return(HdInsightManagementClient.Clusters.Create(resourceGroupName, clusterName, createParams)); }
public virtual Cluster CreateNewCluster(string resourceGroupName, string clusterName, OSType osType, ClusterCreateParameters parameters, string minSupportedTlsVersion = default(string), string cloudAadAuthority = default(string), string cloudDataLakeAudience = default(string)) { var createParams = CreateParametersConverter.GetExtendedClusterCreateParameters(clusterName, parameters); createParams.Properties.OsType = osType; createParams.Properties.MinSupportedTlsVersion = minSupportedTlsVersion; ResetClusterIdentity(createParams, cloudAadAuthority, cloudDataLakeAudience); return(HdInsightManagementClient.Clusters.Create(resourceGroupName, clusterName, createParams)); }
public void CanConvertHadoopClusterWithCustomMetastoresToMarchSpecWithConfigurations() { ClusterCreateParameters createParams = GetClusterCreateParamsWithMinRequiredValues(); createParams.HiveMetastore = new Metastore("server.database.windows.net", "hiveDb", "username", "password"); createParams.OozieMetastore = new Metastore("server.database.windows.net", "oozieDb", "username", "password"); Dictionary <string, string> testConfig = new Dictionary <string, string> { { "key", "value" } }; createParams.Configurations.Add(ConfigurationKey.HiveSite, testConfig); createParams.Configurations.Add(ConfigurationKey.HiveEnv, testConfig); createParams.Configurations.Add(ConfigurationKey.OozieEnv, testConfig); createParams.Configurations.Add(ConfigurationKey.OozieSite, testConfig); ClusterCreateParametersExtended extendedParams = CreateParametersConverter.GetExtendedClusterCreateParameters("testCluster", createParams); Dictionary <string, Dictionary <string, string> > configurations = extendedParams.Properties.ClusterDefinition.Configurations as Dictionary <string, Dictionary <string, string> >; Assert.True(configurations.ContainsKey(ConfigurationKey.HiveSite)); Dictionary <string, string> hiveSiteConfig = configurations[ConfigurationKey.HiveSite]; Assert.Equal(5, hiveSiteConfig.Count); }
public static void ValidateCluster(ClusterCreateParameters parameters, Cluster cluster, string clustername) { ClusterCreateParametersExtended extendedParams = CreateParametersConverter.GetExtendedClusterCreateParameters(clustername, parameters); ValidateCluster(extendedParams, cluster, clustername); }
public void ConvertParametersWithMissingNoProvidedPropertiesShouldNotThrow() { ClusterCreateParameters createParams = new ClusterCreateParameters(); ClusterCreateParametersExtended extendedParams = CreateParametersConverter.GetExtendedClusterCreateParameters("testCluster", createParams); }