get__bucket_available
GET /bucket/available
Get Available Buckets
Retrieve a list of available storage buckets that can be used for creating new repositories. This endpoint returns buckets that are not currently being used by any MIRROR mode repositories.
Note: This endpoint respects workspace access controls. Users with global access can see all available buckets, while users with workspace-specific access can only see buckets within their accessible workspaces.
TypeScript Client Library
public getAvailableStorageBuckets = async (): Promise<StorageBucket[]> => {
return this.makeRequest<StorageBucket[]>('bucket/available', 'GET', null);
};Code Samples
# You can also use wget
curl -X GET https://backend.flashback.tech/bucket/available \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'GET https://backend.flashback.tech/bucket/available HTTP/1.1
Host: localhost:3000
Accept: application/jsonconst headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/bucket/available',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://backend.flashback.tech/bucket/available',
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://backend.flashback.tech/bucket/available', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://backend.flashback.tech/bucket/available', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getResponse()->getBody()->getContents());
}URL obj = new URL("https://backend.flashback.tech/bucket/available");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://backend.flashback.tech/bucket/available", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Example responses
200 Response
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Backup Bucket",
"storageType": "S3",
"bucket": "my-backup-bucket-2024",
"key": "AKIAIOSFODNN7EXAMPLE",
"status": "ONLINE",
"workspaceId": "workspace-123",
"createdAt": "2024-01-15T10:30:00Z"
}
]Responses
Response Schema
Status Code 200
» id
string
false
none
Unique identifier for the bucket
» name
string
false
none
Human-readable name for the bucket
» storageType
string
false
none
Cloud storage provider type
» bucket
string
false
none
Actual bucket name in cloud storage
» key
string
false
none
Access key for the storage provider
» status
string
false
none
Current status of the bucket
» workspaceId
string
false
none
Workspace ID the bucket belongs to (if any)
» createdAt
string(date-time)
false
none
Timestamp when the bucket was created
Enumerated Values
» storageType
S3
» storageType
GCS
» storageType
BLOB
Status Code 404
» success
boolean
false
none
none
» message
string
false
none
none
To perform this operation, you must be authenticated by means of one of the following methods: BearerAuth
Last updated
Was this helpful?