|
|
|
@ -1801,49 +1801,30 @@ module Kubernetes {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function extractDataToOracle($http, selectedReplicationControllers, targetReplicationController){
|
|
|
|
|
export function extractDataToOracle($http, selectedReplicationControllers, targetOracle: Configs.oracleParam){
|
|
|
|
|
//console.log(targetReplicationController.length);
|
|
|
|
|
if(selectedReplicationControllers.length ===1 && (getName(selectedReplicationControllers[0]) === getName(targetReplicationController))){
|
|
|
|
|
alert("您选择的数据库中不包含需要汇总的数据库,导致汇总操作失败,请重新选择!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var answer = checkoutOracleRCIsRunning(targetReplicationController) && targetReplicationController;
|
|
|
|
|
var oracleConnectParam = [{
|
|
|
|
|
OracleName: getName(targetReplicationController),
|
|
|
|
|
connectHost: getHost(targetReplicationController.$pods[0]),
|
|
|
|
|
connectPort: targetReplicationController.$pods[0].spec.containers[0].ports[0].hostPort,
|
|
|
|
|
isTarget: true
|
|
|
|
|
}];
|
|
|
|
|
selectedReplicationControllers.forEach((rc) => {
|
|
|
|
|
if(getName(rc) !== getName(targetReplicationController)){
|
|
|
|
|
answer = answer && checkoutOracleRCIsRunning(rc);
|
|
|
|
|
oracleConnectParam.push({
|
|
|
|
|
"OracleName": getName(rc),
|
|
|
|
|
"connectHost": getHost(rc.$pods[0]),
|
|
|
|
|
"connectPort": rc.$pods[0].spec.containers[0].ports[0].hostPort,
|
|
|
|
|
"isTarget": false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var answer = targetOracle && true;
|
|
|
|
|
var inneedOracle = [];
|
|
|
|
|
selectedReplicationControllers.forEach((rc) => {
|
|
|
|
|
answer = answer && checkoutOracleIsRunning(rc);
|
|
|
|
|
inneedOracle.push({
|
|
|
|
|
"name": getName(rc),
|
|
|
|
|
"ip": getHost(rc.$pods[0]),
|
|
|
|
|
"port": rc.$pods[0].spec.containers[0].ports[0].hostPort,
|
|
|
|
|
"isTarget": false
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(answer){
|
|
|
|
|
$http({
|
|
|
|
|
url: '/extractOracleData',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
method:'POST',
|
|
|
|
|
params:{param: oracleConnectParam}
|
|
|
|
|
}).success(function(data,header,config,status){
|
|
|
|
|
console.log("success");
|
|
|
|
|
}).error(function(data,header,config,status){
|
|
|
|
|
//log.warn("Failed to connect " + connectParam + " " + data + " " + status);
|
|
|
|
|
});
|
|
|
|
|
if(answer){
|
|
|
|
|
var data ={"name": targetOracle.id, "target": targetOracle, "inneed": inneedOracle};
|
|
|
|
|
Configs.oracleInfoOperate($http, "/java/console/api/oracle", Configs.OperateType.EXTRACT, data);
|
|
|
|
|
}else{
|
|
|
|
|
alert("您选择的汇总数据库或需要汇总的数据库中存在未启动成功的数据库,导致汇总操作失败,请重新选择!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function checkoutOracleRCIsRunning(rc){
|
|
|
|
|
if(rc.$podCounters.ready && rc.$oracleStatus == 2){
|
|
|
|
|
export function checkoutOracleIsRunning(rc){
|
|
|
|
|
if(rc.$podCounters.ready && rc.$oracleStatus == 2){
|
|
|
|
|
return true
|
|
|
|
|
}else{
|
|
|
|
|
return false;
|
|
|
|
|