Comprehensive guide to View's object lock management system, including concurrent access control, read/write locking, and object version management.
Overview
The View Object Lock management system provides comprehensive concurrent access control for objects within the View platform. Object locks enable safe concurrent operations by managing read and write access to objects, preventing data corruption and ensuring data consistency across multiple operations and users.
Key Features
- Concurrent Access Control: Manage simultaneous access to objects across multiple users and processes
- Read/Write Locking: Implement granular locking with separate read and write lock types
- Object Versioning: Track object versions for version-aware locking and conflict resolution
- Tenant Isolation: Object locks are isolated per tenant for enhanced security
- Node Association: Associate locks with specific nodes for distributed locking
- Owner Tracking: Track lock ownership for proper access control and cleanup
Supported Operations
- Enumerate: List all object locks with pagination support
- Read: Retrieve individual object lock configurations and metadata
- Read All: Get complete list of all object locks in the tenant
- Delete: Remove object locks to release access control
API Endpoints
Object locks are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/objectlocks
Supported HTTP Methods: GET
, DELETE
Object Lock Object Structure
Object lock objects contain comprehensive metadata for concurrent access control and object locking. Here's the complete structure:
{
"GUID": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"NodeGUID": "11111111-2222-3333-4444-555555555555",
"BucketGUID": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"OwnerGUID": "12345678-90ab-cdef-1234-567890abcdef",
"ObjectGUID": "99999999-8888-7777-6666-555555555555",
"Key": "documents/report.pdf",
"Version": "v1.2.3",
"IsReadLock": true,
"IsWriteLock": false,
"CreatedUtc": "2025-04-01T14:15:22.123Z"
}
Field Descriptions
- GUID (GUID): Globally unique identifier for the object lock
- TenantGUID (GUID): Globally unique identifier for the tenant
- NodeGUID (GUID): Globally unique identifier for the node managing the lock
- BucketGUID (GUID): Globally unique identifier for the bucket containing the object
- OwnerGUID (GUID): Globally unique identifier for the user who owns the lock
- ObjectGUID (GUID): Globally unique identifier for the locked object
- Key (string): Key or path of the locked object
- Version (string): Version of the object being locked
- IsReadLock (boolean): Indicates whether a read lock is active
- IsWriteLock (boolean): Indicates whether a write lock is active
- CreatedUtc (datetime): UTC timestamp when the lock was created
Enumerate Object Locks
Retrieves a paginated list of all object lock objects in the tenant using GET /v2.0/tenants/[tenant-guid]/objectlocks
. This endpoint provides comprehensive enumeration with pagination support for managing multiple object locks.
Request Parameters
No additional parameters required beyond authentication.
curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/objectlocks/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default", //access key
);
const enumerateObjectLocks = async () => {
try {
const response = await api.ObjectLock.enumerate();
console.log(response, "Object locks fetched successfully");
} catch (err) {
console.log("Error fetching Object locks:", err);
}
};
enumerateObjectLocks();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service
sdk = view_sdk.configure(
access_key="default",
base_url="localhost",
tenant_guid="default",
service_ports={Service.DEFAULT: 8000},
)
def enumerateObjectLocks():
objectLocks = configuration.ObjectLock.enumerate()
print(objectLocks)
enumerateObjectLocks()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
EnumerationResult<ObjectLock> response = await sdk.ObjectLock.Enumerate();
Response Structure
Returns a paginated list of object lock objects:
{
"Success": true,
"Timestamp": {
"Start": "2024-10-21T02:36:37.677751Z",
"TotalMs": 23.58,
"Messages": {}
},
"MaxResults": 10,
"IterationsRequired": 1,
"EndOfResults": true,
"RecordsRemaining": 0,
"Objects": [
{
"GUID": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"NodeGUID": "11111111-2222-3333-4444-555555555555",
"BucketGUID": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"OwnerGUID": "12345678-90ab-cdef-1234-567890abcdef",
"ObjectGUID": "99999999-8888-7777-6666-555555555555",
"Key": "documents/report.pdf",
"Version": "v1.2.3",
"IsReadLock": true,
"IsWriteLock": false,
"CreatedUtc": "2025-04-01T14:15:22.123Z"
}
],
"ContinuationToken": null
}
Read Object Lock
Retrieves object lock configuration and metadata by GUID using GET /v1.0/tenants/[tenant-guid]/objectlocks/[objectlock-guid]
. Returns the complete object lock configuration including all properties and metadata. If the object lock doesn't exist, a 404 error is returned.
Request Parameters
- objectlock-guid (string, Path, Required): GUID of the object lock object to retrieve
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/objectlocks/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default", //access key
);
const readObjectLock = async () => {
try {
const response = await api.ObjectLock.read(
"<objectlock-guid>"
);
console.log(response, "Object lock fetched successfully");
} catch (err) {
console.log("Error fetching Object lock:", err);
}
};
readObjectLock();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service
sdk = view_sdk.configure(
access_key="default",
base_url="localhost",
tenant_guid="default",
service_ports={Service.DEFAULT: 8000},
)
def readObjectLock():
objectLock = configuration.ObjectLock.retrieve("<objectlock-guid>")
print(objectLock)
readObjectLock()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
ObjectLock objectLock = await sdk.ObjectLock.Retrieve(Guid.Parse("<objectlock-guid>"));
Response
Returns the complete object lock configuration:
{
"GUID": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"NodeGUID": "11111111-2222-3333-4444-555555555555",
"BucketGUID": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"OwnerGUID": "12345678-90ab-cdef-1234-567890abcdef",
"ObjectGUID": "99999999-8888-7777-6666-555555555555",
"Key": "documents/report.pdf",
"Version": "v1.2.3",
"IsReadLock": true,
"IsWriteLock": false,
"CreatedUtc": "2025-04-01T14:15:22.123Z"
}
Read All Object Locks
Retrieves all object lock objects in the tenant using GET /v1.0/tenants/[tenant-guid]/objectlocks/
. Returns an array of object lock objects with complete configuration details for all locks in the tenant.
Request Parameters
No additional parameters required beyond authentication.
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/objectlocks' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default", //access key
);
const retrieveObjectLocks = async () => {
try {
const response = await api.ObjectLock.readAll();
console.log(response, "Object locks fetched successfully");
} catch (err) {
console.log("Error fetching Object locks:", err);
}
};
retrieveObjectLocks();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service
sdk = view_sdk.configure(
access_key="default",
base_url="localhost",
tenant_guid="default",
service_ports={Service.DEFAULT: 8000},
)
def readAllObjectLocks():
objectLocks = configuration.ObjectLock.retrieve_all()
print(objectLocks)
readAllObjectLocks()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
List<ObjectLock> objectLocks = await sdk.ObjectLock.RetrieveMany();
Response
Returns an array of all object lock objects:
[
{
"GUID": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"NodeGUID": "11111111-2222-3333-4444-555555555555",
"BucketGUID": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"OwnerGUID": "12345678-90ab-cdef-1234-567890abcdef",
"ObjectGUID": "99999999-8888-7777-6666-555555555555",
"Key": "documents/report.pdf",
"Version": "v1.2.3",
"IsReadLock": true,
"IsWriteLock": false,
"CreatedUtc": "2025-04-01T14:15:22.123Z"
},
{
"GUID": "b2c3d4e5-f6g7-8901-bcde-234567890abc",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"NodeGUID": "22222222-3333-4444-5555-666666666666",
"BucketGUID": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff",
"OwnerGUID": "23456789-01ab-cdef-2345-678901abcdef",
"ObjectGUID": "88888888-7777-6666-5555-444444444444",
"Key": "images/photo.jpg",
"Version": "v2.1.0",
"IsReadLock": false,
"IsWriteLock": true,
"CreatedUtc": "2025-04-01T15:30:45.789Z"
}
]
Delete Object Lock
Deletes an object lock by GUID using DELETE /v1.0/tenants/[tenant-guid]/objectlocks/[objectlock-guid]
. This operation permanently removes the object lock and releases access control for the associated object. Use with caution as this action cannot be undone.
Request Parameters
- objectlock-guid (string, Path, Required): GUID of the object lock object to delete
curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/objectlocks/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default", //access key
);
const deleteObjectLock = async () => {
try {
const response = await api.ObjectLock.delete(
"<objectlock-guid>"
);
console.log(response, "Object lock deleted successfully");
} catch (err) {
console.log("Error deleting Object lock:", err);
}
};
deleteObjectLock();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service
sdk = view_sdk.configure(
access_key="default",
base_url="localhost",
tenant_guid="default",
service_ports={Service.DEFAULT: 8000},
)
def deleteObjectLock():
objectLock = configuration.ObjectLock.delete("<objectlock-guid>")
print(objectLock)
deleteObjectLock()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
bool deleted = await sdk.ObjectLock.Delete(Guid.Parse("<objectlock-guid>"));
Response
Returns 204 No Content on successful deletion. No response body is returned.
Best Practices
When managing object locks in the View platform, consider the following recommendations for optimal concurrent access control:
- Lock Duration: Implement appropriate lock timeouts to prevent deadlocks and ensure system availability
- Lock Cleanup: Regularly monitor and clean up orphaned locks to maintain system performance
- Version Management: Use object versioning to implement optimistic locking and conflict resolution
- Access Patterns: Design applications to minimize lock contention and maximize concurrent access
- Monitoring: Implement monitoring for lock usage patterns and potential deadlock situations
Next Steps
After successfully managing object locks, you can:
- Concurrent Applications: Implement multi-user applications with safe concurrent object access
- Lock Management: Build administrative interfaces for monitoring and managing object locks
- Conflict Resolution: Implement version-aware conflict resolution mechanisms
- Performance Optimization: Optimize lock usage patterns for better system performance
- Integration: Integrate object locking with other View platform services and workflows