Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jonasheisterkam
Partner - Creator III
Partner - Creator III

How to restart one QVS-cluster-node with QMSAPI

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.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

Labels (1)
1 Reply
jonasheisterkam
Partner - Creator III
Partner - Creator III
Author

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 = MyQVS.ID;

            }

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

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

            {

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

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

                MSD = QVSStatus.MemberStatusDetails;

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

                {

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

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

                    Message = MSD.Message;

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

                    {

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

                    }

                }

            }

        }