Hi,
anybody here ever had to do anything with Rackspace's Storage API to
move objects around?
I think I've seen Rackspace mentioned here before so I'm hoping.
I've got to copy a file from one container to another (actually it's a
lot of files but I'm just trying to prove the concept).
I've managed to get the authentication sorted out which was defined like
this:
$ curl https://identity.api.rackspacecloud.com/v2.0/tokens \
-X POST \
-d
'{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"yourUserName","apiKey":"$apiKey"}}}'
\
-H "Content-type: application/json"
I was able to translate that like this:
m.lcUrl = "https://identity.api.rackspacecloud.com/v2.0/tokens"
TEXT TO lcAuthBody NOSHOW TEXTMERGE
{
"auth": {
"RAX-KSKEY:apiKeyCredentials": {
"username": "<<UserName>>",
"apiKey": "<<APIKey>>"
}
}
}
ENDTEXT
LOCAL loXmlHttp AS Microsoft.XMLHTTP
loXmlHttp = Newobject( "Microsoft.XMLHTTP" )
loXmlHttp.Open( "POST" , m.lcUrl, .F. )
loXmlHttp.setRequestHeader("Content-Type","application/json")
loXmlHttp.Send( m.lcAuthBody )
I can then pull the token out of the loXmlHttp.responsetext
Now I want to use this token to copy a file from one container to another.
The documentation here
(https://docs.rackspace.com/docs/cloud-files/v1/storage-api-reference/object-services-operations#copy-object
) gives this example:
COPY /v1/account/sourceContainer/sourceObject HTTP/1.1
Host: storageURL
X-Auth-Token: yourAuthToken
Destination: /destinationContainer/destinationObject
I don't know how to interpret this to make an xmlhttp call.
1. What is the url for the end point? I've got the account,
sourceContainer and sourceObject but not sure what comes before the /v1/
2. I'm unaware of a COPY type of Http request, so what should that be?
3. Even trying various things in PostMan aren't helping :(
--
Frank.
Frank Cazabon
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/f121bc31-2491-fc02-3207-c1a4e4d92...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.