Reference

Cancel a purchase before it is sent to AWS

Stops a purchase that has not been sent to AWS: it is rejected, reads cancelled_before_purchase, and stays that way, so it cannot be accepted or released again; raise a new purchase to buy it. An organization admin or the member who raised or requested it may cancel. Calling it again changes nothing. 409 purchase_already_sent once a purchase was sent and may have been bought, purchase_closed for one already bought or rejected, and purchase_bought_by_hand for one released to be bought by hand, which may already be bought. 404 for an id that is no purchase.

POST
/api/v1/commitments/purchase/{recommendation_id}/cancel

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

recommendation_id*Recommendation Id

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/commitments/purchase/string/cancel"
{
  "success": true,
  "timestamp": "2019-08-24T14:15:22Z",
  "data": {
    "recommendation_id": "string",
    "payer_account_id": "string",
    "plan_type": "compute",
    "term_months": 0,
    "payment_option": "all_upfront",
    "commitment_hourly": 0,
    "profile": "conservative",
    "capped_by": [
      "string"
    ],
    "monthly_savings": 0,
    "grain": "daily",
    "source": "cur",
    "created_by": "string",
    "created_at": "string",
    "rebindable": false,
    "kind": "reserved_instance",
    "origin": "recommended",
    "target": {},
    "resource": "string",
    "quantity": 0,
    "offering_id": "string",
    "quote": {},
    "draft": false,
    "draft_expires_at": "string",
    "buying_account_id": "string",
    "schedule_id": "string",
    "tranche_number": 0,
    "tranches_total": 0,
    "buy_after_utc": "string",
    "verified_active_at": "string",
    "execution": {
      "status": "not_started",
      "provider_state": "string",
      "purchase_id": "string",
      "error": "string",
      "starts_at": "string",
      "send_at": "string",
      "can_buy_now": false,
      "can_cancel": false
    },
    "bought_outside": {
      "plan_id": "string",
      "started_on": "string"
    },
    "trigger_info": {
      "property1": null,
      "property2": null
    },
    "execution_steps": [
      {
        "step_id": "string",
        "label": "string",
        "status": "done",
        "duration_seconds": 0,
        "parent_step_id": "string"
      }
    ],
    "execution_logs": [
      {
        "step_id": "string",
        "label": "string",
        "status": "done",
        "commands": [
          {
            "order": 0,
            "command": "string",
            "output": "string"
          }
        ]
      }
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}

Buy a released purchase now instead of after its hold POST

A new purchase released to Automated Savings waits up to 24 hours before LevelFour sends it to AWS, so it can still be cancelled. This ends the wait: the executor sends it on its next run, within about five minutes. Organization admins only. Answers where the purchase stands; calling it again changes nothing. 409 purchase_not_held for a purchase that is not released to Automated Savings, tranche_keeps_its_day for a tranche of a purchase schedule, purchase_cancelled once it was cancelled, and purchase_already_sent once it was sent. 404 for an id that is no purchase.

What a new reservation or Savings Plan would cost and save POST

Quotes one purchase the organization does not hold yet, a NewPurchase with an optional lookback_days of 30 or 60. basis is usage when the buying account's payer already runs the target: a reservation is replayed over its family's daily on-demand hours in units of the class bought and priced at the on-demand rate measured on the bill; a plan is replayed at the organization's own rates, as GET /purchase-simulation does, on any term and payment AWS sells it on. Otherwise basis is full_use: every hour used, against the price list's on-demand rate where it has one, and at face (no saving) where it has none, which is always the case for a plan. upfront, recurring_monthly, commitment_monthly and term_total are the offering's list price; over_automation_cap says Automated Savings would refuse the term total. A reservation quoted on usage also answers unused_units and left_on_demand_units, what it leaves unused and on demand an hour in reservations of the class bought. The offering is the one named, or the cheapest sold on those terms. A plan quoted without an offering_id is priced on its commitment, term and payment option without reading the catalogue, and its offering_id is null. 422 when AWS sells nothing on those terms, and for a Database plan other than 12 months No Upfront; 502 when every connected account refused the offerings lookup. Buys nothing.

Ask the FinOps Agent about your cloud spend