prosociallearnEU / cf-nodejs-client

A Cloud Foundry Client for Node.js
https://prosociallearneu.github.io/cf-nodejs-client/
Apache License 2.0
17 stars 41 forks source link

Get files #44

Open jabrena opened 9 years ago

jabrena commented 9 years ago

GET /v2/apps/d2c6634d-b9da-462c-b420-54ac155e6327/instances/0/files/path_to_file

http://apidocs.cloudfoundry.org/217/files/retrieve_file.html

jabrena commented 8 years ago

Check the feature in CF platforms with Diego enabled.

jabrena commented 8 years ago

https://docs.pivotal.io/pivotalcf/customizing/diego-ssh/access-apps.html https://github.com/cloudfoundry-incubator/diego-ssh http://apidocs.cloudfoundry.org/226/files/retrieve_file.html https://github.com/cloudfoundry-incubator/diego-design-notes/blob/master/ssh-access-and-policy.md

jabrena commented 8 years ago

For Diego, the unique way to download files is using ssh:

Host: uaa.run.pivotal.io
User-Agent: Go-http-client/1.1
Referer: https://uaa.run.pivotal.io/oauth/authorize?client_id=ssh-proxy&grant_ty
pe=authorization_code&response_type=code
Accept-Encoding: gzip

cf ssh appX
jabrena commented 8 years ago

https://github.com/cloudfoundry-incubator/diego-ssh#cloud-foundry-via-cloud-controller-and-uaa

$ curl -k -v -H "Authorization: $(cf oauth-token | tail -1)" \
    https://uaa.bosh-lite.com/oauth/authorize \
    --data-urlencode  "client_id=$(cf curl /v2/info | jq -r .app_ssh_oauth_client)" \
    --data-urlencode 'response_type=code' 2>&1 | \
    grep Location: | \
    cut -f2 -d'?' | \
    cut -f2 -d'=' | \
    pbcopy # paste authoriztion code when prompted for password