Ask Your Question
0

How to create symlinks in swift?

asked 2015-02-03 13:15:47 -0500

roadmr gravatar image

Hello! I'd like to be able to create a symlink or something equivalent in swift. I upload an object named:

/my-project/sub-project/$TIMESTAMP/file.tar.gz

$TIMESTAMP varies so I could have a lot of timestamped objects "under" /my-project/sub-project.

I'd like to create or update a link pointing to the latest:

/my-project/sub-project/current/file.tar.gz

My research showed two ways of doing it. The first is to make my container versioned, so essentially I'd leave timestamp management up to swift. I'm not too happy with this because access to the older objects has to be done in the backup container, which is not ideal.

There's another approach using manifests but it felt way too complicated:

https://developer.rackspace.com/blog/simulate-symLinks-on-cloud-files/ (https://developer.rackspace.com/blog/...)

Finally, the third way is to just manually copy objects to their corresponding "current" version, which will waste storage space.

I'd be grateful for any pointers on the best way to proceed here :)

edit retag flag offensive close merge delete

Comments

Is there any possibility to create symlink to a directory ?

I tried to PUT: 'Content-Type: application/directory'
'X-Object-Manifest: default/test/folder' // location of original directory

But without success.

Any ideas ?

Maverick gravatar imageMaverick ( 2015-03-28 12:17:12 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-02-04 13:22:47 -0500

torgomatic gravatar image

The approach that you mentioned using manifests[1] is the way to do it. If you are using a newer Swift, I'd recommend using static large objects[2] instead of dynamic large objects. The concept is similar, but the creation method differs slightly. However, static large objects give you assurance that the referenced object has not changed out from under you.

[1] https://developer.rackspace.com/blog/...

[2] http://docs.openstack.org/api/opensta...

edit flag offensive delete link more

Comments

Thanks, I actually tried this approach and it's not as complex as I thought it would be. I'll go this way :) much appreciated.

roadmr gravatar imageroadmr ( 2015-02-04 14:15:01 -0500 )edit
0

answered 2019-03-14 10:14:46 -0500

clayg gravatar image
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

2 followers

Stats

Asked: 2015-02-03 13:15:47 -0500

Seen: 1,061 times

Last updated: Mar 14