@opensoha/contracts 0.1.12 → 0.1.13

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.12",
2
+ "version": "0.1.13",
3
3
  "schemas": {
4
4
  "plugins/plugin-manifest.schema.json": {
5
5
  "rootRequired": ["id", "name", "publisher", "type", "version"],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.12",
2
+ "version": "0.1.13",
3
3
  "generatedFrom": "openapi/soha-api.yaml",
4
4
  "entries": [
5
5
  {
@@ -0,0 +1,8 @@
1
+ {
2
+ "data": {
3
+ "sourceUid": "a17fd246-9f85-4a1f-8bb0-c6c1f844b17e",
4
+ "selectedContainer": "worker",
5
+ "containers": [],
6
+ "warnings": []
7
+ }
8
+ }
@@ -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
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "namespace": "default",
3
+ "sourceKind": "Deployment",
4
+ "sourceName": "reports",
5
+ "targetKind": "CronJob",
6
+ "targetName": "reports-schedule",
7
+ "restartPolicy": "Never"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "namespace": "default",
3
+ "sourceKind": "StatefulSet",
4
+ "sourceName": "indexer",
5
+ "targetKind": "WorkloadCronJob",
6
+ "targetName": "indexer-schedule",
7
+ "restartPolicy": "OnFailure"
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "namespace": "default",
3
+ "sourceKind": "Deployment",
4
+ "sourceName": "reports",
5
+ "targetKind": "CronJob",
6
+ "targetName": "reports-schedule",
7
+ "restartPolicy": "Never",
8
+ "schedule": "0 * * * *"
9
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "namespace": "default",
3
+ "sourceKind": "DaemonSet",
4
+ "sourceName": "collector",
5
+ "targetKind": "Job",
6
+ "targetName": "collector-once",
7
+ "restartPolicy": "Never",
8
+ "parallelism": 0,
9
+ "completions": 0,
10
+ "activeDeadlineSeconds": 0
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "namespace": "default",
3
+ "sourceKind": "StatefulSet",
4
+ "sourceName": "indexer",
5
+ "targetKind": "WorkloadCronJob",
6
+ "targetName": "indexer-schedule",
7
+ "restartPolicy": "OnFailure",
8
+ "schedule": "*/15 * * * *"
9
+ }
@@ -14,7 +14,7 @@ import (
14
14
  "time"
15
15
  )
16
16
 
17
- const defaultUserAgent = "opensoha-contracts/0.1.12"
17
+ const defaultUserAgent = "opensoha-contracts/0.1.13"
18
18
 
19
19
  type Client struct {
20
20
  BaseURL string
@@ -2713,6 +2713,66 @@ func (e KubernetesWorkloadImportInputWorkloadKind) Valid() bool {
2713
2713
  }
2714
2714
  }
2715
2715
 
2716
+ // Defines values for KubernetesWorkloadSnapshotRestartPolicy.
2717
+ const (
2718
+ KubernetesWorkloadSnapshotRestartPolicyNever KubernetesWorkloadSnapshotRestartPolicy = "Never"
2719
+ KubernetesWorkloadSnapshotRestartPolicyOnFailure KubernetesWorkloadSnapshotRestartPolicy = "OnFailure"
2720
+ )
2721
+
2722
+ // Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotRestartPolicy enum.
2723
+ func (e KubernetesWorkloadSnapshotRestartPolicy) Valid() bool {
2724
+ switch e {
2725
+ case KubernetesWorkloadSnapshotRestartPolicyNever:
2726
+ return true
2727
+ case KubernetesWorkloadSnapshotRestartPolicyOnFailure:
2728
+ return true
2729
+ default:
2730
+ return false
2731
+ }
2732
+ }
2733
+
2734
+ // Defines values for KubernetesWorkloadSnapshotSourceKind.
2735
+ const (
2736
+ KubernetesWorkloadSnapshotSourceKindDaemonSet KubernetesWorkloadSnapshotSourceKind = "DaemonSet"
2737
+ KubernetesWorkloadSnapshotSourceKindDeployment KubernetesWorkloadSnapshotSourceKind = "Deployment"
2738
+ KubernetesWorkloadSnapshotSourceKindStatefulSet KubernetesWorkloadSnapshotSourceKind = "StatefulSet"
2739
+ )
2740
+
2741
+ // Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotSourceKind enum.
2742
+ func (e KubernetesWorkloadSnapshotSourceKind) Valid() bool {
2743
+ switch e {
2744
+ case KubernetesWorkloadSnapshotSourceKindDaemonSet:
2745
+ return true
2746
+ case KubernetesWorkloadSnapshotSourceKindDeployment:
2747
+ return true
2748
+ case KubernetesWorkloadSnapshotSourceKindStatefulSet:
2749
+ return true
2750
+ default:
2751
+ return false
2752
+ }
2753
+ }
2754
+
2755
+ // Defines values for KubernetesWorkloadSnapshotTargetKind.
2756
+ const (
2757
+ KubernetesWorkloadSnapshotTargetKindCronJob KubernetesWorkloadSnapshotTargetKind = "CronJob"
2758
+ KubernetesWorkloadSnapshotTargetKindJob KubernetesWorkloadSnapshotTargetKind = "Job"
2759
+ KubernetesWorkloadSnapshotTargetKindWorkloadCronJob KubernetesWorkloadSnapshotTargetKind = "WorkloadCronJob"
2760
+ )
2761
+
2762
+ // Valid indicates whether the value is a known member of the KubernetesWorkloadSnapshotTargetKind enum.
2763
+ func (e KubernetesWorkloadSnapshotTargetKind) Valid() bool {
2764
+ switch e {
2765
+ case KubernetesWorkloadSnapshotTargetKindCronJob:
2766
+ return true
2767
+ case KubernetesWorkloadSnapshotTargetKindJob:
2768
+ return true
2769
+ case KubernetesWorkloadSnapshotTargetKindWorkloadCronJob:
2770
+ return true
2771
+ default:
2772
+ return false
2773
+ }
2774
+ }
2775
+
2716
2776
  // Defines values for LLMCallLogCacheStatus.
2717
2777
  const (
2718
2778
  LLMCallLogCacheStatusBypass LLMCallLogCacheStatus = "bypass"
@@ -13983,6 +14043,70 @@ type KubernetesWorkloadRelation struct {
13983
14043
  Relation string `json:"relation,omitempty"`
13984
14044
  }
13985
14045
 
14046
+ // KubernetesWorkloadSnapshot defines model for KubernetesWorkloadSnapshot.
14047
+ type KubernetesWorkloadSnapshot struct {
14048
+ Containers []KubernetesWorkloadSnapshotContainer `json:"containers"`
14049
+
14050
+ // 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.
14051
+ Content string `json:"content"`
14052
+ SelectedContainer string `json:"selectedContainer"`
14053
+ SourceUID string `json:"sourceUid"`
14054
+ Warnings []string `json:"warnings"`
14055
+ }
14056
+
14057
+ // KubernetesWorkloadSnapshotContainer defines model for KubernetesWorkloadSnapshotContainer.
14058
+ type KubernetesWorkloadSnapshotContainer struct {
14059
+ Image string `json:"image"`
14060
+ Name string `json:"name"`
14061
+ }
14062
+
14063
+ // KubernetesWorkloadSnapshotEnvelope defines model for KubernetesWorkloadSnapshotEnvelope.
14064
+ type KubernetesWorkloadSnapshotEnvelope struct {
14065
+ Data KubernetesWorkloadSnapshot `json:"data"`
14066
+ }
14067
+
14068
+ // KubernetesWorkloadSnapshotRequest defines model for KubernetesWorkloadSnapshotRequest.
14069
+ type KubernetesWorkloadSnapshotRequest struct {
14070
+ // ActiveDeadlineSeconds Zero leaves the Kubernetes default unchanged.
14071
+ ActiveDeadlineSeconds int `json:"activeDeadlineSeconds,omitempty"`
14072
+ Annotations map[string]string `json:"annotations,omitempty"`
14073
+ Args []string `json:"args,omitempty"`
14074
+ BackoffLimit int `json:"backoffLimit,omitempty"`
14075
+ Command []string `json:"command,omitempty"`
14076
+
14077
+ // Completions Zero leaves the Kubernetes default unchanged.
14078
+ Completions int `json:"completions,omitempty"`
14079
+ Description string `json:"description,omitempty"`
14080
+ Labels map[string]string `json:"labels,omitempty"`
14081
+
14082
+ // Namespace Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.
14083
+ Namespace string `json:"namespace"`
14084
+
14085
+ // Parallelism Zero leaves the Kubernetes default unchanged.
14086
+ Parallelism int `json:"parallelism,omitempty"`
14087
+ RestartPolicy KubernetesWorkloadSnapshotRestartPolicy `json:"restartPolicy"`
14088
+
14089
+ // Schedule Required when targetKind is CronJob or WorkloadCronJob.
14090
+ Schedule string `json:"schedule,omitempty"`
14091
+
14092
+ // SourceContainer Regular container to retain. When omitted, the first regular container is selected.
14093
+ SourceContainer string `json:"sourceContainer,omitempty"`
14094
+ SourceKind KubernetesWorkloadSnapshotSourceKind `json:"sourceKind"`
14095
+ SourceName string `json:"sourceName"`
14096
+ Suspend bool `json:"suspend,omitempty"`
14097
+ TargetKind KubernetesWorkloadSnapshotTargetKind `json:"targetKind"`
14098
+ TargetName string `json:"targetName"`
14099
+ }
14100
+
14101
+ // KubernetesWorkloadSnapshotRestartPolicy defines model for KubernetesWorkloadSnapshotRestartPolicy.
14102
+ type KubernetesWorkloadSnapshotRestartPolicy string
14103
+
14104
+ // KubernetesWorkloadSnapshotSourceKind defines model for KubernetesWorkloadSnapshotSourceKind.
14105
+ type KubernetesWorkloadSnapshotSourceKind string
14106
+
14107
+ // KubernetesWorkloadSnapshotTargetKind defines model for KubernetesWorkloadSnapshotTargetKind.
14108
+ type KubernetesWorkloadSnapshotTargetKind string
14109
+
13986
14110
  // LLMCallLog defines model for LLMCallLog.
13987
14111
  type LLMCallLog struct {
13988
14112
  ActorID string `json:"actorId,omitempty"`
@@ -21453,6 +21577,9 @@ type PreflightKubernetesResourceCreateJSONRequestBody = KubernetesResourceCreate
21453
21577
  // DecideKubernetesResourceCreateScopeJSONRequestBody defines body for DecideKubernetesResourceCreateScope for application/json ContentType.
21454
21578
  type DecideKubernetesResourceCreateScopeJSONRequestBody = KubernetesResourceCreateScopeDecisionRequest
21455
21579
 
21580
+ // GenerateKubernetesWorkloadSnapshotJSONRequestBody defines body for GenerateKubernetesWorkloadSnapshot for application/json ContentType.
21581
+ type GenerateKubernetesWorkloadSnapshotJSONRequestBody = KubernetesWorkloadSnapshotRequest
21582
+
21456
21583
  // RecordCompanionInteractionJSONRequestBody defines body for RecordCompanionInteraction for application/json ContentType.
21457
21584
  type RecordCompanionInteractionJSONRequestBody = CompanionInteractionRequest
21458
21585
 
@@ -0,0 +1,17 @@
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
+ RestartPolicy: KubernetesWorkloadSnapshotRestartPolicyNever,
13
+ }
14
+ if request.Namespace != "default" {
15
+ t.Fatalf("namespace = %q, want default", request.Namespace)
16
+ }
17
+ }
@@ -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,57 @@ 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
+ KubernetesWorkloadSnapshotRequest: {
15979
+ /** @description Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped. */
15980
+ namespace: string;
15981
+ sourceKind: components["schemas"]["KubernetesWorkloadSnapshotSourceKind"];
15982
+ sourceName: string;
15983
+ /** @description Regular container to retain. When omitted, the first regular container is selected. */
15984
+ sourceContainer?: string;
15985
+ targetKind: components["schemas"]["KubernetesWorkloadSnapshotTargetKind"];
15986
+ targetName: string;
15987
+ description?: string;
15988
+ labels?: {
15989
+ [key: string]: string;
15990
+ };
15991
+ annotations?: {
15992
+ [key: string]: string;
15993
+ };
15994
+ command?: string[];
15995
+ args?: string[];
15996
+ restartPolicy: components["schemas"]["KubernetesWorkloadSnapshotRestartPolicy"];
15997
+ /** @description Zero leaves the Kubernetes default unchanged. */
15998
+ parallelism?: number;
15999
+ /** @description Zero leaves the Kubernetes default unchanged. */
16000
+ completions?: number;
16001
+ backoffLimit?: number;
16002
+ /** @description Zero leaves the Kubernetes default unchanged. */
16003
+ activeDeadlineSeconds?: number;
16004
+ /** @description Required when targetKind is CronJob or WorkloadCronJob. */
16005
+ schedule?: string;
16006
+ suspend?: boolean;
16007
+ };
16008
+ KubernetesWorkloadSnapshotContainer: {
16009
+ name: string;
16010
+ image: string;
16011
+ };
16012
+ KubernetesWorkloadSnapshot: {
16013
+ /** @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. */
16014
+ content: string;
16015
+ sourceUid: string;
16016
+ selectedContainer: string;
16017
+ containers: components["schemas"]["KubernetesWorkloadSnapshotContainer"][];
16018
+ warnings: string[];
16019
+ };
16020
+ KubernetesWorkloadSnapshotEnvelope: {
16021
+ data: components["schemas"]["KubernetesWorkloadSnapshot"];
16022
+ };
16023
+ /** @enum {string} */
15957
16024
  KubernetesResourceCreateSource: "list" | "global_yaml" | "form";
15958
16025
  /** @enum {string} */
15959
16026
  KubernetesResourceScopeMode: "namespace" | "cluster";
@@ -19309,6 +19376,13 @@ export type LogPage = components['schemas']['LogPage'];
19309
19376
  export type LogPageEnvelope = components['schemas']['LogPageEnvelope'];
19310
19377
  export type LogStreamStatus = components['schemas']['LogStreamStatus'];
19311
19378
  export type LogStreamEvent = components['schemas']['LogStreamEvent'];
19379
+ export type KubernetesWorkloadSnapshotSourceKind = components['schemas']['KubernetesWorkloadSnapshotSourceKind'];
19380
+ export type KubernetesWorkloadSnapshotTargetKind = components['schemas']['KubernetesWorkloadSnapshotTargetKind'];
19381
+ export type KubernetesWorkloadSnapshotRestartPolicy = components['schemas']['KubernetesWorkloadSnapshotRestartPolicy'];
19382
+ export type KubernetesWorkloadSnapshotRequest = components['schemas']['KubernetesWorkloadSnapshotRequest'];
19383
+ export type KubernetesWorkloadSnapshotContainer = components['schemas']['KubernetesWorkloadSnapshotContainer'];
19384
+ export type KubernetesWorkloadSnapshot = components['schemas']['KubernetesWorkloadSnapshot'];
19385
+ export type KubernetesWorkloadSnapshotEnvelope = components['schemas']['KubernetesWorkloadSnapshotEnvelope'];
19312
19386
  export type KubernetesResourceCreateSource = components['schemas']['KubernetesResourceCreateSource'];
19313
19387
  export type KubernetesResourceScopeMode = components['schemas']['KubernetesResourceScopeMode'];
19314
19388
  export type KubernetesResourceAction = components['schemas']['KubernetesResourceAction'];
@@ -28239,6 +28313,35 @@ export interface operations {
28239
28313
  404: components["responses"]["Error"];
28240
28314
  };
28241
28315
  };
28316
+ generateKubernetesWorkloadSnapshot: {
28317
+ parameters: {
28318
+ query?: never;
28319
+ header?: never;
28320
+ path: {
28321
+ clusterID: components["parameters"]["ClusterID"];
28322
+ };
28323
+ cookie?: never;
28324
+ };
28325
+ requestBody: {
28326
+ content: {
28327
+ "application/json": components["schemas"]["KubernetesWorkloadSnapshotRequest"];
28328
+ };
28329
+ };
28330
+ responses: {
28331
+ /** @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. */
28332
+ 200: {
28333
+ headers: {
28334
+ [name: string]: unknown;
28335
+ };
28336
+ content: {
28337
+ "application/json": components["schemas"]["KubernetesWorkloadSnapshotEnvelope"];
28338
+ };
28339
+ };
28340
+ 400: components["responses"]["Error"];
28341
+ 403: components["responses"]["Error"];
28342
+ 404: components["responses"]["Error"];
28343
+ };
28344
+ };
28242
28345
  preflightKubernetesResourceCreate: {
28243
28346
  parameters: {
28244
28347
  query?: never;
@@ -24057,6 +24057,232 @@
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
+ "KubernetesWorkloadSnapshotRequest": {
24130
+ "additionalProperties": false,
24131
+ "if": {
24132
+ "properties": {
24133
+ "targetKind": {
24134
+ "enum": [
24135
+ "CronJob",
24136
+ "WorkloadCronJob"
24137
+ ]
24138
+ }
24139
+ },
24140
+ "required": [
24141
+ "targetKind"
24142
+ ]
24143
+ },
24144
+ "properties": {
24145
+ "activeDeadlineSeconds": {
24146
+ "description": "Zero leaves the Kubernetes default unchanged.",
24147
+ "minimum": 0,
24148
+ "type": "integer"
24149
+ },
24150
+ "annotations": {
24151
+ "additionalProperties": {
24152
+ "type": "string"
24153
+ },
24154
+ "maxProperties": 64,
24155
+ "type": "object"
24156
+ },
24157
+ "args": {
24158
+ "items": {
24159
+ "maxLength": 4096,
24160
+ "type": "string"
24161
+ },
24162
+ "maxItems": 128,
24163
+ "type": "array"
24164
+ },
24165
+ "backoffLimit": {
24166
+ "minimum": 0,
24167
+ "type": "integer"
24168
+ },
24169
+ "command": {
24170
+ "items": {
24171
+ "maxLength": 4096,
24172
+ "type": "string"
24173
+ },
24174
+ "maxItems": 128,
24175
+ "type": "array"
24176
+ },
24177
+ "completions": {
24178
+ "description": "Zero leaves the Kubernetes default unchanged.",
24179
+ "minimum": 0,
24180
+ "type": "integer"
24181
+ },
24182
+ "description": {
24183
+ "maxLength": 512,
24184
+ "type": "string"
24185
+ },
24186
+ "labels": {
24187
+ "additionalProperties": {
24188
+ "type": "string"
24189
+ },
24190
+ "maxProperties": 64,
24191
+ "type": "object"
24192
+ },
24193
+ "namespace": {
24194
+ "description": "Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.",
24195
+ "minLength": 1,
24196
+ "type": "string"
24197
+ },
24198
+ "parallelism": {
24199
+ "description": "Zero leaves the Kubernetes default unchanged.",
24200
+ "minimum": 0,
24201
+ "type": "integer"
24202
+ },
24203
+ "restartPolicy": {
24204
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotRestartPolicy"
24205
+ },
24206
+ "schedule": {
24207
+ "description": "Required when targetKind is CronJob or WorkloadCronJob.",
24208
+ "minLength": 1,
24209
+ "type": "string"
24210
+ },
24211
+ "sourceContainer": {
24212
+ "description": "Regular container to retain. When omitted, the first regular container is selected.",
24213
+ "minLength": 1,
24214
+ "type": "string"
24215
+ },
24216
+ "sourceKind": {
24217
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotSourceKind"
24218
+ },
24219
+ "sourceName": {
24220
+ "minLength": 1,
24221
+ "type": "string"
24222
+ },
24223
+ "suspend": {
24224
+ "type": "boolean"
24225
+ },
24226
+ "targetKind": {
24227
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotTargetKind"
24228
+ },
24229
+ "targetName": {
24230
+ "minLength": 1,
24231
+ "type": "string"
24232
+ }
24233
+ },
24234
+ "required": [
24235
+ "namespace",
24236
+ "sourceKind",
24237
+ "sourceName",
24238
+ "targetKind",
24239
+ "targetName",
24240
+ "restartPolicy"
24241
+ ],
24242
+ "then": {
24243
+ "required": [
24244
+ "schedule"
24245
+ ]
24246
+ },
24247
+ "type": "object"
24248
+ },
24249
+ "KubernetesWorkloadSnapshotRestartPolicy": {
24250
+ "enum": [
24251
+ "Never",
24252
+ "OnFailure"
24253
+ ],
24254
+ "type": "string",
24255
+ "x-enum-varnames": [
24256
+ "KubernetesWorkloadSnapshotRestartPolicyNever",
24257
+ "KubernetesWorkloadSnapshotRestartPolicyOnFailure"
24258
+ ]
24259
+ },
24260
+ "KubernetesWorkloadSnapshotSourceKind": {
24261
+ "enum": [
24262
+ "Deployment",
24263
+ "StatefulSet",
24264
+ "DaemonSet"
24265
+ ],
24266
+ "type": "string",
24267
+ "x-enum-varnames": [
24268
+ "KubernetesWorkloadSnapshotSourceKindDeployment",
24269
+ "KubernetesWorkloadSnapshotSourceKindStatefulSet",
24270
+ "KubernetesWorkloadSnapshotSourceKindDaemonSet"
24271
+ ]
24272
+ },
24273
+ "KubernetesWorkloadSnapshotTargetKind": {
24274
+ "enum": [
24275
+ "Job",
24276
+ "CronJob",
24277
+ "WorkloadCronJob"
24278
+ ],
24279
+ "type": "string",
24280
+ "x-enum-varnames": [
24281
+ "KubernetesWorkloadSnapshotTargetKindJob",
24282
+ "KubernetesWorkloadSnapshotTargetKindCronJob",
24283
+ "KubernetesWorkloadSnapshotTargetKindWorkloadCronJob"
24284
+ ]
24285
+ },
24060
24286
  "LLMCallLog": {
24061
24287
  "additionalProperties": false,
24062
24288
  "properties": {
@@ -41167,7 +41393,7 @@
41167
41393
  "info": {
41168
41394
  "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
41395
  "title": "Soha API",
41170
- "version": "0.1.12"
41396
+ "version": "0.1.13"
41171
41397
  },
41172
41398
  "openapi": "3.1.0",
41173
41399
  "paths": {
@@ -52715,6 +52941,55 @@
52715
52941
  ]
52716
52942
  }
52717
52943
  },
52944
+ "/clusters/{clusterID}/resource-creation/workload-snapshot": {
52945
+ "post": {
52946
+ "operationId": "generateKubernetesWorkloadSnapshot",
52947
+ "parameters": [
52948
+ {
52949
+ "$ref": "#/components/parameters/ClusterID"
52950
+ }
52951
+ ],
52952
+ "requestBody": {
52953
+ "content": {
52954
+ "application/json": {
52955
+ "schema": {
52956
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotRequest"
52957
+ }
52958
+ }
52959
+ },
52960
+ "required": true
52961
+ },
52962
+ "responses": {
52963
+ "200": {
52964
+ "content": {
52965
+ "application/json": {
52966
+ "schema": {
52967
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotEnvelope"
52968
+ }
52969
+ }
52970
+ },
52971
+ "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."
52972
+ },
52973
+ "400": {
52974
+ "$ref": "#/components/responses/Error"
52975
+ },
52976
+ "403": {
52977
+ "$ref": "#/components/responses/Error"
52978
+ },
52979
+ "404": {
52980
+ "$ref": "#/components/responses/Error"
52981
+ }
52982
+ },
52983
+ "tags": [
52984
+ "Platform"
52985
+ ],
52986
+ "x-soha-capability": {
52987
+ "name": "k8s.workloads.snapshot.generate",
52988
+ "requiresApproval": false,
52989
+ "riskLevel": "analyze"
52990
+ }
52991
+ }
52992
+ },
52718
52993
  "/clusters/{clusterID}/storage/persistentvolumeclaims": {
52719
52994
  "get": {
52720
52995
  "operationId": "listKubernetesPersistentVolumeClaims",
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Soha API
4
- version: 0.1.12
4
+ version: 0.1.13
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,136 @@ 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
+ KubernetesWorkloadSnapshotRequest:
27780
+ type: object
27781
+ required: [namespace, sourceKind, sourceName, targetKind, targetName, restartPolicy]
27782
+ properties:
27783
+ namespace:
27784
+ type: string
27785
+ minLength: 1
27786
+ description: Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.
27787
+ sourceKind:
27788
+ $ref: "#/components/schemas/KubernetesWorkloadSnapshotSourceKind"
27789
+ sourceName:
27790
+ type: string
27791
+ minLength: 1
27792
+ sourceContainer:
27793
+ type: string
27794
+ minLength: 1
27795
+ description: Regular container to retain. When omitted, the first regular container is selected.
27796
+ targetKind:
27797
+ $ref: "#/components/schemas/KubernetesWorkloadSnapshotTargetKind"
27798
+ targetName:
27799
+ type: string
27800
+ minLength: 1
27801
+ description:
27802
+ type: string
27803
+ maxLength: 512
27804
+ labels:
27805
+ type: object
27806
+ maxProperties: 64
27807
+ additionalProperties: { type: string }
27808
+ annotations:
27809
+ type: object
27810
+ maxProperties: 64
27811
+ additionalProperties: { type: string }
27812
+ command:
27813
+ type: array
27814
+ maxItems: 128
27815
+ items: { type: string, maxLength: 4096 }
27816
+ args:
27817
+ type: array
27818
+ maxItems: 128
27819
+ items: { type: string, maxLength: 4096 }
27820
+ restartPolicy:
27821
+ $ref: "#/components/schemas/KubernetesWorkloadSnapshotRestartPolicy"
27822
+ parallelism:
27823
+ type: integer
27824
+ minimum: 0
27825
+ description: Zero leaves the Kubernetes default unchanged.
27826
+ completions:
27827
+ type: integer
27828
+ minimum: 0
27829
+ description: Zero leaves the Kubernetes default unchanged.
27830
+ backoffLimit:
27831
+ type: integer
27832
+ minimum: 0
27833
+ activeDeadlineSeconds:
27834
+ type: integer
27835
+ minimum: 0
27836
+ description: Zero leaves the Kubernetes default unchanged.
27837
+ schedule:
27838
+ type: string
27839
+ minLength: 1
27840
+ description: Required when targetKind is CronJob or WorkloadCronJob.
27841
+ suspend:
27842
+ type: boolean
27843
+ additionalProperties: false
27844
+ if:
27845
+ properties:
27846
+ targetKind:
27847
+ enum: [CronJob, WorkloadCronJob]
27848
+ required: [targetKind]
27849
+ then:
27850
+ required: [schedule]
27851
+ KubernetesWorkloadSnapshotContainer:
27852
+ type: object
27853
+ required: [name, image]
27854
+ properties:
27855
+ name: { type: string, minLength: 1 }
27856
+ image: { type: string }
27857
+ additionalProperties: false
27858
+ KubernetesWorkloadSnapshot:
27859
+ type: object
27860
+ required: [content, sourceUid, selectedContainer, containers, warnings]
27861
+ properties:
27862
+ content:
27863
+ type: string
27864
+ minLength: 1
27865
+ maxLength: 1048576
27866
+ 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.
27867
+ sourceUid:
27868
+ type: string
27869
+ minLength: 1
27870
+ selectedContainer:
27871
+ type: string
27872
+ minLength: 1
27873
+ containers:
27874
+ type: array
27875
+ minItems: 1
27876
+ items:
27877
+ $ref: "#/components/schemas/KubernetesWorkloadSnapshotContainer"
27878
+ warnings:
27879
+ type: array
27880
+ items: { type: string }
27881
+ additionalProperties: false
27882
+ KubernetesWorkloadSnapshotEnvelope:
27883
+ type: object
27884
+ required: [data]
27885
+ properties:
27886
+ data:
27887
+ $ref: "#/components/schemas/KubernetesWorkloadSnapshot"
27888
+ additionalProperties: false
27730
27889
  KubernetesResourceCreateSource:
27731
27890
  type: string
27732
27891
  enum: [list, global_yaml, form]
@@ -5,9 +5,9 @@ package openapi
5
5
  import _ "embed"
6
6
 
7
7
  const (
8
- Version = "0.1.12"
9
- YAMLSHA256 = "b9dbd5597000f9124790f0df8e9e7616e76f7d7e12df03b72490c3403da4eda5"
10
- JSONSHA256 = "6f34774013b3e6c9dd0e2c9b3e9d929a68f8f8b659a5909dad64a77821ef24dd"
8
+ Version = "0.1.13"
9
+ YAMLSHA256 = "480571290460492a4f422ecf2c2098720989c31a4413c1bf29fc45b1ecaa5c7b"
10
+ JSONSHA256 = "8327233124b473bdfe2a57582eb66ed9c844630bedd0c947eefb707b71f7d3cf"
11
11
  )
12
12
 
13
13
  //go:embed soha-api.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensoha/contracts",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "description": "Shared OpenSoha API, agent, MCP, skill, event, and auth contracts.",
6
6
  "license": "Apache-2.0",