CMDB API
Endpoints Overview
| Method | Path | Description |
|---|---|---|
| GET | /prod/api/cmdb/cis | List configuration items |
| GET | /prod/api/cmdb/cis/:id | Get single CI |
| POST | /prod/api/cmdb/cis | Create CI |
| PATCH | /prod/api/cmdb/cis/:id | Update CI |
| DELETE | /prod/api/cmdb/cis/:id | Retire CI |
| GET | /prod/api/cmdb/cis/:id/relationships | Get CI relationships |
| POST | /prod/api/cmdb/cis/:id/relationships | Add relationship |
| GET | /prod/api/cmdb/search | Full-text CI search |
| POST | /prod/api/cmdb/graph/query | Neptune Gremlin query |
List CIs
curl -H "Authorization: Bearer $TOKEN" "https://your-instance.stackflow-tech.com/prod/api/cmdb/cis?class=aws_lambda&state=active&limit=50"
| Query Param | Description | Example |
|---|---|---|
class | CI class filter | server, aws_lambda, database, network_device |
state | CI operational state | active, maintenance, retired |
environment | Environment tag | production, staging, development |
owner | Owner email or group | platform-eng@example.com |
tag | CI tag filter | cost-center:platform |
Get CI
{
"id": "CI0000789",
"name": "StackFlowAPI",
"class": "aws_lambda",
"state": "active",
"environment": "production",
"description": "Primary StackFlow API Lambda function",
"attributes": {
"function_name": "StackFlowAPI",
"runtime": "nodejs22.x",
"architecture": "arm64",
"memory_mb": 1792,
"timeout_sec": 300,
"region": "us-east-1",
"account_id": "373544523367"
},
"owner": "platform-eng@example.com",
"assignment_group": "Platform Engineering",
"tags": {"Environment": "production", "CostCenter": "platform"},
"relationships": [
{"type": "depends_on", "ci_id": "CI0000790", "ci_name": "StackFlow-Aurora-Main"},
{"type": "depends_on", "ci_id": "CI0000791", "ci_name": "StackFlow-Redis"}
],
"last_discovered": "2026-05-19T12:00:00Z",
"created_at": "2025-01-15T00:00:00Z"
}
Create CI
curl -X POST https://your-instance.stackflow-tech.com/prod/api/cmdb/cis -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"name": "app-server-prod-01",
"class": "server",
"state": "active",
"environment": "production",
"attributes": {
"ip_address": "10.0.1.50",
"os": "Amazon Linux 2023",
"cpu_cores": 8,
"memory_gb": 32
},
"owner": "platform-eng@example.com",
"tags": {"Environment": "production"}
}'
CI Relationships
# Get all relationships for a CI
curl -H "Authorization: Bearer $TOKEN" https://your-instance.stackflow-tech.com/prod/api/cmdb/cis/CI0000789/relationships
# Add a relationship
curl -X POST https://your-instance.stackflow-tech.com/prod/api/cmdb/cis/CI0000789/relationships -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"target_ci_id": "CI0000795",
"relationship_type": "depends_on",
"direction": "outbound"
}'
Supported relationship types: depends_on, hosted_on, connects_to, contains, owned_by, used_by, backed_up_to.
CI Search
curl -H "Authorization: Bearer $TOKEN" "https://your-instance.stackflow-tech.com/prod/api/cmdb/search?q=aurora+production&class=database"
Neptune Graph Query Endpoint
For advanced graph traversals, use the Neptune proxy endpoint. Queries are written in Gremlin and executed against the Amazon Neptune cluster at stackflow-knowledge-graph.cluster-c6pq0smgmlri.us-east-1.neptune.amazonaws.com:8182.
curl -X POST https://your-instance.stackflow-tech.com/prod/api/cmdb/graph/query -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"query": "g.V().has("ci_id", "CI0000789").repeat(out("depends_on")).times(3).path().by("name")",
"max_depth": 3
}'
{
"paths": [
["StackFlowAPI", "StackFlow-Aurora-Main", "aurora-subnet-group"],
["StackFlowAPI", "StackFlow-Redis", "elasticache-subnet-group"]
],
"ci_count": 5,
"execution_time_ms": 48
}
Query Limits: Neptune graph queries are limited to max_depth=5 and 10-second execution timeout via the API. For larger traversals, use the Neptune Analytics console directly from within the VPC.
Field Reference
| Field | Type | Description |
|---|---|---|
name | string | CI display name (required) |
class | string | CI class: server, database, network_device, aws_lambda, aws_rds, aws_ec2, etc. |
state | enum | active, maintenance, retired, disposed |
environment | string | production, staging, development, dr |
attributes | object | Class-specific attributes (flexible schema) |
owner | string | Owner email |
last_discovered | ISO 8601 | Last auto-discovery timestamp |