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
Show:
shell
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Example Responses
Show:
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

Update Segments Storage Targets

Change the bucket entity references in all relevant segment entities. The primary use case for this endpoint is for swapping between bucket providers in a controlled manner.

Description Change the bucket entity references in all relevant segment entities.  
MethodPOST /api/v1/bucket-storage-target/update-segments-storage-target 
Request Data  
Authentication Requiredyes 
Query ArgumentsDescriptionData typeRequired?
newStorageTargetId New storage target ID integerrequired
oldStorageTargetId Old storage target ID integerrequired
Return Codes 
200 Request complete  
400 Bad authentication  
500 Request failed  
http
POST /api/v1/bucket-storage-target/update-segments-storage-target
Show:
shell
curl -v -X POST $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target/update-segments-storage-target?oldStorageTargetId=$OLD_STORAGE_TARGET_ID&newStorageTargetId=$NEW_STORAGE_TARGET_ID \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"

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
Show:
shell
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/bucket-storage-target \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"