GetServiceStatuses Method
Overloads
GetServiceStatuses(List<Guid>) |
Gets the status of all services which matches the provided list of service ID's. |
GetServiceStatuses(List<Guid>)
Gets the status of all services which matches the provided list of service ID's.
Declaration
List<ServiceStatus> GetServiceStatuses(List<Guid> serviceIDs)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Guid> | serviceIDs |
A list of service IDs. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<ServiceStatus> |
A list of statuses of all services with a matching ID. |
Remarks
security
Requires membership of local group QlikView Management API.
Examples
The following example starts by retrieving a list of all QDS-services and then asks for their status.
The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.
using System;
using System.Collections.Generic;
using System.Linq;
using QMSAPI;
class Program
{
static void Main(string[] args)
{
try
{
// create a QMS API client
IQMS apiClient = new QMSClient();
//retrieve a time limited service key
ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();
// get a list of QDS services
List<ServiceInfo> qdsServices = apiClient.GetServices(ServiceTypes.QlikViewDistributionService);
if (qdsServices.Count > 0)
{
//Get the service statuses of all the QDSs using their IDs
List<ServiceStatus> serviceStatuses = apiClient.GetServiceStatuses(qdsServices.Select(qdsService => qdsService.ID).ToList());
//Loop through all received statuses
foreach (ServiceStatus serviceStatus in serviceStatuses)
{
//Print the name of the service
Console.WriteLine(serviceStatus.Name);
//For all members, print the host they are executing on and their current status
serviceStatus.MemberStatusDetails.ForEach(serviceDetail => Console.WriteLine(serviceDetail.Host + ":" + serviceDetail.Status));
}
}
}
catch (Exception ex)
{
Console.WriteLine("An exception occurred: " + ex.Message);
}
// wait for user to press any key
Console.ReadLine();
}
}
See Also
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!