Get the statistics for multiple services

Use the HTTP method GET to retrieve the statistics of all services that are defined for a specific service provider by using the /zosConnect/operations/getStatistics URI and the provider query parameter.

Statistics include IBM® z/OS® Connect data for a service such as InvokeRequestCount, and a TimeOfRegistrationWithZosConnect, along with any other statistics returned by the service provider by using the getStatistics() SPI implementation in the provider. Statistics for a particular service can be retrieved through a /zosConnect/operations or an action=request call. /zosConnect/operations requests offer more flexibility because the product can retrieve statistics for all services. If the authorization interceptor is enabled, the product returns statistics for only those services that the user can request. For more information about user authorization, see Overview of IBM z/OS Connect security.

Note: Statistics are only available for IBM z/OS Connect services and not all IBM z/OS Connect service providers provide statistics. For example the CICS® service provider and REST client service provider do not provide statistics.
HTTP method
GET
URI
/zosConnect/operations/getStatistics?provider=<service provider>
Description
Gets the statistics for all services of the specified service provider.
Security
Users with Admin or Operations authority can get the statistics, users with Invoke or Reader authority cannot. For more information about user authorization, see Overview of IBM z/OS Connect security.
Note: A user must be a member of a global group to be able to see a list of services. If individual services have also configured the authorization interceptor explicitly with the interceptorsRef attribute of the service or zosConnectService element, and defined service scope groups, then the list of installed services returned will be restricted to those for which the authenticated user ID is a member of both a global and a service scope Admin or Operations group
Sample call
https://myhost:myport/zosConnect/operations/getStatistics?provider=imsmobile-2.0
Sample response body
{
  "recordOpsCreate": 
  {
    "ServiceProvider": "imsmobile-2.0",
    "InvokeRequestCount": "100",
    "TimeOfRegistrationWithZosConnect": "<yyyy-mm-dd hh:mm:ss:mmm tzn>",
    "ServiceStatistics": 
    {
      .. <JSON name value pairs showing statistical information about the service returned.>
    }
  }
}

Alternatively, service statistics can be obtained by using an HTTP GET request and the /zosConnect/operations/getStatistics URI:

https://host:port/zosConnect/operations/getStatistics

The following sample shows the JSON payload that is returned:

{
"zosConnectStatistics": 
  [
    {
      "recordOpsCreate": 
      {  
        "ServiceProvider": "SAMPLE-1.0",
        "InvokeRequestCount": "100",
        "TimeOfRegistrationWithZosConnect": "<yyyy-mm-dd hh:mm:ss:mmm tzn>",
        "ServiceStatistics": 
        {
      .. <JSON name value pairs showing statistical information about the service returned.>
        }
      }
    },
    {
      "recordOpsDelete": 
      {  
        "ServiceProvider": "SAMPLE-1.0",
        "InvokeRequestCount": "100",
        "TimeOfRegistrationWithZosConnect": "<yyyy-mm-dd hh:mm:ss:mmm tzn>",
        "ServiceStatistics": 
        {
      .. <JSON name value pairs showing statistical information about the service returned.>
        }
      }
    }
  ]
}

If no services are registered with IBM z/OS Connect , the output resembles the following example:

{
"zosConnectStatistics": ""
}