Endpoints for System Metrics

You can use the Lucidum API to query Lucidum about:

  • the number of assets and the number of users

  • the current license and its expiration date

  • all active Connectors

  • data ingestion jobs

  • Action jobs

The following sections describe the endpoints for these actions.

Headers #

Requests to the endpoints in the Lucidum API v2 must also include a header with:

Query the Lucidum Database about Metrics: /CMDB/v2/system/metrics/data #

This endpoint allows you to query Lucidum for metrics about users and assets, specifically:

  • number of assets

  • number of users

  • 30-day average number of assets

  • 30-day average number of users

Endpoint

Method

/CMDB/v2/system/metrics/data

GET

/CMDB/v2/system/metrics/data?date=yyyy-mm-dd

To query for a specific date, you can append the date string to the URL

GET

Example cURL Query #

curl --location 'https://Company.Lucidum.cloud/CMDB/v2/system/metrics/data?date=2023-07-01' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer quoVnYQeDNicAOywkOKq'
  • Line 1. The cURL call. The method defaults to GET. The URL is host name plus the endpoint for the metrics API. We included the string “date=2023-07-01”.

  • Line 2. The header specifies to return results in JSON.

  • Line 3. The header specifies to use a Bearer Token for authentication and provides the bearer token.

Example Response #

{
    "assetCount": 5488,
    "userCount": 292,
    "date": "2023-07-01",
    "avg30DaysAssetCount": 5118,
    "avg30DaysUserCount": 292
}

Query the Lucidum Database about Licensing: /CMDB/v2/system/metrics/license #

This endpoint allows you to query Lucidum for licensing information.

Endpoint

Method

/CMDB/v2/system/metrics/license

GET

Example cURL Query #

curl --location 'https://Company.Lucidum.cloud/CMDB/v2/system/metrics/license
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer quoVnYQeDNicAOywkOKq'
  • Line 1. The cURL call. The method defaults to GET. The URL is host name plus the endpoint for the license API.

  • Line 2. The header specifies to return results in JSON.

  • Line 3. The header specifies to use a Bearer Token for authentication and provides the bearer token.

Example Response #

{
"licenseType": "FULL",
"expireDate": "2023-12-31",
"customerName": "dogfood"
}

Query the Lucidum Database about Connector Data: /CMDB/v2/system/metrics/connector #

This endpoint allows you to query Lucidum and get a list of each connector used by Lucidum and the data retrieved by each connector.

Endpoint

Method

/CMDB/v2/system/metrics/connector

GET

/CMDB/v2/system/metrics/connector?sort=display_name%2Cdesc

To sort the results by one of the fields, you can append the sort string to the URL. In this example, we sort by the field “display_name” and sort in descending order (z – a)

GET

Example cURL Query #

curl --location 'https://Company.Lucidum.cloud/CMDB/v2/system/metrics/connector?sort=display_name%2Cdesc
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer quoVnYQeDNicAOywkOKq'
  • Line 1. The cURL call. The method defaults to GET. The URL is host name plus the endpoint for the connector API.

  • Line 2. The header specifies to return results in JSON.

  • Line 3. The header specifies to use a Bearer Token for authentication and provides the bearer token.

Example Response #

Because the response is thousands of lines long, this example response includes only the first entry:

{
    "content": [
        {
            "_utc": "2023-08-08T01:06:14.488+00:00",
            "bridge_name": "rumble_user",
            "display_name": "runZero User",
            "profile": {
                "mongo_id": {
                    "timestamp": 1658260353,
                    "date": "2022-07-19T19:52:33.000+00:00"
                },
                "profile_name": "Default profile",
                "display_name": "runZero User",
                "error_msg": "HTTPError:401 Client Error: Unauthorized for url: https://console.rumble.run/api/v1.0/account/users"
            },
            "platform": "api",
            "_time": 1691456774,
            "version": "1.0.0",
            "status": "Error",
            "source_settings": "{\"platform\": \"api\", \"type\": \"user_info\", \"technology\": \"rumble_user\", \"display_name\": \"runZero User\", \"output\": \"mysql\"}",
            "start_time": 1691456774,
            "end_time": 1691456774,
            "duration_minutes": 0.0,
            "input_records": 0,
            "output_records": 0,
            "expected_input_fields": [
                "displayName",
                "Owner_Email",
                "Source_User_Name",
                "Is_Admin",
                "Role_Name",
                "First_Discovered_Datetime",
                "Last_Discovered_Datetime"
            ],
            "raw_data_fields": [
                "join('', [first_name, ' ', last_name])",
                "email",
                "email",
                "client_admin",
                "org_default_role",
                "created_at",
                "last_login_at"
            ],
            "actual_input_fields": [],
            "output_fields": [],
            "event_messages": [
                {
                    "ERROR": "2023-08-08 01:06:14.462 | ERROR    | loguru._logger:exception:1992 - run-adhoc error: HTTPError:401 Client Error: Unauthorized for url: https://console.rumble.run/api/v1.0/account/users\nTraceback (most recent call last):\n\n> File \"lucidum_api.py\", line 113, in lucidum_api.run_adhoc._ingest_data\n    data_frame = pd.DataFrame(technology_service.get_data(source_config))\n                 │  └ <class 'pandas.core.frame.DataFrame'>\n                 └ <module 'pandas' from '/usr/local/lib/python3.9/site-packages/pandas/__init__.py'>\n\n  File \"/usr/local/lib/python3.9/site-packages/pandas/core/frame.py\", line 502, in __init__\n    data = list(data)\n                └ <generator object at 0x7efc48228180>\n\n  File \"rumble_user.py\", line 22, in get_data\n\n  File \"data_base.py\", line 74, in tmp.app.data.data_base.DataBase.do_request\n\n  File \"/usr/local/lib/python3.9/site-packages/requests/models.py\", line 1021, in raise_for_status\n    raise HTTPError(http_error_msg, response=self)\n          │         │                        └ <Response [401]>\n          │         └ '401 Client Error: Unauthorized for url: https://console.rumble.run/api/v1.0/account/users'\n          └ <class 'requests.exceptions.HTTPError'>\n\nrequests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://console.rumble.run/api/v1.0/account/users\n"
                }
            ],
            "data_qa_info": []
        },

Query the Lucidum Database about Ingestion Jobs: /CMDB/v2/system/metrics/data-ingestion #

This endpoint allows you to query Lucidum for a list of data ingestion job. The response lists each job, its start time, end time, and status.

Endpoint

Method

/CMDB/v2/system/metrics/data-ingestion

GET

Example cURL Query #

curl --location 'https://Company.Lucidum.cloud/CMDB/v2/system/metrics/data-ingestion
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer quoVnYQeDNicAOywkOKq'
  • Line 1. The cURL call. The method defaults to GET. The URL is host name plus the endpoint for the data ingestion API.

  • Line 2. The header specifies to return results in JSON.