-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INLONG-9337][Manager] Support querying operation records (#9340)
- Loading branch information
Showing
40 changed files
with
773 additions
and
109 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...t/src/main/java/org/apache/inlong/manager/client/api/inner/client/OperationLogClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.inlong.manager.client.api.inner.client; | ||
|
||
import org.apache.inlong.manager.client.api.ClientConfiguration; | ||
import org.apache.inlong.manager.client.api.service.OperationLogApi; | ||
import org.apache.inlong.manager.client.api.util.ClientUtils; | ||
import org.apache.inlong.manager.pojo.common.PageResult; | ||
import org.apache.inlong.manager.pojo.common.Response; | ||
import org.apache.inlong.manager.pojo.operationLog.OperationLogRequest; | ||
import org.apache.inlong.manager.pojo.operationLog.OperationLogResponse; | ||
|
||
public class OperationLogClient { | ||
|
||
private final OperationLogApi operationLogApi; | ||
|
||
public OperationLogClient(ClientConfiguration configuration) { | ||
operationLogApi = ClientUtils.createRetrofit(configuration).create(OperationLogApi.class); | ||
} | ||
|
||
/** | ||
* create us task by sink id | ||
* | ||
* @return task id | ||
*/ | ||
public PageResult<OperationLogResponse> list(OperationLogRequest request) { | ||
Response<PageResult<OperationLogResponse>> response = | ||
ClientUtils.executeHttpCall(operationLogApi.list(request)); | ||
ClientUtils.assertRespSuccess(response); | ||
if (response.isSuccess()) { | ||
return response.getData(); | ||
} | ||
throw new RuntimeException(response.getErrMsg()); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...er-client/src/main/java/org/apache/inlong/manager/client/api/service/OperationLogApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.inlong.manager.client.api.service; | ||
|
||
import org.apache.inlong.manager.pojo.common.PageResult; | ||
import org.apache.inlong.manager.pojo.common.Response; | ||
import org.apache.inlong.manager.pojo.operationLog.OperationLogRequest; | ||
import org.apache.inlong.manager.pojo.operationLog.OperationLogResponse; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.POST; | ||
|
||
public interface OperationLogApi { | ||
|
||
@POST("operationLog/list") | ||
Call<Response<PageResult<OperationLogResponse>>> list(@Body OperationLogRequest request); | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
.../manager-common/src/main/java/org/apache/inlong/manager/common/enums/OperationTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.inlong.manager.common.enums; | ||
|
||
/** | ||
* Operation target | ||
*/ | ||
public enum OperationTarget { | ||
|
||
TENANT, | ||
|
||
GROUP, | ||
|
||
STREAM, | ||
|
||
SOURCE, | ||
|
||
SINK, | ||
|
||
CONSUME, | ||
|
||
WORKFLOW, | ||
|
||
NODE, | ||
|
||
CLUSTER, | ||
|
||
TRANSFORM, | ||
|
||
INLONG_ROLE, | ||
|
||
TENANT_ROLE | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...r-pojo/src/main/java/org/apache/inlong/manager/pojo/operationLog/OperationLogRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.inlong.manager.pojo.operationLog; | ||
|
||
import org.apache.inlong.manager.pojo.common.PageRequest; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* Request of get operation records | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class OperationLogRequest extends PageRequest { | ||
|
||
@ApiModelProperty("Inlong group id") | ||
private String inlongGroupId; | ||
|
||
@ApiModelProperty("Inlong stream id") | ||
private String inlongStreamId; | ||
|
||
@ApiModelProperty("Operation type") | ||
private String operationType; | ||
|
||
@ApiModelProperty("Operation target") | ||
private String operationTarget; | ||
|
||
@ApiModelProperty(value = "keyword") | ||
private String keyword; | ||
|
||
@ApiModelProperty(value = "query start date, format by 'yyyy-MM-dd'", required = false, example = "2022-01-01") | ||
private String startDate; | ||
|
||
@ApiModelProperty(value = "query end date, format by 'yyyy-MM-dd'", required = false, example = "2022-01-01") | ||
private String endDate; | ||
|
||
} |
Oops, something went wrong.