/db2whrest/v1/buckets/<bucket>: PUT

Modifies the bucket details.

The following table shows which roles can access this REST API endpoint:
Table 1. Access by role
Data admin Data user Collection Admin Admin Service user
Χ Χ Χ Χ
To modify the details of a bucket, you must create a JSON object that is modeled after the original (or existing) bucket definition as shown in the sample:
{
  "name": "SizeRange",
  "source_field": "size",
  "type": "int"
  "ranges": {
    "extra small": [ 0, 4096 ],
    "small": [ 4096, 1048576 ],
    "medium": [ 1048576, 1073741824 ],
    "large": [ 1073741824, 1099511627776 ],
    "extra large": [ 1099511627776, "INFINITY" ]
  }
}

{
  "name": "TimeSinceAccess", 
  "source_field": "atime", 
  "type": "date",
  "ranges": {
    "1 week\": [ 0, 7 ],
    "1 month": [ 7, 30 ],
    "1 quarter": [ 30, 90 ],
    "1 year": [ 90, 365 ],
    "1 year+": [ 365, "INFINITY" ]
    }
}

{
  "name": "FileGroup",
  "type": "list",
  "ranges": {
    "pdf": [ "pdf" ],
    "doc": [ "doc", "docx", "odt" ],
    "xls": [ "xls", "xlsm", "xlsx", "ods" ],
    "image": [ "jpg", "jpeg", "png", "gif", "tif" ],
    "ppt": [ "pptx", "ppt", "pps", "odp" ],
    "compressed": [ "zip", "tar", "gz", "z", "7z", "xz" ],
    "text": [ "txt", "rtf" ],
    "audio": [ "mp3", "wav" ],
    "video": [ "mp4", "mov", "mpg", "mkv" ],
    "medical_image": [ "img", "hdr", "nii", "mnc", "dcm" ],
    "genomics": [ "bam", "sam", "vcf" ],
    "semi_structured": [ "csv", "tsv", "avro", "json", "xml", "parquet" ]
  },
  "source_field": "filetype"
}

The JSON object must be based on the default values of the bucket. You can modify the range labels or values. The bucket name, source_field, and bucket types cannot be modified.

The three bucket types that are supported include:
int
For the int types, each range consists of a label and a minimum and maximum value. The only 'int' type bucket that is supported currently is SizeRange. The units for 'SizeRange' are in bytes. A sample int type appears as shown:
"small": [4096, 8192]
date
For the date types, each range consists of a label and a minimum and maximum value that represents the number of days. The only 'date' type bucket that is supported in the current version is TimeSinceAccess. A sample date range appears as shown:
"1_to_2_years": [365, 730]
list
For the list types, each range consists of a label and a list of at least one string value. The only 'list' type bucket that is supported in the current version is FileGroup. The list of values must be a list of file extensions to be grouped. A sample list range appears as shown:
"images": ["jpg", "jpeg", "gif", "png", "bmp"]

Synopsis of the request URL

 curl -k -H 'Authorization: Bearer <token>' https://<spectrum_discover_host>/db2whrest/v1/buckets/<bucket> -X PUT -d@bucket.json -H "Content-Type: application/json

Supported request types and response formats

Supported request types:
  • PUT
Supported response formats:
  • JSON

Examples

The following example shows how to modify information for a single bucket.
  1. Submit the request:
    curl -k -H 'Authorization: Bearer <token>' https://<master_node>/db2whrest/v1/buckets/SizeRange -X PUT -d@bucket.json -H "Content-Type: application/json
  2. The following response is returned:
    
    [
      {
        "status": "success"
      }
    ]