public interface ICP4DService
Modifier and Type | Method and Description |
---|---|
JobRunConfiguration |
createJobRun(JobDescription jobDescrition,
java.lang.String sabUrl,
com.google.gson.JsonArray jobConfigOverlaysArray)
Creates a Job run for a job description
|
java.lang.String |
getJobsRestUrl()
Returns the REST URl for the jobs REST API, for example https://host.com/v2/jobs
|
JobDescription |
getOrCreateJobDescription(java.lang.String jobName,
java.lang.String spaceId,
java.lang.String projectId)
Gets or creates a CP4D job description associated with either a project or a deployment space.
|
DeploymentSpace |
getOrCreateSpace(java.lang.String spaceName)
Gets or creates a CP4D deployment space.
|
java.lang.String |
getSpaceIdForName(java.lang.String spaceName)
Gets the spaceId for a deployment space given by its name.
|
java.lang.String |
getSpacesRestUrl()
Returns the REST URl for the spaces REST API, for example https://host.com/v2/spaces
|
boolean |
isExternalClient()
true if the client is external to the CP4D, false otherwise.
|
static ICP4DService |
of(com.google.gson.JsonObject service,
boolean verify)
Creates a new ICP4DService instance from the service definition JSON object.
|
void |
test()
Performs a GET request on the Spaces API to verify it is working
|
static ICP4DService of(com.google.gson.JsonObject service, boolean verify)
service
- the service definition object 'topology.service.definition'java.lang.String getJobsRestUrl()
java.lang.String getSpacesRestUrl()
boolean isExternalClient()
void test() throws java.io.IOException
java.io.IOException
- test failedjava.lang.String getSpaceIdForName(java.lang.String spaceName) throws java.io.IOException
spaceName
- the space namejava.io.IOException
DeploymentSpace getOrCreateSpace(java.lang.String spaceName) throws java.io.IOException
spaceName
- the name of the deployment spacejava.io.IOException
JobDescription getOrCreateJobDescription(java.lang.String jobName, java.lang.String spaceId, java.lang.String projectId) throws java.io.IOException
jobName
- the name of the jobspaceId
- the space_id to associate the job with a deployment space. projectId must be null.projectId
- the project_id to associate the job with a project. space_id must be null.java.io.IOException
JobRunConfiguration createJobRun(JobDescription jobDescrition, java.lang.String sabUrl, com.google.gson.JsonArray jobConfigOverlaysArray) throws java.io.IOException
jobDescrition
- the job descriptionsabUrl
- the URL of the Streams application bundlejobConfigOverlaysArray
- the job configurationsjava.io.IOException