Skip to Content

List the Services belonging to a BO Server

Hi

I want to list the Services belonging to a BO Server, the same list that we can see from the "Edit common services" in the CMC.

For example, the services belonging to node.Anaysis server are:
BEx Web Applications Service
Multi Dimensional Analysis Service
TraceLog Service

I hace the SELECT to list the servers, but I need also the list of Services hosted by every Server:

SELECT SI_NAME, SI_KIND, SI_SERVER_IS_ALIVE, SI_DISABLED, SI_SERVER_KIND, SI_FRIENDLY_NAME, SI_EXPECTED_RUN_STATE FROM CI_SYSTEMOBJECTS WHERE SI_KIND= 'SERVER'

I am using the Java SDK and the Query builder.

thanks in advance.

Eusebio Martinez

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Nov 29, 2017 at 02:35 PM

    The following example retrieves the description for each service in the CMS.

    String getServices(IEnterpriseSession enterpriseSession) throws SDKException
    {
      IInfoStore infostore = (IInfoStore)enterpriseSession.getService("InfoStore");    
      String servicesQuery = "SELECT SI_ID, SI_NAME, SI_CUID, SI_ML_DESCRIPTION FROM CI_SYSTEMOBJECTS WHERE SI_KIND='Service' AND SI_PARENT_FOLDER=52";
      IInfoObjects services = (IInfoObjects) infostore.query(servicesQuery);
    
      String resultString = "";
      Iterator it = services.iterator();
      while (it.hasNext())
      {
        IService service = (IService) it.next();
        resultString += "<b>Service Description:</b> " + service.getDescription(Locale.ENGLISH) + " - ";
        resultString += "<b>CUID: </b>" + service.getCUID() + "<br>";
      }
      return resultString;
    }
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2017 at 02:30 PM

    This Method will get all list of servers and Loop the list to get Matrix of each server to append all matrix to html.

    Please copy the returned data to .html file and open it.

    String getServersServices(IEnterpriseSession enterpriseSession) throws SDKException
    
    	{
    
    	  IInfoStore infostore = (IInfoStore)enterpriseSession.getService("InfoStore");
    
    	  String serverQuery = "SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='SERVER'";
    
    	  IInfoObjects servers = (IInfoObjects) infostore.query(serverQuery);
    
    	  Iterator it = servers.iterator();
    
    	  String AllServices = "<html><body>";
    
    	  while (it.hasNext())
    
    	  {
    
    		  IServer server = (IServer) it.next();
    
    		  int serverID = server.getID();
    
    		  AllServices += getServerMetrics(enterpriseSession, serverID);
    
    		  // for services use getServices(enterpriseSession);
    
    	  }
    
    	  AllServices += "</body></html>";
    
    	  return AllServices;
    
    	}
    
    }
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2017 at 02:33 PM

    To get the server matrix for specific Server:

    String getServerMetrics(IEnterpriseSession enterpriseSession, int serverID) throws SDKException
    {
    	  IInfoStore infostore = (IInfoStore)enterpriseSession.getService("InfoStore");
    
    	  String serverQuery = "SELECT SI_METRICS FROM CI_SYSTEMOBJECTS WHERE SI_ID=" + serverID;
    
    	  IServer server = (IServer) infostore.query(serverQuery).get(0);
    
    	    	
    
    	  String metricDescriptionsQuery = "SELECT SI_ID, SI_METRIC_DESCRIPTIONS FROM CI_SYSTEMOBJECTS WHERE SI_KIND='MetricDescriptions'";
    
    	  IMetricDescriptions metricDescriptions = (IMetricDescriptions) infostore.query(metricDescriptionsQuery).get(0);
    
    
    
    
    	  IServerMetrics serverMetrics = server.getMetrics();
    
    
    
    
    	  Set serviceNames = serverMetrics.getServiceInterfaceNames();
    
    	  Iterator serviceNamesIter = serviceNames.iterator();
    
    	  String resultString = "";
    
    
    
    
    	  while(serviceNamesIter.hasNext()) 
    
    	  {
    
    	    String serviceName = (String) serviceNamesIter.next();
    
    	    IMetrics serviceMetrics = serverMetrics.getMetrics(serviceName);
    
    
    
    
    	    resultString += "<div class=\"bordered\"><h5>" + serviceName + " metrics</h5>\n<table>"
    
    	      + "<tr><th align=\"left\">Name</th><th align=\"left\">Value</th></tr>\n";
    
    	    Iterator serviceMetricsIter = serviceMetrics.iterator();
    
    	    
    
    	    while(serviceMetricsIter.hasNext()) 
    
    	    {
    
    	      IMetric metric = (IMetric) serviceMetricsIter.next();
    
    	      String metricName = metric.getName();
    
    	      IMLDescriptions descriptions = metricDescriptions.getMetricDescriptions(serviceName);
    
    	      IPropertyRenderTemplate propertyRenderTemplate = descriptions.getPropertyRenderTemplate(metricName);
    
    	      String localizedMetricName = propertyRenderTemplate.getLabel(Locale.ENGLISH);
    
    
    
    
    	      resultString += "<tr><td valign=\"top\">" + localizedMetricName + "</td><td valign=\"top\">"
    
    	        + metric.getValue() + "</td></tr>\n";
    
    	    }
    
    	    resultString += "</table></div>";
    
    	  }
    
    	  return resultString;
    
    	}  
    
    
    Add comment
    10|10000 characters needed characters exceeded

  • Jun 02 at 12:25 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2017 at 04:50 PM

    Hi,

    You need to query your BO server getting all the properties.Cast the IInfoObject as a IServer.

    Then iterate on the list of hosted services returned by the method getHostedServices() of the IServer object.

    You can also use dedicated SAP BO administration addons that will make like this.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 27, 2017 at 10:19 PM

    Did you find a solution on how to do this in Query Builder?

    Add comment
    10|10000 characters needed characters exceeded