Skip to content

Replication

All operations require authentication.

6 operationsv2/publicCloud/project
View as Markdown (opens in a new tab)
Agent setup

List replication rulesProduction

GET
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication

Returns the rules that copy new objects to other buckets.

Path parameters

bucketName
required
string

Bucket name

projectId
required
string

Project ID

Response

200ReplicationRulesResponsesuccessful operation
rules
read-only
ReplicationRule[]

Array of replication rules

409objectError 409 response

Example uses bucketName = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "rules": [ { "deleteMarkerReplication": "DISABLED", "destination": { "name": "string", "region": "string", "storageClass": "DEEP_ARCHIVE" }, "filter": { "prefix": "string", "tags": { "key": "string" } }, "id": "string", "priority": 0, "status": "DISABLED" } ]}

Replace replication rulesProduction

PUT
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication

Replaces all replication rules of the bucket. An empty list deletes all rules.

Path parameters

bucketName
required
string

Bucket name

projectId
required
string

Project ID

Request body (required)

rules
required
ReplicationRule[]

Array of replication rules. An empty array deletes all rules.

Response

200ReplicationRulesResponsesuccessful operation
rules
read-only
ReplicationRule[]

Array of replication rules

409objectError 409 response

Example uses bucketName = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "rules": [ { "deleteMarkerReplication": "DISABLED", "destination": { "name": "string", "region": "string", "storageClass": "DEEP_ARCHIVE" }, "filter": { "prefix": "string", "tags": { "key": "string" } }, "id": "string", "priority": 0, "status": "DISABLED" } ]}

List batch replication jobsProduction

GET
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger

Returns the batch replication jobs of the bucket and their progress.

Path parameters

bucketName
required
string

Bucket name

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200ReplicationJob[]successful operation
completed
read-only
integer

Number of successfully replicated objects

createdAt
read-only
stringdate-time

Job creation date

failed
read-only
integer

Number of objects that failed to replicate

id
read-only
string

Unique identifier of the job

status
read-only
ReplicationJobStatusEnum

Job status

ValuesACTIVECOMPLETEDCREATEDFAILEDPREPARING
stuck
read-only
integer

Number of stuck objects

total
read-only
integer

Total number of objects to replicate

404objectError 404 response

Example uses bucketName = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "completed": 0, "createdAt": "2024-01-01T12:00:00Z", "failed": 0, "id": "string", "status": "ACTIVE", "stuck": 0, "total": 0 }]

Start a batch replication jobProduction

POST
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger

Applies the current replication rules to the objects already in the bucket.

Path parameters

bucketName
required
string

Bucket name

projectId
required
string

Project ID

Response

200ReplicationJobsuccessful operation
completed
read-only
integer

Number of successfully replicated objects

createdAt
read-only
stringdate-time

Job creation date

failed
read-only
integer

Number of objects that failed to replicate

id
read-only
string

Unique identifier of the job

status
read-only
ReplicationJobStatusEnum

Job status

ValuesACTIVECOMPLETEDCREATEDFAILEDPREPARING
stuck
read-only
integer

Number of stuck objects

total
read-only
integer

Total number of objects to replicate

404objectError 404 response

Example uses bucketName = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "completed": 0, "createdAt": "2024-01-01T12:00:00Z", "failed": 0, "id": "string", "status": "ACTIVE", "stuck": 0, "total": 0}

Get a batch replication jobProduction

GET
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger/{id}

Returns the progress of a batch replication job: total, completed, failed and stuck objects.

Path parameters

bucketName
required
string

Bucket name

id
required
string

Id

projectId
required
string

Project ID

Response

200ReplicationJobsuccessful operation
completed
read-only
integer

Number of successfully replicated objects

createdAt
read-only
stringdate-time

Job creation date

failed
read-only
integer

Number of objects that failed to replicate

id
read-only
string

Unique identifier of the job

status
read-only
ReplicationJobStatusEnum

Job status

ValuesACTIVECOMPLETEDCREATEDFAILEDPREPARING
stuck
read-only
integer

Number of stuck objects

total
read-only
integer

Total number of objects to replicate

404objectError 404 response

Example uses bucketName = string, id = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/trigger/{id} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "completed": 0, "createdAt": "2024-01-01T12:00:00Z", "failed": 0, "id": "string", "status": "ACTIVE", "stuck": 0, "total": 0}

List possible replication destinationsProduction

GET
/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/destination

Returns the other buckets of the project and whether each one can receive objects replicated from this bucket. A bucket that cannot gives a reason: versioning disabled, incompatible object lock, or a region that does not accept replicated objects.

Path parameters

bucketName
required
string

Bucket name

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200ReplicationDestinationCandidate[]successful operation
eligible
read-only
boolean

Whether this bucket can be used as the destination of a replication rule on the source bucket

name
read-only
string

Bucket name

reason
read-only
ReplicationDestinationReasonEnum

Why the bucket cannot be used as a destination. Set only when eligible is false.

ValuesOBJECT_LOCK_INCOMPATIBLEREGION_NOT_REPLICATION_TARGETVERSIONING_DISABLED
region
read-only
string

Region the bucket is located in

404objectError 404 response
409objectError 409 response

Example uses bucketName = string, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/object/bucket/{bucketName}/replication/destination \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "eligible": true, "name": "string", "reason": "OBJECT_LOCK_INCOMPATIBLE", "region": "string" }]