use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method deleteInstances.
// ---------服务实例相关接口
/**
* 删除服务实例
*/
static void deleteInstances() {
// description
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
// 服务实例列表数组
JSONArray instances = new JSONArray();
instances.add("my-mongodb-3632199888-dwpeo");
// instances.add("my-mongodb-3632199888-jjoqx");
params.put("instances.n", instances.toJSONString());
UnitResponse result = SyncXian.call("qcloudContainerService", "deleteInstances", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method resumeClusterService.
/**
* 继续服务更新
*/
static void resumeClusterService() {
// 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", "resumeClusterService", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method describeClusterService.
/**
* 查询服务列表
*/
static void describeClusterService() {
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
params.put("namespace", "predev");
// 展示所有命名空间下的服务
// params.put("allnamespace", 1);
UnitResponse result = SyncXian.call("qcloudContainerService", "describeClusterService", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method createClusterService.
/**
* 创建服务
*/
static void createClusterService() {
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
params.put("serviceName", "my-mongodb");
params.put("serviceDesc", "serverdec");
// params.put("namespace", "xian");
params.put("replicas", 2);
// 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", "createClusterService", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method modifyServiceReplicas.
/**
* 修改实例服务副本数
*/
static void modifyServiceReplicas() {
// description
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
params.put("serviceName", "my-mongodb");
params.put("scaleTo", 5);
UnitResponse result = SyncXian.call("qcloudContainerService", "modifyServiceReplicas", params);
System.out.println(result.getData().toString());
}
Aggregations