Inventory Metric
The Inventory Metric API provides endpoints for retrieving
andinformationmonitoring variousabout metricsrelatedused toyourmonitor and track inventory items. These endpoints allow you toaccesslistperformancealldata,availableusagemetricsstatistics,with filtering capabilities andoperationalretrievemetricsdetailedforinformationdevicesaboutandspecificresourcesmetrics.inCommonyouruseinventorycasessystem. Perfect forinclude building dashboards, configuring monitoring systems, andgeneratinganalyzingreports.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:
Common Metric Types:
These endpoints work together to provide a complete viewaspects of your inventory items, such as stock levels, performance -indicators, useor theoperational liststatistics.
These endpoints are essential for:
The API supports three types of metrics:
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
monitoringadashboardsdropdownthatlistdisplayofmultiple inventoryavailable metrics for dashboard configuration GeneratingSearchingreportsforonmetricssystemwithperformancespecificacrossnames or patterns
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 |
| limit | integer | query | No | Number of results to return per page ( |
| offset | integer | query | No |
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 |
| 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
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 | |
| name | string | query | No | Additional filter by metric name |
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 |
| 401 | Unauthorized - Invalid or missing Bearer token |
| 404 | Not Found - Metric with specified ID does not exist |
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 largeinventories,numbersalwaysofuse thelimitparameter to control response size andmetrics, implement proper pagination usingthelimitand offsetparameter
name