Search in sources :

Example 1 with ModelGenerator

use of com.github.isdream.jointware.core.ModelGenerator in project jointware by isdream.

the class JSONToExecutorSampleTest method main.

/**
 ********************************************
 *
 *                Main
 *
 *********************************************
 */
public static void main(String[] args) throws Exception {
    // JsonToMap
    Map<String, Map<String, Object>> originRequest = getClientRequest();
    // getClient
    DefaultKubernetesClient client = (DefaultKubernetesClient) createClient(originRequest.get("target"));
    // toTartgetMap
    Map<String, Map<String, Object>> targetRequest = toTargetMap(originRequest, "jointwareRef");
    // option : test
    ModelGenerator mg = new KubernetesModelGenerator();
    System.out.println(mg.toObject(targetRequest, Deployment.class.getSimpleName()));
    // getExcutor
    ConatinerExecutor executor = (ConatinerExecutor) createExecutor(originRequest.get("target"));
// impl
// executor.create(client, getKind(originRequest.remove("target")), targetRequest);
}
Also used : KubernetesModelGenerator(com.github.isdream.jointware.kubernetes.KubernetesModelGenerator) KubernetesModelGenerator(com.github.isdream.jointware.kubernetes.KubernetesModelGenerator) ModelGenerator(com.github.isdream.jointware.core.ModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient) Map(java.util.Map)

Aggregations

ModelGenerator (com.github.isdream.jointware.core.ModelGenerator)1 KubernetesModelGenerator (com.github.isdream.jointware.kubernetes.KubernetesModelGenerator)1 DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)1 Map (java.util.Map)1