Actually - I believe the Big Kahuna here - Ed Leafe - he worked for RackSpace if I am not Mistaken!!!
On 5/12/2022 11:10 AM, Frank Cazabon wrote:
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%C2%A0 \ -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-... ) 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.
- What is the url for the end point? I've got the account,
sourceContainer and sourceObject but not sure what comes before the /v1/
I'm unaware of a COPY type of Http request, so what should that be?
Even trying various things in PostMan aren't helping :(