Comprehensive guide to View's object management system, including file storage, metadata management, versioning control, access control, and S3-compatible API integration for efficient data organization.
Overview
The View Object management system provides comprehensive support for file storage, metadata management, and data organization within buckets. Objects serve as the fundamental storage units in the View platform, offering versioning control, access management, and S3-compatible API integration for seamless data handling and retrieval.
Key Features
- File Storage: Complete support for storing and managing files of any type and size
- Metadata Management: Comprehensive metadata tracking including content type, document type, and hash values
- Versioning Control: Full object versioning support for data protection and rollback capabilities
- Access Control: Comprehensive ACL (Access Control List) management for security
- Tagging System: Flexible metadata tagging for object organization and management
- Range Requests: Support for partial content retrieval using HTTP range requests
- Expiration Control: Configurable object expiration for automated lifecycle management
- S3 Compatibility: Full compatibility with Amazon S3 API for seamless integration
- Hash Verification: Built-in MD5, SHA1, and SHA256 hash verification for data integrity
- Compression Support: Optional compression for storage optimization
Supported Operations
- Create: Upload new objects to buckets with metadata and content
- Read Data: Retrieve object content and data
- Read Metadata: Access object metadata and properties
- Read Range: Retrieve specific byte ranges of object content
- Update: Modify object metadata and properties
- Delete: Remove objects from buckets (with versioning support)
- Tag Management: Create, retrieve, and delete object tags
- ACL Management: Configure access control lists for object security
- Expiration Management: Set and manage object expiration times
API Endpoints
Objects are managed via the Storage server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects
Default Ports:
- View REST API: Port
8001
- S3-Compatible API: Port
8002
Supported HTTP Methods: GET
, HEAD
, PUT
, DELETE
Important: All object operations require appropriate authentication tokens.
Object Structure
Object metadata contains comprehensive information about stored files and their properties. Here's the complete structure:
{
"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"
}
Field Descriptions
- GUID (GUID): Globally unique identifier for the object
- TenantGUID (GUID): Globally unique identifier for the tenant
- NodeGUID (GUID): Globally unique identifier for the node where the object was written
- PoolGUID (GUID): Globally unique identifier for the storage pool holding the object
- BucketGUID (GUID): Globally unique identifier for the bucket holding the object
- OwnerGUID (GUID): Globally unique identifier for the user that wrote the object
- Key (string): The key for the object (filename)
- Version (string): The version of the object
- IsLatest (boolean): Whether this version is the latest version of the object
- IsDeleteMarker (boolean): Whether the object is a delete marker
- IsLocal (boolean): Whether the object contents are stored locally
- ContentType (string): The MIME content type of the object
- DocumentType (string): The document type classification of the object
- SourceUrl (string): The source URL for accessing the object
- MD5Hash (string): The MD5 hash as a hexadecimal string
- SHA1Hash (string): The SHA1 hash as a hexadecimal string
- SHA256Hash (string): The SHA256 hash as a hexadecimal string
- IsEncrypted (boolean): Whether the object is encrypted at rest
- WriteMode (enum): The write mode used (GUID, Key)
- CompressionType (enum): The compression type applied to the object
- ContentLength (long): The content length of the object in bytes
- CompressedLength (long): The compressed length of the object in bytes
- EncryptedLength (long): The encrypted length of the object in bytes
- CompressionRatioPercent (decimal): The compression ratio as a percentage
- CompressionRatioX (decimal): The compression ratio as a multiplier
- LastAccessUtc (datetime): UTC timestamp of the last access to the object
- LastModifiedUtc (datetime): UTC timestamp of the last modification
- CreatedUtc (datetime): UTC timestamp when the object was created
Important Notes
- File Storage: Objects represent stored files with comprehensive metadata tracking
- Versioning Support: Objects support versioning for data protection and rollback capabilities
- Hash Verification: Built-in hash verification ensures data integrity and corruption detection
- Access Control: Objects support comprehensive ACL management for security
- S3 Compatibility: Full compatibility with Amazon S3 API for seamless integration
Create Object
Creates a new object in a bucket using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]
. This endpoint allows you to upload files and data to buckets with automatic metadata generation.
Request Parameters
- key (string, Path, Required): File name/key for the object to be created
- Object Data (binary, Body, Required): The actual file content/data to be stored
- Content-Type (string, Header, Optional): MIME type of the content being uploaded
Important Notes
- File Upload: Uploads files and data to the specified bucket with the given key
- Metadata Generation: Automatically generates metadata including content type, size, and hash values
- Versioning Support: Creates new versions if bucket versioning is enabled
- S3 Compatibility: Fully compatible with S3 PUT object operations
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/hello.temp' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: text/plain' \
--data 'Hello, world!'
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const writeObject = async () => {
try {
const response = await api.object.create(
"<bucket-guid>",
"testsdk.temp",
"testobject"
);
console.log(response, "Object written successfully");
} catch (err) {
console.log("Error writing object:", err);
}
};
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def writeObject():
object = storage.Object.write_chunked("<bucket-guid>", "testsdk.temp", "testobject")
print(object)
writeObject()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
ObjectMetadata response = await sdk.Object.CreateChunked(Guid.Parse("<bucket-guid>"), "testsdk.temp", "testobject");
Response
Returns the created object metadata:
{
"GUID": "74ee4b8a-188e-4a73-8a42-3b7fb1ccb5e0",
"TenantGUID": "default",
"NodeGUID": "05a93a0c-bab0-4442-8444-a5863fabc9ec",
"PoolGUID": "default",
"BucketGUID": "example-data-bucket",
"OwnerGUID": "default",
"Key": "testsdk.temp",
"Version": "1",
"IsLatest": true,
"IsDeleteMarker": false,
"IsLocal": true,
"ContentType": "text/plain",
"DocumentType": "Text",
"SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/testsdk.temp",
"MD5Hash": "D41D8CD98F00B204E9800998ECF8427E",
"SHA1Hash": "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709",
"SHA256Hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"IsEncrypted": false,
"WriteMode": "GUID",
"CompressionType": "None",
"ContentLength": 9,
"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"
}
Read Object Data
Retrieves object content and data by key using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]
. Returns the actual file content/data of the object. If the object doesn't exist, a 404 error is returned.
Request Parameters
- key (string, Path, Required): File name/key of the object to retrieve
Response
Returns the raw object content/data as the response body with appropriate content-type headers.
Hello, world!
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/testsdk.temp' \
--header 'Authorization: Bearer ******'
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const readObjectData = async () => {
try {
const response = await api.object.readData(
"<bucket-guid>",
"testsdk.temp"
);
console.log(response, "Object data read successfully");
} catch (err) {
console.log("Error reading object data:", err);
}
};
readObjectData();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readObjectData():
object = storage.Object.retrieve("<bucket-guid>", "test.new")
print(object)
readObjectData()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
string response = await sdk.Object.Retrieve(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns the raw object content/data as the response body:
testobject
To read the metadata of an object, call GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?md
. This will return the JSON object below, which contains the properties described above. If the object does not exist, a 404 will be returned with a NotFound
error response.
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.
Read Object Data in Range
Retrieves a specific byte range of object content using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]
with a Range
header. This enables efficient partial content retrieval for large files.
Request Parameters
- key (string, Path, Required): File name/key of the object to retrieve
- Range (string, Header, Required): Byte range specification (e.g., "bytes=0-1023")
Important Notes
- Partial Content: Enables retrieval of specific byte ranges for efficient large file handling
- HTTP Range Support: Full support for HTTP range requests for streaming and partial downloads
- Performance Optimization: Reduces bandwidth usage for large file access
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/testsdk.temp' \
--header 'Range: bytes=2-3' \
--header 'Authorization: ••••••' \
--data ''
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const retrieveObjectDataInRange = async () => {
try {
const response = await api.object.readDataInRange(
"<bucket-guid>",
"testsdk.temp",
"bytes=1-3"
);
console.log(response, "Object data in range read successfully");
} catch (err) {
console.log("Error reading object data in range:", err);
}
};
retrieveObjectDataInRange();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readObjectDataInRange():
object = storage.Object.retrieve_range("<bucket-guid>", "test.new", 0, 2)
print(object)
readObjectDataInRange()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
string response = await sdk.Object.RetrieveRange(Guid.Parse("<bucket-guid>"), "test.new", 0, 2);
Response
Returns the specified byte range of object content:
te
Read Object Metadata
Retrieves object metadata and properties using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?md
. Returns comprehensive metadata including content type, size, hash values, and versioning information. If the object doesn't exist, a 404 error is returned.
Request Parameters
- key (string, Path, Required): File name/key of the object to retrieve metadata for
curl --location 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/hello.json?md=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 retrieveMetadata = async () => {
try {
const response = await api.object.readMetadata(
"<bucket-guid>",
"testsdk.temp"
);
console.log(response, "Metadata fetched successfully");
} catch (err) {
console.log("Error fetching metadata:", err);
}
};
retrieveMetadata();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readObjectMetadata():
object = storage.Object.retrieve_metadata("<bucket-guid>", "test.new")
print(object)
readObjectMetadata()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
ObjectMetadata response = await sdk.Object.RetrieveMetadata(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns the complete object metadata:
{
"GUID": "74ee4b8a-188e-4a73-8a42-3b7fb1ccb5e0",
"TenantGUID": "default",
"NodeGUID": "05a93a0c-bab0-4442-8444-a5863fabc9ec",
"PoolGUID": "default",
"BucketGUID": "example-data-bucket",
"OwnerGUID": "default",
"Key": "test.new",
"Version": "1",
"IsLatest": true,
"IsDeleteMarker": false,
"IsLocal": true,
"ContentType": "text/plain",
"DocumentType": "Text",
"SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/test.new",
"MD5Hash": "D41D8CD98F00B204E9800998ECF8427E",
"SHA1Hash": "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709",
"SHA256Hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"IsEncrypted": false,
"WriteMode": "GUID",
"CompressionType": "None",
"ContentLength": 9,
"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"
}
Set Object Expiration
Sets expiration time for an object using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?expiration
with ExpirationUtc
in the request body. This enables automated lifecycle management for object deletion.
Request Parameters
- key (string, Path, Required): File name/key of the object to set expiration for
- ExpirationUtc (datetime, Body, Required): UTC timestamp when the object should expire
Important Notes
- Lifecycle Management: Enables automated object deletion based on expiration timestamps
- Compliance Support: Useful for data retention policies and compliance requirements
- Automatic Cleanup: Objects are automatically deleted when the expiration time is reached
curl --location --request PUT 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/testsdk.temp?expiration=null' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data '{
"ExpirationUtc": "2026-09-15T00:00:00.000001Z"
}'
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const writeObjectExpiration = async () => {
try {
const response = await api.object.writeExpiration(
"<bucket-guid>",
"testsdk.temp",
{
ExpirationUtc: "2025-08-08T10:00:00Z",
}
);
console.log(response, "Object expiration written successfully");
} catch (err) {
console.log("Error writing object expiration:", err);
}
};
writeObjectExpiration();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def setObjectExpiration():
object = storage.Object.set_expiration("<bucket-guid>", "test.new", "2024-08-06T16:30:09.495213Z")
print(object)
setObjectExpiration()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
Expiration expiration = new Expiration
{
ExpirationUtc: "2025-08-08T10:00:00Z",
}
ObjectMetadata response = await sdk.Object.CreateExpiration(Guid.Parse("<bucket-guid>"), "test.new", expiration);
Response
Returns the updated object metadata with expiration set:
{
"GUID": "74ee4b8a-188e-4a73-8a42-3b7fb1ccb5e0",
"TenantGUID": "default",
"NodeGUID": "05a93a0c-bab0-4442-8444-a5863fabc9ec",
"PoolGUID": "default",
"BucketGUID": "example-data-bucket",
"OwnerGUID": "default",
"Key": "test.new",
"Version": "1",
"IsLatest": true,
"IsDeleteMarker": false,
"IsLocal": true,
"ContentType": "text/plain",
"DocumentType": "Text",
"SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/test.new",
"MD5Hash": "D41D8CD98F00B204E9800998ECF8427E",
"SHA1Hash": "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709",
"SHA256Hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"IsEncrypted": false,
"WriteMode": "GUID",
"CompressionType": "None",
"ContentLength": 9,
"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",
"ExpirationUtc": "2025-08-08T10:00:00.000000Z"
}
Delete Object
Deletes an object by key using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]
. The behavior depends on bucket versioning settings - if versioning is enabled, a delete marker is added; otherwise, the object is permanently deleted.
Request Parameters
- key (string, Path, Required): File name/key of the object to delete
Important Notes
- Versioning Behavior: Behavior depends on bucket versioning configuration
- Delete Markers: Versioned buckets create delete markers instead of permanent deletion
- Permanent Deletion: Non-versioned buckets permanently delete objects
- Recovery: Deleted objects in versioned buckets can be recovered by removing delete markers
curl --location --request DELETE 'http://view.homedns.org:8001/v1.0/tenants/00000000-0000-0000-0000-000000000000/buckets/00000000-0000-0000-0000-000000000000/objects/hello.json' \
--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 deleteObject = async () => {
try {
const response = await api.object.delete(
"<bucket-guid>",
"testsdk.temp"
);
console.log(response, "Object deleted successfully");
} catch (err) {
console.log("Error deleting object:", err);
}
};
deleteObject();;
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def deleteObject():
object = storage.Object.delete("<bucket-guid>w")
print(object)
deleteObject()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
ObjectMetadata response = await sdk.Object.Delete(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns 200 No Content on successful deletion. No response body is returned.
Create Object Tags
Creates tags for an object using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?tags
. This endpoint allows you to add metadata tags for object organization and management.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/testsdk.temp?tags=null' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data '[
{
"Key": "hello",
"Value": "My first key!"
}
]'
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const writeTagForObject = async () => {
try {
const response = await api.object.createTags(
"<bucket-guid>", //bucket id
"hello.json", //object key
[
{
Key: "hello",
Value: "My first key!",
},
]
);
console.log(response, "Tag written for object successfully");
} catch (err) {
console.log("Error writing tag for object:", err);
}
};
writeTagForObject();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def createObjectTags():
object = storage.ObjectTags.create_tags("<bucket-guid>", "test_sdk.new", [{"Key": "Name", "Value": "testbucket"}])
print(object)
createObjectTags()
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: "hello",
Value: "My first key!",
}
};
List<BucketTag> response = await sdk.Object.CreateTags(Guid.Parse("<bucket-guid>"), "test.new", tags);
Response
Returns the created object tags:
[
{
"Key": "hello",
"Value": "My first key!"
},
{
"Key": "environment",
"Value": "production"
}
]
Retrieve Object Tags
Retrieves tags for an object using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?tags
. Returns all tags associated with the specified object for metadata management and organization.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/hello.json?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 retrieveObjectTags = async () => {
try {
const response = await api.object.readTags(
"<bucket-guid>", //bucket id
"hello.json", //object key
);
console.log(response, "Object tags fetched successfully");
} catch (err) {
console.log("Error fetching object tags:", err);
}
};
retrieveObjectTags();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readObjectTags():
object = storage.ObjectTags.read_tags("<bucket-guid>", "test_sdk.new")
print(object)
readObjectTags()
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.Object.RetrieveTags(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns all tags associated with the object:
[
{
"Key": "hello",
"Value": "My first key!"
},
{
"Key": "Name",
"Value": "testbucket"
},
{
"Key": "Project",
"Value": "view-platform"
}
]
Delete Object Tags
Deletes all tags for an object using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?tags
. This operation permanently removes all tags associated with the object.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/hello.json?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 deleteObjectTags = async () => {
try {
const response = await api.object.deleteTags(
"<bucket-guid>", //bucket id
"hello.json", //object key
);
console.log(response, "Object tags deleted successfully");
} catch (err) {
console.log("Error deleting object tags:", err);
}
};
deleteObjectTags();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def deleteObjectTags():
object = storage.ObjectTags.delete_tags("<bucket-guid>", "test_sdk.new")
print(object)
deleteObjectTags()
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.Object.DeleteTags(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns 200 No Content on successful deletion. No response body is returned.
Create Object ACL
Creates an Access Control List (ACL) for an object using PUT /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?acl
. This endpoint allows you to configure access permissions for object security and user management.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/testsdk.temp?acl=null' \
--header 'Authorization: Bearer default' \
--header 'Content-Type: application/json' \
--data-raw '{
"Owner": {
"GUID": "00000000-0000-0000-0000-000000000000",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": true,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
},
"Entries": []
}'
import { ViewStorageSdk } from "view-sdk";
const api = new ViewStorageSdk(
"http://localhost:8001/", //endpoint
"<tenant-guid>", //tenant Id
"default" //access key
);
const createObjectACL = async () => {
try {
const response = await api.object.createACL(
"<bucket-guid>", //bucket id
"testsdk.temp",//object key
{
"Owner": {
"GUID": "<owner-guid>",
"TenantGUID": "<tenant-guid>",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": true,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
},
"Entries": []
}
);
console.log(response, "Object ACL created successfully");
} catch (err) {
console.log("Error creating object ACL:", err);
}
};
createObjectACL();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def createObjectACL():
object = storage.ObjectACL.create_acl("<bucket-guid>", "test_sdk.new", {
"Owner": {
"GUID": "<owner-guid>",
"TenantGUID": "<tenant-guid>",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": True,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
},
"Users": [],
"Entries": []
})
print(object)
createObjectACL()
using View.Sdk;
using View.Storage;
ViewStorageSdk sdk = new ViewStorageSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"),
"default",
"http://view.homedns.org:8000/");
BucketAcl acl = new BucketAcl
{
Owner = new UserMaster
{
GUID = "<owner-guid>",
TenantGUID = "<tenant-guid>",
FirstName = "Default",
LastName = "User",
FullName = "Default User",
Notes = "Default password is password",
Email = "[email protected]",
Active = true,
CreatedUtc = DateTime.Parse("2024-08-06T16:40:20.223290Z")
},
Users = new List<UserMaster>(),
Entries = new List<BucketAclEntry>()
};
List<BucketAclEntry> response = await sdk.Object.CreateACL(Guid.Parse("<bucket-guid>"), "test.new", acl);
Response
Returns the created object ACL configuration:
{
"Owner": {
"GUID": "00000000-0000-0000-0000-000000000000",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": true,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
},
"Users": [],
"Entries": []
}
Read Object ACL
Retrieves the Access Control List (ACL) for an object using GET /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?acl
. Returns the complete ACL configuration including owner information, user permissions, and access entries.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/hello.json?acl=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 readObjectACL = async () => {
try {
const response = await storage.api.object.readACL(
"<bucket-guid>", //bucket id
"testsdk.temp",//object key
);
console.log(response, "Object ACL fetched successfully");
} catch (err) {
console.log("Error fetching object ACL:", err);
}
};
readObjectACL();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readObjectACL():
object = storage.ObjectACL.read_acl("<bucket-guid>", "test_sdk.new")
print(object)
readObjectACL()
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.Object.RetrieveACL(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns the complete object ACL configuration:
{
"Owner": {
"GUID": "00000000-0000-0000-0000-000000000000",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": true,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
},
"Users": [
{
"GUID": "00000000-0000-0000-0000-000000000000",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"FirstName": "Default",
"LastName": "User",
"FullName": "Default User",
"Notes": "Default password is password",
"Email": "[email protected]",
"Active": true,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
}
],
"Entries": [
{
"GUID": "acl-entry-guid",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"BucketGUID": "example-data-bucket",
"OwnerGUID": "00000000-0000-0000-0000-000000000000",
"UserGUID": "00000000-0000-0000-0000-000000000000",
"CanonicalUser": "",
"EnableRead": true,
"EnableReadAcp": true,
"EnableWrite": false,
"EnableWriteAcp": false,
"FullControl": false,
"CreatedUtc": "2024-08-06T16:40:20.223290Z"
}
]
}
Delete Object ACL
Deletes the Access Control List (ACL) for an object using DELETE /v1.0/tenants/[tenant-guid]/buckets/[bucket-guid]/objects/[key]?acl
. This operation removes all ACL configurations and reverts to default access permissions.
Request Parameters
- key (string, Path, Required): File name/key of the 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/objects/hello.json?acl=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 deleteObjectACL = async () => {
try {
const response = await api.object.deleteACL(
"<bucket-guid>", //bucket id
"testsdk.temp",//object key
);
console.log(response, "Object ACL deleted successfully");
} catch (err) {
console.log("Error deleting object ACL:", err);
}
};
deleteObjectACL();
import view_sdk
from view_sdk import storage
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def deleteObjectACL():
object = storage.ObjectACL.delete_acl("<bucket-guid>", "test_sdk.new")
print(object)
deleteObjectACL()
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.Object.DeleteACL(Guid.Parse("<bucket-guid>"), "test.new");
Response
Returns 200 No Content on successful deletion. No response body is returned.
Best Practices
When managing objects in the View platform, consider the following recommendations for optimal file storage, security, and performance:
- Content Type Management: Set appropriate content-type headers for proper file handling and browser compatibility
- Access Control: Implement proper ACL configurations to ensure secure access to object contents
- Tagging Strategy: Use consistent tagging conventions for object organization and metadata management
- Versioning Utilization: Leverage object versioning for data protection and rollback capabilities
- Range Request Optimization: Use range requests for efficient large file access and streaming
Next Steps
After successfully managing objects, you can:
- Buckets: Organize objects within buckets for logical data grouping and management
- Multipart Uploads: Use multipart upload functionality for efficient large file handling
- Storage Pools: Configure storage pools to optimize data placement and performance
- Access Control: Implement comprehensive ACL settings for secure object access management
- Integration: Integrate object management with other View platform services for comprehensive data processing workflows