Looking for doc and example for the cf-java-client lib
550 views
Skip to first unread message
Dominique Vernier
unread,
Jan 25, 2014, 7:30:13 AM1/25/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
Hi,
I started to use the cf-java-client lib but the number of examples and documentation seems to be very limited or I didn't find it. Could somebody point me to:
1) Samples, blogs and wiki explaning how to use the cf-java-client lib. 2) JavaDoc 3) Community where to find information and exchange information except of this one.
Many Thanks Dominique
James Bayer
unread,
Jan 25, 2014, 7:22:38 PM1/25/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
this is the right place for questions. this tests typically are good examples [1]. if you're familiar with the cf command line client, then i would expect the CloudFoundryClient interface [2] to be straight-forward to understand.
it's easiest to help if you share your use cases / scenarios in some amount of detail.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
Thx James, you right it is useful.
I would like to find out how I can check that an application is fully operational (wait). I tried with this: AppState state; do { CloudApplication app = client.getApplication(appName); state = app.getState(); System.out.println("State:" + state); Thread.sleep(5000); } while (!AppState.STARTED.equals(state)); but the state because STARTED before the app can be used. Shall I go to the staging logs using getStagingLogs() and wait until I have an exception meaning the staging phase is fully finished? or there is another method to test that?
Many Thanks Dominique
James Bayer
unread,
Jan 26, 2014, 2:44:32 AM1/26/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
i think the CloudApplication.getRunningInstances() [1] will give you what you want.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
Thx, it works but you need also to call CloudApplication.getApplication(name) in order to have the latest number of instances.
Scott Frederick
unread,
Jan 27, 2014, 10:11:43 AM1/27/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vcap...@cloudfoundry.org
The Cloud Foundry Maven plugin[1] serves as a good sample of how to interact with cf-java-client. The most useful code is in the package containing the implementations of the goals[2].
For an idea of how to monitor that an application operational, see [3]. This code waits for at least one instance of the app to return a "running" status.