Skip to content

Instantly share code, notes, and snippets.

@mheath
Last active February 9, 2016 20:19
Show Gist options
  • Save mheath/55ee408d98b0864cc58a to your computer and use it in GitHub Desktop.
Save mheath/55ee408d98b0864cc58a to your computer and use it in GitHub Desktop.
package io.pivotal.mheath;
import org.cloudfoundry.client.spring.SpringCloudFoundryClient;
import org.cloudfoundry.operations.CloudFoundryOperations;
import org.cloudfoundry.operations.CloudFoundryOperationsBuilder;
import reactor.rx.Stream;
/**
*
*/
public class V2Client {
public static void main(String[] args) {
final SpringCloudFoundryClient client = SpringCloudFoundryClient.builder()
.host("api.cf.teal.springapps.io")
.username("admin")
.password("f99b597d112cd90c8a17")
.skipSslValidation(true)
.build();
final CloudFoundryOperations ops = new CloudFoundryOperationsBuilder()
.cloudFoundryClient(client)
.target("heathville", "myspace")
.build();
Stream.from(ops.organizations().list())
.map(o -> o.getName())
.consume(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment