Esempio n. 1
0
        public void TestOMSOnRunningCluster()
        {
            string clusterName = "hdisdk-oms";
            string testName    = "TestOMSOnRunningCluster";
            string suiteName   = GetType().FullName;

            ClusterCreateParameters createParams = ClusterCreateParametersHelpers.GetCustomCreateParametersIaas(testName);

            createParams.Version     = "3.6";
            createParams.ClusterType = "Spark";

            HDInsightManagementTestUtilities.CreateClusterInNewResourceGroupAndRunTest(suiteName, testName, clusterName, createParams, (client, rgName) =>
            {
                ClusterMonitoringRequest request = new ClusterMonitoringRequest
                {
                    WorkspaceId = WorkspaceId,
                    PrimaryKey  = PrimaryKey
                };

                client.Extensions.EnableMonitoring(rgName, clusterName, request);
                ClusterMonitoringResponse monitoringStatus = client.Extensions.GetMonitoringStatus(rgName, clusterName);
                Assert.True(monitoringStatus.ClusterMonitoringEnabled);
                Assert.Equal(monitoringStatus.WorkspaceId, WorkspaceId);

                client.Extensions.DisableMonitoring(rgName, clusterName);
                monitoringStatus = client.Extensions.GetMonitoringStatus(rgName, clusterName);
                Assert.False(monitoringStatus.ClusterMonitoringEnabled);
                Assert.Null(monitoringStatus.WorkspaceId);
            });
        }
Esempio n. 2
0
 public AzureHDInsightOMS(ClusterMonitoringResponse operationResource)
 {
     ClusterMonitoringEnabled = operationResource.ClusterMonitoringEnabled;
 }
 public AzureHDInsightMonitoring(ClusterMonitoringResponse clusterMonitoringResponse)
 {
     ClusterMonitoringEnabled = clusterMonitoringResponse.ClusterMonitoringEnabled ?? false;
     WorkspaceId = clusterMonitoringResponse.WorkspaceId;
 }