Search in sources :

Example 66 with UnitResponse

use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.

the class App method rollBackClusterService.

/**
 * 回滚服务
 */
static void rollBackClusterService() {
    // description
    // Man.serial();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clusterId", "cls-768pakpq");
    params.put("serviceName", "my-mongodb");
    UnitResponse result = SyncXian.call("qcloudContainerService", "rollBackClusterService", params);
    System.out.println(result.getData().toString());
}
Also used : HashMap(java.util.HashMap) UnitResponse(info.xiancloud.core.message.UnitResponse) JSONObject(com.alibaba.fastjson.JSONObject)

Example 67 with UnitResponse

use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.

the class App method modifyServiceDescription.

/**
 * 修改服务描述
 */
static void modifyServiceDescription() {
    // description
    // Man.serial();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clusterId", "cls-768pakpq");
    params.put("serviceName", "my-mongodb");
    params.put("description", "嗯,修改服务描述了");
    UnitResponse result = SyncXian.call("qcloudContainerService", "modifyServiceDescription", params);
    System.out.println(result.getData().toString());
}
Also used : HashMap(java.util.HashMap) UnitResponse(info.xiancloud.core.message.UnitResponse) JSONObject(com.alibaba.fastjson.JSONObject)

Example 68 with UnitResponse

use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.

the class App method describeServiceInstance.

/**
 * 查询服务实例列表
 */
static void describeServiceInstance() {
    // description
    // Man.serial();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clusterId", "cls-768pakpq");
    params.put("serviceName", "my-mongodb");
    UnitResponse result = SyncXian.call("qcloudContainerService", "describeServiceInstance", params);
    System.out.println(result.getData().toString());
}
Also used : HashMap(java.util.HashMap) UnitResponse(info.xiancloud.core.message.UnitResponse) JSONObject(com.alibaba.fastjson.JSONObject)

Example 69 with UnitResponse

use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.

the class App method modifyClusterService.

/**
 * 修改服务
 */
static void modifyClusterService() {
    // Man.serial();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clusterId", "cls-768pakpq");
    params.put("serviceName", "my-mongodb");
    params.put("serviceDesc", "serverdecModify");
    params.put("strategy", "Recreate");
    // params.put("namespace", "xian");
    params.put("replicas", 1);
    // params.put("accessType","LoadBalancer");
    // 端口映射相关
    JSONArray portMappings = new JSONArray();
    JSONObject portMap = new JSONObject();
    portMap.put("lbPort", 80);
    portMap.put("containerPort", 80);
    // accessType=LoadBalancer 时,不需要传
    // portMap.put("nodePort", 36001);
    portMap.put("protocol", "TCP");
    portMappings.add(portMap);
    // ---容器相关-----
    JSONArray containers = new JSONArray();
    JSONObject objContain = new JSONObject();
    // 
    objContain.put("containerName", "mongodb");
    objContain.put("image", "mongo");
    containers.add(objContain);
    params.put("portMappings.n", portMappings.toJSONString());
    params.put("containers.n", containers.toJSONString());
    UnitResponse result = SyncXian.call("qcloudContainerService", "modifyClusterService", params);
    System.out.println(result.getData().toString());
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) HashMap(java.util.HashMap) UnitResponse(info.xiancloud.core.message.UnitResponse) JSONArray(com.alibaba.fastjson.JSONArray) JSONObject(com.alibaba.fastjson.JSONObject)

Example 70 with UnitResponse

use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.

the class App method deleteClusterService.

// ----------服务相关接口
/**
 * 删除服务
 */
static void deleteClusterService() {
    // description
    // Man.serial();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clusterId", "cls-768pakpq");
    params.put("serviceName", "my-mongodb");
    UnitResponse result = SyncXian.call("qcloudContainerService", "deleteClusterService", params);
    System.out.println(result.getData().toString());
}
Also used : HashMap(java.util.HashMap) UnitResponse(info.xiancloud.core.message.UnitResponse) JSONObject(com.alibaba.fastjson.JSONObject)

Aggregations

UnitResponse (info.xiancloud.core.message.UnitResponse)106 JSONObject (com.alibaba.fastjson.JSONObject)74 HashMap (java.util.HashMap)22 UnitRequest (info.xiancloud.core.message.UnitRequest)17 NotifyHandler (info.xiancloud.core.NotifyHandler)16 JSONArray (com.alibaba.fastjson.JSONArray)9 Unit (info.xiancloud.core.Unit)6 UnitMeta (info.xiancloud.core.UnitMeta)6 CacheGroup (info.xiancloud.cache.service.CacheGroup)5 Group (info.xiancloud.core.Group)5 Input (info.xiancloud.core.Input)5 CountDownLatch (java.util.concurrent.CountDownLatch)5 Redis (info.xiancloud.cache.redis.Redis)4 CacheConfigBean (info.xiancloud.core.support.cache.CacheConfigBean)4 ThreadPoolManager (info.xiancloud.core.thread_pool.ThreadPoolManager)3 LOG (info.xiancloud.core.util.LOG)3 Set (java.util.Set)3 Test (org.junit.Test)3 MessageType (info.xiancloud.core.distribution.MessageType)2 UnitUndefinedException (info.xiancloud.core.distribution.exception.UnitUndefinedException)2