Skip to main content

Inventory Device Name

Manage inventory devices in your network infrastructure through CRUD operations with filtering and status monitoring capabilities.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Endpoints

GET /inventory_device_name/

Retrieve a paginated list of inventory devices with optional filtering capabilities.

Parameters:

Parameter Type In Required Description
type integer query No Filter device by device 'type' ID field
status string query No Filter device by status field. Use '0', 'false', 'False' for Down status, or '1', 'true', 'True' for Up status
last_status_change_from string query No Filter by datetime field in ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00
organization integer query No Filter device by device 'organization' ID field
limit integer query No Number of results to return per page
offset integer query No The initial index from which to return the results
pending boolean query No Report if the device has pending settings
update_status boolean query No Use configured helpers to update device status before returning information

Example Request:

GET /api/v1/inventory_device_name/?status=true&limit=10&offset=0

Example Response:

{
  "count": 25,
  "next": "https://control.zequenze.com/api/v1/inventory_device_name/?limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "router-01",
      "type": 2,
      "status": true,
      "organization": 1,
      "ip_address": "192.168.1.1",
      "last_status_change": "2024-01-15T10:30:00Z",
      "pending_settings": false
    },
    {
      "id": 2,
      "name": "switch-02",
      "type": 3,
      "status": true,
      "organization": 1,
      "ip_address": "192.168.1.10",
      "last_status_change": "2024-01-14T14:22:00Z",
      "pending_settings": true
    }
  ]
}
Status Description
200 Success
401 Unauthorized

POST /inventory_device_name/

Create a new inventory device in the system.

Parameters:

Parameter Type In Required Description
data object body Yes Device data object

Example Request:

POST /api/v1/inventory_device_name/
Content-Type: application/json

{
  "name": "firewall-03",
  "type": 1,
  "organization": 1,
  "ip_address": "192.168.1.254",
  "status": true,
  "description": "Main firewall device"
}

Example Response:

{
  "id": 3,
  "name": "firewall-03",
  "type": 1,
  "status": true,
  "organization": 1,
  "ip_address": "192.168.1.254",
  "description": "Main firewall device",
  "created_at": "2024-01-15T15:45:00Z",
  "last_status_change": "2024-01-15T15:45:00Z",
  "pending_settings": false
}
Status Description
201 Device created successfully
400 Invalid request data
401 Unauthorized

GET /inventory_device_name/{name}/

Retrieve detailed information about a specific inventory device by its name.

Parameters:

Parameter Type In Required Description
name string path Yes Device name identifier
pending boolean query No Report if the device has pending settings
update_status boolean query No Use configured helpers to update device status before returning information

Example Request:

GET /api/v1/inventory_device_name/router-01/?update_status=true

Example Response:

{
  "id": 1,
  "name": "router-01",
  "type": 2,
  "status": true,
  "organization": 1,
  "ip_address": "192.168.1.1",
  "description": "Primary gateway router",
  "last_status_change": "2024-01-15T10:30:00Z",
  "pending_settings": false,
  "configuration": {
    "model": "Cisco ISR 4321",
    "firmware_version": "16.09.04"
  }
}
Status Description
200 Success
404 Device not found
401 Unauthorized

PUT /inventory_device_name/{name}/

Update an entire inventory device record, replacing all fields.

Parameters:

Parameter Type In Required Description
name string path Yes Device name identifier
data object body Yes Complete device data object

Example Request:

PUT /api/v1/inventory_device_name/router-01/
Content-Type: application/json

{
  "name": "router-01-updated",
  "type": 2,
  "organization": 1,
  "ip_address": "192.168.1.2",
  "status": true,
  "description": "Updated primary gateway router"
}

Example Response:

{
  "id": 1,
  "name": "router-01-updated",
  "type": 2,
  "status": true,
  "organization": 1,
  "ip_address": "192.168.1.2",
  "description": "Updated primary gateway router",
  "last_status_change": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T16:20:00Z",
  "pending_settings": false
}
Status Description
200 Device updated successfully
400 Invalid request data
404 Device not found
401 Unauthorized

PATCH /inventory_device_name/{name}/

Partially update specific fields of an inventory device.

Parameters:

Parameter Type In Required Description
name string path Yes Device name identifier
data object body Yes Partial device data object

Example Request:

PATCH /api/v1/inventory_device_name/router-01/
Content-Type: application/json

{
  "status": false,
  "description": "Router temporarily offline for maintenance"
}

Example Response:

{
  "id": 1,
  "name": "router-01",
  "type": 2,
  "status": false,
  "organization": 1,
  "ip_address": "192.168.1.1",
  "description": "Router temporarily offline for maintenance",
  "last_status_change": "2024-01-15T16:25:00Z",
  "updated_at": "2024-01-15T16:25:00Z",
  "pending_settings": false
}
Status Description
200 Device updated successfully
400 Invalid request data
404 Device not found
401 Unauthorized

DELETE /inventory_device_name/{name}/

Remove an inventory device from the system permanently.

Parameters:

Parameter Type In Required Description
name string path Yes Device name identifier

Example Request:

DELETE /api/v1/inventory_device_name/old-device/
Status Description
204 Device deleted successfully
404 Device not found
401 Unauthorized

Best Practices

  • Pagination: Use limit and offset parameters for large datasets to improve performance
  • Status Filtering: Leverage the status parameter with boolean values or strings for flexible filtering
  • Real-time Updates: Use update_status=true when you need the most current device status information
  • Partial Updates: Prefer PATCH over PUT when updating only specific fields to reduce bandwidth
  • Error Handling: Always check response status codes and handle 404 errors for non-existent devices
  • Date Filtering: Use ISO format dates with last_status_change_from for precise time-based filtering
  • Pending Settings: Monitor the pending_settings field to identify devices requiring configuration updates