cloudfoundry / cf-java-client

Java Client Library for Cloud Foundry
Apache License 2.0
328 stars 318 forks source link

How target the space when pushing an app #1154

Closed donacarr closed 2 years ago

donacarr commented 2 years ago

Hi,

I am updating my code to pass from old client lib 1.x to 5.8 and I need to push my test app in the dev space of my org. I am using CloudFoundryOperations API and so basically I will do something like

cloudFoundryOperations.applications()
            .push(PushApplicationRequest.builder()........

But how may I target the space where pushing the app ?

dmikusa commented 2 years ago

You can set the org & space when you create the DefaultCloudFoundryOperations object using the builder. See below.

DefaultCloudFoundryOperations.builder()
    .cloudFoundryClient(cloudFoundryClient)
    .dopplerClient(dopplerClient)
    .uaaClient(uaaClient)
    .organization("example-organization")
    .space("example-space")
    .build();
donacarr commented 2 years ago

Thank you @dmikusa-pivotal