manifest files and the Java client
Thanks for clarifying this, Scott. There are still a few properties in the manifest file that I am not sure about: no-hostname, random-route, no-route.
On first reading I don’t see these in the maven plugin. But clearly the maven plugin was what I was looking for.
You are correct, the Java client does not support creating an application
based on the data in manifest.yml.
With the cf CLI and manifest.yml, you specify the host(s) (i.e. subdomain)
and domain(s) separately, and these are combined into one ore more routes.
So with a host of "myapp" and a domain of "apps.mycf.org", the full route
would be "myapp.apps.mycf.org". With the Java client, each route (host +
domain) is provided in absolute form in the "List<String> uris" parameter
of the "createApplication()" method. To match the CLI example, you would
specify one "uri" String with the value "myapp.apps.mycf.org". The domain
part of the uri must be a valid domain in your CF deployment (you can see
the list with "cf domains").
The best sample code for the Java client is the Maven and Gradle plugins
there are in the same GitHub repository.
The Maven plugin is here:
The code in the Maven plugin that creates an application, uploads the bits,
and waits for the app to start is here:
From: <Bolour>, GE Global Research <Azad>, GE <Azad.Bolour(a)ge.com<mailto:Azad.Bolour(a)ge.com>>
Date: Friday, June 19, 2015 at 10:05 AM
To: "cf-dev(a)lists.cloudfoundry.org<mailto:cf-dev(a)lists.cloudfoundry.org>" <cf-dev(a)lists.cloudfoundry.org<mailto:cf-dev(a)lists.cloudfoundry.org>>
Cc: "Vydra, David (GE Global Research)" <david.vydra(a)ge.com<mailto:david.vydra(a)ge.com>>
Subject: manifest files and the Java client
Correct me if I am wrong, but as far as I can tell, the cloud foundry Java API does not directly support the creation of an application based on the the manifest file as defined in:
My reading of the code is that the implementation of the create application function in the Java client boils down to the createApplication method of the class CloudControllerClientImpl:
public void createApplication(
String appName, Staging staging, Integer disk, Integer memory,
List<String> uris, List<String> serviceNames)
But the uris parameters does not appear in the manifest specification.
How should I define the uris parameter in terms of the fields in the manifest? Is there sample code somewhere that would clue me into how to do this?