SAP Cloud ALM Configuration and Security Analytics
SAP Cloud ALM OData Analytics API for Configuration and Security Analysis is documented in the SAP Business Accelerator Hub and in the official SAP Help documentation.
This API provides access to analytics data of Configuration and Security Analysis use case of SAP Cloud ALM. It exposes the same data than the generic Analytics OData API (DataSet) and the REST Analytics API.
The API support several use cases:
(*) The API provides access to the full contents of a configuration store for a single store only.
In the following we'll show how this analytics OData API can be used with SAP Analytics Cloud by building step by step a simple story.
We take as example a system of type "SAP NetWeaver AS for ABAP" with id EE1.
|
In order to get the data in SAP Analytics Cloud we need a simple query which selects only the serviceId:
https://{{CALM_URL}}/api/calm-analytics/v1/odata/v4/analytics/ConfigurationItems?$filter=period eq 'C24M' and serviceId eq 'c19e8958-92fa-422b-921b-f9349f2ddfda'
With filter "serviceId eq 'c19e8958-92fa-422b-921b-f9349f2ddfda'" we select the service EE1 of type "SAP NetWeaver AS for ABAP" using its LMS-ID (Landscape Management Service Id). This id can be retrieve from the LMS application of SAP Cloud ALM but also looking at the URL parameters in CSA application (see screenshot below).
With filter "period eq 'C24M'", we select a large period of time of 24 months (including the current month since the period start with character 'C' and not 'L' for LAST). The value of the period to use depends on how far you want to go to build historical charts. If you are not interested by historical values (which are identified with dimension "ElementStatus=OLD"), you can just ignore filter "period" and add the filter "ElementStatus=CURRENT".
Remark about API parameters used by SAP Analytics Cloud
If we call the URL indicated above using an API tool (and the proper OAuth 2.0 credentials / token), we receive all dimensions and measures exposed by the CSA analytics provider:
This includes the dimensions "itemKey" and "itemValue" which are null since we don't access a single configuration store but all the configuration stores of system EE1. When the OData API is called from SAP Analytics Cloud (see after), we generally use the graphical editor to construct the query with the graphical editor. SAP Analytics Cloud adds additional parameters like "$select" which lists the fields (dimensions and measures) that should be returned by the OData API.
SAP Analytics Cloud Connection
There is nothing specific about the SAP Analytics Cloud connection you need to access the CSA OData Analytics API. You can re-use an existing SAP Cloud ALM connection for the generic OData Analytics API or create a new one if you don't have one already.
Of course you need a proper OAuth 2.0 credentials (client id, client secret) with at least the minimum required security scopes:
Data Service URL: https://calm-demo.eu10.alm.cloud.sap/api/calm-analytics/v1/odata/v4/analytics/ Token URL: https://calm-demo.authentication.eu10.hana.ondemand.com/oauth/token |
SAP Analytics Cloud Model
The SAC model can be created in few clicks with minimum effort.
To create the OData model select the connection to the SAP Cloud ALM tenant we want to access. | We select the Entity "ConfigurationItems".
|
We select all dimensions and measures except "itemKey" and "itemValue" that won't be used since we want to create a model with all the configuration stores of the service EE1.
The three measures are automatically recognized as such.
|
|
Dimensions "elementDate" and "elementDateTo" are automatically recognized as Timestamp. In this example, we change the type of those two dimensions to Date since it is more convenient to use in the story and we don't care about the time resolution.
The API returns two additional control dimensions:
SAP Analytics Cloud Story Example
Number of configuration stores
One option to count the number of configuration stores is to count the number of storeIds.
Number of configuration items
To report on the number of items per configuration store we use dimension "StoreName" and measure "NumItems". To count only the current number of items and not the historical ones, we use filter "ElementStatus=CURRENT".
Compliance
In the example below we check the configuration compliance against the security recommendations. To do so, we select only the current version of the configuration by applying the filter "ElementStatus=CURRENT". We use the measure "NumItems" to count the number of items per compliance status and the dimension "ItemSecRecStatus" to distinguish betwen configuration items COMPLIANT, NON COMPLIANT and the those which are not rated.
|
|
Change history
In this example we display the number of changes per week. To do that we use dimension "ElementDate" together with measure "NumChanges". We can easily construct this historical view since we have converted the type of dimension "ElementDate" from Timestamp to Date (see model construction above).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
22 | |
16 | |
11 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 |