Skip to content

Condensed Data

This is a demonstration how to read the Condensed Data programmatically via API.

First we obtain the template and data from the status_info_data_get and status_info_schema_get RPCs method.

👉 All calls to the status_info_data_get always return a result array for each submitted filter. Each result array contains the individual data arrays.

Example

import json
import requests
import sys

target = "https://ripex2a.racom.eu/cgi-bin/"
token = "<auth_token_string>"

for method in ['status_info_data_get', 'status_info_schema_get']:
    res = requests.post(
        f"{target}/rpc.cgi",
        data=json.dumps({
            'method': method,
            'params': {
                'filter': {
                    'types': ['hash_filesystem'] } } }),
        headers={
            'Content-Type': 'application/json',
            'apikey': token})

    if res.status_code != 200:
        print('Error: HTTP status code:', res.status_code)
        sys.exit(42) #error

    print(f'"{method}" RPC response:')
    print(json.dumps(res.json(), indent=2))
    print('')

This should show the result JSON data:

status_info_data_get RPC response:
{
  "result": {
    "hash_filesystem": [
      [
        "32c73f0ce9d6b437cb666fb72d431c671b3bb124bb97d5eee8ca739b49eb08fa"
      ]
    ]
  },
  "device": {
    "tstamp": 1741858385
  }
}

status_info_schema_get RPC response:
{
  "result": {
    "hash_filesystem": {
      "hash": ".0"
    }
  }
}

Now we can use the algorithm to the Condensed Data reconstruction algorithm:

  1. We can see that the response from status_info_schema_get states that data cdid for the hash attribute of hash_filesystem is ".0". This indicates that the value is the first element of the data array.
  2. The response from status_info_data_get shows that for the hash_filesystem filter we received a result array containing one data array.
  3. Now for each data array we can extract the value pointed to by the cdid of the parameter hash.

    The result JSON of this status call is thus:

    [
        { "hash": "32c73f0ce9d6b437cb666fb72d431c671b3bb124bb97d5eee8ca739b49eb08fa" }
    ]