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
MethodGET /api/v1/bucket-storage-target
Response Databucket
Authentication Requiredyes
Return Codes
200 Request complete
400 Bad authentication
500 Request failed
http
GET /api/v1/bucket-storage-target
Mac OS or Linux (curl)
shell
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Mac OS or Linux (curl) One-line
shell
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Windows Cmd and curl
cmd
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json"
Windows Powershell and curl
powershell
curl.exe -X GET 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;
my $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";
Python
python
#! /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)
Node.js
javascript
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);
}
Example Responses
Success (200)
json
[
  {
    "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:

FieldTypeDescription
bucketstring The name of the storage bucket within the cluster
idinteger The ID of the storage bucket within the cluster
keyPrefixstring The prefix used for...
providerstring The provider for the storage bucket
readOnlyboolean If the storage bucket is read-only
regionstring Region annotation for location of the storage bucket
segmentsUsingBucketinteger Number of segments using the storage bucket
uploadedFilesUsingBucketinteger 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
MethodDELETE /api/v1/bucket-storage-target/id
Authentication Requiredyes
Path ArgumentsDescriptionData typeRequired?
id ID of the bucket storage configuration stringrequired
Query ArgumentsDescriptionData typeRequired?
force Force deletion of the bucket storage configuration booleanoptional
 Supported Values 
 falseDeletes only if not used in an active configuration
 trueForce deletion even if used in an active configuration
Return Codes
200 Request complete
400 Bad authentication
500 Request failed
http
DELETE /api/v1/bucket-storage-target/1
DELETE /api/v1/bucket-storage-target/1?force=true
Mac OS or Linux (curl)
shell
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Mac OS or Linux (curl) One-line
shell
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Windows Cmd and curl
cmd
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json"
Windows Powershell and curl
powershell
curl.exe -X DELETE 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;
my $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";
Python
python
#! /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)
Node.js
javascript
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);
}