Skip to content

Commit

Permalink
feature: Job 支持容器执行 - 脚本任务 TencentBlueKing#2631
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Dec 18, 2023
1 parent abc59bf commit 528d2ac
Show file tree
Hide file tree
Showing 12 changed files with 923 additions and 747 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,22 @@
package com.tencent.bk.job.common.constant;

/**
* 执行对象类型
* 兼容类型
*/
public enum ExecutionObjectTypeEnum {
public enum CompatibleType {
/**
* 主机
* 历史数据兼容。历史数据失效之后可删除
*/
HOST(1),
HISTORY_DATA,
/**
* 容器
* API 兼容。API 废弃之后可删除
*/
CONTAINER(2);

ExecutionObjectTypeEnum(int type) {
this.type = type;
}

private final int type;
API,
/**
* 发布兼容。发布完成后可删除
*/
DEPLOY;

public int getValue() {
return this.type;
CompatibleType() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
* IN THE SOFTWARE.
*/

package com.tencent.bk.job.execute.engine.consts;
package com.tencent.bk.job.common.constant;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* 执行对象类型
Expand All @@ -37,27 +39,23 @@ public enum ExecuteObjectTypeEnum {
*/
CONTAINER(2);

ExecuteObjectTypeEnum(int type) {
this.type = type;
}

private final int value;
private final int type;

ExecuteObjectTypeEnum(int value) {
this.value = value;
@JsonValue
public int getValue() {
return this.type;
}

public static ExecuteObjectTypeEnum valueOf(Integer value) {
if (value == null) {
return null;
}
for (ExecuteObjectTypeEnum type : values()) {
if (type.value == value) {
return type;
public static ExecuteObjectTypeEnum valOf(int type) {
for (ExecuteObjectTypeEnum typeEnum : values()) {
if (typeEnum.getValue() == type) {
return typeEnum;
}
}
throw new IllegalArgumentException("No ExecuteObjectTypeEnum constant: " + value);
throw new IllegalArgumentException("No ExecuteObjectTypeEnum constant: " + type);
}

public final int getValue() {
return value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tencent.bk.job.common.annotation.CompatibleImplementation;
import com.tencent.bk.job.common.constant.CompatibleType;
import com.tencent.bk.job.common.constant.ResourceScopeTypeEnum;
import com.tencent.bk.job.common.esb.validate.EsbAppScopeReqGroupSequenceProvider;
import com.tencent.bk.job.common.model.dto.AppResourceScope;
Expand All @@ -50,7 +51,8 @@ public class EsbAppScopeReq extends EsbJobReq {
/**
* 兼容字段,表示cmdb 业务/业务集ID
*/
@CompatibleImplementation(explain = "兼容字段,表示业务ID或者业务集ID", deprecatedVersion = "3.6.x")
@CompatibleImplementation(name = "bizId", type = CompatibleType.API,
explain = "兼容字段,表示业务ID或者业务集ID", deprecatedVersion = "3.6.x")
@JsonProperty("bk_biz_id")
@Min(value = 1L, message = "{validation.constraints.InvalidBkBizId.message}", groups = UseBkBizIdParam.class)
private Long bizId;
Expand Down

This file was deleted.

Loading

0 comments on commit 528d2ac

Please sign in to comment.