Documentation

Recommendations

ZopNight analyzes your cloud resources and generates cost optimization recommendations based on usage patterns, idle detection, and best practices.

How Recommendations Work

The recommender service subscribes to resource discovery events via Redis Streams. When new or updated resources are discovered, it runs audit rules across all three cloud providers to generate actionable recommendations.

Recommendation Categories

CategoryDescription
idleResources with low or no utilization that could be stopped or terminated
rightsizingResources that are over-provisioned and could use a smaller instance type
orphanUnattached resources (volumes, snapshots, IPs) with ongoing costs
complianceResources missing required tags or not following naming conventions
governanceBest practice violations (e.g., public access, missing encryption)

Severity Levels

SeverityDescription
criticalHigh-cost waste requiring immediate attention
highSignificant savings opportunity
mediumModerate optimization potential
lowMinor improvement suggestion
infoInformational — no direct cost impact

List Resource Summaries

GET
/recommendations/resources

List distinct resources with aggregate recommendation stats. Used for the resource view.

Query Parameters

ParameterDescription
statusFilter by recommendation status (open, applied, dismissed, optimised)
severityFilter by severity level
categoryFilter by category
providerFilter by cloud provider
resource_typeFilter by resource type (ec2, rds, disk, etc.)
cloud_account_idFilter by cloud account ID (comma-separated for multiple)
searchSearch by resource name or UID
sort_bySort column (savings_usd, updated_at, severity). Default: savings_usd
sort_orderSort direction (asc, desc). Default: desc
pagePage number (default: 1)
sizeItems per page (default: 10, max: 100)
Responsejson
{
  "data": {
    "items": [
      {
        "resourceUid": "i-0abc123def456",
        "resourceName": "idle-dev-server",
        "resourceType": "ec2",
        "provider": "aws",
        "cloudAccountId": "123456789012",
        "cloudAccountName": "AWS Prod",
        "recommendationCount": 3,
        "openCount": 2,
        "totalSavingsUsd": 52.56
      }
    ],
    "total": 45,
    "page": 1,
    "limit": 10,
    "hasMore": true
  }
}

List Rule Summaries

GET
/recommendations/rules

List distinct rules with aggregate recommendation stats. Used for the rule view.

Query Parameters

Same filters as /recommendations/resources plus:

ParameterDescription
rule_idFilter by specific rule ID (e.g., RC-212)
Responsejson
{
  "data": {
    "items": [
      {
        "ruleId": "RC-212",
        "title": "Azure managed disk is unattached — verify and delete if not needed",
        "category": "orphan",
        "severity": "low",
        "resourceCount": 36,
        "openCount": 35,
        "totalSavingsUsd": 5.00
      }
    ],
    "total": 8,
    "page": 1,
    "limit": 10,
    "hasMore": false
  }
}

List Recommendations

GET
/recommendations

List individual recommendations with filtering and pagination. Use resource_uid or rule_id to scope to a specific group.

Query Parameters

Same filters as /recommendations/resources plus:

ParameterDescription
resource_uidFilter by resource UID (used when expanding a resource card)
rule_idFilter by rule ID (used when expanding a rule card)
Responsejson
{
  "data": {
    "items": [
      {
        "id": "rec_001",
        "resourceUid": "i-0abc123def456",
        "resourceName": "idle-dev-server",
        "resourceType": "ec2",
        "ruleId": "RC-001",
        "title": "Idle EC2 Instance",
        "description": "This instance has had less than 5% CPU utilization over the past 14 days.",
        "currentCostUsd": 52.56,
        "optimizedCostUsd": 0.00,
        "savingsUsd": 52.56,
        "status": "open",
        "severity": "high",
        "category": "idle",
        "remediation": "Consider stopping or terminating this instance if it is not needed.",
        "consoleUrl": "https://console.aws.amazon.com/ec2/home?region=us-east-1#Instances:instanceId=i-0abc123def456",
        "provider": "aws",
        "cloudAccountId": "123456789012",
        "cloudAccountName": "AWS Prod",
        "generatedAt": "2025-01-20T08:00:00Z"
      }
    ],
    "total": 36,
    "page": 1,
    "limit": 5,
    "hasMore": true
  }
}

Recommendation Summary

GET
/recommendations/summary

Get aggregate recommendation statistics.

Responsejson
{
  "data": {
    "totalOpen": 23,
    "totalSavings": 1250.80,
    "criticalCount": 2,
    "highCount": 8,
    "resourceCount": 18,
    "awsResources": 10,
    "gcpResources": 5,
    "azureResources": 3,
    "appliedCount": 12,
    "dismissedCount": 5,
    "optimisedCount": 3
  }
}

Resource Recommendations (Deprecated)

GET
/recommendations/resources/{resourceUID}

Get all recommendations for a specific resource.

Deprecated

Use GET /recommendations?resource_uid={resourceUID} instead, which supports pagination. Target removal: 2026-10-01.

Update Recommendation

PATCH
/recommendations/{recommendationID}

Mark a recommendation as applied or dismissed.

Requestbash
curl -X PATCH https://zopnight.com/api/recommendations/rec_001 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "status": "applied" }'

Valid status transitions:

  • openapplied
  • opendismissed

Filter Fields

GET
/recommendations/filter-fields

Get available filter field values for building filter UIs.

Responsejson
{
  "data": {
    "statuses": ["open", "applied", "dismissed", "optimised"],
    "severities": ["critical", "high", "medium", "low", "info"],
    "categories": ["idle", "rightsizing", "orphan", "compliance", "governance"],
    "providers": ["aws", "gcp", "azure"]
  }
}

Provider Breakdown

GET
/recommendations/summary/providers

Get recommendation counts and savings broken down by cloud provider.

Responsejson
{
  "data": [
    { "provider": "aws", "totalOpen": 12, "totalSavings": 820.50, "criticalCount": 1, "highCount": 5 },
    { "provider": "gcp", "totalOpen": 6, "totalSavings": 310.00, "criticalCount": 0, "highCount": 2 },
    { "provider": "azure", "totalOpen": 5, "totalSavings": 120.30, "criticalCount": 1, "highCount": 1 }
  ]
}

Recommendation Detail

GET
/recommendations/{recID}/detail

Get full detail for a single recommendation including metrics and remediation steps.

Refresh Recommendations

POST
/recommendations/refresh

Trigger a recommendation recomputation for the organization.

Resource Intensive

Refreshing recommendations re-evaluates all rules against all resources. Use sparingly.

Auto-Tagging

ZopNight can predict environment tags (prod, staging, dev) and no-stop flags for resources based on naming patterns, tags, and resource characteristics.

Confidence Score

Each auto-tag suggestion includes a confidence score (1-100) and a reason explaining the prediction. Review suggestions before accepting them.
GET
/autotagging

List auto-tagging suggestions.

Responsejson
{
  "data": {
    "items": [
      {
        "id": "tag_001",
        "resourceUID": "i-0abc123def456",
        "resourceName": "prod-api-server",
        "resourceType": "aws-ec2",
        "provider": "aws",
        "predictedEnv": "prod",
        "predictedNoStop": true,
        "confidence": 92,
        "reason": "Name contains 'prod', has production tags, runs 24/7"
      }
    ],
    "total": 15,
    "page": 1,
    "limit": 20
  }
}
POST
/autotagging/accept

Accept an auto-tag suggestion and apply it.

Requestbash
curl -X POST https://zopnight.com/api/autotagging/accept \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceUID": "i-0abc123def456",
    "env": "prod",
    "noStop": true
  }'
POST
/autotagging/reject

Reject an auto-tag suggestion.

Requestbash
curl -X POST https://zopnight.com/api/autotagging/reject \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "resourceUID": "i-0abc123def456" }'

The recommender runs 316+ audit rules across AWS, GCP, and Azure. See Cloud Support Matrix for provider-specific details.