Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "Die Metrik hat nicht das angegebene Label[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "Doppeltes Label definiert für den Alarm mit UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "Die Metrik[%s] ist auf Administratoren beschränkt und ist für Ihre aktuelle Benutzerrolle nicht verfügbar.",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "Ungültige URL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "Backend-Server konnte nicht geändert werden, da vmincs und Server-IPs null sind",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "Namespace[%s] enthält nicht die Metrik[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "Namespace[%s] wird nicht unterstützt",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "the metric does not have the specified label[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "duplicate label defined for the alarm with UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "the metric[%s] is restricted to administrators and is not available for your current user role.",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "invalid url[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "could not modify backend server because vmincs and server IPs are null",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "namespace[%s] does not contain the metric[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "namespace[%s] is not supported",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "la métrique ne possède pas l'étiquette spécifiée[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "étiquette en double définie pour l'alarme avec UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "la métrique[%s] est restreinte aux administrateurs et n'est pas disponible pour votre rôle utilisateur actuel.",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "URL invalide[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "impossible de modifier le serveur backend car vmincs et les IPs du serveur sont null",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "l'espace de noms[%s] ne contient pas la métrique[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "l'espace de noms[%s] n'est pas pris en charge",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "metrik tidak memiliki label yang ditentukan[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "label duplikat didefinisikan untuk alarm dengan UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "metrik[%s] dibatasi untuk administrator dan tidak tersedia untuk peran pengguna Anda saat ini.",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "URL tidak valid[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "tidak dapat memodifikasi server backend karena vmincs dan IP server kosong",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "namespace[%s] tidak berisi metrik[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "namespace[%s] tidak didukung",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "メトリクスに、指定されたラベル[%s]がありません",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "UUID [uuid:%s]のアラームに重複するラベルが定義されています",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "メトリクス[%s]は管理者向けに制限されており、現在のユーザーロールでは利用できません",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "無効なURL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "vmincsとサーバーIPがnullのため、バックエンドサーバーを変更できませんでした",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "名前空間[%s]にはメトリクス[%s]が含まれていません",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "名前空間[%s]はサポートされていません",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "메트릭에 지정된 라벨[%s]이 없습니다",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "UUID [uuid:%s]가 있는 알람에 중복된 라벨이 정의되어 있습니다",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "메트릭[%s]은 관리자에게만 제한되어 있으며, 현재 사용자 역할에서는 사용할 수 없습니다",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "잘못된 URL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "vmincs와 서버 IP가 null이므로 백엔드 서버를 수정할 수 없습니다",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "네임스페이스[%s]에 메트릭[%s]이 포함되어 있지 않습니다",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "네임스페이스[%s]가 지원되지 않습니다",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "метрика не содержит указанную метку[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "дублирующаяся метка определена для сигнала тревоги с UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "метрика[%s] ограничена для администраторов и недоступна для вашей текущей роли пользователя.",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "недопустимый URL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "не удалось изменить backend-сервер, так как vmincs и IP-адреса серверов равны null",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "namespace[%s] не содержит метрику[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "namespace[%s] не поддерживается",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-th-TH.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "เมทริกไม่มีป้ายกำกับที่ระบุ[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "มีการกำหนดป้ายกำกับซ้ำสำหรับ alarm ที่มี UUID [uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "เมทริก[%s] จำกัดสำหรับผู้ดูแลระบบและไม่พร้อมใช้งานสำหรับบทบาทผู้ใช้ปัจจุบันของคุณ",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "URL ไม่ถูกต้อง[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "ไม่สามารถแก้ไขเซิร์ฟเวอร์แบ็กเอนด์ได้เนื่องจาก vmincs และ IP เซิร์ฟเวอร์เป็นค่าว่าง",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "namespace[%s] ไม่มีเมทริก[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "namespace[%s] ไม่ได้รับการสนับสนุน",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "指标[%s]不存在标签[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "重复标签[key:%s, 操作符:%s, 值:%s]告警[uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "指标[%s]仅管理员可见,当前用户不可用",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "无效的URL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "无法更改后端服务器,因为 vmincs 和 serverips 为空",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "命名空间[%s]不存在度量[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "命名空间[%s]不支持",
Expand Down
1 change: 1 addition & 0 deletions conf/i18n/globalErrorCodeMapping/global-error-zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
"ORG_ZSTACK_ZWATCH_ALARM_10025": "指標[%s]不儲在標签[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10023": "重复標签[key:%s, 操作符:%s, 值:%s]告警[uuid:%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10029": "指標[%s]仅管理員可见,當前用戶不可用",
"ORG_ZSTACK_ZWATCH_ALARM_10030": "無效的URL[%s]",
"ORG_ZSTACK_NETWORK_SERVICE_LB_10171": "無法更改後端服務器,因为 vmincs 和 serverips 为空",
"ORG_ZSTACK_ZWATCH_ALARM_10028": "命名空間[%s]不儲在度量[%s]",
"ORG_ZSTACK_ZWATCH_ALARM_10027": "命名空間[%s]不支持",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package org.zstack.sdk.zwatch.alarm.integration;

import java.util.HashMap;
import java.util.Map;
import org.zstack.sdk.*;

public class CheckExternalAlertIntegrationAction extends AbstractAction {

private static final HashMap<String, Parameter> parameterMap = new HashMap<>();

private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>();

public static class Result {
public ErrorCode error;
public org.zstack.sdk.zwatch.alarm.integration.CheckExternalAlertIntegrationResult value;

public Result throwExceptionIfError() {
if (error != null) {
throw new ApiException(
String.format("error[code: %s, description: %s, details: %s, globalErrorCode: %s]", error.code, error.description, error.details, error.globalErrorCode)
);
}

return this;
}
}

@Param(required = true, maxLength = 36, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String endpointUuid;

@Param(required = true, maxLength = 2048, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String expectedUrl;

@Param(required = false)
public java.util.List systemTags;

@Param(required = false)
public java.util.List userTags;

@Param(required = false)
public String sessionId;

@Param(required = false)
public String accessKeyId;

@Param(required = false)
public String accessKeySecret;

@Param(required = false)
public String requestIp;

@NonAPIParam
public long timeout = -1;

@NonAPIParam
public long pollingInterval = -1;


private Result makeResult(ApiResult res) {
Result ret = new Result();
if (res.error != null) {
ret.error = res.error;
return ret;
}

org.zstack.sdk.zwatch.alarm.integration.CheckExternalAlertIntegrationResult value = res.getResult(org.zstack.sdk.zwatch.alarm.integration.CheckExternalAlertIntegrationResult.class);
ret.value = value == null ? new org.zstack.sdk.zwatch.alarm.integration.CheckExternalAlertIntegrationResult() : value;

return ret;
}

public Result call() {
ApiResult res = ZSClient.call(this);
return makeResult(res);
}

public void call(final Completion<Result> completion) {
ZSClient.call(this, new InternalCompletion() {
@Override
public void complete(ApiResult res) {
completion.complete(makeResult(res));
}
});
}

protected Map<String, Parameter> getParameterMap() {
return parameterMap;
}

protected Map<String, Parameter> getNonAPIParameterMap() {
return nonAPIParameterMap;
}

protected RestInfo getRestInfo() {
RestInfo info = new RestInfo();
info.httpMethod = "POST";
info.path = "/sns/external-alert-integrations/check";
info.needSession = true;
info.needPoll = true;
info.parameterName = "params";
return info;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.zstack.sdk.zwatch.alarm.integration;



public class CheckExternalAlertIntegrationResult {
public boolean healthy;
public void setHealthy(boolean healthy) {
this.healthy = healthy;
}
public boolean getHealthy() {
return this.healthy;
}

public boolean endpointExists;
public void setEndpointExists(boolean endpointExists) {
this.endpointExists = endpointExists;
}
public boolean getEndpointExists() {
return this.endpointExists;
}

public boolean urlMatched;
public void setUrlMatched(boolean urlMatched) {
this.urlMatched = urlMatched;
}
public boolean getUrlMatched() {
return this.urlMatched;
}

public boolean subscribed;
public void setSubscribed(boolean subscribed) {
this.subscribed = subscribed;
}
public boolean getSubscribed() {
return this.subscribed;
}

public boolean templateExists;
public void setTemplateExists(boolean templateExists) {
this.templateExists = templateExists;
}
public boolean getTemplateExists() {
return this.templateExists;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package org.zstack.sdk.zwatch.alarm.integration;

import java.util.HashMap;
import java.util.Map;
import org.zstack.sdk.*;

public class RemoveExternalAlertIntegrationAction extends AbstractAction {

private static final HashMap<String, Parameter> parameterMap = new HashMap<>();

private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>();

public static class Result {
public ErrorCode error;
public org.zstack.sdk.zwatch.alarm.integration.RemoveExternalAlertIntegrationResult value;

public Result throwExceptionIfError() {
if (error != null) {
throw new ApiException(
String.format("error[code: %s, description: %s, details: %s, globalErrorCode: %s]", error.code, error.description, error.details, error.globalErrorCode)
);
}

return this;
}
}

@Param(required = true, maxLength = 36, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String endpointUuid;

@Param(required = false)
public java.util.List systemTags;

@Param(required = false)
public java.util.List userTags;

@Param(required = false)
public String sessionId;

@Param(required = false)
public String accessKeyId;

@Param(required = false)
public String accessKeySecret;

@Param(required = false)
public String requestIp;

@NonAPIParam
public long timeout = -1;

@NonAPIParam
public long pollingInterval = -1;


private Result makeResult(ApiResult res) {
Result ret = new Result();
if (res.error != null) {
ret.error = res.error;
return ret;
}

org.zstack.sdk.zwatch.alarm.integration.RemoveExternalAlertIntegrationResult value = res.getResult(org.zstack.sdk.zwatch.alarm.integration.RemoveExternalAlertIntegrationResult.class);
ret.value = value == null ? new org.zstack.sdk.zwatch.alarm.integration.RemoveExternalAlertIntegrationResult() : value;

return ret;
}

public Result call() {
ApiResult res = ZSClient.call(this);
return makeResult(res);
}

public void call(final Completion<Result> completion) {
ZSClient.call(this, new InternalCompletion() {
@Override
public void complete(ApiResult res) {
completion.complete(makeResult(res));
}
});
}

protected Map<String, Parameter> getParameterMap() {
return parameterMap;
}

protected Map<String, Parameter> getNonAPIParameterMap() {
return nonAPIParameterMap;
}

protected RestInfo getRestInfo() {
RestInfo info = new RestInfo();
info.httpMethod = "DELETE";
info.path = "/sns/external-alert-integrations/{endpointUuid}";
info.needSession = true;
info.needPoll = true;
info.parameterName = "";
return info;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.zstack.sdk.zwatch.alarm.integration;



public class RemoveExternalAlertIntegrationResult {

}
Loading