public class ICP4DServiceImpl extends AbstractConnection implements ICP4DService
| Constructor and Description |
|---|
ICP4DServiceImpl(com.google.gson.JsonObject service,
boolean verify,
java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String> authenticator) |
| 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 via REST.
|
java.lang.String |
getAuthorization()
Returns the Authorization header without the Authorization: keyword.
|
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.
|
void |
test()
Performs a GET request on the Spaces API to verify it is working
|
java.lang.String |
toString() |
allowInsecureHosts, getExecutor, getResponseStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitofpublic ICP4DServiceImpl(com.google.gson.JsonObject service,
boolean verify,
java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String> authenticator)
public java.lang.String getJobsRestUrl()
ICP4DServicegetJobsRestUrl in interface ICP4DServiceICP4DService.getJobsRestUrl()public java.lang.String getSpacesRestUrl()
ICP4DServicegetSpacesRestUrl in interface ICP4DServiceICP4DService.getSpacesRestUrl()public boolean isExternalClient()
isExternalClient in interface ICP4DServicepublic void test()
throws java.io.IOException
ICP4DServicetest in interface ICP4DServicejava.io.IOExceptionpublic java.lang.String getSpaceIdForName(java.lang.String spaceName)
throws java.io.IOException
getSpaceIdForName in interface ICP4DServicespaceName - the space namejava.io.IOExceptionpublic DeploymentSpace getOrCreateSpace(java.lang.String spaceName) throws java.io.IOException
getOrCreateSpace in interface ICP4DServicespaceName - the name of the deployment spacejava.io.IOExceptionICP4DService.getOrCreateSpace(java.lang.String)public JobDescription getOrCreateJobDescription(java.lang.String jobName, java.lang.String spaceId, java.lang.String projectId) throws java.io.IOException
getOrCreateJobDescription in interface ICP4DServicejobName - 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.IOExceptionpublic JobRunConfiguration createJobRun(JobDescription jobDescrition, java.lang.String sabUrl, com.google.gson.JsonArray jobConfigOverlaysArray) throws java.io.IOException
createJobRun in interface ICP4DServicejobDescrition - the job descriptionsabUrl - the URL of the Streams application bundlejobConfigOverlaysArray - the job configurationsjava.io.IOExceptioncom.ibm.streamsx.rest.internal.icp4d.ICP4DService#createJobRun(com.ibm.streamsx.rest.internal.icp4d.JobDescription, java.lang.String)public java.lang.String getAuthorization()
getAuthorization in class AbstractConnectionpublic java.lang.String toString()
toString in class java.lang.Object