POST
/api/v1/storage/buckets/{bucket_name}/lock/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "lock_mode": "GOVERNANCE", "retention_period": 3}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "lock_mode": "GOVERNANCE", "retention_period": 3, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/storage/buckets/{bucket_name}/lock/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "lock_mode": "GOVERNANCE", "retention_period": 3 }),});console.log(await response.json());This API allows users to apply governance lock to a bucket.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”bucket_name
required
string
Bucket Name
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
Request Body
Section titled “Request Body”Media typeapplication/json
object
lock_mode
string
Example
GOVERNANCEretention_period
integer
Example
3Responses
Section titled “Responses”Successful retrieval of the bucket retention policy.
Media typeapplication/json
object
code
integer
data
object
bucket
integer
mode
string
retention_period
integer
created_at
string format: date-time
updated_at
string format: date-time
errors
object
message
string
Example
{ "code": 200, "data": { "bucket": 12345, "mode": "GOVERNANCE", "retention_period": 5, "created_at": "2025-05-27T13:50:12.651315Z", "updated_at": "2025-05-27T13:50:12.651385Z" }, "errors": {}, "message": "Success"}