This project is a Java library for communicating with QCG API.
Add deep-qcg-client as a dependency:
<dependency>
<groupId>xxxx</groupId>
<artifactId>deep.qcg-client</artifactId>
<version>1.0.1</version>
</dependency>
The following piece of code initializes the client. QcgClient.getInstance()
method expects the endpoint for qcg:
String endpoint = "<endpoint>";
Qcg qcg = QcgClient.getInstance(endpoint);
for Basic Auth
String endpoint = "<endpoint>";
String username = "<username>";
String password = "<password>";
Qcg qcg = QcgClient.getInstanceWithBasicAuth(endpoint,username,password);
The following will return all the jobs that have been created:
JobCollection jobs = qcg.getJobs();
The following will return a paginated list of jobs that have been created:
JobCollection jobs = qcg.getJobs(pagenumber, pagesize);
The following example demonstrates how a new job can be created:
JobDescription jd = new JobDescription();
jd.setNote("test job");
JobDescriptionExecution execution = new JobDescriptionExecution();
execution.setExecutable("/usr/bin/printf");
execution.setArgs(Arrays.asList(new String[]{"qgc_test"}));
JobWorkingDirectoryPolicy directory_policy = new JobWorkingDirectoryPolicy();
directory_policy.setCreate(RemoveConditionCreateMode.OVERWRITE);
directory_policy.setRemove(RemoveConditionWhen.NEVER);
execution.setDirectory_policy(directory_policy);
jd.setExecution(execution);
qcg.createJob(jd);
The following example demonstrates how to get details about an already created job:
Job job = qcg.getJob("id");
The following example demonstrates how one can delete an existing application:
qcg.deleteJob("id");
The following example demonstrates how one can retrieve the list of system resources:
Resources resources = qcg.getResources();
This project is built using Apache Maven.
Run the following command from the root of repository, to build the client JAR:
$ mvn clean install
Bugs can be reported using Github issues.