Buckets

Comprehensive guide to View's bucket management system, including virtual repository configuration, object storage organization, versioning control, and S3-compatible API integration for efficient data management.

Overview

The View Bucket management system provides comprehensive configuration for virtual object storage repositories. Buckets serve as logical containers that organize and manage objects within the View platform, offering S3-compatible API integration, versioning control, and flexible storage pool allocation for efficient data organization and access.

Key Features

  • Virtual Repository Management: Logical containers for organizing and managing stored objects
  • S3-Compatible API: Full compatibility with Amazon S3 API for seamless integration
  • Versioning Control: Configurable object versioning for data protection and rollback capabilities
  • Storage Pool Integration: Flexible allocation to different storage pools for optimal data placement
  • Access Control: Comprehensive ACL (Access Control List) management for security
  • Tagging System: Flexible metadata tagging for object organization and management
  • Multipart Upload Support: Efficient handling of large file uploads through multipart operations
  • Regional Configuration: AWS-compatible region string configuration for geographic data placement

Supported Operations

  • Create: Create new bucket configurations with storage pool allocation
  • Read: Retrieve bucket metadata and configuration details
  • List Objects: Enumerate objects within buckets with pagination support
  • List Buckets: Retrieve all buckets in the tenant
  • Update: Modify bucket configurations and settings
  • Delete: Remove bucket configurations and associated data
  • Tag Management: Create, retrieve, and delete bucket tags
  • ACL Management: Configure access control lists for bucket security
  • Existence Check: Verify bucket presence without retrieving details

API Endpoints

Buckets are managed via the Storage server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/buckets or through the S3-compatible API.

Default Ports:

  • View REST API: Port 8001
  • S3-Compatible API: Port 8002

Supported HTTP Methods: GET, HEAD, PUT, DELETE

Important: All bucket operations require appropriate authentication tokens.

Bucket Object Structure

Bucket objects contain comprehensive configuration for virtual object storage repositories. Here's the complete structure:

{
    "GUID": "example-data-bucket",
    "TenantGUID": "default",
    "PoolGUID": "default",
    "OwnerGUID": "default",
    "Name": "example-data-bucket",
    "RegionString": "us-west-1",
    "Versioning": true,
    "MaxMultipartUploadSeconds": 604800,
    "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Field Descriptions

  • GUID (GUID): Globally unique identifier for the bucket object
  • TenantGUID (GUID): Globally unique identifier for the tenant
  • PoolGUID (GUID): Globally unique identifier for the storage pool used by the bucket
  • OwnerGUID (GUID): Globally unique identifier for the user that owns the bucket
  • Name (string): Display name for the bucket
  • RegionString (string): AWS-compatible region string for geographic configuration
  • Versioning (boolean): Whether object versioning is enabled for the bucket
  • MaxMultipartUploadSeconds (integer): Maximum seconds before expiring unfinished multipart uploads
  • LastAccessUtc (datetime): UTC timestamp of the last access to the bucket
  • CreatedUtc (datetime): UTC timestamp when the bucket was created

Important Notes

  • Virtual Repositories: Buckets serve as logical containers for organizing stored objects
  • Storage Pool Allocation: Buckets must be associated with valid storage pools for data placement
  • Versioning Control: Enables object versioning for data protection and rollback capabilities
  • S3 Compatibility: Full compatibility with Amazon S3 API for seamless integration

Create Bucket

Creates a new bucket configuration using PUT /v1.0/tenants/[tenant-guid]/buckets. This endpoint allows you to define virtual object storage repositories with storage pool allocation and versioning control.

Request Parameters

Required Parameters

  • PoolGUID (string, Body, Required): GUID of the storage pool to use for the bucket
  • Name (string, Body, Required): Display name for the bucket
  • RegionString (string, Body, Required): AWS-compatible region string (e.g., "us-west-1")
  • Versioning (boolean, Body, Required): Whether to enable object versioning

Optional Parameters

  • Category (enum, Body, Optional): Bucket category (Data, Metadata, Embeddings)
  • MaxMultipartUploadSeconds (integer, Body, Optional): Maximum seconds for multipart upload expiration (defaults to 604800)

Important Notes

  • Storage Pool Dependencies: Ensure the storage pool exists and is accessible before creating the bucket
  • Versioning Configuration: Enable versioning for data protection and rollback capabilities
  • Regional Configuration: Use appropriate region strings for geographic data placement
  • S3 Compatibility: Created buckets are fully compatible with S3 API operations
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "PoolGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "testbucket [ASH]",
    "RegionString": "us-west-1",
    "Versioning": true
}'
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const createBucket = async () => {
  try {
    const response = await api.bucket.create({
      PoolGUID: "<pool-guid>",
      Name: "testbucket",
      RegionString: "us-west-1",
      Versioning: true,
    });
    console.log(response, "Bucket created successfully");
  } catch (err) {
    console.log("Error creating bucket:", err);
  }
};
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def createBucket():
    bucket = storage.Bucket.create(
        PoolGUID="<pool-guid>",
        Name="testbucket",
        RegionString="us-west-1",
        Versioning=True
    )
    print(bucket)

createBucket()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
BucketMetadata bucket = new BucketMetadata
{
   PoolGUID="<pool-guid>",
   Name="testbucket",
   RegionString="us-west-1",
   Versioning=True
}
BucketMetadata response = await sdk.BucketMetadata.Create(bucket);

Response

Returns the created bucket object with all configuration details:

{
    "GUID": "example-data-bucket",
    "TenantGUID": "default",
    "PoolGUID": "default",
    "OwnerGUID": "default",
    "Name": "testbucket",
    "RegionString": "us-west-1",
    "Versioning": true,
    "MaxMultipartUploadSeconds": 604800,
    "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

List Bucket Objects

Enumerates objects within a bucket using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]. This endpoint provides access to all objects stored within the specified bucket with complete metadata information.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket to list objects from

Response Structure

The response includes comprehensive object metadata. Refer to the Objects page for detailed object metadata information.

curl --location 'http://ampere.view.io:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const retrieveBucketObjects = async () => {
  try {
    const response = await api.bucket.readObject(
      "<bucket-guid>"
    );
    console.log(response, "Buckets fetched successfully");
  } catch (err) {
    console.log("Error fetching buckets:", err);
  }
};

retrieveBucketObjects();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def readAllObjects():
    objects = storage.Bucket.list_objects("<bucket-guid>")
    print(objects)

readAllObjects()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
List<BucketMetadata> response = await sdk.Bucket.ListObjects(Guid.Parse("<bucket-guid>"))

Response

Returns an array of object metadata within the bucket:

[
    {
        "GUID": "74ee4b8a-188e-4a73-8a42-3b7fb1ccb5e0",
        "TenantGUID": "default",
        "NodeGUID": "05a93a0c-bab0-4442-8444-a5863fabc9ec",
        "PoolGUID": "default",
        "BucketGUID": "example-data-bucket",
        "OwnerGUID": "default",
        "Key": "1.pdf",
        "Version": "2",
        "IsLatest": true,
        "IsDeleteMarker": false,
        "IsLocal": true,
        "ContentType": "application/pdf",
        "DocumentType": "Pdf",
        "SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/1.pdf",
        "MD5Hash": "5DB1D1E8426F5381BEAB883076033F9E",
        "SHA1Hash": "09A31789FD9797C311B63C4D8EE9CC103B104066",
        "SHA256Hash": "F36DFAC021555765E6A617481613AB047850B8AB7D84DBD7870DF00CF6A1796B",
        "IsEncrypted": false,
        "WriteMode": "GUID",
        "CompressionType": "None",
        "ContentLength": 1686283,
        "CompressedLength": 0,
        "EncryptedLength": 0,
        "CompressionRatioPercent": 0,
        "CompressionRatioX": 0,
        "LastAccessUtc": "2024-10-25T15:49:58.000000Z",
        "LastModifiedUtc": "2024-10-25T15:49:58.000000Z",
        "CreatedUtc": "2024-10-25T15:49:58.000000Z"
    }
]

List Buckets

Retrieves all bucket objects in the tenant using GET /v1.0/tenants/[tenant-guid]/buckets. Returns an array of bucket objects with complete configuration details for all buckets in the tenant.

Request Parameters

No additional parameters required beyond authentication.

Response Structure

Returns an array containing the list of available buckets with complete metadata:

[
    {
        "GUID": "example-data-bucket",
        "TenantGUID": "default",
        "PoolGUID": "default",
        "OwnerGUID": "default",
        "Name": "example-data-bucket",
        "RegionString": "us-west-1",
        "Versioning": true,
        "MaxMultipartUploadSeconds": 604800,
        "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
        "CreatedUtc": "2024-07-10T05:09:32.000000Z"
    },
    { ... }
]
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const readAllBuckets = async () => {
  try {
    const response = await api.bucket.readAll();
    console.log(response, "Buckets fetched successfully");
  } catch (err) {
    console.log("Error fetching buckets:", err);
  }
};

readAllBuckets();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def readAllBuckets():
    buckets = storage.Bucket.list_buckets()
    print(buckets)

readAllBuckets()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
List<BucketMetadata> response = await sdk.Bucket.RetrieveMany()

Response

Returns an array of all bucket objects:

[
    {
        "GUID": "example-data-bucket",
        "TenantGUID": "default",
        "PoolGUID": "default",
        "OwnerGUID": "default",
        "Name": "example-data-bucket",
        "RegionString": "us-west-1",
        "Versioning": true,
        "MaxMultipartUploadSeconds": 604800,
        "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
        "CreatedUtc": "2024-07-10T05:09:32.000000Z"
    },
    {
        "GUID": "metadata-bucket",
        "TenantGUID": "default",
        "PoolGUID": "default",
        "OwnerGUID": "default",
        "Name": "metadata-bucket",
        "RegionString": "us-east-1",
        "Versioning": false,
        "MaxMultipartUploadSeconds": 604800,
        "LastAccessUtc": "2024-07-11T10:15:30.123456Z",
        "CreatedUtc": "2024-07-11T10:15:30.123456Z"
    }
]

Read Bucket Metadata

Retrieves bucket metadata and configuration by GUID using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?md. Returns the complete bucket configuration including storage pool allocation, versioning settings, and regional configuration. If the bucket doesn't exist, a 404 error is returned.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to retrieve metadata for
{
    "GUID": "example-data-bucket",
    "TenantGUID": "default",
    "PoolGUID": "default",
    "OwnerGUID": "default",
    "Name": "example-data-bucket",
    "RegionString": "us-west-1",
    "Versioning": true,
    "MaxMultipartUploadSeconds": 604800,
    "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?md=null' \
--header 'Authorization: ••••••' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const retrieveBucketMetadata = async () => {
  try {
    const response = await api.bucket.readMetadata(
      "<bucket-guid>"
    );
    console.log(response, "Bucket fetched successfully");
  } catch (err) {
    console.log("Error fetching bucket:", err);
  }
};

retrieveBucketMetadata();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def readBucketMetadata():
    bucket = storage.Bucket.retrieve_metadata("<bucket-guid>")
    print(bucket)

readBucketMetadata()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
BucketMetadata response = await sdk.Bucket.RetrieveMetadata(Guid.Parse("<bucket-guid>"))

Response

Returns the complete bucket configuration:

{
    "GUID": "example-data-bucket",
    "TenantGUID": "default",
    "PoolGUID": "default",
    "OwnerGUID": "default",
    "Name": "example-data-bucket",
    "RegionString": "us-west-1",
    "Versioning": true,
    "MaxMultipartUploadSeconds": 604800,
    "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

Update Bucket

Updates an existing bucket configuration using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]. This endpoint allows you to modify bucket parameters while preserving certain immutable fields.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to update

Updateable Fields

All configuration parameters can be updated except for:

  • GUID: Immutable identifier
  • TenantGUID: Immutable tenant association
  • OwnerGUID: Immutable owner association
  • CreatedUtc: Immutable creation timestamp

Important Notes

  • Field Preservation: Certain fields cannot be modified and will be preserved across updates
  • Complete Object: Provide a fully populated object in the request body
  • Configuration Validation: All updated parameters will be validated before applying changes
  • Impact Assessment: Consider the impact of bucket changes on existing objects and access patterns
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data '{
    "Name": "testbucket2",
    "RegionString": "us-west-1",
    "Versioning": true,
    "RetentionMinutes": 1
}'
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);


const updateBucket = async () => {
  try {
    const response = await api.bucket.update({
      GUID: "<bucket-guid>",
      Name: "testbucket [ASH1] [updated]",
      RegionString: "us-west-1",
      Versioning: true,
      MaxMultipartUploadSeconds: 604800,
    });
    console.log(response, "Bucket updated successfully");
  } catch (err) {
    console.log("Error updating bucket:", err);
  }
};

updateBucket();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def updateBucket():
    bucket = storage.Bucket.update(
        "<bucket-guid>",
        Name="testbucket",
        RegionString="us-west-1",
        Versioning=True
    )
    print(bucket)

updateBucket()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
BucketMetadata bucket = new BucketMetadata
{
   GUID="<bucket-guid>",
   Name="testbucket",
   RegionString="us-west-1",
   Versioning=True
}
BucketMetadata response = await sdk.Bucket.Update(bucket);

Response

Returns the updated bucket object with all configuration details:

{
    "GUID": "example-data-bucket",
    "TenantGUID": "default",
    "PoolGUID": "default",
    "OwnerGUID": "default",
    "Name": "testbucket2",
    "RegionString": "us-west-1",
    "Versioning": true,
    "MaxMultipartUploadSeconds": 604800,
    "LastAccessUtc": "2024-07-10T05:09:32.000000Z",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Delete Bucket

Deletes a bucket object by GUID using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]. This operation permanently removes the bucket configuration from the system. Use with caution as this action cannot be undone.

Important Note: The bucket must be empty before deletion. If the bucket contains objects, a 400 error will be returned.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to delete
curl --location --request DELETE 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: Bearer default' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const deleteBucket = async () => {
  try {
    const response = await api.bucket.delete(
      "<bucket-guid>"
    );
    console.log(response, "Bucket deleted successfully");
  } catch (err) {
    console.log("Error deleting bucket:", err);
  }
};

deleteBucket();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def deleteBucket():
    bucket = storage.Bucket.delete("<bucket-guid>")
    print(bucket)

deleteBucket()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
bool deleted = await sdk.Bucket.Delete(Guid.Parse("<bucket-guid>"))

Response

Returns 200 No Content on successful deletion. No response body is returned.

Create Bucket Tags

Creates tags for a bucket using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?tags. This endpoint allows you to add metadata tags for bucket organization and management.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to create tags for
  • Tags (array, Body, Required): Array of tag objects with Key and Value properties
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?tags=null' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data '[
    {
        "Key": "foo",
        "Value": "bar"
    }
]'
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const createBucketTags = async () => {
  try {
    const response = await api.bucket.createTags(
      "<bucket-guid>",
      [
        {
          Key: "test",
          Value: "test",
        },
      ]
    );
    console.log(response, "Bucket tags created successfully");
  } catch (err) {
    console.log("Error creating bucket tags:", err);
  }
};
createBucketTags();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def createBucketTags():
    bucket = storage.BucketTags.create("<bucket-guid>",
        [
            {"Key": "Name", "Value": "testbucket"},
        ]
    )
    print(bucket)

createBucketTags()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
List<BucketTag> tags = new List<BucketTag>
{
  new BucketTag
  {
    Key= "test",
    Value= "test",
  }
};
List<BucketTag> response = await sdk.Bucket.CreateTag(Guid.Parse("<bucket-guid>"), tags)

Response

Returns the created bucket tags:

[
    {
        "Key": "test",
        "Value": "test"
    },
    {
        "Key": "environment",
        "Value": "production"
    }
]

Retrieve Bucket Tags

Retrieves tags for a bucket using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?tags. Returns all tags associated with the specified bucket for metadata management and organization.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to retrieve tags for
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?tags=null' \
--header 'Authorization: Bearer default'
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const retrieveBucketTags = async () => {
  try {
    const response = await api.bucket.readTags(
      "<bucket-guid>"
    );
    console.log(response, "Bucket tags fetched successfully");
  } catch (err) {
    console.log("Error fetching bucket tags:", err);
  }
};

retrieveBucketTags();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def readBucketTag():
    bucket = storage.BucketTags.retrieve("<bucket-guid>")
    print(bucket)

readBucketTag()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");

List<BucketTag> response = await sdk.Bucket.RetrieveTags(Guid.Parse("<bucket-guid>"))

Response

Returns all tags associated with the bucket:

[
    {
        "Key": "Name",
        "Value": "testbucket"
    },
    {
        "Key": "Environment",
        "Value": "production"
    },
    {
        "Key": "Project",
        "Value": "view-platform"
    }
]

Delete Bucket Tags

Deletes all tags for a bucket using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?tags. This operation permanently removes all tags associated with the bucket.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to delete tags from
curl --location --request DELETE 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?tags=null' \
--header 'Authorization: Bearer default' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const deleteBucketTags = async () => {
  try {
    const response = await api.bucket.deleteTags(
      "<bucket-guid>"
    );
    console.log(response, "Bucket tags deleted successfully");
  } catch (err) {
    console.log("Error deleting bucket tags:", err);
  }
};

deleteBucketTags();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def deleteBucketTag():
    bucket = storage.BucketTags.delete("<bucket-guid>")
    print(bucket)

deleteBucketTag()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");

bool deleted = await sdk.Bucket.DeleteTag(Guid.Parse("<bucket-guid>"))

Response

Returns 204 No Content on successful deletion. No response body is returned.


Create Bucket ACL

Creates an Access Control List (ACL) for a bucket using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?acl. This endpoint allows you to configure access permissions for bucket security and user management.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to create ACL for
  • ACL Configuration (object, Body, Required): Complete ACL configuration with Owner, Users, and Entries
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?acl=null' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Owner": {
        "GUID": "default",
        "TenantGUID": "default",
        "FirstName": "Default",
        "LastName": "User",
        "FullName": "Default User",
        "Notes": "Default password is password",
        "Email": "[email protected]",
        "Active": true,
        "CreatedUtc": "2024-08-06T16:30:09.495213Z"
    },
    "Users": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "FirstName": "Default",
            "LastName": "User",
            "FullName": "Default User",
            "Notes": "Default password is password",
            "Email": "[email protected]",
            "Active": true,
            "CreatedUtc": "2024-08-06T16:30:09.495213Z"
        }
    ],
    "Entries": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "OwnerGUID": "default",
            "UserGUID": "default",
            "CanonicalUser": "",
            "EnableRead": true,
            "EnableReadAcp": true,
            "EnableWrite": true,
            "EnableWriteAcp": true,
            "FullControl": true,
            "CreatedUtc": "2024-08-06T16:30:09.643691Z"
        }
    ]
}'
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const createBucketACL = async () => {
  try {
    const response = await api.bucket.createACL(
      "<bucket-guid>",
      {
        Owner: {
          GUID: "default",
          TenantGUID: "default",
          FirstName: "Default",
          LastName: "User",
          FullName: "Default User",
          Notes: "Default password is password",
          Email: "[email protected]",
          Active: true,
          CreatedUtc: "2024-08-06T16:30:09.495213Z",
        },
        Users: [
          {
            GUID: "default",
            TenantGUID: "default",
            FirstName: "Default",
            LastName: "User",
            FullName: "Default User",
            Notes: "Default password is password",
            Email: "[email protected]",
            Active: true,
            CreatedUtc: "2024-08-06T16:30:09.495213Z",
          },
        ],
        Entries: [
          {
            GUID: "default",
            TenantGUID: "default",
            BucketGUID: "example-data-bucket",
            OwnerGUID: "default",
            UserGUID: "default",
            CanonicalUser: "",
            EnableRead: true,
            EnableReadAcp: true,
            EnableWrite: true,
            EnableWriteAcp: true,
            FullControl: true,
            CreatedUtc: "2024-08-06T16:30:09.643691Z",
          },
        ],
      }
    );
    console.log(response, "Bucket ACL created successfully");
  } catch (err) {
    console.log("Error creating bucket ACL:", err);
  }
};

createBucketACL();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def createBucketACL():
    bucket = storage.BucketACL.create("<bucket-guid>",
    {
          "Owner": {
                "GUID": "default",
                "TenantGUID": "default",
                "FirstName": "Default",
                "LastName": "User",
                "FullName": "Default User",
                "Notes": "Default password is password",
                "Email": "[email protected]",
                "Active": True,
                "CreatedUtc": "2024-08-06T16:30:09.495213Z"
             },
    "Users": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "FirstName": "Default",
            "LastName": "User",
            "FullName": "Default User",
            "Notes": "Default password is password",
            "Email": "[email protected]",
            "Active": True,
            "CreatedUtc": "2024-08-06T16:30:09.495213Z"
        }
    ],
    "Entries": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "OwnerGUID": "default",
            "UserGUID": "default",
            "CanonicalUser": "",
            "EnableRead": True,
            "EnableReadAcp": True,
            "EnableWrite": True,
            "EnableWriteAcp": True,
            "FullControl": True,
            "CreatedUtc": "2024-08-06T16:30:09.643691Z"
        }
        ]
    }
    )
    print(bucket)

createBucketACL()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");
BucketAclEntry acl = new BucketAcl
        {
            Owner = new UserMaster
            {
                GUID = "default",
                TenantGUID = "default",
                FirstName = "Default",
                LastName = "User",
                FullName = "Default User",
                Notes = "Default password is password",
                Email = "[email protected]",
                Active = true,
                CreatedUtc = DateTime.Parse("2024-08-06T16:30:09.495213Z")
            },
            Users = new List<UserMaster>
            {
                new UserMaster
                {
                    GUID = "default",
                    TenantGUID = "default",
                    FirstName = "Default",
                    LastName = "User",
                    FullName = "Default User",
                    Notes = "Default password is password",
                    Email = "[email protected]",
                    Active = true,
                    CreatedUtc = DateTime.Parse("2024-08-06T16:30:09.495213Z")
                }
            },
            Entries = new List<BucketAclEntry>
            {
                new BucketAclEntry
                {
                    GUID = "default",
                    TenantGUID = "default",
                    BucketGUID = "example-data-bucket",
                    OwnerGUID = "default",
                    UserGUID = "default",
                    CanonicalUser = string.Empty,
                    EnableRead = true,
                    EnableReadAcp = true,
                    EnableWrite = true,
                    EnableWriteAcp = true,
                    FullControl = true,
                    CreatedUtc = DateTime.Parse("2024-08-06T16:30:09.643691Z")
                }
            }
        };
List<BucketAclEntry> response = await sdk.Bucket.CreateTag(Guid.Parse("<bucket-guid>"), acl)

Response

Returns the created bucket ACL configuration:

{
    "Owner": {
        "GUID": "default",
        "TenantGUID": "default",
        "FirstName": "Default",
        "LastName": "User",
        "FullName": "Default User",
        "Notes": "Default password is password",
        "Email": "[email protected]",
        "Active": true,
        "CreatedUtc": "2024-08-06T16:30:09.495213Z"
    },
    "Users": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "FirstName": "Default",
            "LastName": "User",
            "FullName": "Default User",
            "Notes": "Default password is password",
            "Email": "[email protected]",
            "Active": true,
            "CreatedUtc": "2024-08-06T16:30:09.495213Z"
        }
    ],
    "Entries": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "OwnerGUID": "default",
            "UserGUID": "default",
            "CanonicalUser": "",
            "EnableRead": true,
            "EnableReadAcp": true,
            "EnableWrite": true,
            "EnableWriteAcp": true,
            "FullControl": true,
            "CreatedUtc": "2024-08-06T16:30:09.643691Z"
        }
    ]
}

Read Bucket ACL

Retrieves the Access Control List (ACL) for a bucket using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?acl. Returns the complete ACL configuration including owner information, user permissions, and access entries.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to retrieve ACL for
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?acl=null' \
--header 'Authorization: Bearer default' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const retrieveBucketACL = async () => {
  try {
    const response = await api.bucket.readACL(
      "<bucket-guid>"
    );
    console.log(response, "Bucket ACL fetched successfully");
  } catch (err) {
    console.log("Error fetching bucket ACL:", err);
  }
};

retrieveBucketACL();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def readBucketACL():
    bucket = storage.BucketACL.retrieve("<bucket-guid>")
    print(bucket)

readBucketACL()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");

BucketAcl response = await sdk.Bucket.RetrieveACL(Guid.Parse("<bucket-guid>"))

Response

Returns the complete bucket ACL configuration:

{
    "Owner": {
        "GUID": "default",
        "TenantGUID": "default",
        "FirstName": "Default",
        "LastName": "User",
        "FullName": "Default User",
        "Notes": "Default password is password",
        "Email": "[email protected]",
        "Active": true,
        "CreatedUtc": "2024-08-06T16:30:09.495213Z"
    },
    "Users": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "FirstName": "Default",
            "LastName": "User",
            "FullName": "Default User",
            "Notes": "Default password is password",
            "Email": "[email protected]",
            "Active": true,
            "CreatedUtc": "2024-08-06T16:30:09.495213Z"
        }
    ],
    "Entries": [
        {
            "GUID": "default",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "OwnerGUID": "default",
            "UserGUID": "default",
            "CanonicalUser": "",
            "EnableRead": true,
            "EnableReadAcp": true,
            "EnableWrite": true,
            "EnableWriteAcp": true,
            "FullControl": true,
            "CreatedUtc": "2024-08-06T16:30:09.643691Z"
        }
    ]
}

Delete Bucket ACL

Deletes the Access Control List (ACL) for a bucket using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]?acl. This operation removes all ACL configurations and reverts to default access permissions.

Request Parameters

  • bucket-guid (string, Path, Required): GUID of the bucket object to delete ACL for
curl --location --request DELETE 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000?acl=null' \
--header 'Authorization: Bearer default' \
--data ''
import { ViewStorageSdk } from "view-sdk";

const api = new ViewStorageSdk(
  "http://localhost:8001/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const deleteBucketACL = async () => {
  try {
    const response = await api.bucket.deleteACL(
      "<bucket-guid>"
    );
    console.log(response, "Bucket ACL deleted successfully");
  } catch (err) {
    console.log("Error deleting bucket ACL:", err);
  }
};

deleteBucketACL();
import view_sdk
from view_sdk import storage
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="tenant-guid",
    service_ports={Service.STORAGE: 8001},
)

def deleteBucketACL():
    bucket = storage.BucketACL.delete("<bucket-guid>")
    print(bucket)

deleteBucketACL()
using View.Sdk;
using View.Storage;

ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                        "default", 
                                        "http://view.homedns.org:8000/");

bool deleted = await sdk.Bucket.DeleteACL(Guid.Parse("<bucket-guid>"))

Response

Returns 204 No Content on successful deletion. No response body is returned.

Best Practices

When managing buckets in the View platform, consider the following recommendations for optimal object storage organization and security:

  • Storage Pool Allocation: Choose appropriate storage pools based on performance requirements and data access patterns
  • Versioning Configuration: Enable versioning for critical data to provide rollback capabilities and data protection
  • Access Control: Implement proper ACL configurations to ensure secure access to bucket contents
  • Tagging Strategy: Use consistent tagging conventions for bucket organization and management
  • Regional Configuration: Configure appropriate region strings for geographic data placement and compliance

Next Steps

After successfully configuring buckets, you can:

  • Objects: Upload and manage objects within your configured buckets for data storage
  • Multipart Uploads: Use multipart upload functionality for efficient large file handling
  • Storage Pools: Set up additional storage pools to optimize data placement and performance
  • Access Control: Configure comprehensive ACL settings for secure bucket access management
  • Integration: Integrate buckets with other View platform services for comprehensive data processing workflows