1 Reply Latest reply: Dec 1, 2013 3:05 PM by Jonas Heisterkamp RSS

    How to restart one QVS-cluster-node with QMSAPI

    Jonas Heisterkamp

      Hi,

      i wrote a code to restart QVSs. But it is not able to differ between the cluster nodes, how can I implement it.

       

      QMSClient Client;

      Client = new QMSClient("BasicHttpBinding_IQMS");

      string key = Client.GetTimeLimitedServiceKey();

      ServiceKeyClientMessageInspector.ServiceKey = key;

      ServiceInfo[] MyQVS = Client.GetServices(ServiceTypes.QlikViewServer);

      for (int i = 0; i < MyQVS.Length; i++)

      {

      //If this is the one

      //{

      Client.RestartQVS(MyQVS[i].ID);

      //}

      }

       

      In other part of the code I parse the qvsstatus.aspx page to detect the QVSs I need to restart.

      Is there code to get this status from the api? I found some status functions in the object list but I'm not able to run it.

       

      Thanks

      Jonas

        • Re: How to restart one QVS-cluster-node with QMSAPI
          Jonas Heisterkamp

          For the status of each cluster i found a solution, but not for the restart.

          Status:

          Guid[] MyQVSID = new Guid[MyQVS.Length];

                      for (int i = 0; i < MyQVS.Length; i++)

                      {

                          MyQVSID[i] = MyQVS[i].ID;

                      }

                      ServiceStatus[] QVSStatus = Client.GetServiceStatuses(MyQVSID);

                      for (int i = 0; i < QVSStatus.Length; i++)

                      {

                          Console.WriteLine("Service Status:" + QVSStatus[i].ID + " " + QVSStatus[i].Name + " " + QVSStatus[i].Url.DnsSafeHost.ToString() + " " + QVSStatus[i].ServiceComposition.ToString());

                          ServiceStatusDetail[] MSD = new ServiceStatusDetail[QVSStatus[i].MemberStatusDetails.Length];

                          MSD = QVSStatus[i].MemberStatusDetails;

                          for (int j = 0; j < MSD.Length; j++)

                          {

                              Console.WriteLine("Service Status Detail:" + MSD[j].ID + " " + MSD[j].Host+ " " +MSD[j].Status.ToString());

                              string[] Message = new string[MSD[j].Message.Length];

                              Message = MSD[j].Message;

                              for (int k = 0; k < Message.Length; k++)

                              {

                                  Console.WriteLine("Service Status Detail Message:" +  Message[k]);

                              }

                          }

                      }

           

                  }