Ask Your Question
0

Container sync from Rackspace CloudFiles

asked 2015-09-23 15:53:21 -0500

gsvi gravatar image

Hello

I would like to sync my containers that are currently located on CloudFiles. I would like CloudFiles to be the source and push the updated containers to my private Swift cluster.

I have found the following article on how to push data to CloudFiles. http://www.rackspace.com/knowledge_center/article/syncing-private-cloud-swift-containers-to-rackspace-cloud-files (http://www.rackspace.com/knowledge_ce...)

  • I am looking for information on how to do the reverse.. pushing object from CloudFiles to my Swift cluster.
  • Also I am curious how often the syncing process is initiated on cloudfiles.

I have configured my cluster to accept the rackspace api url via container-server.conf.

[DEFAULT]

allowed-sync-hosts= auth.api.rackspacecloud.com

and I have set the headers via the following script

container = pyrax_connection.cloudfiles.get_container(container_name)

log.debug('Got all the container.  About to check metadata on container_name {0}...'.format(container_name))

d = container.get_metadata()

log.info('Metadata...{0}'.format(d))

sync_host_header = d.get('x_container_sync_to')

log.debug('{0} has valid sync_host header? {1}'.format(
    container,
    sync_host_header and sync_host_header == sync_host))

set_header = True

if sync_host_header is not None:
    if sync_host in sync_host_header:
        set_header = False
if set_header:
    log.info("Setting Sync headers on {0}.".format(container))

    sync_container_header = sync_host + container_name

    container.set_metadata({
        'X-Container-Sync-To': sync_container_header})
    container.set_metadata({
        'X-Container-Sync-Key': secret_key})

log.info('Verified container {0} have sync_host headers set to allow '
         'access from {1}.'.format(container_name, sync_host))

Any advise would be appreciated.

Thanks Greg

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-23 19:52:14 -0500

gsvi gravatar image

Heard from Rackspace..

You can sync data to CloudFiles but you cannot sync data to CloudFiles.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-09-23 15:53:21 -0500

Seen: 70 times

Last updated: Sep 23 '15