TypeScript
import { Metadata, ReallocatePrototype, SaladCloudImdsSdk } from '@saladtechnologies-oss/salad-cloud-imds-sdk';
(async () => {
const saladCloudImdsSdk = new SaladCloudImdsSdk({});
const metadata = Metadata.TRUE_;
const reallocatePrototype: ReallocatePrototype = {
reason: 'Insufficient VRAM',
};
const { data } = await saladCloudImdsSdk.metadata.reallocate(reallocatePrototype, {
metadata: metadata,
});
console.log(data);
})();using Salad.Cloud.IMDS.SDK;
using Salad.Cloud.IMDS.SDK.Config;
using Salad.Cloud.IMDS.SDK.Models;
var config = new SaladCloudImdsSdkConfig{};
var client = new SaladCloudImdsSdkClient(config);
var input = new ReallocatePrototype("Insufficient VRAM");
await client.Metadata.ReallocateAsync(input, Metadata1.True_);import (
"fmt"
"encoding/json"
"context"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdkconfig"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdk"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/util"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/metadata"
)
config := saladcloudimdssdkconfig.NewConfig()
client := saladcloudimdssdk.NewSaladCloudImdsSdk(config)
metadata := metadata.METADATA_TRUE
params := metadata.ReallocateRequestParams{
Metadata: &metadata,
}
request := metadata.ReallocatePrototype{
Reason: util.ToPointer("Insufficient VRAM"),
}
response, err := client.Metadata.Reallocate(context.Background(), request, params)
if err != nil {
panic(err)
}
fmt.Println(response)from salad_cloud_imds_sdk import SaladCloudImdsSdk
from salad_cloud_imds_sdk.models import ReallocatePrototype, Metadata
sdk = SaladCloudImdsSdk(
timeout=10000
)
request_body = ReallocatePrototype(
reason="Insufficient VRAM"
)
result = sdk.metadata.reallocate(
request_body=request_body,
metadata="true"
)
print(result)import com.salad.cloud.imdssdk.SaladCloudImdsSdk;
import com.salad.cloud.imdssdk.models.Metadata;
import com.salad.cloud.imdssdk.models.ReallocateParameters;
import com.salad.cloud.imdssdk.models.ReallocatePrototype;
public class Main {
public static void main(String[] args) {
SaladCloudImdsSdk saladCloudImdsSdk = new SaladCloudImdsSdk();
ReallocatePrototype reallocatePrototype = ReallocatePrototype.builder().reason("Insufficient VRAM").build();
ReallocateParameters requestParameters = ReallocateParameters.builder()
.metadata(Metadata.TRUE)
.reallocatePrototype(reallocatePrototype)
.build();
saladCloudImdsSdk.metadata.reallocate(requestParameters);
}
}curl --request POST \
--url http://169.254.169.254/v1/reallocate \
--header 'Content-Type: application/json' \
--header 'Metadata: <metadata>' \
--data '
{
"reason": "Insufficient VRAM"
}
'const options = {
method: 'POST',
headers: {Metadata: '<metadata>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Insufficient VRAM'})
};
fetch('http://169.254.169.254/v1/reallocate', 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/reallocate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Insufficient VRAM'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Metadata: <metadata>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("http://169.254.169.254/v1/reallocate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Metadata"] = '<metadata>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Insufficient VRAM\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"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
Reallocate Container Instance
Reallocates the current container instance to another SaladCloud node
POST
/
v1
/
reallocate
TypeScript
import { Metadata, ReallocatePrototype, SaladCloudImdsSdk } from '@saladtechnologies-oss/salad-cloud-imds-sdk';
(async () => {
const saladCloudImdsSdk = new SaladCloudImdsSdk({});
const metadata = Metadata.TRUE_;
const reallocatePrototype: ReallocatePrototype = {
reason: 'Insufficient VRAM',
};
const { data } = await saladCloudImdsSdk.metadata.reallocate(reallocatePrototype, {
metadata: metadata,
});
console.log(data);
})();using Salad.Cloud.IMDS.SDK;
using Salad.Cloud.IMDS.SDK.Config;
using Salad.Cloud.IMDS.SDK.Models;
var config = new SaladCloudImdsSdkConfig{};
var client = new SaladCloudImdsSdkClient(config);
var input = new ReallocatePrototype("Insufficient VRAM");
await client.Metadata.ReallocateAsync(input, Metadata1.True_);import (
"fmt"
"encoding/json"
"context"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdkconfig"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdk"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/util"
"github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/metadata"
)
config := saladcloudimdssdkconfig.NewConfig()
client := saladcloudimdssdk.NewSaladCloudImdsSdk(config)
metadata := metadata.METADATA_TRUE
params := metadata.ReallocateRequestParams{
Metadata: &metadata,
}
request := metadata.ReallocatePrototype{
Reason: util.ToPointer("Insufficient VRAM"),
}
response, err := client.Metadata.Reallocate(context.Background(), request, params)
if err != nil {
panic(err)
}
fmt.Println(response)from salad_cloud_imds_sdk import SaladCloudImdsSdk
from salad_cloud_imds_sdk.models import ReallocatePrototype, Metadata
sdk = SaladCloudImdsSdk(
timeout=10000
)
request_body = ReallocatePrototype(
reason="Insufficient VRAM"
)
result = sdk.metadata.reallocate(
request_body=request_body,
metadata="true"
)
print(result)import com.salad.cloud.imdssdk.SaladCloudImdsSdk;
import com.salad.cloud.imdssdk.models.Metadata;
import com.salad.cloud.imdssdk.models.ReallocateParameters;
import com.salad.cloud.imdssdk.models.ReallocatePrototype;
public class Main {
public static void main(String[] args) {
SaladCloudImdsSdk saladCloudImdsSdk = new SaladCloudImdsSdk();
ReallocatePrototype reallocatePrototype = ReallocatePrototype.builder().reason("Insufficient VRAM").build();
ReallocateParameters requestParameters = ReallocateParameters.builder()
.metadata(Metadata.TRUE)
.reallocatePrototype(reallocatePrototype)
.build();
saladCloudImdsSdk.metadata.reallocate(requestParameters);
}
}curl --request POST \
--url http://169.254.169.254/v1/reallocate \
--header 'Content-Type: application/json' \
--header 'Metadata: <metadata>' \
--data '
{
"reason": "Insufficient VRAM"
}
'const options = {
method: 'POST',
headers: {Metadata: '<metadata>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Insufficient VRAM'})
};
fetch('http://169.254.169.254/v1/reallocate', 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/reallocate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Insufficient VRAM'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Metadata: <metadata>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("http://169.254.169.254/v1/reallocate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Metadata"] = '<metadata>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Insufficient VRAM\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"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
Body
application/json
Represents a request to reallocate the current container instance to another SaladCloud node.
Response
No Content
Was this page helpful?