Skip to content

Apply Governance Lock (Object)

POST
/api/v1/storage/buckets/{bucket_name}/lock/object/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/object/?object_name=<OBJECT_NAME>&project_id=<PROJECT_ID>&location=<LOCATION>&version_id=<VERSION_ID>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"lock_mode": "GOVERNANCE",
"retention_period": 3
}'

This API allows users to apply governance lock to an object.

bucket_name
required
string

Bucket Name

object_name
required
string

Object Name with Directory.

project_id
required
integer
location
required
string
Allowed values: Delhi Chennai

Deployment region for the resource. Accepted values: Delhi, Chennai.

Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.

version_id
required
string

Example

740d0a130b0745ebb036bb866c87f847

Version ID

Media typeapplication/json
object
lock_mode
string
Allowed values: GOVERNANCE

Example

GOVERNANCE
retention_period
integer

Example

3

Response indicating that object retention has been set

Media typeapplication/json
object
code
integer
data
object
bucket_name
string
object_name
string
version_id
string
lock_mode
string
Allowed values: GOVERNANCE
retained_until
string format: date-time
errors
object
message
string

Example

{
"code": 200,
"data": {
"bucket_name": "example-bucket",
"object_name": "example-object.png",
"version_id": "abc123-version-id",
"lock_mode": "GOVERNANCE",
"retained_until": "2025-05-30T12:24:35.844118"
},
"errors": {},
"message": "Success"
}