@opensoha/contracts 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/catalog_generated.go +2 -2
- package/auth/catalog_test.go +40 -0
- package/auth/permission-catalog.json +123 -3
- package/compat/json-schema-ecosystem-0.1.0.json +1 -1
- package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
- package/fixtures/openapi/KubernetesWorkloadSnapshotEnvelope/invalid/missing-content.json +8 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotEnvelope/valid/job.json +14 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/invalid/cronjob-missing-schedule.json +8 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/invalid/unknown-inheritance.json +9 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/invalid/workload-cronjob-missing-schedule.json +8 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/cronjob.json +9 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/job-zero-values.json +11 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/selective-job.json +9 -0
- package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/workload-cronjob.json +9 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/types.go +169 -0
- package/gen/go/sohaapi/types_test.go +18 -0
- package/gen/ts/sohaapi/index.ts +108 -0
- package/openapi/soha-api.json +308 -1
- package/openapi/soha-api.yaml +179 -1
- package/openapi/spec_generated.go +3 -3
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ import _ "embed"
|
|
|
6
6
|
|
|
7
7
|
const (
|
|
8
8
|
PermissionCatalogVersion = "2.0.0"
|
|
9
|
-
PermissionCatalogContentSHA256 = "
|
|
10
|
-
PermissionCatalogSHA256 = "
|
|
9
|
+
PermissionCatalogContentSHA256 = "0efe8f496fa0fb29703584586f9306d04fdb5b9a38eaea78532107698230f609"
|
|
10
|
+
PermissionCatalogSHA256 = "5f1d8b49fb4155473f61ff255002ec7a13e3f63d718d5f9fc592daa93da610df"
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
//go:embed permission-catalog.json
|
package/auth/catalog_test.go
CHANGED
|
@@ -86,3 +86,43 @@ func TestPermissionCatalogIncludesIndependentResourceCreationEntry(t *testing.T)
|
|
|
86
86
|
t.Fatal("platform.resource-creation.use is missing")
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
func TestPermissionCatalogIncludesIndependentWorkbenchEntries(t *testing.T) {
|
|
91
|
+
var catalog struct {
|
|
92
|
+
Permissions []struct {
|
|
93
|
+
Key string `json:"key"`
|
|
94
|
+
Domain string `json:"domain"`
|
|
95
|
+
Action string `json:"action"`
|
|
96
|
+
Status string `json:"status"`
|
|
97
|
+
Assignable bool `json:"assignable"`
|
|
98
|
+
} `json:"permissions"`
|
|
99
|
+
}
|
|
100
|
+
if err := json.Unmarshal(PermissionCatalogJSON(), &catalog); err != nil {
|
|
101
|
+
t.Fatalf("decode permission catalog: %v", err)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
want := map[string]bool{
|
|
105
|
+
"workbench.ai.view": false,
|
|
106
|
+
"workbench.compute.view": false,
|
|
107
|
+
"workbench.delivery.view": false,
|
|
108
|
+
"workbench.home.view": false,
|
|
109
|
+
"workbench.monitoring.view": false,
|
|
110
|
+
"workbench.platform.view": false,
|
|
111
|
+
"workbench.security.view": false,
|
|
112
|
+
"workbench.settings.view": false,
|
|
113
|
+
}
|
|
114
|
+
for _, permission := range catalog.Permissions {
|
|
115
|
+
if _, ok := want[permission.Key]; !ok {
|
|
116
|
+
continue
|
|
117
|
+
}
|
|
118
|
+
if permission.Domain != "workbench" || permission.Action != "view" || permission.Status != "active" || !permission.Assignable {
|
|
119
|
+
t.Fatalf("workbench entry must be independently assignable: %#v", permission)
|
|
120
|
+
}
|
|
121
|
+
want[permission.Key] = true
|
|
122
|
+
}
|
|
123
|
+
for key, found := range want {
|
|
124
|
+
if !found {
|
|
125
|
+
t.Fatalf("%s is missing", key)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "authorization.opensoha.io/v1",
|
|
3
3
|
"catalogVersion": "2.0.0",
|
|
4
|
-
"contentHash": "sha256:
|
|
4
|
+
"contentHash": "sha256:0efe8f496fa0fb29703584586f9306d04fdb5b9a38eaea78532107698230f609",
|
|
5
5
|
"permissions": [
|
|
6
6
|
{
|
|
7
7
|
"key": "access.directory.create",
|
|
@@ -10929,12 +10929,132 @@
|
|
|
10929
10929
|
"status": "active",
|
|
10930
10930
|
"assignable": true
|
|
10931
10931
|
},
|
|
10932
|
+
{
|
|
10933
|
+
"key": "workbench.ai.view",
|
|
10934
|
+
"domain": "workbench",
|
|
10935
|
+
"resource": "ai",
|
|
10936
|
+
"action": "view",
|
|
10937
|
+
"displayName": "访问 AI 工作台",
|
|
10938
|
+
"riskLevel": "read",
|
|
10939
|
+
"scopeKinds": [
|
|
10940
|
+
"tenant",
|
|
10941
|
+
"workspace"
|
|
10942
|
+
],
|
|
10943
|
+
"approvalPolicy": "never",
|
|
10944
|
+
"status": "active",
|
|
10945
|
+
"assignable": true
|
|
10946
|
+
},
|
|
10947
|
+
{
|
|
10948
|
+
"key": "workbench.compute.view",
|
|
10949
|
+
"domain": "workbench",
|
|
10950
|
+
"resource": "compute",
|
|
10951
|
+
"action": "view",
|
|
10952
|
+
"displayName": "访问计算资源工作台",
|
|
10953
|
+
"riskLevel": "read",
|
|
10954
|
+
"scopeKinds": [
|
|
10955
|
+
"tenant",
|
|
10956
|
+
"workspace"
|
|
10957
|
+
],
|
|
10958
|
+
"approvalPolicy": "never",
|
|
10959
|
+
"status": "active",
|
|
10960
|
+
"assignable": true
|
|
10961
|
+
},
|
|
10962
|
+
{
|
|
10963
|
+
"key": "workbench.delivery.view",
|
|
10964
|
+
"domain": "workbench",
|
|
10965
|
+
"resource": "delivery",
|
|
10966
|
+
"action": "view",
|
|
10967
|
+
"displayName": "访问应用交付工作台",
|
|
10968
|
+
"riskLevel": "read",
|
|
10969
|
+
"scopeKinds": [
|
|
10970
|
+
"tenant",
|
|
10971
|
+
"workspace"
|
|
10972
|
+
],
|
|
10973
|
+
"approvalPolicy": "never",
|
|
10974
|
+
"status": "active",
|
|
10975
|
+
"assignable": true
|
|
10976
|
+
},
|
|
10977
|
+
{
|
|
10978
|
+
"key": "workbench.home.view",
|
|
10979
|
+
"domain": "workbench",
|
|
10980
|
+
"resource": "home",
|
|
10981
|
+
"action": "view",
|
|
10982
|
+
"displayName": "访问应用门户",
|
|
10983
|
+
"riskLevel": "read",
|
|
10984
|
+
"scopeKinds": [
|
|
10985
|
+
"tenant",
|
|
10986
|
+
"workspace"
|
|
10987
|
+
],
|
|
10988
|
+
"approvalPolicy": "never",
|
|
10989
|
+
"status": "active",
|
|
10990
|
+
"assignable": true
|
|
10991
|
+
},
|
|
10992
|
+
{
|
|
10993
|
+
"key": "workbench.monitoring.view",
|
|
10994
|
+
"domain": "workbench",
|
|
10995
|
+
"resource": "monitoring",
|
|
10996
|
+
"action": "view",
|
|
10997
|
+
"displayName": "访问可观测与值班工作台",
|
|
10998
|
+
"riskLevel": "read",
|
|
10999
|
+
"scopeKinds": [
|
|
11000
|
+
"tenant",
|
|
11001
|
+
"workspace"
|
|
11002
|
+
],
|
|
11003
|
+
"approvalPolicy": "never",
|
|
11004
|
+
"status": "active",
|
|
11005
|
+
"assignable": true
|
|
11006
|
+
},
|
|
11007
|
+
{
|
|
11008
|
+
"key": "workbench.platform.view",
|
|
11009
|
+
"domain": "workbench",
|
|
11010
|
+
"resource": "platform",
|
|
11011
|
+
"action": "view",
|
|
11012
|
+
"displayName": "访问 k8s工作台",
|
|
11013
|
+
"riskLevel": "read",
|
|
11014
|
+
"scopeKinds": [
|
|
11015
|
+
"tenant",
|
|
11016
|
+
"workspace"
|
|
11017
|
+
],
|
|
11018
|
+
"approvalPolicy": "never",
|
|
11019
|
+
"status": "active",
|
|
11020
|
+
"assignable": true
|
|
11021
|
+
},
|
|
11022
|
+
{
|
|
11023
|
+
"key": "workbench.security.view",
|
|
11024
|
+
"domain": "workbench",
|
|
11025
|
+
"resource": "security",
|
|
11026
|
+
"action": "view",
|
|
11027
|
+
"displayName": "访问身份与安全工作台",
|
|
11028
|
+
"riskLevel": "read",
|
|
11029
|
+
"scopeKinds": [
|
|
11030
|
+
"tenant",
|
|
11031
|
+
"workspace"
|
|
11032
|
+
],
|
|
11033
|
+
"approvalPolicy": "never",
|
|
11034
|
+
"status": "active",
|
|
11035
|
+
"assignable": true
|
|
11036
|
+
},
|
|
11037
|
+
{
|
|
11038
|
+
"key": "workbench.settings.view",
|
|
11039
|
+
"domain": "workbench",
|
|
11040
|
+
"resource": "settings",
|
|
11041
|
+
"action": "view",
|
|
11042
|
+
"displayName": "访问设置中心",
|
|
11043
|
+
"riskLevel": "read",
|
|
11044
|
+
"scopeKinds": [
|
|
11045
|
+
"tenant",
|
|
11046
|
+
"workspace"
|
|
11047
|
+
],
|
|
11048
|
+
"approvalPolicy": "never",
|
|
11049
|
+
"status": "active",
|
|
11050
|
+
"assignable": true
|
|
11051
|
+
},
|
|
10932
11052
|
{
|
|
10933
11053
|
"key": "workspace.application.view",
|
|
10934
11054
|
"domain": "workspace",
|
|
10935
11055
|
"resource": "application",
|
|
10936
11056
|
"action": "view",
|
|
10937
|
-
"displayName": "
|
|
11057
|
+
"displayName": "查看工作空间应用",
|
|
10938
11058
|
"riskLevel": "read",
|
|
10939
11059
|
"scopeKinds": [
|
|
10940
11060
|
"tenant",
|
|
@@ -10950,7 +11070,7 @@
|
|
|
10950
11070
|
"domain": "workspace",
|
|
10951
11071
|
"resource": "resource",
|
|
10952
11072
|
"action": "view",
|
|
10953
|
-
"displayName": "
|
|
11073
|
+
"displayName": "查看工作空间资源",
|
|
10954
11074
|
"riskLevel": "read",
|
|
10955
11075
|
"scopeKinds": [
|
|
10956
11076
|
"tenant",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"content": "apiVersion: batch/v1\nkind: Job\nmetadata:\n name: report\n",
|
|
4
|
+
"sourceUid": "a17fd246-9f85-4a1f-8bb0-c6c1f844b17e",
|
|
5
|
+
"selectedContainer": "worker",
|
|
6
|
+
"containers": [
|
|
7
|
+
{
|
|
8
|
+
"name": "worker",
|
|
9
|
+
"image": "registry.example.com/report:2026.08"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"warnings": []
|
|
13
|
+
}
|
|
14
|
+
}
|
package/gen/go/sohaapi/client.go
CHANGED
package/gen/go/sohaapi/types.go
CHANGED
|
@@ -2713,6 +2713,102 @@ func (e KubernetesWorkloadImportInputWorkloadKind) Valid() bool {
|
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
|
+
// Defines values for KubernetesWorkloadSnapshotInheritance.
|
|
2717
|
+
const (
|
|
2718
|
+
KubernetesWorkloadSnapshotInheritanceEnvironment KubernetesWorkloadSnapshotInheritance = "environment"
|
|
2719
|
+
KubernetesWorkloadSnapshotInheritanceInitContainers KubernetesWorkloadSnapshotInheritance = "initContainers"
|
|
2720
|
+
KubernetesWorkloadSnapshotInheritanceResources KubernetesWorkloadSnapshotInheritance = "resources"
|
|
2721
|
+
KubernetesWorkloadSnapshotInheritanceScheduling KubernetesWorkloadSnapshotInheritance = "scheduling"
|
|
2722
|
+
KubernetesWorkloadSnapshotInheritanceSecurityContext KubernetesWorkloadSnapshotInheritance = "securityContext"
|
|
2723
|
+
KubernetesWorkloadSnapshotInheritanceServiceRuntime KubernetesWorkloadSnapshotInheritance = "serviceRuntime"
|
|
2724
|
+
KubernetesWorkloadSnapshotInheritanceStorage KubernetesWorkloadSnapshotInheritance = "storage"
|
|
2725
|
+
KubernetesWorkloadSnapshotInheritanceTemplateMetadata KubernetesWorkloadSnapshotInheritance = "templateMetadata"
|
|
2726
|
+
)
|
|
2727
|
+
|
|
2728
|
+
// Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotInheritance enum.
|
|
2729
|
+
func (e KubernetesWorkloadSnapshotInheritance) Valid() bool {
|
|
2730
|
+
switch e {
|
|
2731
|
+
case KubernetesWorkloadSnapshotInheritanceEnvironment:
|
|
2732
|
+
return true
|
|
2733
|
+
case KubernetesWorkloadSnapshotInheritanceInitContainers:
|
|
2734
|
+
return true
|
|
2735
|
+
case KubernetesWorkloadSnapshotInheritanceResources:
|
|
2736
|
+
return true
|
|
2737
|
+
case KubernetesWorkloadSnapshotInheritanceScheduling:
|
|
2738
|
+
return true
|
|
2739
|
+
case KubernetesWorkloadSnapshotInheritanceSecurityContext:
|
|
2740
|
+
return true
|
|
2741
|
+
case KubernetesWorkloadSnapshotInheritanceServiceRuntime:
|
|
2742
|
+
return true
|
|
2743
|
+
case KubernetesWorkloadSnapshotInheritanceStorage:
|
|
2744
|
+
return true
|
|
2745
|
+
case KubernetesWorkloadSnapshotInheritanceTemplateMetadata:
|
|
2746
|
+
return true
|
|
2747
|
+
default:
|
|
2748
|
+
return false
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
// Defines values for KubernetesWorkloadSnapshotRestartPolicy.
|
|
2753
|
+
const (
|
|
2754
|
+
KubernetesWorkloadSnapshotRestartPolicyNever KubernetesWorkloadSnapshotRestartPolicy = "Never"
|
|
2755
|
+
KubernetesWorkloadSnapshotRestartPolicyOnFailure KubernetesWorkloadSnapshotRestartPolicy = "OnFailure"
|
|
2756
|
+
)
|
|
2757
|
+
|
|
2758
|
+
// Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotRestartPolicy enum.
|
|
2759
|
+
func (e KubernetesWorkloadSnapshotRestartPolicy) Valid() bool {
|
|
2760
|
+
switch e {
|
|
2761
|
+
case KubernetesWorkloadSnapshotRestartPolicyNever:
|
|
2762
|
+
return true
|
|
2763
|
+
case KubernetesWorkloadSnapshotRestartPolicyOnFailure:
|
|
2764
|
+
return true
|
|
2765
|
+
default:
|
|
2766
|
+
return false
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
// Defines values for KubernetesWorkloadSnapshotSourceKind.
|
|
2771
|
+
const (
|
|
2772
|
+
KubernetesWorkloadSnapshotSourceKindDaemonSet KubernetesWorkloadSnapshotSourceKind = "DaemonSet"
|
|
2773
|
+
KubernetesWorkloadSnapshotSourceKindDeployment KubernetesWorkloadSnapshotSourceKind = "Deployment"
|
|
2774
|
+
KubernetesWorkloadSnapshotSourceKindStatefulSet KubernetesWorkloadSnapshotSourceKind = "StatefulSet"
|
|
2775
|
+
)
|
|
2776
|
+
|
|
2777
|
+
// Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotSourceKind enum.
|
|
2778
|
+
func (e KubernetesWorkloadSnapshotSourceKind) Valid() bool {
|
|
2779
|
+
switch e {
|
|
2780
|
+
case KubernetesWorkloadSnapshotSourceKindDaemonSet:
|
|
2781
|
+
return true
|
|
2782
|
+
case KubernetesWorkloadSnapshotSourceKindDeployment:
|
|
2783
|
+
return true
|
|
2784
|
+
case KubernetesWorkloadSnapshotSourceKindStatefulSet:
|
|
2785
|
+
return true
|
|
2786
|
+
default:
|
|
2787
|
+
return false
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
// Defines values for KubernetesWorkloadSnapshotTargetKind.
|
|
2792
|
+
const (
|
|
2793
|
+
KubernetesWorkloadSnapshotTargetKindCronJob KubernetesWorkloadSnapshotTargetKind = "CronJob"
|
|
2794
|
+
KubernetesWorkloadSnapshotTargetKindJob KubernetesWorkloadSnapshotTargetKind = "Job"
|
|
2795
|
+
KubernetesWorkloadSnapshotTargetKindWorkloadCronJob KubernetesWorkloadSnapshotTargetKind = "WorkloadCronJob"
|
|
2796
|
+
)
|
|
2797
|
+
|
|
2798
|
+
// Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotTargetKind enum.
|
|
2799
|
+
func (e KubernetesWorkloadSnapshotTargetKind) Valid() bool {
|
|
2800
|
+
switch e {
|
|
2801
|
+
case KubernetesWorkloadSnapshotTargetKindCronJob:
|
|
2802
|
+
return true
|
|
2803
|
+
case KubernetesWorkloadSnapshotTargetKindJob:
|
|
2804
|
+
return true
|
|
2805
|
+
case KubernetesWorkloadSnapshotTargetKindWorkloadCronJob:
|
|
2806
|
+
return true
|
|
2807
|
+
default:
|
|
2808
|
+
return false
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2716
2812
|
// Defines values for LLMCallLogCacheStatus.
|
|
2717
2813
|
const (
|
|
2718
2814
|
LLMCallLogCacheStatusBypass LLMCallLogCacheStatus = "bypass"
|
|
@@ -13983,6 +14079,76 @@ type KubernetesWorkloadRelation struct {
|
|
|
13983
14079
|
Relation string `json:"relation,omitempty"`
|
|
13984
14080
|
}
|
|
13985
14081
|
|
|
14082
|
+
// KubernetesWorkloadSnapshot defines model for KubernetesWorkloadSnapshot.
|
|
14083
|
+
type KubernetesWorkloadSnapshot struct {
|
|
14084
|
+
Containers []KubernetesWorkloadSnapshotContainer `json:"containers"`
|
|
14085
|
+
|
|
14086
|
+
// Content Generated native batch/v1 Job or CronJob YAML, or workloads.soha.io/v1alpha1 WorkloadCronJob YAML whose selected container image follows the source workload, ready for the existing resource-creation preflight.
|
|
14087
|
+
Content string `json:"content"`
|
|
14088
|
+
SelectedContainer string `json:"selectedContainer"`
|
|
14089
|
+
SourceUID string `json:"sourceUid"`
|
|
14090
|
+
Warnings []string `json:"warnings"`
|
|
14091
|
+
}
|
|
14092
|
+
|
|
14093
|
+
// KubernetesWorkloadSnapshotContainer defines model for KubernetesWorkloadSnapshotContainer.
|
|
14094
|
+
type KubernetesWorkloadSnapshotContainer struct {
|
|
14095
|
+
Image string `json:"image"`
|
|
14096
|
+
Name string `json:"name"`
|
|
14097
|
+
}
|
|
14098
|
+
|
|
14099
|
+
// KubernetesWorkloadSnapshotEnvelope defines model for KubernetesWorkloadSnapshotEnvelope.
|
|
14100
|
+
type KubernetesWorkloadSnapshotEnvelope struct {
|
|
14101
|
+
Data KubernetesWorkloadSnapshot `json:"data"`
|
|
14102
|
+
}
|
|
14103
|
+
|
|
14104
|
+
// KubernetesWorkloadSnapshotInheritance defines model for KubernetesWorkloadSnapshotInheritance.
|
|
14105
|
+
type KubernetesWorkloadSnapshotInheritance string
|
|
14106
|
+
|
|
14107
|
+
// KubernetesWorkloadSnapshotRequest defines model for KubernetesWorkloadSnapshotRequest.
|
|
14108
|
+
type KubernetesWorkloadSnapshotRequest struct {
|
|
14109
|
+
// ActiveDeadlineSeconds Zero leaves the Kubernetes default unchanged.
|
|
14110
|
+
ActiveDeadlineSeconds int `json:"activeDeadlineSeconds,omitempty"`
|
|
14111
|
+
Annotations map[string]string `json:"annotations,omitempty"`
|
|
14112
|
+
Args []string `json:"args,omitempty"`
|
|
14113
|
+
BackoffLimit int `json:"backoffLimit,omitempty"`
|
|
14114
|
+
Command []string `json:"command,omitempty"`
|
|
14115
|
+
|
|
14116
|
+
// Completions Zero leaves the Kubernetes default unchanged.
|
|
14117
|
+
Completions int `json:"completions,omitempty"`
|
|
14118
|
+
Description string `json:"description,omitempty"`
|
|
14119
|
+
|
|
14120
|
+
// Inherit Runtime modules copied from the source Pod template. Omitting this field preserves the legacy full-template snapshot; an explicit array copies only the selected modules while always retaining the selected container name, image, imagePullPolicy, command, args, and working directory.
|
|
14121
|
+
Inherit []KubernetesWorkloadSnapshotInheritance `json:"inherit,omitempty"`
|
|
14122
|
+
Labels map[string]string `json:"labels,omitempty"`
|
|
14123
|
+
|
|
14124
|
+
// Namespace Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.
|
|
14125
|
+
Namespace string `json:"namespace"`
|
|
14126
|
+
|
|
14127
|
+
// Parallelism Zero leaves the Kubernetes default unchanged.
|
|
14128
|
+
Parallelism int `json:"parallelism,omitempty"`
|
|
14129
|
+
RestartPolicy KubernetesWorkloadSnapshotRestartPolicy `json:"restartPolicy"`
|
|
14130
|
+
|
|
14131
|
+
// Schedule Required when targetKind is CronJob or WorkloadCronJob.
|
|
14132
|
+
Schedule string `json:"schedule,omitempty"`
|
|
14133
|
+
|
|
14134
|
+
// SourceContainer Regular container to retain. When omitted, the first regular container is selected.
|
|
14135
|
+
SourceContainer string `json:"sourceContainer,omitempty"`
|
|
14136
|
+
SourceKind KubernetesWorkloadSnapshotSourceKind `json:"sourceKind"`
|
|
14137
|
+
SourceName string `json:"sourceName"`
|
|
14138
|
+
Suspend bool `json:"suspend,omitempty"`
|
|
14139
|
+
TargetKind KubernetesWorkloadSnapshotTargetKind `json:"targetKind"`
|
|
14140
|
+
TargetName string `json:"targetName"`
|
|
14141
|
+
}
|
|
14142
|
+
|
|
14143
|
+
// KubernetesWorkloadSnapshotRestartPolicy defines model for KubernetesWorkloadSnapshotRestartPolicy.
|
|
14144
|
+
type KubernetesWorkloadSnapshotRestartPolicy string
|
|
14145
|
+
|
|
14146
|
+
// KubernetesWorkloadSnapshotSourceKind defines model for KubernetesWorkloadSnapshotSourceKind.
|
|
14147
|
+
type KubernetesWorkloadSnapshotSourceKind string
|
|
14148
|
+
|
|
14149
|
+
// KubernetesWorkloadSnapshotTargetKind defines model for KubernetesWorkloadSnapshotTargetKind.
|
|
14150
|
+
type KubernetesWorkloadSnapshotTargetKind string
|
|
14151
|
+
|
|
13986
14152
|
// LLMCallLog defines model for LLMCallLog.
|
|
13987
14153
|
type LLMCallLog struct {
|
|
13988
14154
|
ActorID string `json:"actorId,omitempty"`
|
|
@@ -21453,6 +21619,9 @@ type PreflightKubernetesResourceCreateJSONRequestBody = KubernetesResourceCreate
|
|
|
21453
21619
|
// DecideKubernetesResourceCreateScopeJSONRequestBody defines body for DecideKubernetesResourceCreateScope for application/json ContentType.
|
|
21454
21620
|
type DecideKubernetesResourceCreateScopeJSONRequestBody = KubernetesResourceCreateScopeDecisionRequest
|
|
21455
21621
|
|
|
21622
|
+
// GenerateKubernetesWorkloadSnapshotJSONRequestBody defines body for GenerateKubernetesWorkloadSnapshot for application/json ContentType.
|
|
21623
|
+
type GenerateKubernetesWorkloadSnapshotJSONRequestBody = KubernetesWorkloadSnapshotRequest
|
|
21624
|
+
|
|
21456
21625
|
// RecordCompanionInteractionJSONRequestBody defines body for RecordCompanionInteraction for application/json ContentType.
|
|
21457
21626
|
type RecordCompanionInteractionJSONRequestBody = CompanionInteractionRequest
|
|
21458
21627
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package sohaapi
|
|
2
|
+
|
|
3
|
+
import "testing"
|
|
4
|
+
|
|
5
|
+
func TestKubernetesWorkloadSnapshotRequestGeneratedShape(t *testing.T) {
|
|
6
|
+
request := KubernetesWorkloadSnapshotRequest{
|
|
7
|
+
Namespace: "default",
|
|
8
|
+
SourceKind: KubernetesWorkloadSnapshotSourceKindDeployment,
|
|
9
|
+
SourceName: "reports",
|
|
10
|
+
TargetKind: KubernetesWorkloadSnapshotTargetKindCronJob,
|
|
11
|
+
TargetName: "reports-schedule",
|
|
12
|
+
Inherit: []KubernetesWorkloadSnapshotInheritance{KubernetesWorkloadSnapshotInheritanceEnvironment},
|
|
13
|
+
RestartPolicy: KubernetesWorkloadSnapshotRestartPolicyNever,
|
|
14
|
+
}
|
|
15
|
+
if request.Namespace != "default" || len(request.Inherit) != 1 {
|
|
16
|
+
t.Fatalf("request = %#v", request)
|
|
17
|
+
}
|
|
18
|
+
}
|
package/gen/ts/sohaapi/index.ts
CHANGED
|
@@ -4562,6 +4562,22 @@ export interface paths {
|
|
|
4562
4562
|
patch?: never;
|
|
4563
4563
|
trace?: never;
|
|
4564
4564
|
};
|
|
4565
|
+
"/clusters/{clusterID}/resource-creation/workload-snapshot": {
|
|
4566
|
+
parameters: {
|
|
4567
|
+
query?: never;
|
|
4568
|
+
header?: never;
|
|
4569
|
+
path?: never;
|
|
4570
|
+
cookie?: never;
|
|
4571
|
+
};
|
|
4572
|
+
get?: never;
|
|
4573
|
+
put?: never;
|
|
4574
|
+
post: operations["generateKubernetesWorkloadSnapshot"];
|
|
4575
|
+
delete?: never;
|
|
4576
|
+
options?: never;
|
|
4577
|
+
head?: never;
|
|
4578
|
+
patch?: never;
|
|
4579
|
+
trace?: never;
|
|
4580
|
+
};
|
|
4565
4581
|
"/clusters/{clusterID}/resource-creation/preflight": {
|
|
4566
4582
|
parameters: {
|
|
4567
4583
|
query?: never;
|
|
@@ -15954,6 +15970,61 @@ export interface components {
|
|
|
15954
15970
|
status?: components["schemas"]["LogStreamStatus"];
|
|
15955
15971
|
} & (unknown & unknown);
|
|
15956
15972
|
/** @enum {string} */
|
|
15973
|
+
KubernetesWorkloadSnapshotSourceKind: "Deployment" | "StatefulSet" | "DaemonSet";
|
|
15974
|
+
/** @enum {string} */
|
|
15975
|
+
KubernetesWorkloadSnapshotTargetKind: "Job" | "CronJob" | "WorkloadCronJob";
|
|
15976
|
+
/** @enum {string} */
|
|
15977
|
+
KubernetesWorkloadSnapshotRestartPolicy: "Never" | "OnFailure";
|
|
15978
|
+
/** @enum {string} */
|
|
15979
|
+
KubernetesWorkloadSnapshotInheritance: "environment" | "storage" | "resources" | "securityContext" | "scheduling" | "initContainers" | "templateMetadata" | "serviceRuntime";
|
|
15980
|
+
KubernetesWorkloadSnapshotRequest: {
|
|
15981
|
+
/** @description Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped. */
|
|
15982
|
+
namespace: string;
|
|
15983
|
+
sourceKind: components["schemas"]["KubernetesWorkloadSnapshotSourceKind"];
|
|
15984
|
+
sourceName: string;
|
|
15985
|
+
/** @description Regular container to retain. When omitted, the first regular container is selected. */
|
|
15986
|
+
sourceContainer?: string;
|
|
15987
|
+
targetKind: components["schemas"]["KubernetesWorkloadSnapshotTargetKind"];
|
|
15988
|
+
targetName: string;
|
|
15989
|
+
description?: string;
|
|
15990
|
+
labels?: {
|
|
15991
|
+
[key: string]: string;
|
|
15992
|
+
};
|
|
15993
|
+
annotations?: {
|
|
15994
|
+
[key: string]: string;
|
|
15995
|
+
};
|
|
15996
|
+
command?: string[];
|
|
15997
|
+
args?: string[];
|
|
15998
|
+
/** @description Runtime modules copied from the source Pod template. Omitting this field preserves the legacy full-template snapshot; an explicit array copies only the selected modules while always retaining the selected container name, image, imagePullPolicy, command, args, and working directory. */
|
|
15999
|
+
inherit?: components["schemas"]["KubernetesWorkloadSnapshotInheritance"][];
|
|
16000
|
+
restartPolicy: components["schemas"]["KubernetesWorkloadSnapshotRestartPolicy"];
|
|
16001
|
+
/** @description Zero leaves the Kubernetes default unchanged. */
|
|
16002
|
+
parallelism?: number;
|
|
16003
|
+
/** @description Zero leaves the Kubernetes default unchanged. */
|
|
16004
|
+
completions?: number;
|
|
16005
|
+
backoffLimit?: number;
|
|
16006
|
+
/** @description Zero leaves the Kubernetes default unchanged. */
|
|
16007
|
+
activeDeadlineSeconds?: number;
|
|
16008
|
+
/** @description Required when targetKind is CronJob or WorkloadCronJob. */
|
|
16009
|
+
schedule?: string;
|
|
16010
|
+
suspend?: boolean;
|
|
16011
|
+
};
|
|
16012
|
+
KubernetesWorkloadSnapshotContainer: {
|
|
16013
|
+
name: string;
|
|
16014
|
+
image: string;
|
|
16015
|
+
};
|
|
16016
|
+
KubernetesWorkloadSnapshot: {
|
|
16017
|
+
/** @description Generated native batch/v1 Job or CronJob YAML, or workloads.soha.io/v1alpha1 WorkloadCronJob YAML whose selected container image follows the source workload, ready for the existing resource-creation preflight. */
|
|
16018
|
+
content: string;
|
|
16019
|
+
sourceUid: string;
|
|
16020
|
+
selectedContainer: string;
|
|
16021
|
+
containers: components["schemas"]["KubernetesWorkloadSnapshotContainer"][];
|
|
16022
|
+
warnings: string[];
|
|
16023
|
+
};
|
|
16024
|
+
KubernetesWorkloadSnapshotEnvelope: {
|
|
16025
|
+
data: components["schemas"]["KubernetesWorkloadSnapshot"];
|
|
16026
|
+
};
|
|
16027
|
+
/** @enum {string} */
|
|
15957
16028
|
KubernetesResourceCreateSource: "list" | "global_yaml" | "form";
|
|
15958
16029
|
/** @enum {string} */
|
|
15959
16030
|
KubernetesResourceScopeMode: "namespace" | "cluster";
|
|
@@ -19309,6 +19380,14 @@ export type LogPage = components['schemas']['LogPage'];
|
|
|
19309
19380
|
export type LogPageEnvelope = components['schemas']['LogPageEnvelope'];
|
|
19310
19381
|
export type LogStreamStatus = components['schemas']['LogStreamStatus'];
|
|
19311
19382
|
export type LogStreamEvent = components['schemas']['LogStreamEvent'];
|
|
19383
|
+
export type KubernetesWorkloadSnapshotSourceKind = components['schemas']['KubernetesWorkloadSnapshotSourceKind'];
|
|
19384
|
+
export type KubernetesWorkloadSnapshotTargetKind = components['schemas']['KubernetesWorkloadSnapshotTargetKind'];
|
|
19385
|
+
export type KubernetesWorkloadSnapshotRestartPolicy = components['schemas']['KubernetesWorkloadSnapshotRestartPolicy'];
|
|
19386
|
+
export type KubernetesWorkloadSnapshotInheritance = components['schemas']['KubernetesWorkloadSnapshotInheritance'];
|
|
19387
|
+
export type KubernetesWorkloadSnapshotRequest = components['schemas']['KubernetesWorkloadSnapshotRequest'];
|
|
19388
|
+
export type KubernetesWorkloadSnapshotContainer = components['schemas']['KubernetesWorkloadSnapshotContainer'];
|
|
19389
|
+
export type KubernetesWorkloadSnapshot = components['schemas']['KubernetesWorkloadSnapshot'];
|
|
19390
|
+
export type KubernetesWorkloadSnapshotEnvelope = components['schemas']['KubernetesWorkloadSnapshotEnvelope'];
|
|
19312
19391
|
export type KubernetesResourceCreateSource = components['schemas']['KubernetesResourceCreateSource'];
|
|
19313
19392
|
export type KubernetesResourceScopeMode = components['schemas']['KubernetesResourceScopeMode'];
|
|
19314
19393
|
export type KubernetesResourceAction = components['schemas']['KubernetesResourceAction'];
|
|
@@ -28239,6 +28318,35 @@ export interface operations {
|
|
|
28239
28318
|
404: components["responses"]["Error"];
|
|
28240
28319
|
};
|
|
28241
28320
|
};
|
|
28321
|
+
generateKubernetesWorkloadSnapshot: {
|
|
28322
|
+
parameters: {
|
|
28323
|
+
query?: never;
|
|
28324
|
+
header?: never;
|
|
28325
|
+
path: {
|
|
28326
|
+
clusterID: components["parameters"]["ClusterID"];
|
|
28327
|
+
};
|
|
28328
|
+
cookie?: never;
|
|
28329
|
+
};
|
|
28330
|
+
requestBody: {
|
|
28331
|
+
content: {
|
|
28332
|
+
"application/json": components["schemas"]["KubernetesWorkloadSnapshotRequest"];
|
|
28333
|
+
};
|
|
28334
|
+
};
|
|
28335
|
+
responses: {
|
|
28336
|
+
/** @description A native Job or CronJob manifest, or a workloads.soha.io/v1alpha1 WorkloadCronJob manifest, generated from a same-namespace workload Pod template. This operation does not create resources. */
|
|
28337
|
+
200: {
|
|
28338
|
+
headers: {
|
|
28339
|
+
[name: string]: unknown;
|
|
28340
|
+
};
|
|
28341
|
+
content: {
|
|
28342
|
+
"application/json": components["schemas"]["KubernetesWorkloadSnapshotEnvelope"];
|
|
28343
|
+
};
|
|
28344
|
+
};
|
|
28345
|
+
400: components["responses"]["Error"];
|
|
28346
|
+
403: components["responses"]["Error"];
|
|
28347
|
+
404: components["responses"]["Error"];
|
|
28348
|
+
};
|
|
28349
|
+
};
|
|
28242
28350
|
preflightKubernetesResourceCreate: {
|
|
28243
28351
|
parameters: {
|
|
28244
28352
|
query?: never;
|
package/openapi/soha-api.json
CHANGED
|
@@ -24057,6 +24057,264 @@
|
|
|
24057
24057
|
],
|
|
24058
24058
|
"type": "object"
|
|
24059
24059
|
},
|
|
24060
|
+
"KubernetesWorkloadSnapshot": {
|
|
24061
|
+
"additionalProperties": false,
|
|
24062
|
+
"properties": {
|
|
24063
|
+
"containers": {
|
|
24064
|
+
"items": {
|
|
24065
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotContainer"
|
|
24066
|
+
},
|
|
24067
|
+
"minItems": 1,
|
|
24068
|
+
"type": "array"
|
|
24069
|
+
},
|
|
24070
|
+
"content": {
|
|
24071
|
+
"description": "Generated native batch/v1 Job or CronJob YAML, or workloads.soha.io/v1alpha1 WorkloadCronJob YAML whose selected container image follows the source workload, ready for the existing resource-creation preflight.",
|
|
24072
|
+
"maxLength": 1048576,
|
|
24073
|
+
"minLength": 1,
|
|
24074
|
+
"type": "string"
|
|
24075
|
+
},
|
|
24076
|
+
"selectedContainer": {
|
|
24077
|
+
"minLength": 1,
|
|
24078
|
+
"type": "string"
|
|
24079
|
+
},
|
|
24080
|
+
"sourceUid": {
|
|
24081
|
+
"minLength": 1,
|
|
24082
|
+
"type": "string"
|
|
24083
|
+
},
|
|
24084
|
+
"warnings": {
|
|
24085
|
+
"items": {
|
|
24086
|
+
"type": "string"
|
|
24087
|
+
},
|
|
24088
|
+
"type": "array"
|
|
24089
|
+
}
|
|
24090
|
+
},
|
|
24091
|
+
"required": [
|
|
24092
|
+
"content",
|
|
24093
|
+
"sourceUid",
|
|
24094
|
+
"selectedContainer",
|
|
24095
|
+
"containers",
|
|
24096
|
+
"warnings"
|
|
24097
|
+
],
|
|
24098
|
+
"type": "object"
|
|
24099
|
+
},
|
|
24100
|
+
"KubernetesWorkloadSnapshotContainer": {
|
|
24101
|
+
"additionalProperties": false,
|
|
24102
|
+
"properties": {
|
|
24103
|
+
"image": {
|
|
24104
|
+
"type": "string"
|
|
24105
|
+
},
|
|
24106
|
+
"name": {
|
|
24107
|
+
"minLength": 1,
|
|
24108
|
+
"type": "string"
|
|
24109
|
+
}
|
|
24110
|
+
},
|
|
24111
|
+
"required": [
|
|
24112
|
+
"name",
|
|
24113
|
+
"image"
|
|
24114
|
+
],
|
|
24115
|
+
"type": "object"
|
|
24116
|
+
},
|
|
24117
|
+
"KubernetesWorkloadSnapshotEnvelope": {
|
|
24118
|
+
"additionalProperties": false,
|
|
24119
|
+
"properties": {
|
|
24120
|
+
"data": {
|
|
24121
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshot"
|
|
24122
|
+
}
|
|
24123
|
+
},
|
|
24124
|
+
"required": [
|
|
24125
|
+
"data"
|
|
24126
|
+
],
|
|
24127
|
+
"type": "object"
|
|
24128
|
+
},
|
|
24129
|
+
"KubernetesWorkloadSnapshotInheritance": {
|
|
24130
|
+
"enum": [
|
|
24131
|
+
"environment",
|
|
24132
|
+
"storage",
|
|
24133
|
+
"resources",
|
|
24134
|
+
"securityContext",
|
|
24135
|
+
"scheduling",
|
|
24136
|
+
"initContainers",
|
|
24137
|
+
"templateMetadata",
|
|
24138
|
+
"serviceRuntime"
|
|
24139
|
+
],
|
|
24140
|
+
"type": "string",
|
|
24141
|
+
"x-enum-varnames": [
|
|
24142
|
+
"KubernetesWorkloadSnapshotInheritanceEnvironment",
|
|
24143
|
+
"KubernetesWorkloadSnapshotInheritanceStorage",
|
|
24144
|
+
"KubernetesWorkloadSnapshotInheritanceResources",
|
|
24145
|
+
"KubernetesWorkloadSnapshotInheritanceSecurityContext",
|
|
24146
|
+
"KubernetesWorkloadSnapshotInheritanceScheduling",
|
|
24147
|
+
"KubernetesWorkloadSnapshotInheritanceInitContainers",
|
|
24148
|
+
"KubernetesWorkloadSnapshotInheritanceTemplateMetadata",
|
|
24149
|
+
"KubernetesWorkloadSnapshotInheritanceServiceRuntime"
|
|
24150
|
+
]
|
|
24151
|
+
},
|
|
24152
|
+
"KubernetesWorkloadSnapshotRequest": {
|
|
24153
|
+
"additionalProperties": false,
|
|
24154
|
+
"if": {
|
|
24155
|
+
"properties": {
|
|
24156
|
+
"targetKind": {
|
|
24157
|
+
"enum": [
|
|
24158
|
+
"CronJob",
|
|
24159
|
+
"WorkloadCronJob"
|
|
24160
|
+
]
|
|
24161
|
+
}
|
|
24162
|
+
},
|
|
24163
|
+
"required": [
|
|
24164
|
+
"targetKind"
|
|
24165
|
+
]
|
|
24166
|
+
},
|
|
24167
|
+
"properties": {
|
|
24168
|
+
"activeDeadlineSeconds": {
|
|
24169
|
+
"description": "Zero leaves the Kubernetes default unchanged.",
|
|
24170
|
+
"minimum": 0,
|
|
24171
|
+
"type": "integer"
|
|
24172
|
+
},
|
|
24173
|
+
"annotations": {
|
|
24174
|
+
"additionalProperties": {
|
|
24175
|
+
"type": "string"
|
|
24176
|
+
},
|
|
24177
|
+
"maxProperties": 64,
|
|
24178
|
+
"type": "object"
|
|
24179
|
+
},
|
|
24180
|
+
"args": {
|
|
24181
|
+
"items": {
|
|
24182
|
+
"maxLength": 4096,
|
|
24183
|
+
"type": "string"
|
|
24184
|
+
},
|
|
24185
|
+
"maxItems": 128,
|
|
24186
|
+
"type": "array"
|
|
24187
|
+
},
|
|
24188
|
+
"backoffLimit": {
|
|
24189
|
+
"minimum": 0,
|
|
24190
|
+
"type": "integer"
|
|
24191
|
+
},
|
|
24192
|
+
"command": {
|
|
24193
|
+
"items": {
|
|
24194
|
+
"maxLength": 4096,
|
|
24195
|
+
"type": "string"
|
|
24196
|
+
},
|
|
24197
|
+
"maxItems": 128,
|
|
24198
|
+
"type": "array"
|
|
24199
|
+
},
|
|
24200
|
+
"completions": {
|
|
24201
|
+
"description": "Zero leaves the Kubernetes default unchanged.",
|
|
24202
|
+
"minimum": 0,
|
|
24203
|
+
"type": "integer"
|
|
24204
|
+
},
|
|
24205
|
+
"description": {
|
|
24206
|
+
"maxLength": 512,
|
|
24207
|
+
"type": "string"
|
|
24208
|
+
},
|
|
24209
|
+
"inherit": {
|
|
24210
|
+
"description": "Runtime modules copied from the source Pod template. Omitting this field preserves the legacy full-template snapshot; an explicit array copies only the selected modules while always retaining the selected container name, image, imagePullPolicy, command, args, and working directory.",
|
|
24211
|
+
"items": {
|
|
24212
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotInheritance"
|
|
24213
|
+
},
|
|
24214
|
+
"maxItems": 8,
|
|
24215
|
+
"type": "array",
|
|
24216
|
+
"uniqueItems": true
|
|
24217
|
+
},
|
|
24218
|
+
"labels": {
|
|
24219
|
+
"additionalProperties": {
|
|
24220
|
+
"type": "string"
|
|
24221
|
+
},
|
|
24222
|
+
"maxProperties": 64,
|
|
24223
|
+
"type": "object"
|
|
24224
|
+
},
|
|
24225
|
+
"namespace": {
|
|
24226
|
+
"description": "Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.",
|
|
24227
|
+
"minLength": 1,
|
|
24228
|
+
"type": "string"
|
|
24229
|
+
},
|
|
24230
|
+
"parallelism": {
|
|
24231
|
+
"description": "Zero leaves the Kubernetes default unchanged.",
|
|
24232
|
+
"minimum": 0,
|
|
24233
|
+
"type": "integer"
|
|
24234
|
+
},
|
|
24235
|
+
"restartPolicy": {
|
|
24236
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotRestartPolicy"
|
|
24237
|
+
},
|
|
24238
|
+
"schedule": {
|
|
24239
|
+
"description": "Required when targetKind is CronJob or WorkloadCronJob.",
|
|
24240
|
+
"minLength": 1,
|
|
24241
|
+
"type": "string"
|
|
24242
|
+
},
|
|
24243
|
+
"sourceContainer": {
|
|
24244
|
+
"description": "Regular container to retain. When omitted, the first regular container is selected.",
|
|
24245
|
+
"minLength": 1,
|
|
24246
|
+
"type": "string"
|
|
24247
|
+
},
|
|
24248
|
+
"sourceKind": {
|
|
24249
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotSourceKind"
|
|
24250
|
+
},
|
|
24251
|
+
"sourceName": {
|
|
24252
|
+
"minLength": 1,
|
|
24253
|
+
"type": "string"
|
|
24254
|
+
},
|
|
24255
|
+
"suspend": {
|
|
24256
|
+
"type": "boolean"
|
|
24257
|
+
},
|
|
24258
|
+
"targetKind": {
|
|
24259
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotTargetKind"
|
|
24260
|
+
},
|
|
24261
|
+
"targetName": {
|
|
24262
|
+
"minLength": 1,
|
|
24263
|
+
"type": "string"
|
|
24264
|
+
}
|
|
24265
|
+
},
|
|
24266
|
+
"required": [
|
|
24267
|
+
"namespace",
|
|
24268
|
+
"sourceKind",
|
|
24269
|
+
"sourceName",
|
|
24270
|
+
"targetKind",
|
|
24271
|
+
"targetName",
|
|
24272
|
+
"restartPolicy"
|
|
24273
|
+
],
|
|
24274
|
+
"then": {
|
|
24275
|
+
"required": [
|
|
24276
|
+
"schedule"
|
|
24277
|
+
]
|
|
24278
|
+
},
|
|
24279
|
+
"type": "object"
|
|
24280
|
+
},
|
|
24281
|
+
"KubernetesWorkloadSnapshotRestartPolicy": {
|
|
24282
|
+
"enum": [
|
|
24283
|
+
"Never",
|
|
24284
|
+
"OnFailure"
|
|
24285
|
+
],
|
|
24286
|
+
"type": "string",
|
|
24287
|
+
"x-enum-varnames": [
|
|
24288
|
+
"KubernetesWorkloadSnapshotRestartPolicyNever",
|
|
24289
|
+
"KubernetesWorkloadSnapshotRestartPolicyOnFailure"
|
|
24290
|
+
]
|
|
24291
|
+
},
|
|
24292
|
+
"KubernetesWorkloadSnapshotSourceKind": {
|
|
24293
|
+
"enum": [
|
|
24294
|
+
"Deployment",
|
|
24295
|
+
"StatefulSet",
|
|
24296
|
+
"DaemonSet"
|
|
24297
|
+
],
|
|
24298
|
+
"type": "string",
|
|
24299
|
+
"x-enum-varnames": [
|
|
24300
|
+
"KubernetesWorkloadSnapshotSourceKindDeployment",
|
|
24301
|
+
"KubernetesWorkloadSnapshotSourceKindStatefulSet",
|
|
24302
|
+
"KubernetesWorkloadSnapshotSourceKindDaemonSet"
|
|
24303
|
+
]
|
|
24304
|
+
},
|
|
24305
|
+
"KubernetesWorkloadSnapshotTargetKind": {
|
|
24306
|
+
"enum": [
|
|
24307
|
+
"Job",
|
|
24308
|
+
"CronJob",
|
|
24309
|
+
"WorkloadCronJob"
|
|
24310
|
+
],
|
|
24311
|
+
"type": "string",
|
|
24312
|
+
"x-enum-varnames": [
|
|
24313
|
+
"KubernetesWorkloadSnapshotTargetKindJob",
|
|
24314
|
+
"KubernetesWorkloadSnapshotTargetKindCronJob",
|
|
24315
|
+
"KubernetesWorkloadSnapshotTargetKindWorkloadCronJob"
|
|
24316
|
+
]
|
|
24317
|
+
},
|
|
24060
24318
|
"LLMCallLog": {
|
|
24061
24319
|
"additionalProperties": false,
|
|
24062
24320
|
"properties": {
|
|
@@ -41167,7 +41425,7 @@
|
|
|
41167
41425
|
"info": {
|
|
41168
41426
|
"description": "Public OpenSoha core API contract. This first contract focuses on stable cross-repository boundaries: auth, health, runner-facing control-plane callbacks, AI Gateway, and MCP capability discovery.\n",
|
|
41169
41427
|
"title": "Soha API",
|
|
41170
|
-
"version": "0.1.
|
|
41428
|
+
"version": "0.1.14"
|
|
41171
41429
|
},
|
|
41172
41430
|
"openapi": "3.1.0",
|
|
41173
41431
|
"paths": {
|
|
@@ -52715,6 +52973,55 @@
|
|
|
52715
52973
|
]
|
|
52716
52974
|
}
|
|
52717
52975
|
},
|
|
52976
|
+
"/clusters/{clusterID}/resource-creation/workload-snapshot": {
|
|
52977
|
+
"post": {
|
|
52978
|
+
"operationId": "generateKubernetesWorkloadSnapshot",
|
|
52979
|
+
"parameters": [
|
|
52980
|
+
{
|
|
52981
|
+
"$ref": "#/components/parameters/ClusterID"
|
|
52982
|
+
}
|
|
52983
|
+
],
|
|
52984
|
+
"requestBody": {
|
|
52985
|
+
"content": {
|
|
52986
|
+
"application/json": {
|
|
52987
|
+
"schema": {
|
|
52988
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotRequest"
|
|
52989
|
+
}
|
|
52990
|
+
}
|
|
52991
|
+
},
|
|
52992
|
+
"required": true
|
|
52993
|
+
},
|
|
52994
|
+
"responses": {
|
|
52995
|
+
"200": {
|
|
52996
|
+
"content": {
|
|
52997
|
+
"application/json": {
|
|
52998
|
+
"schema": {
|
|
52999
|
+
"$ref": "#/components/schemas/KubernetesWorkloadSnapshotEnvelope"
|
|
53000
|
+
}
|
|
53001
|
+
}
|
|
53002
|
+
},
|
|
53003
|
+
"description": "A native Job or CronJob manifest, or a workloads.soha.io/v1alpha1 WorkloadCronJob manifest, generated from a same-namespace workload Pod template. This operation does not create resources."
|
|
53004
|
+
},
|
|
53005
|
+
"400": {
|
|
53006
|
+
"$ref": "#/components/responses/Error"
|
|
53007
|
+
},
|
|
53008
|
+
"403": {
|
|
53009
|
+
"$ref": "#/components/responses/Error"
|
|
53010
|
+
},
|
|
53011
|
+
"404": {
|
|
53012
|
+
"$ref": "#/components/responses/Error"
|
|
53013
|
+
}
|
|
53014
|
+
},
|
|
53015
|
+
"tags": [
|
|
53016
|
+
"Platform"
|
|
53017
|
+
],
|
|
53018
|
+
"x-soha-capability": {
|
|
53019
|
+
"name": "k8s.workloads.snapshot.generate",
|
|
53020
|
+
"requiresApproval": false,
|
|
53021
|
+
"riskLevel": "analyze"
|
|
53022
|
+
}
|
|
53023
|
+
}
|
|
53024
|
+
},
|
|
52718
53025
|
"/clusters/{clusterID}/storage/persistentvolumeclaims": {
|
|
52719
53026
|
"get": {
|
|
52720
53027
|
"operationId": "listKubernetesPersistentVolumeClaims",
|
package/openapi/soha-api.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.1.0
|
|
2
2
|
info:
|
|
3
3
|
title: Soha API
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
5
5
|
description: >
|
|
6
6
|
Public OpenSoha core API contract. This first contract focuses on stable
|
|
7
7
|
cross-repository boundaries: auth, health, runner-facing control-plane
|
|
@@ -6304,6 +6304,35 @@ paths:
|
|
|
6304
6304
|
$ref: "#/components/responses/Error"
|
|
6305
6305
|
"404":
|
|
6306
6306
|
$ref: "#/components/responses/Error"
|
|
6307
|
+
/clusters/{clusterID}/resource-creation/workload-snapshot:
|
|
6308
|
+
post:
|
|
6309
|
+
tags: [Platform]
|
|
6310
|
+
operationId: generateKubernetesWorkloadSnapshot
|
|
6311
|
+
x-soha-capability:
|
|
6312
|
+
name: k8s.workloads.snapshot.generate
|
|
6313
|
+
riskLevel: analyze
|
|
6314
|
+
requiresApproval: false
|
|
6315
|
+
parameters:
|
|
6316
|
+
- $ref: "#/components/parameters/ClusterID"
|
|
6317
|
+
requestBody:
|
|
6318
|
+
required: true
|
|
6319
|
+
content:
|
|
6320
|
+
application/json:
|
|
6321
|
+
schema:
|
|
6322
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotRequest"
|
|
6323
|
+
responses:
|
|
6324
|
+
"200":
|
|
6325
|
+
description: A native Job or CronJob manifest, or a workloads.soha.io/v1alpha1 WorkloadCronJob manifest, generated from a same-namespace workload Pod template. This operation does not create resources.
|
|
6326
|
+
content:
|
|
6327
|
+
application/json:
|
|
6328
|
+
schema:
|
|
6329
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotEnvelope"
|
|
6330
|
+
"400":
|
|
6331
|
+
$ref: "#/components/responses/Error"
|
|
6332
|
+
"403":
|
|
6333
|
+
$ref: "#/components/responses/Error"
|
|
6334
|
+
"404":
|
|
6335
|
+
$ref: "#/components/responses/Error"
|
|
6307
6336
|
/clusters/{clusterID}/resource-creation/preflight:
|
|
6308
6337
|
post:
|
|
6309
6338
|
tags: [Platform]
|
|
@@ -27727,6 +27756,155 @@ components:
|
|
|
27727
27756
|
required: [type]
|
|
27728
27757
|
then:
|
|
27729
27758
|
required: [status]
|
|
27759
|
+
KubernetesWorkloadSnapshotSourceKind:
|
|
27760
|
+
type: string
|
|
27761
|
+
enum: [Deployment, StatefulSet, DaemonSet]
|
|
27762
|
+
x-enum-varnames:
|
|
27763
|
+
- KubernetesWorkloadSnapshotSourceKindDeployment
|
|
27764
|
+
- KubernetesWorkloadSnapshotSourceKindStatefulSet
|
|
27765
|
+
- KubernetesWorkloadSnapshotSourceKindDaemonSet
|
|
27766
|
+
KubernetesWorkloadSnapshotTargetKind:
|
|
27767
|
+
type: string
|
|
27768
|
+
enum: [Job, CronJob, WorkloadCronJob]
|
|
27769
|
+
x-enum-varnames:
|
|
27770
|
+
- KubernetesWorkloadSnapshotTargetKindJob
|
|
27771
|
+
- KubernetesWorkloadSnapshotTargetKindCronJob
|
|
27772
|
+
- KubernetesWorkloadSnapshotTargetKindWorkloadCronJob
|
|
27773
|
+
KubernetesWorkloadSnapshotRestartPolicy:
|
|
27774
|
+
type: string
|
|
27775
|
+
enum: [Never, OnFailure]
|
|
27776
|
+
x-enum-varnames:
|
|
27777
|
+
- KubernetesWorkloadSnapshotRestartPolicyNever
|
|
27778
|
+
- KubernetesWorkloadSnapshotRestartPolicyOnFailure
|
|
27779
|
+
KubernetesWorkloadSnapshotInheritance:
|
|
27780
|
+
type: string
|
|
27781
|
+
enum: [environment, storage, resources, securityContext, scheduling, initContainers, templateMetadata, serviceRuntime]
|
|
27782
|
+
x-enum-varnames:
|
|
27783
|
+
- KubernetesWorkloadSnapshotInheritanceEnvironment
|
|
27784
|
+
- KubernetesWorkloadSnapshotInheritanceStorage
|
|
27785
|
+
- KubernetesWorkloadSnapshotInheritanceResources
|
|
27786
|
+
- KubernetesWorkloadSnapshotInheritanceSecurityContext
|
|
27787
|
+
- KubernetesWorkloadSnapshotInheritanceScheduling
|
|
27788
|
+
- KubernetesWorkloadSnapshotInheritanceInitContainers
|
|
27789
|
+
- KubernetesWorkloadSnapshotInheritanceTemplateMetadata
|
|
27790
|
+
- KubernetesWorkloadSnapshotInheritanceServiceRuntime
|
|
27791
|
+
KubernetesWorkloadSnapshotRequest:
|
|
27792
|
+
type: object
|
|
27793
|
+
required: [namespace, sourceKind, sourceName, targetKind, targetName, restartPolicy]
|
|
27794
|
+
properties:
|
|
27795
|
+
namespace:
|
|
27796
|
+
type: string
|
|
27797
|
+
minLength: 1
|
|
27798
|
+
description: Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.
|
|
27799
|
+
sourceKind:
|
|
27800
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotSourceKind"
|
|
27801
|
+
sourceName:
|
|
27802
|
+
type: string
|
|
27803
|
+
minLength: 1
|
|
27804
|
+
sourceContainer:
|
|
27805
|
+
type: string
|
|
27806
|
+
minLength: 1
|
|
27807
|
+
description: Regular container to retain. When omitted, the first regular container is selected.
|
|
27808
|
+
targetKind:
|
|
27809
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotTargetKind"
|
|
27810
|
+
targetName:
|
|
27811
|
+
type: string
|
|
27812
|
+
minLength: 1
|
|
27813
|
+
description:
|
|
27814
|
+
type: string
|
|
27815
|
+
maxLength: 512
|
|
27816
|
+
labels:
|
|
27817
|
+
type: object
|
|
27818
|
+
maxProperties: 64
|
|
27819
|
+
additionalProperties: { type: string }
|
|
27820
|
+
annotations:
|
|
27821
|
+
type: object
|
|
27822
|
+
maxProperties: 64
|
|
27823
|
+
additionalProperties: { type: string }
|
|
27824
|
+
command:
|
|
27825
|
+
type: array
|
|
27826
|
+
maxItems: 128
|
|
27827
|
+
items: { type: string, maxLength: 4096 }
|
|
27828
|
+
args:
|
|
27829
|
+
type: array
|
|
27830
|
+
maxItems: 128
|
|
27831
|
+
items: { type: string, maxLength: 4096 }
|
|
27832
|
+
inherit:
|
|
27833
|
+
type: array
|
|
27834
|
+
maxItems: 8
|
|
27835
|
+
uniqueItems: true
|
|
27836
|
+
items:
|
|
27837
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotInheritance"
|
|
27838
|
+
description: Runtime modules copied from the source Pod template. Omitting this field preserves the legacy full-template snapshot; an explicit array copies only the selected modules while always retaining the selected container name, image, imagePullPolicy, command, args, and working directory.
|
|
27839
|
+
restartPolicy:
|
|
27840
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotRestartPolicy"
|
|
27841
|
+
parallelism:
|
|
27842
|
+
type: integer
|
|
27843
|
+
minimum: 0
|
|
27844
|
+
description: Zero leaves the Kubernetes default unchanged.
|
|
27845
|
+
completions:
|
|
27846
|
+
type: integer
|
|
27847
|
+
minimum: 0
|
|
27848
|
+
description: Zero leaves the Kubernetes default unchanged.
|
|
27849
|
+
backoffLimit:
|
|
27850
|
+
type: integer
|
|
27851
|
+
minimum: 0
|
|
27852
|
+
activeDeadlineSeconds:
|
|
27853
|
+
type: integer
|
|
27854
|
+
minimum: 0
|
|
27855
|
+
description: Zero leaves the Kubernetes default unchanged.
|
|
27856
|
+
schedule:
|
|
27857
|
+
type: string
|
|
27858
|
+
minLength: 1
|
|
27859
|
+
description: Required when targetKind is CronJob or WorkloadCronJob.
|
|
27860
|
+
suspend:
|
|
27861
|
+
type: boolean
|
|
27862
|
+
additionalProperties: false
|
|
27863
|
+
if:
|
|
27864
|
+
properties:
|
|
27865
|
+
targetKind:
|
|
27866
|
+
enum: [CronJob, WorkloadCronJob]
|
|
27867
|
+
required: [targetKind]
|
|
27868
|
+
then:
|
|
27869
|
+
required: [schedule]
|
|
27870
|
+
KubernetesWorkloadSnapshotContainer:
|
|
27871
|
+
type: object
|
|
27872
|
+
required: [name, image]
|
|
27873
|
+
properties:
|
|
27874
|
+
name: { type: string, minLength: 1 }
|
|
27875
|
+
image: { type: string }
|
|
27876
|
+
additionalProperties: false
|
|
27877
|
+
KubernetesWorkloadSnapshot:
|
|
27878
|
+
type: object
|
|
27879
|
+
required: [content, sourceUid, selectedContainer, containers, warnings]
|
|
27880
|
+
properties:
|
|
27881
|
+
content:
|
|
27882
|
+
type: string
|
|
27883
|
+
minLength: 1
|
|
27884
|
+
maxLength: 1048576
|
|
27885
|
+
description: Generated native batch/v1 Job or CronJob YAML, or workloads.soha.io/v1alpha1 WorkloadCronJob YAML whose selected container image follows the source workload, ready for the existing resource-creation preflight.
|
|
27886
|
+
sourceUid:
|
|
27887
|
+
type: string
|
|
27888
|
+
minLength: 1
|
|
27889
|
+
selectedContainer:
|
|
27890
|
+
type: string
|
|
27891
|
+
minLength: 1
|
|
27892
|
+
containers:
|
|
27893
|
+
type: array
|
|
27894
|
+
minItems: 1
|
|
27895
|
+
items:
|
|
27896
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshotContainer"
|
|
27897
|
+
warnings:
|
|
27898
|
+
type: array
|
|
27899
|
+
items: { type: string }
|
|
27900
|
+
additionalProperties: false
|
|
27901
|
+
KubernetesWorkloadSnapshotEnvelope:
|
|
27902
|
+
type: object
|
|
27903
|
+
required: [data]
|
|
27904
|
+
properties:
|
|
27905
|
+
data:
|
|
27906
|
+
$ref: "#/components/schemas/KubernetesWorkloadSnapshot"
|
|
27907
|
+
additionalProperties: false
|
|
27730
27908
|
KubernetesResourceCreateSource:
|
|
27731
27909
|
type: string
|
|
27732
27910
|
enum: [list, global_yaml, form]
|
|
@@ -5,9 +5,9 @@ package openapi
|
|
|
5
5
|
import _ "embed"
|
|
6
6
|
|
|
7
7
|
const (
|
|
8
|
-
Version = "0.1.
|
|
9
|
-
YAMLSHA256 = "
|
|
10
|
-
JSONSHA256 = "
|
|
8
|
+
Version = "0.1.14"
|
|
9
|
+
YAMLSHA256 = "231a8b25b830df7c602c1356494502235ca8c00f23a4aea56c87c0fd79438663"
|
|
10
|
+
JSONSHA256 = "35983758f2bf5d2b4c2e918ee32f34f384218d882edf42d86c310f2820e2a82f"
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
//go:embed soha-api.yaml
|