use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method describeClusterServiceInfo.
/**
* 查询服务详情
*/
static void describeClusterServiceInfo() {
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
params.put("serviceName", "xiandb-dev");
// params.put("namespace", "default");
UnitResponse result = SyncXian.call("qcloudContainerService", "describeClusterServiceInfo", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method modifyClusterServiceImage.
/**
* 修改服务镜像
*/
public static void modifyClusterServiceImage() throws Exception {
// description
// Man.serial();
Map<String, Object> params = new HashMap<String, Object>();
params.put("clusterId", "cls-768pakpq");
params.put("serviceName", "communication");
// 实例下只有一个容器 直接传 image参数即可
params.put("image", DeploymentUtil.REGISTRY_URI() + "xian_predev:jenkins-xian_predev-400");
// 测试多多容器修改镜像
/*JSONArray containers = new JSONArray();
JSONObject container = new JSONObject();
container.put("containerName", "mongodb");
container.put("image", "nginx");
containers.add(container);
params.put("containers.n", containers.toJSONString());
UnitResponse result = Xian.call("qcloudContainerService", "modifyClusterServiceImage", params);*/
String outString = HttpKit.post("http://localhost:9125/v1.0/qcloudContainerService/modifyClusterServiceImage").addParams(params).execute();
UnitResponse result = UnitResponse.create(JSON.parseObject(outString));
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class App method describeServiceEvent.
/**
* 获取服务事件列表
*/
static void describeServiceEvent() {
// 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", "describeServiceEvent", params);
System.out.println(result.getData().toString());
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class DeployApplications_v_2 method execute.
@Override
public UnitResponse execute(UnitRequest msg) {
String applications = msg.getString("applications");
UnitResponse unitResponseObject;
if (applications != null && applications.contains("=")) {
unitResponseObject = UnitResponse.failure(null, NOT_SUPPORTED_TIP);
} else
unitResponseObject = deploy(msg);
unitResponseObject.getContext().setPretty(true);
return unitResponseObject;
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapRemoveUnit method execute.
@Override
public UnitResponse execute(UnitRequest msg) {
String key = msg.getArgMap().get("key").toString();
String field = msg.getArgMap().get("field").toString();
CacheConfigBean cacheConfigBean = msg.get("cacheConfig", CacheConfigBean.class);
long length;
try {
length = Redis.call(cacheConfigBean, jedis -> jedis.hdel(key, field));
} catch (Exception e) {
return UnitResponse.exception(e);
}
return UnitResponse.success(length);
}
Aggregations