Manage Bucket Storage Targets
List Bucket Storage Targets
LogScale keeps a record of all the buckets that have ever been
configured, even if the bucket is not in the current configuration. For
the GET
form, this endpoint returns the list of storage
buckets that LogScale is aware of. The output returns the list
of known buckets, and a value for the storage used and managed by
LogScale within those buckets.
Description | Returns a list of the known buckets used for storage | |
Method | GET /api/v1/bucket-storage-target | |
Response Data | bucket | |
Authentication Required | yes | |
Return Codes | ||
200 | Request complete | |
400 | Bad authentication | |
500 | Request failed |
GET /api/v1/bucket-storage-target
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target ^
-H "Authorization: Bearer $TOKEN" ^
-H "Content-Type: application/json"
curl.exe -X GET
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
#!/usr/bin/perl
use HTTP::Request;
use LWP;
my $INGEST_TOKEN = "TOKEN";
my $uri = '$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target';
my $req = HTTP::Request->new("GET", $uri );
$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");
my $lwp = LWP::UserAgent->new;
my $result = $lwp->request( $req );
print $result->{"_content"},"\n";
#! /usr/local/bin/python3
import requests
url = '$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target'
resp = requests.get(url,
headers = {
"Authorization" : "Bearer $TOKEN",
"Content-Type" : "application/json"
}
)
print(resp.text)
const https = require('https');
let request = https.get('$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target', (res) => {
if (res.statusCode !== 200) {
console.error(`Error from server. Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('close', () => {
console.log('Response:');
console.log(JSON.parse(data));
});
});
return(undef,undef);
}
[
{
"bucket": "bucket1",
"id": "1",
"keyPrefix": "logscale/",
"provider": "s3",
"readOnly": false,
"region": "us-east-1",
"segmentsUsingBucket": 1277,
"uploadedFilesUsingBucket": 1
}
]
The returned JSON has the following structure:
Table: Response Structure
Field | Type | Description |
---|---|---|
bucket | string | The name of the storage bucket within the cluster |
id | integer | The ID of the storage bucket within the cluster |
keyPrefix | string | The prefix used for... |
provider | string | The provider for the storage bucket |
readOnly | boolean | If the storage bucket is read-only |
region | string | Region annotation for location of the storage bucket |
segmentsUsingBucket | integer | Number of segments using the storage bucket |
uploadedFilesUsingBucket | integer | Number of files uploaded using the storage bucket |
Delete Bucket Storage Targets
To delete an entry for an unnecessary bucket, use the
DELETE
command, specifying the bucket number
(id from the
returned JSON). The command deletes the bucket entry if LogScale
thinks the bucket no longer contains data that is still required by the
cluster. To delete the bucket forcibly, for example, when the bucket has
been lost, set the force
parameter to true. Note that this will result in data loss.
Description | Deletes a bucket storage configuration | ||
Method | DELETE /api/v1/bucket-storage-target/ | ||
Authentication Required | yes | ||
Path Arguments | Description | Data type | Required? |
id | ID of the bucket storage configuration | string | required |
Query Arguments | Description | Data type | Required? |
force | Force deletion of the bucket storage configuration | boolean | optional |
Supported Values | |||
false | Deletes only if not used in an active configuration | ||
true | Force deletion even if used in an active configuration | ||
Return Codes | |||
200 | Request complete | ||
400 | Bad authentication | ||
500 | Request failed |
DELETE /api/v1/bucket-storage-target/1
DELETE /api/v1/bucket-storage-target/1?force=true
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target ^
-H "Authorization: Bearer $TOKEN" ^
-H "Content-Type: application/json"
curl.exe -X DELETE
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
#!/usr/bin/perl
use HTTP::Request;
use LWP;
my $INGEST_TOKEN = "TOKEN";
my $uri = '$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target';
my $req = HTTP::Request->new("DELETE", $uri );
$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");
my $lwp = LWP::UserAgent->new;
my $result = $lwp->request( $req );
print $result->{"_content"},"\n";
#! /usr/local/bin/python3
import requests
url = '$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target'
resp = requests.delete(url,
headers = {
"Authorization" : "Bearer $TOKEN",
"Content-Type" : "application/json"
}
)
print(resp.text)
const https = require('https');
let request = https.delete('$YOUR_LOGSCALE_URL/api/v1/bucket-storage-target', (res) => {
if (res.statusCode !== 200) {
console.error(`Error from server. Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('close', () => {
console.log('Response:');
console.log(JSON.parse(data));
});
});
return(undef,undef);
}