Get Container Instance Deletion Cost
curl --request GET \
--url http://169.254.169.254/v1/deletion-cost \
--header 'Metadata: <metadata>'import requests
url = "http://169.254.169.254/v1/deletion-cost"
headers = {"Metadata": "<metadata>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Metadata: '<metadata>'}};
fetch('http://169.254.169.254/v1/deletion-cost', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://169.254.169.254/v1/deletion-cost",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Metadata: <metadata>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://169.254.169.254/v1/deletion-cost"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Metadata", "<metadata>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://169.254.169.254/v1/deletion-cost")
.header("Metadata", "<metadata>")
.asString();require 'uri'
require 'net/http'
url = URI("http://169.254.169.254/v1/deletion-cost")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Metadata"] = '<metadata>'
response = http.request(request)
puts response.read_body{
"deletion_cost": 100
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}Instance Metadata Service
Get Container Instance Deletion Cost
Gets the deletion cost of the current container instance
GET
/
v1
/
deletion-cost
Get Container Instance Deletion Cost
curl --request GET \
--url http://169.254.169.254/v1/deletion-cost \
--header 'Metadata: <metadata>'import requests
url = "http://169.254.169.254/v1/deletion-cost"
headers = {"Metadata": "<metadata>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Metadata: '<metadata>'}};
fetch('http://169.254.169.254/v1/deletion-cost', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://169.254.169.254/v1/deletion-cost",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Metadata: <metadata>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://169.254.169.254/v1/deletion-cost"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Metadata", "<metadata>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://169.254.169.254/v1/deletion-cost")
.header("Metadata", "<metadata>")
.asString();require 'uri'
require 'net/http'
url = URI("http://169.254.169.254/v1/deletion-cost")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Metadata"] = '<metadata>'
response = http.request(request)
puts response.read_body{
"deletion_cost": 100
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}{
"code": "container-not-found",
"detail": "The container instance could not be found.",
"errors": {},
"instance": "https://leaf.salad.com/i/5e76d3ae-6660-444e-a7c4-7a3999023fb6",
"status": 404,
"title": "Not Found",
"type": "https://leaf.salad.com/e/container-group-not-found"
}Last Updated: May 10, 2025
Headers
A custom request header required by all operations.
Allowed value:
"true"Response
OK
The deletion cost of the current container instance.
An integer value that identifies the relative cost to the application running across the container group if the current container instance is deleted. A higher value indicates a higher cost, and a lower value indicates a lower cost. If the container group is scaled down, the scheduler will attempt to delete the container instances with the lowest deletion costs first.
Required range:
-2147483648 <= x <= 2147483647Example:
100
Was this page helpful?