Skip to main content

Inventory Metric Log

RetrieveThe Inventory Metric Log API provides access to time-series metric data collected from devices in your inventory. These endpoints allow you to query and filterretrieve inventoryhistorical metricmetrics, logmeasurements, and sensor data with datetime range and device/parameterflexible filtering capabilities.options. Use these endpoints to build dashboards, generate reports, or analyze device performance over time.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Metric Log API is designed for accessing and analyzing time-series data collected from various devices in your infrastructure. This API category focuses on retrieving metric logs that contain measurements, sensor readings, and other quantitative data points captured over time.

Key Concepts:

    Metrics: Quantitative measurements collected from devices (CPU usage, temperature, bandwidth, etc.) Parameters: The specific types of measurements being tracked (variable names, display names, units) Time-series Data: All metrics are timestamped and can be filtered by date ranges Device Association: Every metric log is linked to a specific device in your inventory

    Common Use Cases:

      Building monitoring dashboards with real-time and historical data Generating performance reports for specific devices or time periods Analyzing trends and patterns in device metrics Troubleshooting issues by examining metric history Creating alerts based on metric thresholds

      The API supports flexible filtering by device, metric type, parameter names, and time ranges, making it easy to retrieve exactly the data you need for your specific use case.


      Endpoints

      GET /inventory_metric_log/

      RetrieveDescription: Retrieves a paginated list of inventory metric logs with advancedcomprehensive filtering optionsoptions. This endpoint is ideal for datetimefetching ranges,multiple metric records across different devices, time periods, and parameters.metric types. Use it to build dashboards, generate reports, or perform bulk data analysis.

      Use Cases:

        Fetch all temperature readings from a specific device over the last 24 hours Retrieve CPU metrics from multiple servers within a date range Build real-time monitoring dashboards showing current and historical data Export metric data for external analysis or reporting tools

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=server-01&metric_name=cpu_usage&datetime__gte=2024-01-15T00:00:00Z&limit=100
        

        Parameters:

        Parameter Type In Required Description
        datetime__gte string query No Filter records from this datetime (onwards. Accepts ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00)00
        datetime__lte string query No Filter records untilup to this datetimedatetime. (Accepts ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00)00
        device__name string query No Filter metrics by exact device name
        metric__name string query No Filter by the internal metric name identifier
        parameter__name string query No Filter by parameterthe parameter's display name
        parameter__short_name string query No Filter by parameterthe shortparameter's abbreviated name
        parameter__variable_name string query No Filter by parameterthe parameter's variable name used in data collection
        cursor string query No Pagination cursor for navigatingretrieving the next set of results
        limit integer query No Number of results to return per page (default paginationvaries applies)by system configuration)
        metric_name string query No Alternative parameter to filter forby metric's parameter name
        parameter_name string query No Alternative parameter to filter forby metric's parameter name

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&metric_name=memory_usage&datetime__gte=2024-01-01&device__name=sensor-0115T00:00:00Z&limit=5050" \
          -H "Authorization: Bearer <your-api-token>YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 1250,1247,
          "next": "https://control.zequenze.com/api/v1/inventory_metric_log/?cursor=eyJkYXRldGltZSI6IjIwMjQtMDEtMDIifQ"eyJpZCI6MTAwfQ%3D%3D&limit=50",
          "previous": null,
          "results": [
            {
              "id": 12345,15234,
              "datetime": "2024-01-02T10:15T14:30:00Z",
              "device": {
                "id": 42,
                "name": "sensor-web-server-01",
                "id"type": 101"server",
                "location": "datacenter-east"
              },
              "metric": {
                "id": 7,
                "name": "temperature_reading"memory_usage",
                "id"unit": 501"percentage"
              },
              "parameter": {
                "name": "Temperature"Memory Utilization",
                "short_name": "temp"MEM",
                "variable_name": "temp_celsius"memory_percent",
                "id"unit": 301"%"
              },
              "value": 23.5,67.8,
              "unit"status": "°C"normal",
              "created_at": "2024-01-02T10:15T14:30:15Z"
            },
            {
              "id": 12346,15235,
              "datetime": "2024-01-02T10:35:15T14:25:00Z",
              "device": {
                "id": 42,
                "name": "sensor-web-server-01",
                "id"type": 101"server",
                "location": "datacenter-east"
              },
              "metric": {
                "id": 7,
                "name": "humidity_reading"memory_usage",
                "id"unit": 502"percentage"
              },
              "parameter": {
                "name": "Humidity"Memory Utilization",
                "short_name": "humid"MEM",
                "variable_name": "humidity_percent"memory_percent",
                "id"unit": 302"%"
              },
              "value": 65.2,
              "unit"status": "%"normal",
              "created_at": "2024-01-02T10:35:12Z"15T14:25:15Z"
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 SuccessfullySuccess retrieved- Returns paginated list of metric logs matching the filter criteria
        400 Bad Request - Invalid query parameters or date format 401 Unauthorized - Invalid or missing Bearerauthentication token 400403 Bad RequestForbidden - InvalidInsufficient datetimepermissions formatto oraccess parametersmetric data

        GET /inventory_metric_log/{id}/

        RetrieveDescription: Retrieves a specific inventory metric log entryrecord by its unique identifier.ID. This endpoint provides detailed information about a single metric entry, including all associated device, metric, and parameter data. Use this when you need complete details about a specific measurement or when following up on a particular data point identified in list queries.

        Use Cases:

          Get detailed information about a specific anomalous reading identified in monitoring Retrieve complete metadata for a metric entry including collection timestamp Verify specific measurements for audit or compliance purposes Access full parameter details for a particular metric reading

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_metric_log/15234/
          

          Parameters:

          Parameter Type In Required Description
          id integer path Yes Unique identifier of the metric log entry to retrieve
          datetime__gte string query No FilterAdditional byfilter for datetime greater(though thantypically ornot equalneeded tofor (ISOsingle format)record retrieval)
          datetime__lte string query No FilterAdditional byfilter for datetime less(though thantypically ornot equalneeded tofor (ISOsingle format)record retrieval)
          device__name string query No FilterAdditional filter by device name (for validation purposes)
          metric_name string query No FilterAdditional filter by metric parameter name
          parameter_name string query No FilterAdditional filter by parameter name
          parameter__variable_name string query No FilterAdditional filter by parameter variable name

          ExamplecURL Request:Example:

          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/12345/15234/" \
            -H "Authorization: Bearer <your-api-token>YOUR_API_TOKEN" \
            -H "Content-Type: application/json"
          

          Example Response:

          {
            "id": 12345,15234,
            "datetime": "2024-01-02T10:15T14:30:00Z",
            "device": {
              "id": 42,
              "name": "sensor-web-server-01",
              "id": 101,
              "location": "Building A - Floor 2",
              "type": "temperature_sensor"server",
              "model": "Dell PowerEdge R740",
              "serial_number": "ABC123XYZ789",
              "location": "datacenter-east",
              "rack": "R15-U24",
              "organization": "Production Web Services",
              "status": "active",
              "last_seen": "2024-01-15T14:30:00Z"
            },
            "metric": {
              "id": 7,
              "name": "temperature_reading"memory_usage",
              "id": 501,
              "description": "AmbientSystem temperaturememory measurement"utilization percentage",
              "frequency"unit": "5_minutes"percentage",
              "collection_interval": 300,
              "retention_days": 90
            },
            "parameter": {
              "id": 23,
              "name": "Temperature"Memory Utilization",
              "short_name": "temp"MEM",
              "variable_name": "temp_celsius"memory_percent",
              "id"description": 301,"Percentage of total system memory currently in use",
              "unit": "°C"%",
              "data_type"min_value": 0,
              "float"max_value": 100,
              "warning_threshold": 80,
              "critical_threshold": 95
            },
            "value": 23.5,67.8,
            "unit"raw_value": "°C"67.84329",
            "status": "normal",
            "quality": "good",
            "status"collection_method": "active"snmp",
            "created_at": "2024-01-02T10:15T14:30:15Z",
            "updated_at": "2024-01-02T10:15T14:30:15Z"
          }
          

          Response Codes:

          Status Description
          200 SuccessfullySuccess retrieved- Returns the specific metric log entry with complete details
          401 Unauthorized - Invalid or missing Bearerauthentication token
          403 Forbidden - Insufficient permissions to access this metric data 404 Not Found - Metric log entry with the specified ID does not exist 400 Bad
          Request

          Common Use Cases

          Use Case 1: Building a Device Performance Dashboard

          Retrieve recent metrics for multiple parameters from a specific device to display current status and short-term trends.

          # Get last 24 hours of CPU, memory, and disk metrics for a server
          curl -X InvalidGET ID"https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&datetime__gte=2024-01-15T00:00:00Z&limit=500" format\
            -H "Authorization: Bearer YOUR_API_TOKEN"
          

          Use Case 2: Historical Trend Analysis

          Fetch metric data over a longer time period to analyze performance trends and identify patterns or queryseasonal parameters

          variations.
          # Get temperature readings for the past month
          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?parameter__variable_name=temperature&datetime__gte=2023-12-15T00:00:00Z&datetime__lte=2024-01-15T00:00:00Z" \
            -H "Authorization: Bearer YOUR_API_TOKEN"
          

          Use Case 3: Multi-Device Monitoring

          Monitor the same metric across multiple devices by filtering on parameter name without specifying a device.

          # Get CPU usage from all devices in the last hour
          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?metric_name=cpu_usage&datetime__gte=2024-01-15T13:00:00Z&limit=1000" \
            -H "Authorization: Bearer YOUR_API_TOKEN"
          

          Use Case 4: Investigating Specific Incidents

          When you identify an anomalous reading in your monitoring system, use the detail endpoint to get complete context about that specific measurement.

          # Get full details about a specific concerning metric reading
          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/15234/" \
            -H "Authorization: Bearer YOUR_API_TOKEN"
          

          Use Case 5: Data Export for External Analysis

          Retrieve large datasets for import into external analytics tools or for compliance reporting.

          # Export all metrics for a specific device over a quarter
          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=critical-server-01&datetime__gte=2024-01-01T00:00:00Z&datetime__lte=2024-03-31T23:59:59Z&limit=10000" \
            -H "Authorization: Bearer YOUR_API_TOKEN"
          

          Best Practices

          • DateTimeUse FilteringDate Range Filters: Always specify datetime filters (datetime__gte and datetime__lte) to avoid retrieving excessive historical data and improve response times.

          Implement Pagination: For large datasets, use the limit parameter and pagination cursors to retrieve data in manageable chunks. Start with reasonable limits (100-500 records) and adjust based on your needs.

          Cache Frequently Accessed Data: If building dashboards or reports that refresh frequently, consider caching metric data client-side for short periods to reduce API calls and improve user experience.

          Combine Filters Effectively: Use ISOmultiple 8601filter formatparameters for datetime parameters. Supports date-onlytogether (2024-01-01),device datetimename (2024-01-01+ 10:30:00),metric andtype timezone-aware+ formatsdate (2024-01-01range) 10:30:00+00:00)

          to precisely Pagination: Usetarget the cursordata parameteryou for efficient pagination through large datasetsneed rather than offset-basedfiltering paginationlarge result sets client-side.

          PerformanceHandle Rate Limits: CombineImplement filtersexponential backoff retry logic in your applications to reducehandle responsepotential sizerate andlimiting improve query performance,gracefully, especially when dealingmaking withbulk largedata timerequests.

          ranges

          RateMonitor LimitingAPI Usage: ImplementTrack appropriateyour delaysAPI betweenusage requests when processing large datasetspatterns to optimize query efficiency and avoid hitting API rate limits during peak monitoring periods.

          CachingValidate Date Formats: ConsiderEnsure cachingdatetime responsesparameters are properly formatted in ISO 8601 format. Include timezone information when precision is important for frequentlyyour accesseduse metriccase.

          logs that don't change often

          Use Appropriate Error Handling: AlwaysImplement checkrobust responseerror statushandling codesfor common scenarios like missing devices, invalid date ranges, and implementnetwork retrytimeouts, logicespecially forin transientautomated failuresmonitoring systems.