Re: Accessing CF Org in startup script


Vinod Singh <vinoddandy@...>
 

Thanks for prompt response, Daniel.

Actually, org/space info is needed outside my application. I can get
org/space inside my app using CF APIs. But I need org/info outside app in
my startup script (inside Procfile) which will be executed before running
my app. Is there any possibility to get org/info in my startup script ? I
do not want to hard code in app's manifest.yml file.

Making sense ?

Regards,
Vinod



On Wed, Oct 12, 2016 at 9:08 AM, Daniel Jones <
daniel.jones(a)engineerbetter.com> wrote:

Hi Vinod,

Is it correct to assume that your app needs to know the org and space it
is in? If so, you will need to either set these manually using `cf set-env
appname SPACE_NAME my-space`, or you can use the CloudController API
<https://apidocs.cloudfoundry.org/245/> to look up the name of the space
from the space_id field in VCAP_APPLICATION
<https://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html#VCAP-APPLICATION>
.

Regards,
Daniel Jones - CTO
+44 (0)79 8000 9153
@DanielJonesEB <https://twitter.com/DanielJonesEB>
*EngineerBetter* Ltd <http://www.engineerbetter.com> - UK Cloud Foundry
Specialists

On Wed, Oct 12, 2016 at 2:12 PM, Vinod Singh <vinoddandy(a)gmail.com> wrote:

Hi,

I need to access user's org before running the app on CF.

In my script, I am trying to access using $SPACE_NAME but it is not
working. Any suggestion please.

Again, please note that I need space info before starting of my
application.


Regards,
Vinod

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.