Skip to content

Commit

Permalink
add dashboard/etl api
Browse files Browse the repository at this point in the history
  • Loading branch information
tangkai1719 committed Sep 25, 2017
1 parent 317e186 commit e372b38
Show file tree
Hide file tree
Showing 80 changed files with 15,859 additions and 115 deletions.
614 changes: 542 additions & 72 deletions src/main/java/com/aliyun/openservices/log/Client.java

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions src/main/java/com/aliyun/openservices/log/LogService.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@
import com.aliyun.openservices.log.request.ApproveMachineGroupRequest;
import com.aliyun.openservices.log.request.BatchGetLogRequest;
import com.aliyun.openservices.log.request.CreateAlertRequest;
import com.aliyun.openservices.log.request.CreateChartRequest;
import com.aliyun.openservices.log.request.CreateConfigRequest;
import com.aliyun.openservices.log.request.CreateConsumerGroupRequest;
import com.aliyun.openservices.log.request.CreateDashboardRequest;
import com.aliyun.openservices.log.request.CreateIndexRequest;
import com.aliyun.openservices.log.request.CreateLogStoreRequest;
import com.aliyun.openservices.log.request.CreateMachineGroupRequest;
import com.aliyun.openservices.log.request.CreateSavedSearchRequest;
import com.aliyun.openservices.log.request.DeleteAlertRequest;
import com.aliyun.openservices.log.request.DeleteChartRequest;
import com.aliyun.openservices.log.request.DeleteConfigRequest;
import com.aliyun.openservices.log.request.DeleteDashboardRequest;
import com.aliyun.openservices.log.request.DeleteIndexRequest;
import com.aliyun.openservices.log.request.DeleteLogStoreRequest;
import com.aliyun.openservices.log.request.DeleteMachineGroupRequest;
Expand All @@ -38,9 +42,11 @@
import com.aliyun.openservices.log.request.GetAlertRequest;
import com.aliyun.openservices.log.request.GetAppliedConfigsRequest;
import com.aliyun.openservices.log.request.GetAppliedMachineGroupRequest;
import com.aliyun.openservices.log.request.GetChartRequest;
import com.aliyun.openservices.log.request.GetConfigRequest;
import com.aliyun.openservices.log.request.GetCursorRequest;
import com.aliyun.openservices.log.request.GetCursorTimeRequest;
import com.aliyun.openservices.log.request.GetDashboardRequest;
import com.aliyun.openservices.log.request.GetHistogramsRequest;
import com.aliyun.openservices.log.request.GetIndexRequest;
import com.aliyun.openservices.log.request.GetLogStoreRequest;
Expand All @@ -51,6 +57,7 @@
import com.aliyun.openservices.log.request.ListAlertFailRequest;
import com.aliyun.openservices.log.request.ListAlertRequest;
import com.aliyun.openservices.log.request.ListConfigRequest;
import com.aliyun.openservices.log.request.ListDashboardRequest;
import com.aliyun.openservices.log.request.ListLogStoresRequest;
import com.aliyun.openservices.log.request.ListMachineGroupRequest;
import com.aliyun.openservices.log.request.ListProjectRequest;
Expand All @@ -63,7 +70,9 @@
import com.aliyun.openservices.log.request.SplitShardRequest;
import com.aliyun.openservices.log.request.UpdateACLRequest;
import com.aliyun.openservices.log.request.UpdateAlertRequest;
import com.aliyun.openservices.log.request.UpdateChartRequest;
import com.aliyun.openservices.log.request.UpdateConfigRequest;
import com.aliyun.openservices.log.request.UpdateDashboardRequest;
import com.aliyun.openservices.log.request.UpdateIndexRequest;
import com.aliyun.openservices.log.request.UpdateLogStoreRequest;
import com.aliyun.openservices.log.request.UpdateMachineGroupMachineRequest;
Expand All @@ -76,17 +85,21 @@
import com.aliyun.openservices.log.response.ConsumerGroupHeartBeatResponse;
import com.aliyun.openservices.log.response.ConsumerGroupUpdateCheckPointResponse;
import com.aliyun.openservices.log.response.CreateAlertResponse;
import com.aliyun.openservices.log.response.CreateChartResponse;
import com.aliyun.openservices.log.response.CreateConfigResponse;
import com.aliyun.openservices.log.response.CreateConsumerGroupResponse;
import com.aliyun.openservices.log.response.CreateDashboardResponse;
import com.aliyun.openservices.log.response.CreateIndexResponse;
import com.aliyun.openservices.log.response.CreateLogStoreResponse;
import com.aliyun.openservices.log.response.CreateMachineGroupResponse;
import com.aliyun.openservices.log.response.CreateProjectResponse;
import com.aliyun.openservices.log.response.CreateSavedSearchResponse;
import com.aliyun.openservices.log.response.CreateShipperResponse;
import com.aliyun.openservices.log.response.DeleteAlertResponse;
import com.aliyun.openservices.log.response.DeleteChartResponse;
import com.aliyun.openservices.log.response.DeleteConfigResponse;
import com.aliyun.openservices.log.response.DeleteConsumerGroupResponse;
import com.aliyun.openservices.log.response.DeleteDashboardResponse;
import com.aliyun.openservices.log.response.DeleteIndexResponse;
import com.aliyun.openservices.log.response.DeleteLogStoreResponse;
import com.aliyun.openservices.log.response.DeleteMachineGroupResponse;
Expand All @@ -97,9 +110,11 @@
import com.aliyun.openservices.log.response.GetAlertResponse;
import com.aliyun.openservices.log.response.GetAppliedConfigResponse;
import com.aliyun.openservices.log.response.GetAppliedMachineGroupsResponse;
import com.aliyun.openservices.log.response.GetChartResponse;
import com.aliyun.openservices.log.response.GetConfigResponse;
import com.aliyun.openservices.log.response.GetCursorResponse;
import com.aliyun.openservices.log.response.GetCursorTimeResponse;
import com.aliyun.openservices.log.response.GetDashboardResponse;
import com.aliyun.openservices.log.response.GetHistogramsResponse;
import com.aliyun.openservices.log.response.GetIndexResponse;
import com.aliyun.openservices.log.response.GetLogStoreResponse;
Expand All @@ -114,6 +129,7 @@
import com.aliyun.openservices.log.response.ListAlertResponse;
import com.aliyun.openservices.log.response.ListConfigResponse;
import com.aliyun.openservices.log.response.ListConsumerGroupResponse;
import com.aliyun.openservices.log.response.ListDashboardResponse;
import com.aliyun.openservices.log.response.ListLogStoresResponse;
import com.aliyun.openservices.log.response.ListMachineGroupResponse;
import com.aliyun.openservices.log.response.ListMachinesResponse;
Expand All @@ -127,14 +143,30 @@
import com.aliyun.openservices.log.response.RetryShipperTasksResponse;
import com.aliyun.openservices.log.response.UpdateACLResponse;
import com.aliyun.openservices.log.response.UpdateAlertResponse;
import com.aliyun.openservices.log.response.UpdateChartResponse;
import com.aliyun.openservices.log.response.UpdateConfigResponse;
import com.aliyun.openservices.log.response.UpdateConsumerGroupResponse;
import com.aliyun.openservices.log.response.UpdateDashboardResponse;
import com.aliyun.openservices.log.response.UpdateIndexResponse;
import com.aliyun.openservices.log.response.UpdateLogStoreResponse;
import com.aliyun.openservices.log.response.UpdateMachineGroupMachineResponse;
import com.aliyun.openservices.log.response.UpdateMachineGroupResponse;
import com.aliyun.openservices.log.response.UpdateSavedSearchResponse;
import com.aliyun.openservices.log.response.UpdateShipperResponse;
import com.aliyun.openservices.log.request.CreateEtlJobRequest;
import com.aliyun.openservices.log.request.DeleteEtlJobRequest;
import com.aliyun.openservices.log.request.UpdateEtlJobRequest;
import com.aliyun.openservices.log.request.GetEtlJobRequest;
import com.aliyun.openservices.log.request.ListEtlJobRequest;
import com.aliyun.openservices.log.request.ListEtlTaskRequest;
import com.aliyun.openservices.log.request.UpdateEtlTaskStatusRequest;
import com.aliyun.openservices.log.response.CreateEtlJobResponse;
import com.aliyun.openservices.log.response.DeleteEtlJobResponse;
import com.aliyun.openservices.log.response.UpdateEtlJobResponse;
import com.aliyun.openservices.log.response.GetEtlJobResponse;
import com.aliyun.openservices.log.response.ListEtlJobResponse;
import com.aliyun.openservices.log.response.ListEtlTaskResponse;
import com.aliyun.openservices.log.response.UpdateEtlTaskStatusResponse;

public interface LogService {

Expand Down Expand Up @@ -2711,4 +2743,30 @@ public DeleteProjectResponse DeleteProject(String project)
* if any required string parameter is empty
*/
ListAlertFailResponse listAlertFail(ListAlertFailRequest request) throws LogException;

CreateDashboardResponse createDashboard(CreateDashboardRequest request) throws LogException;
UpdateDashboardResponse updateDashboard(UpdateDashboardRequest request) throws LogException;
DeleteDashboardResponse deleteDashboard(DeleteDashboardRequest request) throws LogException;
GetDashboardResponse getDashboard(GetDashboardRequest request) throws LogException;
ListDashboardResponse listDashboard(ListDashboardRequest request) throws LogException;


CreateChartResponse createChart(CreateChartRequest request) throws LogException;
UpdateChartResponse updateChart(UpdateChartRequest request) throws LogException;
DeleteChartResponse deleteChart(DeleteChartRequest request) throws LogException;
GetChartResponse getChart(GetChartRequest request) throws LogException;

CreateEtlJobResponse createEtlJob(CreateEtlJobRequest request) throws LogException;

DeleteEtlJobResponse deleteEtlJob(DeleteEtlJobRequest request) throws LogException;

UpdateEtlJobResponse updateEtlJob(UpdateEtlJobRequest request) throws LogException;

GetEtlJobResponse getEtlJob(GetEtlJobRequest request) throws LogException;

ListEtlJobResponse listEtlJob(ListEtlJobRequest request) throws LogException;

ListEtlTaskResponse listEtlTask(ListEtlTaskRequest request) throws LogException;

UpdateEtlTaskStatusResponse updateEtlTaskStatus(UpdateEtlTaskStatusRequest request) throws LogException;
}
29 changes: 27 additions & 2 deletions src/main/java/com/aliyun/openservices/log/common/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ public class Alert implements Serializable {
protected String actionType;
protected String phoneNumber;
protected String roleArn;
protected String mnsParam;
protected String message;

public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMnsParam() {
return mnsParam;
}
public void setMnsParam(String mnsParam) {
this.mnsParam = mnsParam;
}
public String getRoleArn() {
return roleArn;
}
Expand Down Expand Up @@ -128,7 +142,12 @@ public JSONObject ToJsonObject() {
alertJson.put(Consts.CONST_ALERT_DETAIL, alertDetail);
alertJson.put(Consts.CONST_ALERT_ACTIONTYPE, getActionType());
JSONObject actionDetail = new JSONObject();
actionDetail.put(Consts.CONST_ALERT_ACTIONDETAIL_PHONENUMBER, getPhoneNumber());
if (getActionType().equals(Consts.CONST_ALERT_ACTIONTYPE_SMS))
actionDetail.put(Consts.CONST_ALERT_ACTIONDETAIL_PHONENUMBER, getPhoneNumber());
else if (getActionType().equals(Consts.CONST_ALERT_ACTIONTYPE_MNS))
actionDetail.put(Consts.CONST_ALERT_ACTIONDETAIL_MNS_PARAM, getMnsParam());
else
actionDetail.put(Consts.CONST_ALERT_ACTIONDETAIL_MESSAGE, getMessage());
alertJson.put(Consts.CONST_ALERT_ACTIONDETAIL, actionDetail);
return alertJson;
}
Expand All @@ -150,7 +169,13 @@ public void FromJsonObject(JSONObject dict) throws LogException {
setComparator(alertDetail.getString(Consts.CONST_ALERT_COMPARATOR));
setActionType(dict.getString(Consts.CONST_ALERT_ACTIONTYPE));
JSONObject actionDetail = dict.getJSONObject(Consts.CONST_ALERT_ACTIONDETAIL);
setPhoneNumber(actionDetail.getString(Consts.CONST_ALERT_ACTIONDETAIL_PHONENUMBER));
if (getActionType().equals(Consts.CONST_ALERT_ACTIONTYPE_SMS))
setPhoneNumber(actionDetail.getString(Consts.CONST_ALERT_ACTIONDETAIL_PHONENUMBER));
else if (getActionType().equals(Consts.CONST_ALERT_ACTIONTYPE_MNS))
setMnsParam(actionDetail.getString(Consts.CONST_ALERT_ACTIONDETAIL_MNS_PARAM));
else
setMessage(actionDetail.getString(Consts.CONST_ALERT_ACTIONDETAIL_MESSAGE));

} catch (JSONException e) {
throw new LogException("FailToGenerateAlert", e.getMessage(), e, "");
}
Expand Down
Loading

0 comments on commit e372b38

Please sign in to comment.