forked from TencentBlueKing/bk-job
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Job Open API 支持容器执行 TencentBlueKing#2774
- Loading branch information
Showing
11 changed files
with
520 additions
and
28 deletions.
There are no files selected for viewing
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
48 changes: 48 additions & 0 deletions
48
...s/cmdb-sdk/src/main/java/com/tencent/bk/job/common/cc/constants/KubeTopoNodeTypeEnum.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,48 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available. | ||
* | ||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License. | ||
* | ||
* License for BK-JOB蓝鲸智云作业平台: | ||
* -------------------------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
* to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bk.job.common.cc.constants; | ||
|
||
/** | ||
* 容器拓扑节点资源类型 | ||
*/ | ||
public enum KubeTopoNodeTypeEnum { | ||
CLUSTER("cluster"), | ||
NAMESPACE("namespace"), | ||
DEPLOYMENT("deployment"), | ||
DAEMON_SET("daemonSet"), | ||
STATEFUL_SET("statefulSet"), | ||
CRON_JOB("cronJob"), | ||
JOB("job"); | ||
|
||
private final String value; | ||
|
||
KubeTopoNodeTypeEnum(String val) { | ||
this.value = val; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
} |
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
78 changes: 78 additions & 0 deletions
78
...ons/cmdb-sdk/src/main/java/com/tencent/bk/job/common/cc/model/query/KubeClusterQuery.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,78 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available. | ||
* | ||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License. | ||
* | ||
* License for BK-JOB蓝鲸智云作业平台: | ||
* -------------------------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
* to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bk.job.common.cc.model.query; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 容器集群查询 | ||
*/ | ||
@Getter | ||
@ToString | ||
public class KubeClusterQuery { | ||
private final Long bizId; | ||
|
||
private final List<Long> ids; | ||
|
||
private final List<String> bkClusterUIDs; | ||
|
||
private KubeClusterQuery(Builder builder) { | ||
bizId = builder.bizId; | ||
ids = builder.ids; | ||
bkClusterUIDs = builder.bkClusterUIDs; | ||
} | ||
|
||
|
||
public static final class Builder { | ||
private final Long bizId; | ||
private List<Long> ids; | ||
private List<String> bkClusterUIDs; | ||
|
||
private Builder(long bizId) { | ||
this.bizId = bizId; | ||
} | ||
|
||
public static Builder builder(long bizId) { | ||
return new Builder(bizId); | ||
} | ||
|
||
public Builder ids(List<Long> ids) { | ||
this.ids = ids; | ||
return this; | ||
} | ||
|
||
public Builder bkClusterUIDs(List<String> bkClusterUIDs) { | ||
this.bkClusterUIDs = bkClusterUIDs; | ||
return this; | ||
} | ||
|
||
public KubeClusterQuery build() { | ||
return new KubeClusterQuery(this); | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
...mmons/cmdb-sdk/src/main/java/com/tencent/bk/job/common/cc/model/query/NamespaceQuery.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,87 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available. | ||
* | ||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License. | ||
* | ||
* License for BK-JOB蓝鲸智云作业平台: | ||
* -------------------------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
* to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bk.job.common.cc.model.query; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* namespace 查询 | ||
*/ | ||
@Getter | ||
@ToString | ||
public class NamespaceQuery { | ||
private final Long bizId; | ||
|
||
private final List<Long> ids; | ||
|
||
private final List<String> names; | ||
|
||
private final List<Long> bkClusterIds; | ||
|
||
private NamespaceQuery(Builder builder) { | ||
bizId = builder.bizId; | ||
ids = builder.ids; | ||
names = builder.names; | ||
bkClusterIds = builder.bkClusterIds; | ||
} | ||
|
||
|
||
public static final class Builder { | ||
private final Long bizId; | ||
private List<Long> ids; | ||
private List<String> names; | ||
private List<Long> bkClusterIds; | ||
|
||
private Builder(long bizId) { | ||
this.bizId = bizId; | ||
} | ||
|
||
public static Builder builder(long bizId) { | ||
return new Builder(bizId); | ||
} | ||
|
||
public Builder ids(List<Long> ids) { | ||
this.ids = ids; | ||
return this; | ||
} | ||
|
||
public Builder names(List<String> names) { | ||
this.names = names; | ||
return this; | ||
} | ||
|
||
public Builder bkClusterIds(List<Long> bkClusterIds) { | ||
this.bkClusterIds = bkClusterIds; | ||
return this; | ||
} | ||
|
||
public NamespaceQuery build() { | ||
return new NamespaceQuery(this); | ||
} | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
...ommons/cmdb-sdk/src/main/java/com/tencent/bk/job/common/cc/model/query/WorkloadQuery.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,101 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available. | ||
* | ||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License. | ||
* | ||
* License for BK-JOB蓝鲸智云作业平台: | ||
* -------------------------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
* to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bk.job.common.cc.model.query; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* workload 查询 | ||
*/ | ||
@Getter | ||
@ToString | ||
public class WorkloadQuery { | ||
private final Long bizId; | ||
|
||
private final List<Long> ids; | ||
|
||
private final List<String> names; | ||
|
||
private final List<Long> bkClusterIds; | ||
|
||
private final List<Long> bkNamespaceIds; | ||
|
||
private final String kind; | ||
|
||
private WorkloadQuery(Builder builder) { | ||
bizId = builder.bizId; | ||
ids = builder.ids; | ||
names = builder.names; | ||
bkClusterIds = builder.bkClusterIds; | ||
bkNamespaceIds = builder.bkNamespaceIds; | ||
kind = builder.kind; | ||
} | ||
|
||
|
||
public static final class Builder { | ||
private final Long bizId; | ||
private List<Long> ids; | ||
private List<String> names; | ||
private List<Long> bkClusterIds; | ||
private List<Long> bkNamespaceIds; | ||
private final String kind; | ||
|
||
private Builder(long bizId, String kind) { | ||
this.bizId = bizId; | ||
this.kind = kind; | ||
} | ||
|
||
public static Builder builder(long bizId, String kind) { | ||
return new Builder(bizId, kind); | ||
} | ||
|
||
public Builder ids(List<Long> ids) { | ||
this.ids = ids; | ||
return this; | ||
} | ||
|
||
public Builder names(List<String> names) { | ||
this.names = names; | ||
return this; | ||
} | ||
|
||
public Builder bkClusterIds(List<Long> bkClusterIds) { | ||
this.bkClusterIds = bkClusterIds; | ||
return this; | ||
} | ||
|
||
public Builder bkNamespaceIds(List<Long> bkNamespaceIds) { | ||
this.bkNamespaceIds = bkNamespaceIds; | ||
return this; | ||
} | ||
|
||
public WorkloadQuery build() { | ||
return new WorkloadQuery(this); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.