Object Locks

This page covers configuration and management of View collection objects.

Object Overview

Object Locks.

Endpoint, URL, and Supported Methods

Objects are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/objectlocks

Supported methods include: GET``DELETE

Structure

Objects have the following 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"
}
  • GUID GUID globally unique identifier for the object
  • TenantGUID GUID globally unique identifier for the tenant
  • NodeGUID ``GUID` globally unique identifier for the Node
  • BucketGUID``GUID globally unique identifier for the bucket
  • ObjectGUID GUID globally unique identifier for the object
  • OwnerGUID GUID globally unique identifier for the owner
  • Key string key of the object
  • Version string version of the object
  • IsReadLock boolean is having read lock
  • IsWriteLock boolean is having write lock
  • CreatedUtc datetime timestamp from creation, in UTC time

Enumerate

Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/objectlocks

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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def enumerateObjectLocks():
    objectLocks = configuration.ObjectLock.enumerate()
    print(objectLocks)

enumerateObjectLocks()

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/objectlocks/[objectlock-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.RetrieveObjectLock(Guid.Parse("<objectlock-guid>"));

Read all

o read all objects, call GET /v1.0/tenants/[tenant-guid]/objectlocks/. If the object exists, it will be returned as an array of JSON object in the response body

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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.RetrieveObjectLocks();

Delete

To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/objectlocks/[objectlock-guid].

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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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/");
            
Guid objectLockGuid = Guid.Parse("<objectlock-guid>");