Create Bucket
curl --request PUT \
--url https://api.tenbytecloud.com/v1/storage/bucket \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: <api-key>' \
--data 'name=<string>'import requests
url = "https://api.tenbytecloud.com/v1/storage/bucket"
payload = { "name": "<string>" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({name: '<string>'})
};
fetch('https://api.tenbytecloud.com/v1/storage/bucket', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/storage/bucket"
payload := strings.NewReader("name=%3Cstring%3E")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/storage/bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "name=%3Cstring%3E"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.put("https://api.tenbytecloud.com/v1/storage/bucket")
.header("apikey", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("name=%3Cstring%3E")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/storage/bucket");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddParameter("name", "<string>");
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/storage/bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "name=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "pang1",
"size_bytes": 0,
"billing_account_id": 129093,
"num_objects": 0
}Object Storage
Create Bucket
Create an S3 object storage bucket. Bucket names must be globally unique across all users.
PUT
/
storage
/
bucket
Create Bucket
curl --request PUT \
--url https://api.tenbytecloud.com/v1/storage/bucket \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: <api-key>' \
--data 'name=<string>'import requests
url = "https://api.tenbytecloud.com/v1/storage/bucket"
payload = { "name": "<string>" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({name: '<string>'})
};
fetch('https://api.tenbytecloud.com/v1/storage/bucket', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/storage/bucket"
payload := strings.NewReader("name=%3Cstring%3E")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/storage/bucket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "name=%3Cstring%3E"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.put("https://api.tenbytecloud.com/v1/storage/bucket")
.header("apikey", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("name=%3Cstring%3E")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/storage/bucket");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddParameter("name", "<string>");
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/storage/bucket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "name=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "pang1",
"size_bytes": 0,
"billing_account_id": 129093,
"num_objects": 0
}⌘I