get_signal_for_instance
Retrieve the best spot instance action for a specific cloud, region, and instance type. Returns a deterministic action like buy_spot or use_on_demand, optimized for autoscalers.
Instructions
Get the single best spot action for a specific cloud/region/instance type. Optimized for autoscalers that need one clear, deterministic action. Requires REFINEX_API_KEY env var.
Args: cloud: Cloud provider — "aws", "gcp", or "azure" region: AWS region, e.g. "us-east-1", "us-west-2", "eu-west-1" instance_type: EC2 instance type, e.g. "m6i.large", "c7g.xlarge", "t3.medium" fallback: What to return when no signal exists — "on_demand" (default), "wait", or "none"
Returns:
action: "buy_spot" | "migrate_spot" | "wait" | "use_on_demand"
signal{}: full signal detail for the chosen action
alternatives[]: other AZs for the same instance type, with their prices/confidence
Use fallback="on_demand" in CI/CD pipelines so you always get a safe default. Use fallback="wait" in cost-sensitive batch jobs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cloud | Yes | ||
| region | Yes | ||
| instance_type | Yes | ||
| fallback | No | on_demand |