Ask Your Question
0

Can you copy objects across accounts?

asked 2014-10-05 02:47:31 -0500

anonymous user

Anonymous

updated 2014-10-05 02:48:31 -0500

Hi,

Looking online I came across the following article explaining how to "copy" objects from one container to another. I've successfully been able to do using the COPY method.

The example below copies an object from one container to another within the same account.

curl -X COPY -i \
-H "Host: /v1/AUTH_6c0ed185bc0f42768059a534ae4a0573" \
-H "X-Auth-Token: AUTH_tkbe3523ef3ef44f88b57e5c78c36e96a2" \
-H "Destination: /test/ea4320089eb2fafc590eefe0c3d78a1d" \
http://192.168.1.2/v1/AUTH_6c0ed185bc0f42768059a534ae4a0573/27288691841f48e3bb303444e4dc59c3/ea4320089eb2fafc590eefe0c3d78a1d

I am now trying to copy an object from one account to a container in another one. I keep running into a message that says "The resource could not be found". Below is the code I'm using;

curl -X COPY -i \
-H "Host: /v1/AUTH_90770b104bb44c41b5ed9d061e8b5bf5" \
-H "X-Auth-Token: AUTH_tkbe3523ef3ef44f88b57e5c78c36e9622" \
-H "Destination: /c3da701a337d49a080f5e9563b6ceed0/ea4320089eb2fafc590eefe0c3d78a1d" \
http://192.168.1.2/v1/AUTH_6c0ed185bc0f42768059a534ae4a0573/27288691841f48e3bb303444e4dc59c3/ea4320089eb2fafc590eefe0c3d78a1d

The account I am using to run these curl commands with is a superadmin. Is it possible to copy an object from one account to another without downloading and re-uploading it? If so, what am I doing wrong here?!

Cheers,

Tim

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-10-05 12:15:02 -0500

user.cayman gravatar image

Hi Sam thanks for the quick reply!

The account I am using to run these commands is a "superuser" who has RWD perms on all accounts and containers. The actions above are all happening within compiled code as part of a workflow. The username and password for this account is very well locked down, not shared with anyone, so no person would be able to arbitrarily move information. The "superadmin" account is specific to the compiled workflow.

My workflow requires a document to be uploaded to Swift first, then after some business logic, copied to the appropriate account and container as its final destination.

Being able to copy an object across accounts would be excellent for users where their Swift deployments are hosted with providers that charge on the amount of bandwidth between your app and Swift. Also, in internal networks where, as the file sizes can potentially be very large (100MB+).

Any help on this would be excellent!

edit flag offensive delete link more
0

answered 2014-10-05 03:07:29 -0500

SamYaple gravatar image

While the underlying "copy" mechanism should have no problem doing what you ask, think about how that would not work.

You need to use an Auth-Token to authenticate yourself with a particular account. What you propose would allow a user to abritrarily copy out of any other account and into your own.

There _may_ be a way to do this if you have your user in multiple tenants (with the appropriate roles) but that is doubtful as well since that token would auth for a single tenant. Still I have not looked into that method enough to definitively rule it out.

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: 2014-10-05 02:47:31 -0500

Seen: 427 times

Last updated: Oct 05 '14