Get upgrade opportunities

This function lists accounts that could benefit from upgrading to a different package. The listed accounts may be nearing (or exceeding) resource usage thresholds.

SecurityBasicAuth
Request
query Parameters
disk_threshold_blocks
integer >= 0
Default: 2097152

A fixed number of blocks to use as an alternative disk usage threshold.

Example: disk_threshold_blocks=8388608
nearness_fraction
number ( 0 .. 1 )
Default: 0.8

The fraction of 1 at which to consider usage "near".

Example: nearness_fraction=0.6
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/get_upgrade_opportunities
Request samples
whmapi1 --output=jsonpretty \
  get_upgrade_opportunities
Response samples
application/json
{
  • "data": {
    • "upgrade_opportunities": {
      • "property1": {
        • "bw_limit": {
          • "last_month": {
            • "fraction": 0.54,
            • "near": 1,
            • "reached": 1
            },
          • "messages": [
            • "This account has used 54% of its bandwidth quota for this month."
            ],
          • "this_month": {
            • "fraction": 0.54,
            • "near": 1,
            • "reached": 1
            }
          },
        • "disk_usage": {
          • "messages": [
            • "This account has used 94% of its disk quota."
            ],
          • "relative_to_fixed_amount": {
            • "fraction": 0,
            • "near": 0,
            • "reached": 0,
            • "threshold_blocks": 10485760
            },
          • "relative_to_quota": {
            • "fraction": 0,
            • "near": 0,
            • "reached": 0,
            • "threshold_blocks": 10485760
            }
          },
        • "messages": [
          • "This account has used 54% of its bandwidth quota for this month.",
          • "This account has used 94% of its disk quota."
          ]
        },
      • "property2": {
        • "bw_limit": {
          • "last_month": {
            • "fraction": 0.54,
            • "near": 1,
            • "reached": 1
            },
          • "messages": [
            • "This account has used 54% of its bandwidth quota for this month."
            ],
          • "this_month": {
            • "fraction": 0.54,
            • "near": 1,
            • "reached": 1
            }
          },
        • "disk_usage": {
          • "messages": [
            • "This account has used 94% of its disk quota."
            ],
          • "relative_to_fixed_amount": {
            • "fraction": 0,
            • "near": 0,
            • "reached": 0,
            • "threshold_blocks": 10485760
            },
          • "relative_to_quota": {
            • "fraction": 0,
            • "near": 0,
            • "reached": 0,
            • "threshold_blocks": 10485760
            }
          },
        • "messages": [
          • "This account has used 54% of its bandwidth quota for this month.",
          • "This account has used 94% of its disk quota."
          ]
        }
      }
    },
  • "metadata": {
    • "command": "get_upgrade_opportunities",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}