cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature Request: Support downloading raw files

Open youngm opened this issue 12 years ago • 5 comments

We'd like to download raw binary and text files from the cli. I know you can > the output but it adds the Getting files for app\nOK message to the output which is annoying and doesn't work with binary files.

I'm thinking an arg like -f would work.

cf files app app/someBinary.zip -f localBinary.zip

As a side note. We have a fork of the CLI. It would be handy if there was a way to invoke net.doRequest (https://github.com/cloudfoundry/cli/blob/master/cf/net/gateway.go#L402) without net.dumpResponse dumping the response body as well. https://github.com/cloudfoundry/cli/blob/master/cf/net/http_client.go#L59

I imagine changing that api will be necessary to fix this issue so it would be great if it was fixed in such a way that others could take advantage of the ability to execute requests that don't dump the response body aswell.

Thanks, Mike

youngm avatar Aug 25 '14 17:08 youngm

Not sure whether you can use cf curl option here. You can specify --output option to save the output directly when using cf curl. This was added to allow downloading binaries using cf curl (to against any instance of the app by constructing the url, rather than files which goes against first available instance) without adding any new lines or other characters to the actual file content.

Grab the thread dump from instance 10 with associated guid. Sample url : /v2/apps/38699180-05c1-4c15-af24-f6c3fce5b1dc/instances/10/files/dumps/05_2 0_14/threadDump.wls12c-0.104.22_01_11.txt

Sample command: CF_TRACE=false cf curl $captureDumpUrl --output $tmpDumpFile·

-Sabha

sparameswaran avatar Aug 25 '14 17:08 sparameswaran

You're right that does work. Thanks. I still think it would be nice to be able to do this right from the "files" command but that will work in a pinch.

Mike

youngm avatar Aug 25 '14 17:08 youngm

with SCP coming in Diego I think I'll close this.

youngm avatar Sep 03 '15 17:09 youngm

https://github.com/ibmjstart/cf-download may help for those not on Diego yet.

afeld avatar Aug 02 '16 06:08 afeld

For those landing on this old issue, the CF ssh enables use of the scp command, whose specific syntax is detailed in https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#other-ssh-access

gberche-orange avatar Oct 17 '18 10:10 gberche-orange