For starters, you want to use the CloudFoundryOperations API. This is a higher level abstraction and mimics the behaviors of the cf
cli. This is opposed to the CloudFoundryClient API which more closely mimics the raw underlying Cloud Foundry API.
The CloudFoundryOperations.pushManifest(..)
method should do what you want. It takes a PushApplicationManifestRequest
object.
You can use the builder directly to create one, or you can use the ApplicationManifestUtils.read(..)
method. The read(..)
method will read from a traditional cf cli manifest.yml
file and you can use the Builder's methods like addAllManifests(..)
or manifests(..)
to add the ApplicationManifest
object that you get from the call to read(..)
to your PushApplicationManifestRequest
object.
When you have the PushApplicationManifestRequest
object build the way you want, you simply pass that through to CloudFoundryOperations.pushManifest(..)
.
For other's reference, there is a CloudFoundryOperations.push(..)
method, if you don't want to use a manifest that one will work too. It functions roughly the same, but doesn't have the support for manifests.