Object Replication With the Wasabi S3 API
    • 06 Jun 2024
    • 3 Minutes to read
    • PDF

    Object Replication With the Wasabi S3 API

    • PDF

    Article summary

    PUT Object Replication

    Wasabi supports functionality for replication configuration with:

    • One source and one destination bucket (without filters)

    • One source and one destination bucket (with filters)

    • One source and multiple destination buckets

    In addition, Wasabi supports functionality for updating existing an replication configuration.

    Replication Configuration With One Source and One Destination Bucket (Without Filters)

    PUT
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    Status 200 OK

    Notes:

    1. Make sure both the source and destination buckets match the same bucket-property while scheduling the replication configuration.

      1. Non-versioned source —> Non-versioned destination

      2. Versioned source —> Versioned destination

    2. Only new objects (uploaded after scheduling the replication configuration) will be replicated to the destination bucket.

    3. To replicate the existing objects from the source to the destination, you need to initiate the following API only after scheduling the replication configuration.

    PUT
    
    https://s3.<region>.wasabisys.com/my-replication-source?manifestCreateAndProcess

    Response body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <ManifestCreateAndProcess>jobId : DHZsWBhwMUg9euZyFg7eahv4</ManifestCreateAndProcess>
    Status 200 OK

    Replication Configuration With One Source and One Destination Bucket (With Filters)

    In this example, objects that satisfy both conditions (prefix as AA- and tag “key1-value1”) will be replicated to the destination bucket.

    PUT
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    
       <Role></Role>
    
       <Rule>
    
          <ID>job1</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Disabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination</Bucket>
    
          </Destination>
    
          <Filter>
    
               <And>
    
                    <Prefix>AA-</Prefix>
    
                    <Tag>
    
                         <Key>key1</Key>
    
                         <Value>value1</Value>
    
                    </Tag>
    
               </And>
    
          </Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
    </ReplicationConfiguration>
    Status 200 OK

    Replication Configuration With One Source and Multiple Destinations

    PUT
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    
       <Role></Role>
    
       <Rule>
    
          <ID>job1</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Enabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination-1</Bucket>
    
          </Destination>
    
          <Filter></Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
       <Rule>
    
          <ID>job2</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Enabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination-2</Bucket>
    
          </Destination>
    
          <Filter></Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
    </ReplicationConfiguration>
    Status 200 OK

    Updating an Existing Replication Configuration

    The replication configuration will replace an existing configuration. In this example, an existing replication configuration maps job2 to my-replication-destination-2, and the update changes the replication configuration to map job2 to my-replication-destination-3.

    PUT
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    
       <Role></Role>
    
       <Rule>
    
          <ID>job1</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Enabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination-1</Bucket>
    
          </Destination>
    
          <Filter></Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
       <Rule>
    
          <ID>job2</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Enabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination-3</Bucket>
    
          </Destination>
    
          <Filter></Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
    </ReplicationConfiguration>
    Status 200 OK

    GET Object Replication

    GET
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    
       <Role></Role>
    
       <Rule>
    
          <ID>job1</ID>
    
          <Priority>1</Priority>
    
          <Status>Enabled</Status>
    
          <DeleteMarkerReplication>
    
             <Status>Enabled</Status>
    
          </DeleteMarkerReplication>
    
          <Destination>
    
             <Bucket>arn:aws:s3:::my-replication-destination</Bucket>
    
          </Destination>
    
          <Filter></Filter>
    
          <WCSM>true</WCSM>
    
       </Rule>
    
    </ReplicationConfiguration>
    Status 200 OK

    DELETE Object Replication

    You can delete the existing replication configuration of the bucket. This removes the entire replication configuration from the specified bucket.

    DELETE
    
    https://s3.<region>.wasabisys.com/my-replication-source?replication

    Response body:

    <empty>
    Status 204 No Content