Skip to main content

Inventory Metric

The Inventory Metric API provides endpoints for retrieving andinformation monitoring variousabout metrics relatedused to yourmonitor and track inventory items. These endpoints allow you to accesslist performanceall data,available usagemetrics statistics,with filtering capabilities and operationalretrieve metricsdetailed forinformation devicesabout andspecific resourcesmetrics. inCommon youruse inventorycases system. Perfect forinclude building dashboards, configuring monitoring systems, and generatinganalyzing reports.inventory performance data.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Metric API category enables you to access comprehensiveand manage inventory metrics and analytical data aboutwithin your inventorymonitoring items.and Thesetracking endpointssystem. Inventory metrics are designedmeasurements tothat help you monitor performance, track usagevarious patterns, analyze trends, and generate insights about your inventory resources.

Key Features:

    Retrieve metrics for all inventory items with filtering capabilities Access detailed metric data for specific items Filter results by metric names to focus on specific KPIs Paginate through large datasets efficiently

    Common Metric Types:

      CPU utilization and performance metrics Memory usage statistics Network throughput and connectivity data Storage capacity and usage Uptime and availability metrics Error rates and system health indicators

      These endpoints work together to provide a complete viewaspects of your inventory items, such as stock levels, performance -indicators, useor theoperational liststatistics.

      endpoint

      These endpoints are essential for:

        Dashboard Creation: Building custom dashboards that display real-time inventory metrics Monitoring Integration: Connecting your inventory system to getmonitoring an overviewtools and identifyalerting systems Reporting and Analytics: Extracting metric definitions for reporting tools and data analysis platforms Configuration Management: Understanding available metrics when setting up automated inventory tracking

        The API supports three types of metrics:

          Absolute (a): Point-in-time measurements (e.g., current stock level) Counter (c): Cumulative values that only increase (e.g., total items ofsold) interest, thenDelta drill(d): downChange-based measurements (e.g., stock movement over time)

          Each metric can be associated with thea detail endpointgroup for comprehensiveorganization metricand analysis.may include parameters for customization.


          Endpoints

          GET /inventory_metric/

          Description: Retrieves a paginated list of all inventory metrics in yourthe system. This endpoint is essential for getting an overview of metric data across your entire inventory, with powerfulsupports filtering capabilities to narrow down results by metric name.name and includes pagination controls for handling large datasets. Use this endpoint when you need to browse available metrics, search for specific metrics by name, or build metric selection interfaces.

          Use Cases:

          • Building monitoringa dashboardsdropdown thatlist displayof multiple inventoryavailable metrics for dashboard configuration
          • GeneratingSearching reportsfor onmetrics systemwith performancespecific acrossnames or patterns
          Retrieving all devices Identifying specific metrics by name for focusedbulk analysisoperations or synchronization Implementing automated alerting systems based on metric thresholdsdiscovery in monitoring applications

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_metric/?name=cpu_usagestock_level&limit=5025&offset=0
          

          Parameters:

          Parameter Type In Required Description
          name string query No Filter resultsmetrics by partial or exact name match. Case-sensitive search on the metric's name field. Useful for finding specific metrics like "cpu_usage", "memory_utilization", or "network_throughput"field
          limit integer query No Number of results to return per page (default: 20, max: 100). Use fordefault pagination controllimit applies if not specified)
          offset integer query No TheStarting initialposition indexfor fromresults, which to return results. Use with limitused for pagination (0-based indexing)

          cURL Example:

          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric/?name=cpu_usagestock&limit=2510&offset=0" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/json"
          

          Example Response:

          {
            "count": 147,25,
            "next": "https://control.zequenze.com/api/v1/inventory_metric/?limit=2510&offset=25"10",
            "previous": null,
            "results": [
              {
                "id": 1,
                "name": "cpu_usage"stock_level_current",
                "device_id"group": 42,2,
                "device_name"description": "web-server-01"Current inventory stock level for items",
                "metric_type"type": "performance"a",
                "value"parameter": 78.5,
                "unit": "percent",
                "timestamp": "2024-01-15T10:30:00Z",
                "status": "normal",
                "threshold_warning": 80.0,
                "threshold_critical": 95.0101
              },
              {
                "id": 2,
                "name": "memory_utilization"stock_movement_delta",
                "device_id"group": 42,2,
                "device_name"description": "web-server-01"Change in stock levels over specified time period",
                "metric_type"type": "performance"d",
                "value"parameter": 6.2,
                "unit": "GB",
                "timestamp": "2024-01-15T10:30:00Z",
                "status": "normal",
                "threshold_warning": 7.0,
                "threshold_critical": 7.8102
              },
              {
                "id": 3,
                "name": "network_throughput"total_items_processed",
                "device_id"group": 43,1,
                "device_name"description": "database-server-01"Cumulative count of items processed through inventory",
                "metric_type"type": "network"c",
                "value"parameter": 125.7,
                "unit": "Mbps",
                "timestamp": "2024-01-15T10:29:45Z",
                "status": "normal",
                "threshold_warning": 800.0,
                "threshold_critical": 950.0null
              }
            ]
          }
          

          Response Codes:

          Status Description
          200 Success - Returns the paginated list of inventory metrics
          401 Unauthorized - Invalid or missing Bearer token
          400 Bad Request - Invalid query parameters (e.g., negative offset)

          GET /inventory_metric/{id}/

          Description: Retrieves detailed information about a specific inventory metric by its unique ID. This endpoint providesreturns comprehensivecomplete metric datainformation including historicalits values,type, description, group association, and parameter configuration. Use this endpoint when you need full details about a specific metric for configuration details,or anddisplay related device information.purposes.

          Use Cases:

          • Displaying detailed metric information in monitoringconfiguration interfaces
          • Validating metric properties before using in monitoring systems
          Retrieving specificmetric specifications for documentation or reporting Getting complete metric data for analysisintegration andwith reportingthird-party Getting current values and thresholds for alerting systems Accessing historical trend data for a particular metrictools

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_metric/1/?name=cpu_usage
          

          Parameters:

          Parameter Type In Required Description
          id integer path Yes The uniqueUnique identifier of the inventory metric to retrieve
          name string query No Additional filter by metric name for(typically validationnot orneeded cross-referencingwhen using ID)

          cURL Example:

          curl -X GET "https://control.zequenze.com/api/v1/inventory_metric/1/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/json"
          

          Example Response:

          {
            "id": 1,
            "name": "cpu_usage"warehouse_capacity_utilization",
            "device_id"group": 42,
            "device_name": "web-server-01",
            "device_type": "server",
            "organization": "Production",
            "metric_type": "performance",3,
            "description": "CPUPercentage utilizationof percentagewarehouse forcapacity webcurrently server"being utilized across all inventory locations",
            "current_value": 78.5,
            "unit": "percent",
            "last_updated": "2024-01-15T10:30:00Z",
            "status": "normal",
            "threshold_warning": 80.0,
            "threshold_critical": 95.0,
            "collection_interval": 60,
            "retention_days": 90,
            "historical_data": [
              {
                "timestamp": "2024-01-15T10:29:00Z",
                "value": 76.2
              },
              {
                "timestamp": "2024-01-15T10:28:00Z",
                "value": 74.8
              },
              {
                "timestamp": "2024-01-15T10:27:00Z",
                "value": 79.1
              }
            ],
            "alerts": [
              {
                "id": 101,
            "type": "warning"a",
            "triggered_at"parameter": "2024-01-15T09:45:00Z",
                "message": "CPU usage approaching warning threshold"
              }
            ],
            "created_at": "2024-01-01T00:00:00Z",
            "updated_at": "2024-01-15T10:30:00Z"205
          }
          

          Response Codes:

          Status Description
          200 Success - Returns the detailedrequested inventory metric informationdetails
          401 Unauthorized - Invalid or missing Bearer token
          404 Not Found - Metric with specified ID does not exist
          403400 ForbiddenBad Request - AccessInvalid deniedID to this metricformat

          Common Use Cases

          Use Case 1: Building a Real-time Monitoring Dashboard

          CombineRetrieve bothall endpointsavailable metrics using the list endpoint, then fetch detailed information for selected metrics to create abuild comprehensive monitoring dashboard.dashboards. Filter by metric type to separate real-time values (absolute) from cumulative counters and change indicators.

          Use Case 2: Configuring Inventory Alerts

          Use the list endpoint to getdiscover an overview of allavailable metrics, then drill down into specific metrics using the detail endpoint for charts and detailed analysis.

          Use Case 2: Automated Performance Alerting

          Regularly poll the list endpoint filtered byretrieve specific metric names (like cpu_usage or memory_utilization)details to checkunderstand currenttheir values against thresholdstypes and triggerparameters for setting up automated alerts when necessary.inventory thresholds are reached.

          Use Case 3: HistoricalMetric PerformanceDiscovery Analysisfor Third-Party Integration

          UseProgrammatically discover all available inventory metrics using the list endpoint with pagination, then use the detail endpoint to accessgather historicalcomplete dataspecifications needed for specificintegrating metrics,with enablingexternal trendmonitoring analysisor andanalytics capacity planning based on past performance patterns.platforms.

          Use Case 4: CustomInventory Reporting and AnalyticsSetup

          FilterSearch for specific metrics by name andpattern combineusing datathe fromname multiplefilter, devicesthen retrieve detailed information about selected metrics to generateconfigure customautomated inventory reports onthat systemtrack performance,stock resourcelevels, utilization,movement, and operationalperformance efficiency.

          Use Case 5: Inventory Health Assessment

          Systematically retrieve metrics across your entire inventory to assess overall system health and identify devices or resources that may need attention.indicators.


          Best Practices

          • Use Pagination Effectively: ForWhen retrieving large inventories,numbers alwaysof use the limit parameter to control response size andmetrics, implement proper pagination using thelimit and offset parameter
          Filter by Metric Name: When you need specific types of metrics, always use the name parameterparameters to reduceavoid responseperformance sizeissues and improve performancetimeouts Cache ResponsesMetric Definitions: ImplementMetric cachingdefinitions fortypically metric data that doesn'don't change frequentlyfrequently, so consider caching the results to reduce API calls and improve application performance HandleFilter Rate LimitsEarly: ImplementUse exponentialthe backoffname parameter to filter metrics on the server side rather than retrieving all metrics and respectfiltering any rate limiting to ensure reliable access to the APIclient-side MonitorHandle ResponseMetric TimesTypes Appropriately: For real-time dashboards, considerUnderstand the refreshdifference frequencybetween neededabsolute, versuscounter, APIand performancedelta metrics to provideproperly optimalinterpret userand experiencedisplay metric data in your applications Error Handling: Always implement proper error handling for 404 responses when accessingrequesting specific metrics,metrics by ID, as devicesmetrics may be removed or metrics may be discontinuedrenamed Batch ProcessingSecurity: WhenStore analyzingAPI multipletokens metrics, consider batching requestssecurely and processinguse themenvironment efficientlyvariables rather than hardcoding tokens in your applications Rate Limiting: Implement appropriate rate limiting in your applications to avoid overwhelming the API, especially when making individualbulk calls for each metricrequests