예제 #1
0
        //[Fact]
        public void TestCustomCreateEnableDisableConnectivity()
        {
            var handler = new RecordedDelegatingHandler {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            using (var context = UndoContext.Current)
            {
                context.Start();

                var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
                var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);
                var resourceGroup            = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);

                var          cluster = GetClusterSpecHelpers.GetCustomCreateParametersPaas();
                const string dnsname = "hdisdk-testcluster1";

                var createresponse = client.Clusters.Create(resourceGroup, dnsname, cluster);
                Assert.Equal(dnsname, createresponse.Cluster.Name);

                var getresponse = client.Clusters.Get(resourceGroup, dnsname);

                client.Clusters.DisableHttp(resourceGroup, dnsname);
                getresponse = client.Clusters.Get(resourceGroup, dnsname);

                client.Clusters.EnableHttp(resourceGroup, dnsname, "hadoopuser", "Akasja2!1a");
                getresponse = client.Clusters.Get(resourceGroup, dnsname);

                var result = client.Clusters.Delete(resourceGroup, dnsname);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);
                Assert.Equal(result.State, AsyncOperationState.Succeeded);
            }
        }
예제 #2
0
        /// <summary>
        /// ClusterCreateParameters used for DataLake additional FS
        /// </summary>
        /// <returns></returns>
        private ClusterCreateParameters GetDataLakeClusterParameters()
        {
            var clusterCreateParams = GetClusterSpecHelpers.GetCustomCreateParametersPaas();

            clusterCreateParams.Principal = new ServicePrincipal(new Guid(ApplicationId), new Guid(AadTenantId),
                                                                 CertificateFileBytes, CertificatePassword);
            return(clusterCreateParams);
        }