Skip to main content
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": "<string>"
}
'
const options = {
method: 'POST',
headers: {Metadata: '<metadata>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};

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' => '<string>'
]),
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\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": "<string>",
  "detail": "<string>",
  "errors": {},
  "instance": "<string>",
  "status": 349,
  "title": "<string>",
  "type": "about:blank"
}
{
"code": "<string>",
"detail": "<string>",
"errors": {},
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}
{
"code": "<string>",
"detail": "<string>",
"errors": {},
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}
{
"code": "<string>",
"detail": "<string>",
"errors": {},
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}
Last Updated: May 10, 2025

Headers

Metadata
string
required

A custom request header required by all operations.

Allowed value: "true"

Body

application/json

Represents a request to reallocate the current container instance to another SaladCloud node.

reason
string
required

The reason for reallocating the current container instance. This value is reported to SaladCloud support for quality assurance purposes of SaladCloud nodes.

Required string length: 1 - 1000
Example:

"Insufficient VRAM"

Response

No Content