list-insight-resource-results
dci list-insight-resource-results <sourceID> <insightKey> [flags]
Returns a paginated list of individual resource-level results for a specific insight. Each resource result represents a single cloud resource (e.g. an EC2 instance, a GCS bucket) affected by the insight, along with its risk scores or potential savings.
sourceID— The identifier of the source that generated the insight.insightKey— The unique key identifying the insight.
Examples
# The affected resources of one insight, up to 1000 per page.
dci list-insight-resource-results <source-id> <insight-key>
# A compact table of where each resource lives and how severe the finding is.
dci list-insight-resource-results <source-id> <insight-key> -C resourceId,account,location,severity
# Every page as JSON, for scripts.
dci list-insight-resource-results <source-id> <insight-key> --all --output json
# Browse a large result set in the full-screen viewer.
dci list-insight-resource-results <source-id> <insight-key> -M interactive
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--page-token | string | Token from a previous response to fetch the next page. | ||
--max-results | integer | 1000 | Maximum number of results per page (default 1000, max 5000). |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
Successful operation
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
resourceResults | array of object | |
resourceResults[].resourceId | string | The cloud resource identifier. |
resourceResults[].resourceType | string | What the resource actually is, eg. for an EC2 resource ID, this field would be instance |
resourceResults[].cloudProvider | string | The cloud provider associated with the resource. |
resourceResults[].account | string | The cloud account or project ID containing this resource. |
resourceResults[].location | string | represents the region/zone of the resource in AWS, or equivalent for other providers |
resourceResults[].resolved | boolean | Whether this resource-level issue has been resolved. Computed server-side. |
resourceResults[].severity | string | The severity level of the finding. Computed server-side from the security risk counts. One of: "critical", "high", "medium", "low". |
resourceResults[].externalId | string | the external ID of the resource in the provider's system for the resource |
resourceResults[].externalUrl | string | the URL to the resource-level issue in the provider's system |
resourceResults[].metadata | object | contains any additional information for the resource results |
resourceResults[].enhancement | object | DoiT-managed metadata associated with a resource result. |
resourceResults[].enhancement.tags | array of string | Tags assigned to this resource result. |
resourceResults[].enhancement.priority | object | Priority information for this resource result. |
resourceResults[].enhancement.priority.value | string | The priority level (e.g. Low, Medium, High). |
resourceResults[].enhancement.priority.priorityScore | number (double) | Numeric priority score. |
resourceResults[].enhancement.lastUpdatedBy | string | The user who last updated this enhancement. |
resourceResults[].enhancement.lastUpdatedAt | string (date-time) | Timestamp of the last update. |
resourceResults[].resultType | string | The discriminator property that determines which fields are populated in the 'result' object. One of: "security_risk", "potential_daily_savings", "potential_daily_savings_with_recommendation", "potential_daily_savings_with_cluster_agent". |
resourceResults[].result | object | The result data for this resource. Which fields are populated depends on the resultType. For security_risk: critical, high, medium, low. For potential_daily_savings: value. For potential_daily_savings_with_recommendation: value, current, recommendation. For potential_daily_savings_with_cluster_agent: value, agentInstalled. |
resourceResults[].result.value | number (double) | the daily saving amount for this result |
resourceResults[].result.critical | integer | number of critical security risks |
resourceResults[].result.high | integer | number of high security risks |
resourceResults[].result.medium | integer | number of medium security risks |
resourceResults[].result.low | integer | number of low security risks |
resourceResults[].result.current | string | the current state (i.e. current instance type) |
resourceResults[].result.recommendation | string | the recommended state (i.e. recommended instance type) |
resourceResults[].result.agentInstalled | boolean | true if the agent is installed |
pageToken | string | |
rowCount | integer |
Raw JSON schema
{
"type": "object",
"required": [
"resourceResults",
"rowCount"
],
"properties": {
"resourceResults": {
"type": "array",
"items": {
"type": "object",
"description": "A single resource-level result within an insight, as returned in API responses.",
"required": [
"resourceId",
"resultType",
"account",
"cloudProvider"
],
"properties": {
"resourceId": {
"description": "The cloud resource identifier.",
"type": "string"
},
"resourceType": {
"description": "What the resource actually is, eg. for an EC2 resource ID, this field would be `instance`",
"type": "string",
"example": "instance, disk, cache"
},
"cloudProvider": {
"type": "string",
"example": "aws",
"description": "The cloud provider associated with the resource."
},
"account": {
"type": "string",
"description": "The cloud account or project ID containing this resource."
},
"location": {
"type": "string",
"description": "represents the region/zone of the resource in AWS, or equivalent for other providers",
"example": "eu-west-2"
},
"resolved": {
"type": "boolean",
"description": "Whether this resource-level issue has been resolved. Computed server-side."
},
"severity": {
"type": "string",
"enum": [
"critical",
"high",
"medium",
"low"
],
"description": "The severity level of the finding. Computed server-side from the security risk counts."
},
"externalId": {
"type": "string",
"description": "the external ID of the resource in the provider's system for the resource"
},
"externalUrl": {
"type": "string",
"description": "the URL to the resource-level issue in the provider's system"
},
"metadata": {
"type": "object",
"description": "contains any additional information for the resource results"
},
"enhancement": {
"type": "object",
"description": "DoiT-managed metadata associated with a resource result.",
"properties": {
"tags": {
"type": "array",
"description": "Tags assigned to this resource result.",
"items": {
"type": "string"
}
},
"priority": {
"type": "object",
"description": "Priority information for this resource result.",
"properties": {
"value": {
"type": "string",
"description": "The priority level (e.g. Low, Medium, High)."
},
"priorityScore": {
"type": "number",
"format": "double",
"description": "Numeric priority score."
}
}
},
"lastUpdatedBy": {
"type": "string",
"description": "The user who last updated this enhancement."
},
"lastUpdatedAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the last update."
}
}
},
"resultType": {
"type": "string",
"enum": [
"security_risk",
"potential_daily_savings",
"potential_daily_savings_with_recommendation",
"potential_daily_savings_with_cluster_agent"
],
"description": "The discriminator property that determines which fields are populated in the 'result' object."
},
"result": {
"description": "The result data for this resource. Which fields are populated depends on the resultType. For security_risk: critical, high, medium, low. For potential_daily_savings: value. For potential_daily_savings_with_recommendation: value, current, recommendation. For potential_daily_savings_with_cluster_agent: value, agentInstalled.\n",
"type": "object",
"properties": {
"value": {
"type": "number",
"format": "double",
"description": "the daily saving amount for this result"
},
"critical": {
"type": "integer",
"description": "number of critical security risks"
},
"high": {
"type": "integer",
"description": "number of high security risks"
},
"medium": {
"type": "integer",
"description": "number of medium security risks"
},
"low": {
"type": "integer",
"description": "number of low security risks"
},
"current": {
"type": "string",
"description": "the current state (i.e. current instance type)"
},
"recommendation": {
"type": "string",
"description": "the recommended state (i.e. recommended instance type)"
},
"agentInstalled": {
"type": "boolean",
"description": "true if the agent is installed"
}
}
}
}
}
},
"pageToken": {
"type": "string"
},
"rowCount": {
"type": "integer"
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
Related
- get-insight — Retrieve an insight
- list-insights — List insights
- replace-insight-resource-results — Replace resource results for an insight
- API reference: GET /insights/v1/results/source/{sourceID}/insight/{insightKey}/resource-results
Aliases: get-insight-resource-results