POST
/api/v1/container_registry/replication/policies/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/container_registry/replication/policies/?cr_project_id=<CR_PROJECT_ID>&project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "policy_name": "replication-ruled", "policy_description": null, "registry_id": 40, "flattening_level": -1, "trigger_type": "manual", "trigger_value": null, "replicate_deletion": false, "override": true, "filters": [], "enabled": true}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/container_registry/replication/policies/", params={"cr_project_id": "<CR_PROJECT_ID>", "project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "policy_name": "replication-ruled", "policy_description": None, "registry_id": 40, "flattening_level": -1, "trigger_type": "manual", "trigger_value": None, "replicate_deletion": False, "override": True, "filters": [], "enabled": True, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/container_registry/replication/policies/");url.search = new URLSearchParams({ cr_project_id: "<CR_PROJECT_ID>", 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({ "policy_name": "replication-ruled", "policy_description": null, "registry_id": 40, "flattening_level": -1, "trigger_type": "manual", "trigger_value": null, "replicate_deletion": false, "override": true, "filters": [], "enabled": true }),});console.log(await response.json());Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”cr_project_id
required
integer
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
policy_name
string
Example
replication-ruledpolicy_description
string
Example
nullregistry_id
integer
Example
40flattening_level
integer
Example
-1trigger_type
string
Example
manualtrigger_value
string
Example
nullreplicate_deletion
boolean
Example
falseoverride
boolean
Example
truefilters
Array
Example
[]enabled
boolean
Example
trueResponses
Section titled “Responses”Replication policy created successfully.
Media typeapplication/json
object
code
integer
data
object
replication_details
object
copy_by_chunk
boolean
creation_time
string format: date-time
dest_namespace
string
dest_namespace_replace_count
integer
dest_registry
object
creation_time
string format: date-time
credential
object
access_secret
string
type
string
id
integer
insecure
boolean
name
string
status
string
type
string
update_time
string format: date-time
url
string
enabled
boolean
filters
object
id
integer
name
string
override
boolean
speed
integer
src_registry
object
creation_time
string format: date-time
credential
object
access_key
string
access_secret
string
type
string
description
string
id
integer
insecure
boolean
name
string
status
string
type
string
update_time
string format: date-time
url
string
trigger
object
trigger_settings
object
key
additional properties
type
string
update_time
string format: date-time
errors
object
key
additional properties
message
string
Example
{ "code": 200, "data": { "replication_details": { "copy_by_chunk": false, "creation_time": "2025-04-29T10:55:31.466Z", "dest_namespace": "cr-12345", "dest_namespace_replace_count": -1, "dest_registry": { "creation_time": "0001-01-01T00:00:00.000Z", "credential": { "access_secret": "*****", "type": "secret" }, "id": 0, "insecure": true, "name": "Local", "status": "healthy", "type": "harbor", "update_time": "0001-01-01T00:00:00.000Z", "url": "http://core:8080" }, "enabled": true, "filters": null, "id": 35, "name": "replication-ruled", "override": true, "speed": 0, "src_registry": { "creation_time": "2025-04-29T09:54:19.843Z", "credential": { "access_key": "<token_name>", "access_secret": "*****", "type": "basic" }, "description": "docker hub source registry", "id": 50, "insecure": true, "name": "docker-source", "status": "healthy", "type": "docker-hub", "update_time": "2025-04-29T10:03:49.718Z", "url": "https://hub.docker.com" }, "trigger": { "trigger_settings": {}, "type": "manual" }, "update_time": "2025-04-29T10:55:31.466Z" } }, "errors": {}, "message": "Replication Policy Created Successfully"}