Set storage pool
curl --request PUT \
--url https://api.torrin.app/api/storage/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providers": [
{
"provider": "<string>",
"endpoint": "<string>",
"region": "<string>",
"bucket": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"user": "<string>",
"pass": "<string>",
"token": "<string>",
"config": "<string>"
}
]
}
'import requests
url = "https://api.torrin.app/api/storage/providers"
payload = { "providers": [
{
"provider": "<string>",
"endpoint": "<string>",
"region": "<string>",
"bucket": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"user": "<string>",
"pass": "<string>",
"token": "<string>",
"config": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providers: [
{
provider: '<string>',
endpoint: '<string>',
region: '<string>',
bucket: '<string>',
access_key: '<string>',
secret_key: '<string>',
user: '<string>',
pass: '<string>',
token: '<string>',
config: '<string>'
}
]
})
};
fetch('https://api.torrin.app/api/storage/providers', 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 => "https://api.torrin.app/api/storage/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'provider' => '<string>',
'endpoint' => '<string>',
'region' => '<string>',
'bucket' => '<string>',
'access_key' => '<string>',
'secret_key' => '<string>',
'user' => '<string>',
'pass' => '<string>',
'token' => '<string>',
'config' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.torrin.app/api/storage/providers"
payload := strings.NewReader("{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.torrin.app/api/storage/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.torrin.app/api/storage/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "<string>"
}Storage
Set storage pool
Add providers to the storage pool and set placement. Submitted providers are merged
into the existing pool. union_policy is epmfs (spread by free space) or all (mirror).
PUT
/
api
/
storage
/
providers
Set storage pool
curl --request PUT \
--url https://api.torrin.app/api/storage/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providers": [
{
"provider": "<string>",
"endpoint": "<string>",
"region": "<string>",
"bucket": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"user": "<string>",
"pass": "<string>",
"token": "<string>",
"config": "<string>"
}
]
}
'import requests
url = "https://api.torrin.app/api/storage/providers"
payload = { "providers": [
{
"provider": "<string>",
"endpoint": "<string>",
"region": "<string>",
"bucket": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"user": "<string>",
"pass": "<string>",
"token": "<string>",
"config": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providers: [
{
provider: '<string>',
endpoint: '<string>',
region: '<string>',
bucket: '<string>',
access_key: '<string>',
secret_key: '<string>',
user: '<string>',
pass: '<string>',
token: '<string>',
config: '<string>'
}
]
})
};
fetch('https://api.torrin.app/api/storage/providers', 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 => "https://api.torrin.app/api/storage/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'provider' => '<string>',
'endpoint' => '<string>',
'region' => '<string>',
'bucket' => '<string>',
'access_key' => '<string>',
'secret_key' => '<string>',
'user' => '<string>',
'pass' => '<string>',
'token' => '<string>',
'config' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.torrin.app/api/storage/providers"
payload := strings.NewReader("{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.torrin.app/api/storage/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.torrin.app/api/storage/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\",\n \"token\": \"<string>\",\n \"config\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "<string>"
}Authorizations
Your instance API key as a bearer token: Authorization: Bearer <api_key>.
/rest/1.0 also accepts ?auth_token=; /v0/store also accepts
X-StremThru-Store-Authorization: Bearer <api_key>.
Body
application/json
Response
OK.
Example:
"ok"
Was this page helpful?
⌘I