Download my app_bits from CloudFoundry.com?

192 views
Skip to first unread message

Lei Zhang

unread,
Feb 18, 2013, 2:44:06 AM2/18/13
to vcap...@cloudfoundry.org
I know there's a api I can call in CC to download bits of my app from CF.com:

get    'apps/:name/application'    => 'apps#download',        :as => :app_download

But when I tried to call that api I got only strings like:

staging.log 189B
stderr.log 0B
stdout.log 217B
staging.log 189B
stderr.log 0B
stdout.log 217B
app/ -
logs/

No zip files and more like "view files" mode. So, does download app_bits still available in CF.com now?

Lei Zhang

unread,
Feb 18, 2013, 8:15:57 AM2/18/13
to vcap...@cloudfoundry.org

I tried STS and it can download app files! How did it work and why I can't get app files by calling apps/:name/application?

James Bayer

unread,
Feb 18, 2013, 4:15:34 PM2/18/13
to vcap...@cloudfoundry.org
vmc files mytomcat7 app/bin/catalina.sh

this will download a file catalina.sh from the application mytomcat7, which is placed in the "app/bin" directory. if you add a "-t" or "--trace" switch to the vmc command it will show you the rest calls such as:


called with the appropriate Authorization header set with a bearer token.

Lei Zhang

unread,
Feb 18, 2013, 9:44:51 PM2/18/13
to vcap...@cloudfoundry.org
So, I can't download the whole app like what I did before? Why CF prevent this?

James Bayer

unread,
Feb 18, 2013, 11:35:46 PM2/18/13
to vcap...@cloudfoundry.org
There is a Cloud Controller API that enables downloading an entire zipped application to clients, which is used in the staging process.

The quickest way to see how that works in practice is probably to review Dr Nic's latest article about that v1 staging process: http://starkandwayne.com/articles/2013/02/14/diy-paas-staging-an-app/

get    'staging/app/:id'                => 'staging#download_app',   :as => :download_unstaged_app
From reviewing the CC source code, this API is here:
But it would appear that this API is reserved for the staging process only:

It's possible that the Eclipse tooling may use this the file by file approach, I have no idea.

What is the use case you are looking to use this API for? It's certainly possible that we could open up this "download my entire unstaged app as a zip file" API to end-users with cloud_controller_ng.

Thanks, James

Lei Zhang

unread,
Feb 19, 2013, 1:10:00 AM2/19/13
to vcap...@cloudfoundry.org
Thank you very much for your reply.

I have just found out why the app download is broken, I'll feedback here when I finish it. Just one or two days.

My use case is simple: migrate apps among mutiple CF instances. It's useful for private cloud.

Andy Piper

unread,
Feb 19, 2013, 10:22:24 AM2/19/13
to vcap...@cloudfoundry.org
You can download the (staged) app into a zip file using this simple code from Dan Higham https://gist.github.com/danhigham/4705713

Dan Higham

unread,
Feb 19, 2013, 12:39:19 PM2/19/13
to vcap...@cloudfoundry.org
Goes without saying that for JVM based apps, this will only download the compiled byte code!

--
Dan Higham 
CloudFoundry Support
@danhigham

David Laing

unread,
Feb 19, 2013, 6:03:44 PM2/19/13
to vcap-dev
@andypiper / @danhigham - either of you fancy contributing a section to http://cf-docs-contrib.cloudfoundry.com/ explaining how to do this?
--
David Laing
Trading API @ City Index
da...@davidlaing.com
http://davidlaing.com
Twitter: @davidlaing

Lei Zhang

unread,
Feb 20, 2013, 3:28:11 AM2/20/13
to vcap...@cloudfoundry.org
I pull a request on cf-release about this bug.


On Tuesday, February 19, 2013 12:35:46 PM UTC+8, James Bayer wrote:

Andy Piper

unread,
Feb 21, 2013, 10:20:18 AM2/21/13
to vcap...@cloudfoundry.org
Added to the new cf-docs-contrib wiki https://github.com/mrdavidlaing/cf-docs-contrib/wiki
Reply all
Reply to author
Forward
0 new messages