Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(fleets): idle pool lifecycle, stuck-claim reaping, faster cold bind (#7886)

ddupont0722e6e94605
diff --git a/libs/fleet/backend/auth/policy_pool_lifecycle_test.go b/libs/fleet/backend/auth/policy_pool_lifecycle_test.go
new file mode 100644
index 0000000000..7cb5f9e824
--- /dev/null
+++ b/libs/fleet/backend/auth/policy_pool_lifecycle_test.go
@@ -0,0 +1,94 @@
+package auth
+
+import (
+ "net/http"
+ "testing"
+)
+
+// These tests pin that the pool lifecycle fields (WarmPool spec.idleTtlSeconds
+// and spec.ttlPolicy) and creator-set cua.ai/ labels and annotations on warm
+// pools and claims pass the production /api/k8s tree end to end. The surface is
+// an allowlist over group/resource/method, and only templates and sandboxes
+// have body admission, so no policy change is needed for them. These tests
+// fail if a future body leaf starts rejecting the lifecycle fields.
+
+func TestK8sWarmPoolLifecycleFieldsAdmitted(t *testing.T) {
+ setCardAdmissionFlags(t, false)
+ const collection = "apis/osgym.cua.ai/v1alpha1/namespaces/ns-a/osgymsandboxwarmpools"
+ const item = collection + "/ns-a"
+
+ for _, testCase := range []struct {
+ name string
+ method string
+ path string
+ body string
+ }{
+ {
+ name: "create with idle TTL, Cascade policy, labels and annotations",
+ method: http.MethodPost,
+ path: collection,
+ body: `{"apiVersion":"osgym.cua.ai/v1alpha1","kind":"OSGymSandboxWarmPool",` +
+ `"metadata":{"name":"ns-a","namespace":"ns-a",` +
+ `"labels":{"cua.ai/managed-by":"cua-sdk","cua.ai/owner-hash":"abc123"},` +
+ `"annotations":{"cua.ai/created-by":"sdk"}},` +
+ `"spec":{"replicas":0,"sandboxTemplateRef":{"name":"ns-a-template"},` +
+ `"autoscaling":{"minPoolSize":0,"maxPoolSize":4},` +
+ `"idleTtlSeconds":900,"ttlPolicy":"Cascade","ttlSecondsAfterCreated":86400}}`,
+ },
+ {
+ name: "merge-patch idle TTL and policy",
+ method: http.MethodPatch,
+ path: item,
+ body: `{"spec":{"idleTtlSeconds":300,"ttlPolicy":"Retain"}}`,
+ },
+ {
+ name: "merge-patch metadata only",
+ method: http.MethodPatch,
+ path: item,
+ body: `{"metadata":{"labels":{"cua.ai/managed-by":"cua-sdk"},"annotations":{"cua.ai/last-used":"2026-09-22T00:00:00Z"}}}`,
+ },
+ } {
+ t.Run(testCase.name, func(t *testing.T) {
+ response, reached := runK8sPolicyResponse(t, sandboxServicesRequest(testCase.method, testCase.path, testCase.body))
+ if response.Code != http.StatusNoContent || !reached {
+ t.Fatalf("status, reached = %d, %v; want %d, true; body = %s",
+ response.Code, reached, http.StatusNoContent, response.Body.String())
+ }
+ })
+ }
+}
+
+func TestK8sClaimCreatorLabelsAdmitted(t *testing.T) {
+ setCardAdmissionFlags(t, false)
+ const collection = "apis/osgym.cua.ai/v1alpha1/namespaces/ns-a/osgymsandboxclaims"
+
+ for _, testCase := range []struct {
+ name string
+ method string
+ path string
+ body string
+ }{
+ {
+ name: "create with labels",
+ method: http.MethodPost,
+ path: collection,
+ body: `{"apiVersion":"osgym.cua.ai/v1alpha1","kind":"OSGymSandboxClaim",` +
+ `"metadata":{"name":"claim-a","namespace":"ns-a","labels":{"cua.ai/fleet":"f1"}},` +
+ `"spec":{"sandboxTemplateRef":{"name":"ns-a-template"},"ttlSecondsAfterCreated":600}}`,
+ },
+ {
+ name: "patch labels and annotations",
+ method: http.MethodPatch,
+ path: collection + "/claim-a",
+ body: `{"metadata":{"labels":{"cua.ai/fleet":"f2"},"annotations":{"cua.ai/note":"x"}}}`,
+ },
+ } {
+ t.Run(testCase.name, func(t *testing.T) {
+ response, reached := runK8sPolicyResponse(t, sandboxServicesRequest(testCase.method, testCase.path, testCase.body))
+ if response.Code != http.StatusNoContent || !reached {
+ t.Fatalf("status, reached = %d, %v; want %d, true; body = %s",
+ response.Code, reached, http.StatusNoContent, response.Body.String())
+ }
+ })
+ }
+}
diff --git a/libs/fleet/backend/auth/pool_admission_test.rego b/libs/fleet/backend/auth/pool_admission_test.rego
index faf10937e5..67e9b2a4ac 100644
--- a/libs/fleet/backend/auth/pool_admission_test.rego
+++ b/libs/fleet/backend/auth/pool_admission_test.rego
@@ -241,3 +241,38 @@ test_nested_virt_false_allowed_for_non_admin {
"flags": non_admin_flags,
}
}
+
+# Warm pools and claims carry no image configuration, so pool admission does
+# not apply to them: the idle-TTL lifecycle fields and creator-set cua.ai/
+# labels and annotations pass without a policy change.
+test_warm_pool_lifecycle_fields_and_labels_not_subject_to_pool_admission {
+ pool_admission.allow with input as {
+ "method": "POST",
+ "params": {"path": "apis/osgym.cua.ai/v1alpha1/namespaces/ns-a/osgymsandboxwarmpools"},
+ "body": json.marshal({
+ "metadata": {
+ "name": "ns-a",
+ "labels": {"cua.ai/managed-by": "cua-sdk"},
+ "annotations": {"cua.ai/created-by": "sdk"},
+ },
+ "spec": {
+ "replicas": 0,
+ "sandboxTemplateRef": {"name": "ns-a-template"},
+ "idleTtlSeconds": 900,
+ "ttlPolicy": "Cascade",
+ },
+ }),
+ "user": non_admin,
+ "flags": non_admin_flags,
+ }
+}
+
+test_claim_label_patch_not_subject_to_pool_admission {
+ pool_admission.allow with input as {
+ "method": "PATCH",
+ "params": {"path": "apis/osgym.cua.ai/v1alpha1/namespaces/ns-a/osgymsandboxclaims/claim-a"},
+ "body": json.marshal({"metadata": {"labels": {"cua.ai/fleet": "f1"}}}),
+ "user": non_admin,
+ "flags": non_admin_flags,
+ }
+}
diff --git a/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.go b/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.go
index 359f086b45..c16bb804a8 100644
--- a/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.go
+++ b/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.go
@@ -1127,6 +1127,8 @@ type OsGymSandboxWarmPoolSpec struct {
SandboxTemplateRef SandboxTemplateRef
Autoscaling *WarmPoolAutoscaling
TtlSecondsAfterCreated *uint32
+ IdleTtlSeconds *uint32
+ TtlPolicy *WarmPoolTtlPolicy
}
func (r *OsGymSandboxWarmPoolSpec) Destroy() {
@@ -1134,6 +1136,8 @@ func (r *OsGymSandboxWarmPoolSpec) Destroy() {
FfiDestroyerSandboxTemplateRef{}.Destroy(r.SandboxTemplateRef)
FfiDestroyerOptionalWarmPoolAutoscaling{}.Destroy(r.Autoscaling)
FfiDestroyerOptionalUint32{}.Destroy(r.TtlSecondsAfterCreated)
+ FfiDestroyerOptionalUint32{}.Destroy(r.IdleTtlSeconds)
+ FfiDestroyerOptionalWarmPoolTtlPolicy{}.Destroy(r.TtlPolicy)
}
type FfiConverterOsGymSandboxWarmPoolSpec struct{}
@@ -1150,6 +1154,8 @@ func (c FfiConverterOsGymSandboxWarmPoolSpec) Read(reader io.Reader) OsGymSandbo
FfiConverterSandboxTemplateRefINSTANCE.Read(reader),
FfiConverterOptionalWarmPoolAutoscalingINSTANCE.Read(reader),
FfiConverterOptionalUint32INSTANCE.Read(reader),
+ FfiConverterOptionalUint32INSTANCE.Read(reader),
+ FfiConverterOptionalWarmPoolTtlPolicyINSTANCE.Read(reader),
}
}
@@ -1166,6 +1172,8 @@ func (c FfiConverterOsGymSandboxWarmPoolSpec) Write(writer io.Writer, value OsGy
FfiConverterSandboxTemplateRefINSTANCE.Write(writer, value.SandboxTemplateRef)
FfiConverterOptionalWarmPoolAutoscalingINSTANCE.Write(writer, value.Autoscaling)
FfiConverterOptionalUint32INSTANCE.Write(writer, value.TtlSecondsAfterCreated)
+ FfiConverterOptionalUint32INSTANCE.Write(writer, value.IdleTtlSeconds)
+ FfiConverterOptionalWarmPoolTtlPolicyINSTANCE.Write(writer, value.TtlPolicy)
}
type FfiDestroyerOsGymSandboxWarmPoolSpec struct{}
@@ -1175,15 +1183,19 @@ func (_ FfiDestroyerOsGymSandboxWarmPoolSpec) Destroy(value OsGymSandboxWarmPool
}
type OsGymSandboxWarmPoolStatus struct {
- Replicas *uint32
- ReadyReplicas *uint32
- Selector *string
+ Replicas *uint32
+ ReadyReplicas *uint32
+ Selector *string
+ LastClaimedAt *string
+ LastActivityTime *string
}
func (r *OsGymSandboxWarmPoolStatus) Destroy() {
FfiDestroyerOptionalUint32{}.Destroy(r.Replicas)
FfiDestroyerOptionalUint32{}.Destroy(r.ReadyReplicas)
FfiDestroyerOptionalString{}.Destroy(r.Selector)
+ FfiDestroyerOptionalString{}.Destroy(r.LastClaimedAt)
+ FfiDestroyerOptionalString{}.Destroy(r.LastActivityTime)
}
type FfiConverterOsGymSandboxWarmPoolStatus struct{}
@@ -1199,6 +1211,8 @@ func (c FfiConverterOsGymSandboxWarmPoolStatus) Read(reader io.Reader) OsGymSand
FfiConverterOptionalUint32INSTANCE.Read(reader),
FfiConverterOptionalUint32INSTANCE.Read(reader),
FfiConverterOptionalStringINSTANCE.Read(reader),
+ FfiConverterOptionalStringINSTANCE.Read(reader),
+ FfiConverterOptionalStringINSTANCE.Read(reader),
}
}
@@ -1214,6 +1228,8 @@ func (c FfiConverterOsGymSandboxWarmPoolStatus) Write(writer io.Writer, value Os
FfiConverterOptionalUint32INSTANCE.Write(writer, value.Replicas)
FfiConverterOptionalUint32INSTANCE.Write(writer, value.ReadyReplicas)
FfiConverterOptionalStringINSTANCE.Write(writer, value.Selector)
+ FfiConverterOptionalStringINSTANCE.Write(writer, value.LastClaimedAt)
+ FfiConverterOptionalStringINSTANCE.Write(writer, value.LastActivityTime)
}
type FfiDestroyerOsGymSandboxWarmPoolStatus struct{}
@@ -1881,6 +1897,47 @@ type FfiDestroyerServiceProtocol struct{}
func (_ FfiDestroyerServiceProtocol) Destroy(value ServiceProtocol) {
}
+// What the pool-operator deletes when a warm pool's creation TTL
+// (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+type WarmPoolTtlPolicy uint
+
+const (
+ // Delete only the warm pool. Its claims and namespace stay.
+ WarmPoolTtlPolicyRetain WarmPoolTtlPolicy = 1
+ // Also delete the pool's dead unbound claims (TTL passed, older than
+ // max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ WarmPoolTtlPolicyCascade WarmPoolTtlPolicy = 2
+)
+
+type FfiConverterWarmPoolTtlPolicy struct{}
+
+var FfiConverterWarmPoolTtlPolicyINSTANCE = FfiConverterWarmPoolTtlPolicy{}
+
+func (c FfiConverterWarmPoolTtlPolicy) Lift(rb RustBufferI) WarmPoolTtlPolicy {
+ return LiftFromRustBuffer[WarmPoolTtlPolicy](c, rb)
+}
+
+func (c FfiConverterWarmPoolTtlPolicy) Lower(value WarmPoolTtlPolicy) C.RustBuffer {
+ return LowerIntoRustBuffer[WarmPoolTtlPolicy](c, value)
+}
+
+func (c FfiConverterWarmPoolTtlPolicy) LowerExternal(value WarmPoolTtlPolicy) ExternalCRustBuffer {
+ return RustBufferFromC(LowerIntoRustBuffer[WarmPoolTtlPolicy](c, value))
+}
+func (FfiConverterWarmPoolTtlPolicy) Read(reader io.Reader) WarmPoolTtlPolicy {
+ id := readInt32(reader)
+ return WarmPoolTtlPolicy(id)
+}
+
+func (FfiConverterWarmPoolTtlPolicy) Write(writer io.Writer, value WarmPoolTtlPolicy) {
+ writeInt32(writer, int32(value))
+}
+
+type FfiDestroyerWarmPoolTtlPolicy struct{}
+
+func (_ FfiDestroyerWarmPoolTtlPolicy) Destroy(value WarmPoolTtlPolicy) {
+}
+
type FfiConverterOptionalUint32 struct{}
var FfiConverterOptionalUint32INSTANCE = FfiConverterOptionalUint32{}
@@ -2414,6 +2471,47 @@ func (_ FfiDestroyerOptionalServiceProtocol) Destroy(value *ServiceProtocol) {
}
}
+type FfiConverterOptionalWarmPoolTtlPolicy struct{}
+
+var FfiConverterOptionalWarmPoolTtlPolicyINSTANCE = FfiConverterOptionalWarmPoolTtlPolicy{}
+
+func (c FfiConverterOptionalWarmPoolTtlPolicy) Lift(rb RustBufferI) *WarmPoolTtlPolicy {
+ return LiftFromRustBuffer[*WarmPoolTtlPolicy](c, rb)
+}
+
+func (_ FfiConverterOptionalWarmPoolTtlPolicy) Read(reader io.Reader) *WarmPoolTtlPolicy {
+ if readInt8(reader) == 0 {
+ return nil
+ }
+ temp := FfiConverterWarmPoolTtlPolicyINSTANCE.Read(reader)
+ return &temp
+}
+
+func (c FfiConverterOptionalWarmPoolTtlPolicy) Lower(value *WarmPoolTtlPolicy) C.RustBuffer {
+ return LowerIntoRustBuffer[*WarmPoolTtlPolicy](c, value)
+}
+
+func (c FfiConverterOptionalWarmPoolTtlPolicy) LowerExternal(value *WarmPoolTtlPolicy) ExternalCRustBuffer {
+ return RustBufferFromC(LowerIntoRustBuffer[*WarmPoolTtlPolicy](c, value))
+}
+
+func (_ FfiConverterOptionalWarmPoolTtlPolicy) Write(writer io.Writer, value *WarmPoolTtlPolicy) {
+ if value == nil {
+ writeInt8(writer, 0)
+ } else {
+ writeInt8(writer, 1)
+ FfiConverterWarmPoolTtlPolicyINSTANCE.Write(writer, *value)
+ }
+}
+
+type FfiDestroyerOptionalWarmPoolTtlPolicy struct{}
+
+func (_ FfiDestroyerOptionalWarmPoolTtlPolicy) Destroy(value *WarmPoolTtlPolicy) {
+ if value != nil {
+ FfiDestroyerWarmPoolTtlPolicy{}.Destroy(*value)
+ }
+}
+
type FfiConverterOptionalSequenceString struct{}
var FfiConverterOptionalSequenceStringINSTANCE = FfiConverterOptionalSequenceString{}
diff --git a/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.h b/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.h
index fade805585..03a69a6c00 100644
--- a/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.h
+++ b/libs/fleet/sdk-bindings/go-uniffi/cyclops_sdk_schema/cyclops_sdk_schema.h
@@ -605,6 +605,11 @@ uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_aut
RustBuffer uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(uint64_t ptr, RustCallStatus *out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(uint64_t ptr, uint32_t value, RustCallStatus *out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(uint64_t ptr, uint32_t value, RustCallStatus *out_status
@@ -615,6 +620,11 @@ uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_rep
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(uint64_t ptr, RustBuffer value, RustCallStatus *out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(uint64_t ptr, RustBuffer value, RustCallStatus *out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(uint64_t ptr, uint32_t value, RustCallStatus *out_status
@@ -1082,6 +1092,12 @@ uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuild
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
@@ -1094,6 +1110,12 @@ uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuild
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
diff --git a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
index b586ecc49b..2f13f113ab 100644
--- a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
+++ b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
@@ -692,10 +692,14 @@ internal object IntegrityCheckingUniffiLib {
): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(
): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ ): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas(
): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(
): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ ): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_warmpoolautoscalingbuilder_build(
@@ -830,10 +834,14 @@ external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder
): Long
external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(`ptr`: Long,`value`: Int,uniffi_out_err: UniffiRustCallStatus,
+): Long
external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(`ptr`: Long,`value`: Int,uniffi_out_err: UniffiRustCallStatus,
): Long
external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(`ptr`: Long,`value`: Int,uniffi_out_err: UniffiRustCallStatus,
): Long
external fun uniffi_cyclops_sdk_schema_fn_clone_warmpoolautoscalingbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
@@ -1053,12 +1061,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds() != 56677.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy() != 53364.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created() != 44516.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
@@ -1754,10 +1768,14 @@ public interface OsGymSandboxWarmPoolSpecBuilderInterface {
fun `build`(): OsGymSandboxWarmPoolSpec
+ fun `idleTtlSeconds`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder
+
fun `replicas`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder
fun `sandboxTemplateRef`(`value`: SandboxTemplateRef): OsGymSandboxWarmPoolSpecBuilder
+ fun `ttlPolicy`(`value`: WarmPoolTtlPolicy): OsGymSandboxWarmPoolSpecBuilder
+
fun `ttlSecondsAfterCreated`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder
companion object
@@ -1894,6 +1912,19 @@ open class OsGymSandboxWarmPoolSpecBuilder: Disposable, AutoCloseable, OsGymSand
}
+ override fun `idleTtlSeconds`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ it,
+ FfiConverterUInt.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
override fun `replicas`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder {
return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
callWithHandle {
@@ -1920,6 +1951,19 @@ open class OsGymSandboxWarmPoolSpecBuilder: Disposable, AutoCloseable, OsGymSand
}
+ override fun `ttlPolicy`(`value`: WarmPoolTtlPolicy): OsGymSandboxWarmPoolSpecBuilder {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ it,
+ FfiConverterTypeWarmPoolTtlPolicy.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
override fun `ttlSecondsAfterCreated`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder {
return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
callWithHandle {
@@ -4044,6 +4088,10 @@ data class OsGymSandboxWarmPoolSpec (
var `autoscaling`: WarmPoolAutoscaling?
,
var `ttlSecondsAfterCreated`: kotlin.UInt? = null
+ ,
+ var `idleTtlSeconds`: kotlin.UInt? = null
+ ,
+ var `ttlPolicy`: WarmPoolTtlPolicy? = null
){
@@ -4064,6 +4112,8 @@ public object FfiConverterTypeOSGymSandboxWarmPoolSpec: FfiConverterRustBuffer<O
FfiConverterTypeSandboxTemplateRef.read(buf),
FfiConverterOptionalTypeWarmPoolAutoscaling.read(buf),
FfiConverterOptionalUInt.read(buf),
+ FfiConverterOptionalUInt.read(buf),
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.read(buf),
)
}
@@ -4071,7 +4121,9 @@ public object FfiConverterTypeOSGymSandboxWarmPoolSpec: FfiConverterRustBuffer<O
FfiConverterUInt.allocationSize(value.`replicas`) +
FfiConverterTypeSandboxTemplateRef.allocationSize(value.`sandboxTemplateRef`) +
FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(value.`autoscaling`) +
- FfiConverterOptionalUInt.allocationSize(value.`ttlSecondsAfterCreated`)
+ FfiConverterOptionalUInt.allocationSize(value.`ttlSecondsAfterCreated`) +
+ FfiConverterOptionalUInt.allocationSize(value.`idleTtlSeconds`) +
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.allocationSize(value.`ttlPolicy`)
)
override fun write(value: OsGymSandboxWarmPoolSpec, buf: ByteBuffer) {
@@ -4079,6 +4131,8 @@ public object FfiConverterTypeOSGymSandboxWarmPoolSpec: FfiConverterRustBuffer<O
FfiConverterTypeSandboxTemplateRef.write(value.`sandboxTemplateRef`, buf)
FfiConverterOptionalTypeWarmPoolAutoscaling.write(value.`autoscaling`, buf)
FfiConverterOptionalUInt.write(value.`ttlSecondsAfterCreated`, buf)
+ FfiConverterOptionalUInt.write(value.`idleTtlSeconds`, buf)
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.write(value.`ttlPolicy`, buf)
}
}
@@ -4090,6 +4144,10 @@ data class OsGymSandboxWarmPoolStatus (
var `readyReplicas`: kotlin.UInt?
,
var `selector`: kotlin.String?
+ ,
+ var `lastClaimedAt`: kotlin.String? = null
+ ,
+ var `lastActivityTime`: kotlin.String? = null
){
@@ -4109,19 +4167,25 @@ public object FfiConverterTypeOSGymSandboxWarmPoolStatus: FfiConverterRustBuffer
FfiConverterOptionalUInt.read(buf),
FfiConverterOptionalUInt.read(buf),
FfiConverterOptionalString.read(buf),
+ FfiConverterOptionalString.read(buf),
+ FfiConverterOptionalString.read(buf),
)
}
override fun allocationSize(value: OsGymSandboxWarmPoolStatus) = (
FfiConverterOptionalUInt.allocationSize(value.`replicas`) +
FfiConverterOptionalUInt.allocationSize(value.`readyReplicas`) +
- FfiConverterOptionalString.allocationSize(value.`selector`)
+ FfiConverterOptionalString.allocationSize(value.`selector`) +
+ FfiConverterOptionalString.allocationSize(value.`lastClaimedAt`) +
+ FfiConverterOptionalString.allocationSize(value.`lastActivityTime`)
)
override fun write(value: OsGymSandboxWarmPoolStatus, buf: ByteBuffer) {
FfiConverterOptionalUInt.write(value.`replicas`, buf)
FfiConverterOptionalUInt.write(value.`readyReplicas`, buf)
FfiConverterOptionalString.write(value.`selector`, buf)
+ FfiConverterOptionalString.write(value.`lastClaimedAt`, buf)
+ FfiConverterOptionalString.write(value.`lastActivityTime`, buf)
}
}
@@ -4697,6 +4761,51 @@ public object FfiConverterTypeServiceProtocol: FfiConverterRustBuffer<ServicePro
+/**
+ * What the pool-operator deletes when a warm pool's creation TTL
+ * (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+ */
+
+enum class WarmPoolTtlPolicy {
+
+ /**
+ * Delete only the warm pool. Its claims and namespace stay.
+ */
+ RETAIN,
+ /**
+ * Also delete the pool's dead unbound claims (TTL passed, older than
+ * max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ */
+ CASCADE;
+
+
+
+
+ companion object
+}
+
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeWarmPoolTtlPolicy: FfiConverterRustBuffer<WarmPoolTtlPolicy> {
+ override fun read(buf: ByteBuffer) = try {
+ WarmPoolTtlPolicy.values()[buf.getInt() - 1]
+ } catch (e: IndexOutOfBoundsException) {
+ throw RuntimeException("invalid enum value, something is very wrong!!", e)
+ }
+
+ override fun allocationSize(value: WarmPoolTtlPolicy) = 4UL
+
+ override fun write(value: WarmPoolTtlPolicy, buf: ByteBuffer) {
+ buf.putInt(value.ordinal + 1)
+ }
+}
+
+
+
+
+
/**
* @suppress
@@ -5114,6 +5223,38 @@ public object FfiConverterOptionalTypeServiceProtocol: FfiConverterRustBuffer<Se
+/**
+ * @suppress
+ */
+public object FfiConverterOptionalTypeWarmPoolTtlPolicy: FfiConverterRustBuffer<WarmPoolTtlPolicy?> {
+ override fun read(buf: ByteBuffer): WarmPoolTtlPolicy? {
+ if (buf.get().toInt() == 0) {
+ return null
+ }
+ return FfiConverterTypeWarmPoolTtlPolicy.read(buf)
+ }
+
+ override fun allocationSize(value: WarmPoolTtlPolicy?): ULong {
+ if (value == null) {
+ return 1UL
+ } else {
+ return 1UL + FfiConverterTypeWarmPoolTtlPolicy.allocationSize(value)
+ }
+ }
+
+ override fun write(value: WarmPoolTtlPolicy?, buf: ByteBuffer) {
+ if (value == null) {
+ buf.put(0)
+ } else {
+ buf.put(1)
+ FfiConverterTypeWarmPoolTtlPolicy.write(value, buf)
+ }
+ }
+}
+
+
+
+
/**
* @suppress
*/
diff --git a/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py b/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
index 743928b87a..6a122fb747 100644
--- a/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
+++ b/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
@@ -490,10 +490,14 @@ def _uniffi_check_api_checksums(lib):
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds() != 56677:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy() != 53364:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created() != 44516:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() != 24064:
@@ -925,6 +929,12 @@ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_b
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds.argtypes = (
+ ctypes.c_uint64,
+ ctypes.c_uint32,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds.restype = ctypes.c_uint64
_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas.argtypes = (
ctypes.c_uint64,
ctypes.c_uint32,
@@ -937,6 +947,12 @@ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_s
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy.restype = ctypes.c_uint64
_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created.argtypes = (
ctypes.c_uint64,
ctypes.c_uint32,
@@ -1148,12 +1164,18 @@ _UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbui
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created.restype = ctypes.c_uint16
@@ -2877,9 +2899,85 @@ class _UniffiFfiConverterOptionalTypeWarmPoolAutoscaling(_UniffiConverterRustBuf
else:
raise InternalError("Unexpected flag byte for optional type")
+
+
+
+
+
+class WarmPoolTtlPolicy(enum.Enum):
+ """
+ What the pool-operator deletes when a warm pool's creation TTL
+ (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+"""
+
+ RETAIN = 0
+ """
+ Delete only the warm pool. Its claims and namespace stay.
+"""
+
+ CASCADE = 1
+ """
+ Also delete the pool's dead unbound claims (TTL passed, older than
+ max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+"""
+
+
+
+class _UniffiFfiConverterTypeWarmPoolTtlPolicy(_UniffiConverterRustBuffer):
+ @staticmethod
+ def read(buf):
+ variant = buf.read_i32()
+ if variant == 1:
+ return WarmPoolTtlPolicy.RETAIN
+ if variant == 2:
+ return WarmPoolTtlPolicy.CASCADE
+ raise InternalError("Raw enum value doesn't match any cases")
+
+ @staticmethod
+ def check_lower(value):
+ if value == WarmPoolTtlPolicy.RETAIN:
+ return
+ if value == WarmPoolTtlPolicy.CASCADE:
+ return
+ raise ValueError(value)
+
+ @staticmethod
+ def write(value, buf):
+ if value == WarmPoolTtlPolicy.RETAIN:
+ buf.write_i32(1)
+ if value == WarmPoolTtlPolicy.CASCADE:
+ buf.write_i32(2)
+
+
+
+class _UniffiFfiConverterOptionalTypeWarmPoolTtlPolicy(_UniffiConverterRustBuffer):
+ @classmethod
+ def check_lower(cls, value):
+ if value is not None:
+ _UniffiFfiConverterTypeWarmPoolTtlPolicy.check_lower(value)
+
+ @classmethod
+ def write(cls, value, buf):
+ if value is None:
+ buf.write_u8(0)
+ return
+
+ buf.write_u8(1)
+ _UniffiFfiConverterTypeWarmPoolTtlPolicy.write(value, buf)
+
+ @classmethod
+ def read(cls, buf):
+ flag = buf.read_u8()
+ if flag == 0:
+ return None
+ elif flag == 1:
+ return _UniffiFfiConverterTypeWarmPoolTtlPolicy.read(buf)
+ else:
+ raise InternalError("Unexpected flag byte for optional type")
+
@dataclass
class OsGymSandboxWarmPoolSpec:
- def __init__(self, *, replicas:int, sandbox_template_ref:SandboxTemplateRef, autoscaling:typing.Optional[WarmPoolAutoscaling], ttl_seconds_after_created:typing.Optional[int] = _DEFAULT):
+ def __init__(self, *, replicas:int, sandbox_template_ref:SandboxTemplateRef, autoscaling:typing.Optional[WarmPoolAutoscaling], ttl_seconds_after_created:typing.Optional[int] = _DEFAULT, idle_ttl_seconds:typing.Optional[int] = _DEFAULT, ttl_policy:typing.Optional[WarmPoolTtlPolicy] = _DEFAULT):
self.replicas = replicas
self.sandbox_template_ref = sandbox_template_ref
self.autoscaling = autoscaling
@@ -2887,12 +2985,20 @@ class OsGymSandboxWarmPoolSpec:
self.ttl_seconds_after_created = None
else:
self.ttl_seconds_after_created = ttl_seconds_after_created
+ if idle_ttl_seconds is _DEFAULT:
+ self.idle_ttl_seconds = None
+ else:
+ self.idle_ttl_seconds = idle_ttl_seconds
+ if ttl_policy is _DEFAULT:
+ self.ttl_policy = None
+ else:
+ self.ttl_policy = ttl_policy
def __str__(self):
- return "OsGymSandboxWarmPoolSpec(replicas={}, sandbox_template_ref={}, autoscaling={}, ttl_seconds_after_created={})".format(self.replicas, self.sandbox_template_ref, self.autoscaling, self.ttl_seconds_after_created)
+ return "OsGymSandboxWarmPoolSpec(replicas={}, sandbox_template_ref={}, autoscaling={}, ttl_seconds_after_created={}, idle_ttl_seconds={}, ttl_policy={})".format(self.replicas, self.sandbox_template_ref, self.autoscaling, self.ttl_seconds_after_created, self.idle_ttl_seconds, self.ttl_policy)
def __eq__(self, other):
if self.replicas != other.replicas:
return False
@@ -2902,6 +3008,10 @@ class OsGymSandboxWarmPoolSpec:
return False
if self.ttl_seconds_after_created != other.ttl_seconds_after_created:
return False
+ if self.idle_ttl_seconds != other.idle_ttl_seconds:
+ return False
+ if self.ttl_policy != other.ttl_policy:
+ return False
return True
class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec(_UniffiConverterRustBuffer):
@@ -2912,6 +3022,8 @@ class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec(_UniffiConverterRustBuffer
sandbox_template_ref=_UniffiFfiConverterTypeSandboxTemplateRef.read(buf),
autoscaling=_UniffiFfiConverterOptionalTypeWarmPoolAutoscaling.read(buf),
ttl_seconds_after_created=_UniffiFfiConverterOptionalUInt32.read(buf),
+ idle_ttl_seconds=_UniffiFfiConverterOptionalUInt32.read(buf),
+ ttl_policy=_UniffiFfiConverterOptionalTypeWarmPoolTtlPolicy.read(buf),
)
@staticmethod
@@ -2920,6 +3032,8 @@ class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec(_UniffiConverterRustBuffer
_UniffiFfiConverterTypeSandboxTemplateRef.check_lower(value.sandbox_template_ref)
_UniffiFfiConverterOptionalTypeWarmPoolAutoscaling.check_lower(value.autoscaling)
_UniffiFfiConverterOptionalUInt32.check_lower(value.ttl_seconds_after_created)
+ _UniffiFfiConverterOptionalUInt32.check_lower(value.idle_ttl_seconds)
+ _UniffiFfiConverterOptionalTypeWarmPoolTtlPolicy.check_lower(value.ttl_policy)
@staticmethod
def write(value, buf):
@@ -2927,19 +3041,29 @@ class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec(_UniffiConverterRustBuffer
_UniffiFfiConverterTypeSandboxTemplateRef.write(value.sandbox_template_ref, buf)
_UniffiFfiConverterOptionalTypeWarmPoolAutoscaling.write(value.autoscaling, buf)
_UniffiFfiConverterOptionalUInt32.write(value.ttl_seconds_after_created, buf)
+ _UniffiFfiConverterOptionalUInt32.write(value.idle_ttl_seconds, buf)
+ _UniffiFfiConverterOptionalTypeWarmPoolTtlPolicy.write(value.ttl_policy, buf)
@dataclass
class OsGymSandboxWarmPoolStatus:
- def __init__(self, *, replicas:typing.Optional[int], ready_replicas:typing.Optional[int], selector:typing.Optional[str]):
+ def __init__(self, *, replicas:typing.Optional[int], ready_replicas:typing.Optional[int], selector:typing.Optional[str], last_claimed_at:typing.Optional[str] = _DEFAULT, last_activity_time:typing.Optional[str] = _DEFAULT):
self.replicas = replicas
self.ready_replicas = ready_replicas
self.selector = selector
+ if last_claimed_at is _DEFAULT:
+ self.last_claimed_at = None
+ else:
+ self.last_claimed_at = last_claimed_at
+ if last_activity_time is _DEFAULT:
+ self.last_activity_time = None
+ else:
+ self.last_activity_time = last_activity_time
def __str__(self):
- return "OsGymSandboxWarmPoolStatus(replicas={}, ready_replicas={}, selector={})".format(self.replicas, self.ready_replicas, self.selector)
+ return "OsGymSandboxWarmPoolStatus(replicas={}, ready_replicas={}, selector={}, last_claimed_at={}, last_activity_time={})".format(self.replicas, self.ready_replicas, self.selector, self.last_claimed_at, self.last_activity_time)
def __eq__(self, other):
if self.replicas != other.replicas:
return False
@@ -2947,6 +3071,10 @@ class OsGymSandboxWarmPoolStatus:
return False
if self.selector != other.selector:
return False
+ if self.last_claimed_at != other.last_claimed_at:
+ return False
+ if self.last_activity_time != other.last_activity_time:
+ return False
return True
class _UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus(_UniffiConverterRustBuffer):
@@ -2956,6 +3084,8 @@ class _UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus(_UniffiConverterRustBuff
replicas=_UniffiFfiConverterOptionalUInt32.read(buf),
ready_replicas=_UniffiFfiConverterOptionalUInt32.read(buf),
selector=_UniffiFfiConverterOptionalString.read(buf),
+ last_claimed_at=_UniffiFfiConverterOptionalString.read(buf),
+ last_activity_time=_UniffiFfiConverterOptionalString.read(buf),
)
@staticmethod
@@ -2963,12 +3093,16 @@ class _UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus(_UniffiConverterRustBuff
_UniffiFfiConverterOptionalUInt32.check_lower(value.replicas)
_UniffiFfiConverterOptionalUInt32.check_lower(value.ready_replicas)
_UniffiFfiConverterOptionalString.check_lower(value.selector)
+ _UniffiFfiConverterOptionalString.check_lower(value.last_claimed_at)
+ _UniffiFfiConverterOptionalString.check_lower(value.last_activity_time)
@staticmethod
def write(value, buf):
_UniffiFfiConverterOptionalUInt32.write(value.replicas, buf)
_UniffiFfiConverterOptionalUInt32.write(value.ready_replicas, buf)
_UniffiFfiConverterOptionalString.write(value.selector, buf)
+ _UniffiFfiConverterOptionalString.write(value.last_claimed_at, buf)
+ _UniffiFfiConverterOptionalString.write(value.last_activity_time, buf)
@@ -3185,10 +3319,14 @@ class OsGymSandboxWarmPoolSpecBuilderProtocol(typing.Protocol):
raise NotImplementedError
def build(self, ) -> OsGymSandboxWarmPoolSpec:
raise NotImplementedError
+ def idle_ttl_seconds(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
+ raise NotImplementedError
def replicas(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
raise NotImplementedError
def sandbox_template_ref(self, value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder:
raise NotImplementedError
+ def ttl_policy(self, value: WarmPoolTtlPolicy) -> OsGymSandboxWarmPoolSpecBuilder:
+ raise NotImplementedError
def ttl_seconds_after_created(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
raise NotImplementedError
@@ -3251,6 +3389,21 @@ class OsGymSandboxWarmPoolSpecBuilder(OsGymSandboxWarmPoolSpecBuilderProtocol):
*_uniffi_lowered_args,
)
return _uniffi_lift_return(_uniffi_ffi_result)
+ def idle_ttl_seconds(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
+
+ _UniffiFfiConverterUInt32.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterUInt32.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
def replicas(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
_UniffiFfiConverterUInt32.check_lower(value)
@@ -3281,6 +3434,21 @@ class OsGymSandboxWarmPoolSpecBuilder(OsGymSandboxWarmPoolSpecBuilderProtocol):
*_uniffi_lowered_args,
)
return _uniffi_lift_return(_uniffi_ffi_result)
+ def ttl_policy(self, value: WarmPoolTtlPolicy) -> OsGymSandboxWarmPoolSpecBuilder:
+
+ _UniffiFfiConverterTypeWarmPoolTtlPolicy.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeWarmPoolTtlPolicy.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
def ttl_seconds_after_created(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
_UniffiFfiConverterUInt32.check_lower(value)
@@ -4056,6 +4224,7 @@ __all__ = [
"ImagePullPolicy",
"Firmware",
"ServiceProtocol",
+ "WarmPoolTtlPolicy",
"JsonValueError",
"SchemaBuildError",
"ClaimLifecycle",
diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
index 84738aeacc..8b1d0dedb2 100644
--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
@@ -310,6 +310,8 @@ end
RustBuffer.check_lower_TypeSandboxTemplateRef(v.sandbox_template_ref)
RustBuffer.check_lower_OptionalTypeWarmPoolAutoscaling(v.autoscaling)
RustBuffer.check_lower_Optionalu32(v.ttl_seconds_after_created)
+ RustBuffer.check_lower_Optionalu32(v.idle_ttl_seconds)
+ RustBuffer.check_lower_OptionalTypeWarmPoolTtlPolicy(v.ttl_policy)
end
def self.alloc_from_TypeOSGymSandboxWarmPoolSpec(v)
@@ -331,6 +333,8 @@ end
RustBuffer.check_lower_Optionalu32(v.replicas)
RustBuffer.check_lower_Optionalu32(v.ready_replicas)
RustBuffer.check_lower_Optionalstring(v.selector)
+ RustBuffer.check_lower_Optionalstring(v.last_claimed_at)
+ RustBuffer.check_lower_Optionalstring(v.last_activity_time)
end
def self.alloc_from_TypeOSGymSandboxWarmPoolStatus(v)
@@ -544,6 +548,25 @@ end
end
+ # The Enum type WarmPoolTtlPolicy.
+
+ def self.check_lower_TypeWarmPoolTtlPolicy(v)
+ end
+
+ def self.alloc_from_TypeWarmPoolTtlPolicy(v)
+ RustBuffer.allocWithBuilder do |builder|
+ builder.write_TypeWarmPoolTtlPolicy(v)
+ return builder.finalize
+ end
+ end
+
+ def consumeIntoTypeWarmPoolTtlPolicy
+ consumeWithStream do |stream|
+ return stream.readTypeWarmPoolTtlPolicy
+ end
+ end
+
+
# The Optional<T> type for u32.
def self.check_lower_Optionalu32(v)
@@ -817,6 +840,27 @@ end
end
end
+ # The Optional<T> type for TypeWarmPoolTtlPolicy.
+
+ def self.check_lower_OptionalTypeWarmPoolTtlPolicy(v)
+ if not v.nil?
+ RustBuffer.check_lower_TypeWarmPoolTtlPolicy(v)
+ end
+ end
+
+ def self.alloc_from_OptionalTypeWarmPoolTtlPolicy(v)
+ RustBuffer.allocWithBuilder do |builder|
+ builder.write_OptionalTypeWarmPoolTtlPolicy(v)
+ return builder.finalize()
+ end
+ end
+
+ def consumeIntoOptionalTypeWarmPoolTtlPolicy
+ consumeWithStream do |stream|
+ return stream.readOptionalTypeWarmPoolTtlPolicy
+ end
+ end
+
# The Optional<T> type for Sequencestring.
def self.check_lower_OptionalSequencestring(v)
@@ -1246,7 +1290,9 @@ class RustBufferStream
replicas: readU32,
sandbox_template_ref: readTypeSandboxTemplateRef,
autoscaling: readOptionalTypeWarmPoolAutoscaling,
- ttl_seconds_after_created: readOptionalu32
+ ttl_seconds_after_created: readOptionalu32,
+ idle_ttl_seconds: readOptionalu32,
+ ttl_policy: readOptionalTypeWarmPoolTtlPolicy
)
end
@@ -1256,7 +1302,9 @@ class RustBufferStream
OSGymSandboxWarmPoolStatus.new(
replicas: readOptionalu32,
ready_replicas: readOptionalu32,
- selector: readOptionalstring
+ selector: readOptionalstring,
+ last_claimed_at: readOptionalstring,
+ last_activity_time: readOptionalstring
)
end
@@ -1444,6 +1492,25 @@ class RustBufferStream
+
+
+ # The Enum type WarmPoolTtlPolicy.
+
+ def readTypeWarmPoolTtlPolicy
+ variant = unpack_from 4, 'l>'
+
+ if variant == 1
+ return WarmPoolTtlPolicy::RETAIN
+ end
+ if variant == 2
+ return WarmPoolTtlPolicy::CASCADE
+ end
+
+ raise InternalError, 'Unexpected variant tag for TypeWarmPoolTtlPolicy'
+ end
+
+
+
# The Optional<T> type for u32.
def readOptionalu32
@@ -1626,6 +1693,20 @@ class RustBufferStream
end
end
+ # The Optional<T> type for TypeWarmPoolTtlPolicy.
+
+ def readOptionalTypeWarmPoolTtlPolicy
+ flag = unpack_from 1, 'c'
+
+ if flag == 0
+ return nil
+ elsif flag == 1
+ return readTypeWarmPoolTtlPolicy
+ else
+ raise InternalError, 'Unexpected flag byte for OptionalTypeWarmPoolTtlPolicy'
+ end
+ end
+
# The Optional<T> type for Sequencestring.
def readOptionalSequencestring
@@ -1970,6 +2051,8 @@ class RustBufferBuilder
self.write_TypeSandboxTemplateRef(v.sandbox_template_ref)
self.write_OptionalTypeWarmPoolAutoscaling(v.autoscaling)
self.write_Optionalu32(v.ttl_seconds_after_created)
+ self.write_Optionalu32(v.idle_ttl_seconds)
+ self.write_OptionalTypeWarmPoolTtlPolicy(v.ttl_policy)
end
# The Record type OSGymSandboxWarmPoolStatus.
@@ -1978,6 +2061,8 @@ class RustBufferBuilder
self.write_Optionalu32(v.replicas)
self.write_Optionalu32(v.ready_replicas)
self.write_Optionalstring(v.selector)
+ self.write_Optionalstring(v.last_claimed_at)
+ self.write_Optionalstring(v.last_activity_time)
end
# The Record type OidcConfig.
@@ -2065,6 +2150,13 @@ class RustBufferBuilder
end
+ # The Enum type WarmPoolTtlPolicy.
+
+ def write_TypeWarmPoolTtlPolicy(v)
+ pack_into(4, 'l>', v)
+ end
+
+
# The Optional<T> type for u32.
def write_Optionalu32(v)
@@ -2208,6 +2300,17 @@ class RustBufferBuilder
end
end
+ # The Optional<T> type for TypeWarmPoolTtlPolicy.
+
+ def write_OptionalTypeWarmPoolTtlPolicy(v)
+ if v.nil?
+ pack_into(1, 'c', 0)
+ else
+ pack_into(1, 'c', 1)
+ self.write_TypeWarmPoolTtlPolicy(v)
+ end
+ end
+
# The Optional<T> type for Sequencestring.
def write_OptionalSequencestring(v)
@@ -2401,6 +2504,7 @@ module JsonValueError
end
+
# Map error modules to the RustBuffer method name that reads them
ERROR_MODULE_TO_READER_METHOD = {
@@ -2413,6 +2517,7 @@ ERROR_MODULE_TO_READER_METHOD = {
JsonValueError => :readTypeJsonValueError,
+
}
private_constant :ERROR_MODULE_TO_READER_METHOD, :CALL_SUCCESS, :CALL_ERROR, :CALL_PANIC,
@@ -2620,12 +2725,18 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build,
[:uint64, RustCallStatus.by_ref],
RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds,
+ [:uint64, :uint32, RustCallStatus.by_ref],
+ :uint64
attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas,
[:uint64, :uint32, RustCallStatus.by_ref],
:uint64
attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,
[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
:uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created,
[:uint64, :uint32, RustCallStatus.by_ref],
:uint64
@@ -2746,12 +2857,18 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas,
[RustCallStatus.by_ref],
:uint16
attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created,
[RustCallStatus.by_ref],
:uint16
@@ -2845,6 +2962,17 @@ end
+
+
+
+class WarmPoolTtlPolicy
+ RETAIN = 1
+ CASCADE = 2
+
+end
+
+
+
# Record type ClaimLifecycle
class ClaimLifecycle
attr_reader :shutdown_time, :shutdown_policy, :auto_renew
@@ -3236,13 +3364,15 @@ end
# Record type OSGymSandboxWarmPoolSpec
class OSGymSandboxWarmPoolSpec
- attr_reader :replicas, :sandbox_template_ref, :autoscaling, :ttl_seconds_after_created
+ attr_reader :replicas, :sandbox_template_ref, :autoscaling, :ttl_seconds_after_created, :idle_ttl_seconds, :ttl_policy
- def initialize(replicas:, sandbox_template_ref:, autoscaling:, ttl_seconds_after_created: nil)
+ def initialize(replicas:, sandbox_template_ref:, autoscaling:, ttl_seconds_after_created: nil, idle_ttl_seconds: nil, ttl_policy: nil)
@replicas = replicas
@sandbox_template_ref = sandbox_template_ref
@autoscaling = autoscaling
@ttl_seconds_after_created = ttl_seconds_after_created
+ @idle_ttl_seconds = idle_ttl_seconds
+ @ttl_policy = ttl_policy
end
def ==(other)
@@ -3258,6 +3388,12 @@ class OSGymSandboxWarmPoolSpec
if @ttl_seconds_after_created != other.ttl_seconds_after_created
return false
end
+ if @idle_ttl_seconds != other.idle_ttl_seconds
+ return false
+ end
+ if @ttl_policy != other.ttl_policy
+ return false
+ end
true
end
@@ -3265,12 +3401,14 @@ end
# Record type OSGymSandboxWarmPoolStatus
class OSGymSandboxWarmPoolStatus
- attr_reader :replicas, :ready_replicas, :selector
+ attr_reader :replicas, :ready_replicas, :selector, :last_claimed_at, :last_activity_time
- def initialize(replicas:, ready_replicas:, selector:)
+ def initialize(replicas:, ready_replicas:, selector:, last_claimed_at: nil, last_activity_time: nil)
@replicas = replicas
@ready_replicas = ready_replicas
@selector = selector
+ @last_claimed_at = last_claimed_at
+ @last_activity_time = last_activity_time
end
def ==(other)
@@ -3283,6 +3421,12 @@ class OSGymSandboxWarmPoolStatus
if @selector != other.selector
return false
end
+ if @last_claimed_at != other.last_claimed_at
+ return false
+ end
+ if @last_activity_time != other.last_activity_time
+ return false
+ end
true
end
@@ -3791,6 +3935,12 @@ end
result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build,uniffi_clone_handle(),)
return result.consumeIntoTypeOSGymSandboxWarmPoolSpec
end
+ def idle_ttl_seconds(value)
+ value = CyclopsSdkSchema::uniffi_in_range(value, "u32", 0, 2**32)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds,uniffi_clone_handle(),value)
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
+ end
def replicas(value)
value = CyclopsSdkSchema::uniffi_in_range(value, "u32", 0, 2**32)
@@ -3803,6 +3953,12 @@ end
result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,uniffi_clone_handle(),RustBuffer.alloc_from_TypeSandboxTemplateRef(value))
return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
end
+ def ttl_policy(value)
+ value = value
+ RustBuffer.check_lower_TypeWarmPoolTtlPolicy(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy,uniffi_clone_handle(),RustBuffer.alloc_from_TypeWarmPoolTtlPolicy(value))
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
+ end
def ttl_seconds_after_created(value)
value = CyclopsSdkSchema::uniffi_in_range(value, "u32", 0, 2**32)
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
index ee001b41be..d6302b5f95 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
@@ -656,10 +656,14 @@ public protocol OsGymSandboxWarmPoolSpecBuilderProtocol: AnyObject, Sendable {
func build() throws -> OsGymSandboxWarmPoolSpec
+ func idleTtlSeconds(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder
+
func replicas(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder
func sandboxTemplateRef(value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder
+ func ttlPolicy(value: WarmPoolTtlPolicy) -> OsGymSandboxWarmPoolSpecBuilder
+
func ttlSecondsAfterCreated(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder
}
@@ -740,6 +744,15 @@ open func build()throws -> OsGymSandboxWarmPoolSpec {
})
}
+open func idleTtlSeconds(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ self.uniffiCloneHandle(),
+ FfiConverterUInt32.lower(value),$0
+ )
+})
+}
+
open func replicas(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder {
return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(
@@ -758,6 +771,15 @@ open func sandboxTemplateRef(value: SandboxTemplateRef) -> OsGymSandboxWarmPoolS
})
}
+open func ttlPolicy(value: WarmPoolTtlPolicy) -> OsGymSandboxWarmPoolSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeWarmPoolTtlPolicy_lower(value),$0
+ )
+})
+}
+
open func ttlSecondsAfterCreated(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder {
return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
@@ -2227,14 +2249,18 @@ public struct OsGymSandboxWarmPoolSpec: Equatable, Hashable {
public var sandboxTemplateRef: SandboxTemplateRef
public var autoscaling: WarmPoolAutoscaling?
public var ttlSecondsAfterCreated: UInt32?
+ public var idleTtlSeconds: UInt32?
+ public var ttlPolicy: WarmPoolTtlPolicy?
// Default memberwise initializers are never public by default, so we
// declare one manually.
- public init(replicas: UInt32, sandboxTemplateRef: SandboxTemplateRef, autoscaling: WarmPoolAutoscaling?, ttlSecondsAfterCreated: UInt32? = nil) {
+ public init(replicas: UInt32, sandboxTemplateRef: SandboxTemplateRef, autoscaling: WarmPoolAutoscaling?, ttlSecondsAfterCreated: UInt32? = nil, idleTtlSeconds: UInt32? = nil, ttlPolicy: WarmPoolTtlPolicy? = nil) {
self.replicas = replicas
self.sandboxTemplateRef = sandboxTemplateRef
self.autoscaling = autoscaling
self.ttlSecondsAfterCreated = ttlSecondsAfterCreated
+ self.idleTtlSeconds = idleTtlSeconds
+ self.ttlPolicy = ttlPolicy
}
@@ -2256,7 +2282,9 @@ public struct FfiConverterTypeOSGymSandboxWarmPoolSpec: FfiConverterRustBuffer {
replicas: FfiConverterUInt32.read(from: &buf),
sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from: &buf),
autoscaling: FfiConverterOptionTypeWarmPoolAutoscaling.read(from: &buf),
- ttlSecondsAfterCreated: FfiConverterOptionUInt32.read(from: &buf)
+ ttlSecondsAfterCreated: FfiConverterOptionUInt32.read(from: &buf),
+ idleTtlSeconds: FfiConverterOptionUInt32.read(from: &buf),
+ ttlPolicy: FfiConverterOptionTypeWarmPoolTtlPolicy.read(from: &buf)
)
}
@@ -2265,6 +2293,8 @@ public struct FfiConverterTypeOSGymSandboxWarmPoolSpec: FfiConverterRustBuffer {
FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into: &buf)
FfiConverterOptionTypeWarmPoolAutoscaling.write(value.autoscaling, into: &buf)
FfiConverterOptionUInt32.write(value.ttlSecondsAfterCreated, into: &buf)
+ FfiConverterOptionUInt32.write(value.idleTtlSeconds, into: &buf)
+ FfiConverterOptionTypeWarmPoolTtlPolicy.write(value.ttlPolicy, into: &buf)
}
}
@@ -2288,13 +2318,17 @@ public struct OsGymSandboxWarmPoolStatus: Equatable, Hashable {
public var replicas: UInt32?
public var readyReplicas: UInt32?
public var selector: String?
+ public var lastClaimedAt: String?
+ public var lastActivityTime: String?
// Default memberwise initializers are never public by default, so we
// declare one manually.
- public init(replicas: UInt32?, readyReplicas: UInt32?, selector: String?) {
+ public init(replicas: UInt32?, readyReplicas: UInt32?, selector: String?, lastClaimedAt: String? = nil, lastActivityTime: String? = nil) {
self.replicas = replicas
self.readyReplicas = readyReplicas
self.selector = selector
+ self.lastClaimedAt = lastClaimedAt
+ self.lastActivityTime = lastActivityTime
}
@@ -2315,7 +2349,9 @@ public struct FfiConverterTypeOSGymSandboxWarmPoolStatus: FfiConverterRustBuffer
try OsGymSandboxWarmPoolStatus(
replicas: FfiConverterOptionUInt32.read(from: &buf),
readyReplicas: FfiConverterOptionUInt32.read(from: &buf),
- selector: FfiConverterOptionString.read(from: &buf)
+ selector: FfiConverterOptionString.read(from: &buf),
+ lastClaimedAt: FfiConverterOptionString.read(from: &buf),
+ lastActivityTime: FfiConverterOptionString.read(from: &buf)
)
}
@@ -2323,6 +2359,8 @@ public struct FfiConverterTypeOSGymSandboxWarmPoolStatus: FfiConverterRustBuffer
FfiConverterOptionUInt32.write(value.replicas, into: &buf)
FfiConverterOptionUInt32.write(value.readyReplicas, into: &buf)
FfiConverterOptionString.write(value.selector, into: &buf)
+ FfiConverterOptionString.write(value.lastClaimedAt, into: &buf)
+ FfiConverterOptionString.write(value.lastActivityTime, into: &buf)
}
}
@@ -3115,6 +3153,84 @@ public func FfiConverterTypeServiceProtocol_lower(_ value: ServiceProtocol) -> R
}
+// Note that we don't yet support `indirect` for enums.
+// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
+/**
+ * What the pool-operator deletes when a warm pool's creation TTL
+ * (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+ */
+
+public enum WarmPoolTtlPolicy: Equatable, Hashable {
+
+ /**
+ * Delete only the warm pool. Its claims and namespace stay.
+ */
+ case retain
+ /**
+ * Also delete the pool's dead unbound claims (TTL passed, older than
+ * max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ */
+ case cascade
+
+
+
+
+
+}
+
+#if compiler(>=6)
+extension WarmPoolTtlPolicy: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeWarmPoolTtlPolicy: FfiConverterRustBuffer {
+ typealias SwiftType = WarmPoolTtlPolicy
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WarmPoolTtlPolicy {
+ let variant: Int32 = try readInt(&buf)
+ switch variant {
+
+ case 1: return .retain
+
+ case 2: return .cascade
+
+ default: throw UniffiInternalError.unexpectedEnumCase
+ }
+ }
+
+ public static func write(_ value: WarmPoolTtlPolicy, into buf: inout [UInt8]) {
+ switch value {
+
+
+ case .retain:
+ writeInt(&buf, Int32(1))
+
+
+ case .cascade:
+ writeInt(&buf, Int32(2))
+
+ }
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeWarmPoolTtlPolicy_lift(_ buf: RustBuffer) throws -> WarmPoolTtlPolicy {
+ return try FfiConverterTypeWarmPoolTtlPolicy.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeWarmPoolTtlPolicy_lower(_ value: WarmPoolTtlPolicy) -> RustBuffer {
+ return FfiConverterTypeWarmPoolTtlPolicy.lower(value)
+}
+
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
@@ -3427,6 +3543,30 @@ fileprivate struct FfiConverterOptionTypeServiceProtocol: FfiConverterRustBuffer
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterOptionTypeWarmPoolTtlPolicy: FfiConverterRustBuffer {
+ typealias SwiftType = WarmPoolTtlPolicy?
+
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
+ guard let value = value else {
+ writeInt(&buf, Int8(0))
+ return
+ }
+ writeInt(&buf, Int8(1))
+ FfiConverterTypeWarmPoolTtlPolicy.write(value, into: &buf)
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
+ switch try readInt(&buf) as Int8 {
+ case 0: return nil
+ case 1: return try FfiConverterTypeWarmPoolTtlPolicy.read(from: &buf)
+ default: throw UniffiInternalError.unexpectedOptionalTag
+ }
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
@@ -3772,12 +3912,18 @@ private let initializationResult: InitializationResult = {
if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds() != 56677) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy() != 53364) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created() != 44516) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
index bd330474f6..27e6eaba04 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
@@ -478,6 +478,11 @@ uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_aut
RustBuffer uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(uint64_t ptr, uint32_t value, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(uint64_t ptr, uint32_t value, RustCallStatus *_Nonnull out_status
@@ -488,6 +493,11 @@ uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_rep
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(uint64_t ptr, uint32_t value, RustCallStatus *_Nonnull out_status
@@ -955,6 +965,12 @@ uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuild
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_IDLE_TTL_SECONDS
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
@@ -967,6 +983,12 @@ uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuild
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_POLICY
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_TTL_SECONDS_AFTER_CREATED
diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_schema_module.rs b/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_schema_module.rs
index 76e5ee6337..6ffaf7190c 100644
--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_schema_module.rs
+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_schema_module.rs
@@ -203,6 +203,11 @@ extern "C" {
ptr: u64,
status_: &mut u::RustCallStatus,
) -> u::RustBuffer;
+ fn uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ ptr: u64,
+ value: u32,
+ status_: &mut u::RustCallStatus,
+ ) -> u64;
fn uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(
ptr: u64,
value: u32,
@@ -213,6 +218,11 @@ extern "C" {
value: u::RustBuffer,
status_: &mut u::RustCallStatus,
) -> u64;
+ fn uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ ptr: u64,
+ value: u::RustBuffer,
+ status_: &mut u::RustCallStatus,
+ ) -> u64;
fn uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
ptr: u64,
value: u32,
@@ -276,9 +286,12 @@ extern "C" {
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template() -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling() -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() -> u16;
+ fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ ) -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(
) -> u16;
+ fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy() -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
) -> u16;
fn uniffi_cyclops_sdk_schema_checksum_method_warmpoolautoscalingbuilder_build() -> u16;
@@ -991,6 +1004,23 @@ pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_
value_.into_js()
}
#[wasm_bindgen]
+pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ ptr: js::Handle,
+ value: js::UInt32,
+ f_status_: &mut js::RustCallStatus,
+) -> js::Handle {
+ let mut u_status_ = u::RustCallStatus::default();
+ let value_ = unsafe {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ u64::into_rust(ptr),
+ u32::into_rust(value),
+ &mut u_status_,
+ )
+ };
+ f_status_.copy_from(u_status_);
+ value_.into_js()
+}
+#[wasm_bindgen]
pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(
ptr: js::Handle,
value: js::UInt32,
@@ -1025,6 +1055,23 @@ pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_
value_.into_js()
}
#[wasm_bindgen]
+pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ ptr: js::Handle,
+ value: js::ForeignBytes,
+ f_status_: &mut js::RustCallStatus,
+) -> js::Handle {
+ let mut u_status_ = u::RustCallStatus::default();
+ let value_ = unsafe {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ u64::into_rust(ptr),
+ u::RustBuffer::into_rust(value),
+ &mut u_status_,
+ )
+ };
+ f_status_.copy_from(u_status_);
+ value_.into_js()
+}
+#[wasm_bindgen]
pub fn ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
ptr: js::Handle,
value: js::UInt32,
@@ -1285,6 +1332,12 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoo
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build().into_js()
}
#[wasm_bindgen]
+pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+) -> js::UInt16 {
+ uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds()
+ .into_js()
+}
+#[wasm_bindgen]
pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas(
) -> js::UInt16 {
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas().into_js()
@@ -1296,6 +1349,11 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoo
.into_js()
}
#[wasm_bindgen]
+pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+) -> js::UInt16 {
+ uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy().into_js()
+}
+#[wasm_bindgen]
pub unsafe fn ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(
) -> js::UInt16 {
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created () . into_js ()
diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts
index d7f1996c2d..cae2e0ebf6 100644
--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts
+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts
@@ -1034,11 +1034,53 @@ const FfiConverterTypeWarmPoolAutoscaling = (() => {
return new FFIConverter();
})();
+/**
+ * What the pool-operator deletes when a warm pool's creation TTL
+ * (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+ */
+export enum WarmPoolTtlPolicy {
+ /**
+ * Delete only the warm pool. Its claims and namespace stay.
+ */
+ Retain,
+ /**
+ * Also delete the pool's dead unbound claims (TTL passed, older than
+ * max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ */
+ Cascade
+}
+
+const FfiConverterTypeWarmPoolTtlPolicy = (() => {
+ const ordinalConverter = FfiConverterInt32;
+ type TypeName = WarmPoolTtlPolicy;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ switch (ordinalConverter.read(from)) {
+ case 1: return WarmPoolTtlPolicy.Retain;
+ case 2: return WarmPoolTtlPolicy.Cascade;
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ switch (value) {
+ case WarmPoolTtlPolicy.Retain: return ordinalConverter.write(1, into);
+ case WarmPoolTtlPolicy.Cascade: return ordinalConverter.write(2, into);
+ }
+ }
+ allocationSize(value: TypeName): number {
+ return ordinalConverter.allocationSize(0);
+ }
+ }
+ return new FFIConverter();
+})();
+
export type OsGymSandboxWarmPoolSpec = {
replicas: number,
sandboxTemplateRef: SandboxTemplateRef,
autoscaling?: WarmPoolAutoscaling,
- ttlSecondsAfterCreated?: number
+ ttlSecondsAfterCreated?: number,
+ idleTtlSeconds?: number,
+ ttlPolicy?: WarmPoolTtlPolicy
}
/**
@@ -1046,7 +1088,9 @@ export type OsGymSandboxWarmPoolSpec = {
*/
export const OsGymSandboxWarmPoolSpec = (() => {
const defaults = () => ({
- ttlSecondsAfterCreated: undefined
+ ttlSecondsAfterCreated: undefined,
+ idleTtlSeconds: undefined,
+ ttlPolicy: undefined
});
const create = (() => {
return uniffiCreateRecord<OsGymSandboxWarmPoolSpec, ReturnType<typeof defaults>>(defaults);
@@ -1066,7 +1110,9 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
replicas: FfiConverterUInt32.read(from),
sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),
autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from),
- ttlSecondsAfterCreated: FfiConverterOptionalUInt32.read(from)
+ ttlSecondsAfterCreated: FfiConverterOptionalUInt32.read(from),
+ idleTtlSeconds: FfiConverterOptionalUInt32.read(from),
+ ttlPolicy: FfiConverterOptionalTypeWarmPoolTtlPolicy.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -1074,12 +1120,16 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);
FfiConverterOptionalTypeWarmPoolAutoscaling.write(value.autoscaling, into);
FfiConverterOptionalUInt32.write(value.ttlSecondsAfterCreated, into);
+ FfiConverterOptionalUInt32.write(value.idleTtlSeconds, into);
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.write(value.ttlPolicy, into);
}
allocationSize(value: TypeName): number {
return FfiConverterUInt32.allocationSize(value.replicas) +
FfiConverterTypeSandboxTemplateRef.allocationSize(value.sandboxTemplateRef) +
FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(value.autoscaling) +
- FfiConverterOptionalUInt32.allocationSize(value.ttlSecondsAfterCreated);
+ FfiConverterOptionalUInt32.allocationSize(value.ttlSecondsAfterCreated) +
+ FfiConverterOptionalUInt32.allocationSize(value.idleTtlSeconds) +
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.allocationSize(value.ttlPolicy);
}
};
@@ -1089,7 +1139,9 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
export type OsGymSandboxWarmPoolStatus = {
replicas?: number,
readyReplicas?: number,
- selector?: string
+ selector?: string,
+ lastClaimedAt?: string,
+ lastActivityTime?: string
}
/**
@@ -1097,6 +1149,8 @@ export type OsGymSandboxWarmPoolStatus = {
*/
export const OsGymSandboxWarmPoolStatus = (() => {
const defaults = () => ({
+ lastClaimedAt: undefined,
+ lastActivityTime: undefined
});
const create = (() => {
return uniffiCreateRecord<OsGymSandboxWarmPoolStatus, ReturnType<typeof defaults>>(defaults);
@@ -1115,18 +1169,24 @@ const FfiConverterTypeOSGymSandboxWarmPoolStatus = (() => {
return {
replicas: FfiConverterOptionalUInt32.read(from),
readyReplicas: FfiConverterOptionalUInt32.read(from),
- selector: FfiConverterOptionalString.read(from)
+ selector: FfiConverterOptionalString.read(from),
+ lastClaimedAt: FfiConverterOptionalString.read(from),
+ lastActivityTime: FfiConverterOptionalString.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
FfiConverterOptionalUInt32.write(value.replicas, into);
FfiConverterOptionalUInt32.write(value.readyReplicas, into);
FfiConverterOptionalString.write(value.selector, into);
+ FfiConverterOptionalString.write(value.lastClaimedAt, into);
+ FfiConverterOptionalString.write(value.lastActivityTime, into);
}
allocationSize(value: TypeName): number {
return FfiConverterOptionalUInt32.allocationSize(value.replicas) +
FfiConverterOptionalUInt32.allocationSize(value.readyReplicas) +
- FfiConverterOptionalString.allocationSize(value.selector);
+ FfiConverterOptionalString.allocationSize(value.selector) +
+ FfiConverterOptionalString.allocationSize(value.lastClaimedAt) +
+ FfiConverterOptionalString.allocationSize(value.lastActivityTime);
}
};
@@ -1480,8 +1540,10 @@ export interface OsGymSandboxWarmPoolSpecBuilderLike {
autoscaling(value: WarmPoolAutoscaling): OsGymSandboxWarmPoolSpecBuilderLike;
build() /*throws*/: OsGymSandboxWarmPoolSpec;
+ idleTtlSeconds(value: number): OsGymSandboxWarmPoolSpecBuilderLike;
replicas(value: number): OsGymSandboxWarmPoolSpecBuilderLike;
sandboxTemplateRef(value: SandboxTemplateRef): OsGymSandboxWarmPoolSpecBuilderLike;
+ ttlPolicy(value: WarmPoolTtlPolicy): OsGymSandboxWarmPoolSpecBuilderLike;
ttlSecondsAfterCreated(value: number): OsGymSandboxWarmPoolSpecBuilderLike;
}
/**
@@ -1542,6 +1604,18 @@ export class OsGymSandboxWarmPoolSpecBuilder extends UniffiAbstractObject implem
));
}
+ idleTtlSeconds(value: number): OsGymSandboxWarmPoolSpecBuilderLike {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(uniffiCaller.rustCall(
+ /*caller:*/ (callStatus) => {
+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(
+ uniffiTypeOsGymSandboxWarmPoolSpecBuilderObjectFactory.clonePointer(this),
+ FfiConverterUInt32.lower(value, nativeModule().rustbuffer_alloc),
+ callStatus);
+ },
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
+ ));
+ }
+
replicas(value: number): OsGymSandboxWarmPoolSpecBuilderLike {
return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(uniffiCaller.rustCall(
/*caller:*/ (callStatus) => {
@@ -1566,6 +1640,18 @@ export class OsGymSandboxWarmPoolSpecBuilder extends UniffiAbstractObject implem
));
}
+ ttlPolicy(value: WarmPoolTtlPolicy): OsGymSandboxWarmPoolSpecBuilderLike {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(uniffiCaller.rustCall(
+ /*caller:*/ (callStatus) => {
+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(
+ uniffiTypeOsGymSandboxWarmPoolSpecBuilderObjectFactory.clonePointer(this),
+ FfiConverterTypeWarmPoolTtlPolicy.lower(value, nativeModule().rustbuffer_alloc),
+ callStatus);
+ },
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
+ ));
+ }
+
ttlSecondsAfterCreated(value: number): OsGymSandboxWarmPoolSpecBuilderLike {
return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(uniffiCaller.rustCall(
/*caller:*/ (callStatus) => {
@@ -2546,6 +2632,9 @@ const FfiConverterOptionalTypeOidcConfig = new FfiConverterOptional(FfiConverter
// FfiConverter for WarmPoolAutoscaling | undefined
const FfiConverterOptionalTypeWarmPoolAutoscaling = new FfiConverterOptional(FfiConverterTypeWarmPoolAutoscaling);
+// FfiConverter for WarmPoolTtlPolicy | undefined
+const FfiConverterOptionalTypeWarmPoolTtlPolicy = new FfiConverterOptional(FfiConverterTypeWarmPoolTtlPolicy);
+
/**
* This should be called before anything else.
@@ -2583,12 +2672,18 @@ function uniffiEnsureInitialized() {
if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() !== 5682) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build");
}
+ if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds() !== 56677) {
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds");
+ }
if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() !== 50438) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas");
}
if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() !== 7198) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref");
}
+ if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy() !== 53364) {
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy");
+ }
if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created() !== 44516) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created");
}
@@ -2726,5 +2821,6 @@ export default Object.freeze({
FfiConverterTypeVmTemplateBuilder,
FfiConverterTypeWarmPoolAutoscaling,
FfiConverterTypeWarmPoolAutoscalingBuilder,
+ FfiConverterTypeWarmPoolTtlPolicy,
}
});
diff --git a/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema-ffi.ts b/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema-ffi.ts
index aeb6bd1eb3..798ba32786 100644
--- a/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema-ffi.ts
+++ b/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema-ffi.ts
@@ -363,6 +363,11 @@ const DEFINITIONS = {
ret: FfiType.RustBuffer,
hasRustCallStatus: true,
},
+ "uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds": {
+ args: [FfiType.Handle, FfiType.UInt32],
+ ret: FfiType.Handle,
+ hasRustCallStatus: true,
+ },
"uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas": {
args: [FfiType.Handle, FfiType.UInt32],
ret: FfiType.Handle,
@@ -373,6 +378,11 @@ const DEFINITIONS = {
ret: FfiType.Handle,
hasRustCallStatus: true,
},
+ "uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy": {
+ args: [FfiType.Handle, FfiType.RustBuffer],
+ ret: FfiType.Handle,
+ hasRustCallStatus: true,
+ },
"uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created": {
args: [FfiType.Handle, FfiType.UInt32],
ret: FfiType.Handle,
@@ -578,6 +588,11 @@ const DEFINITIONS = {
ret: FfiType.UInt16,
hasRustCallStatus: false,
},
+ "uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds": {
+ args: [],
+ ret: FfiType.UInt16,
+ hasRustCallStatus: false,
+ },
"uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas": {
args: [],
ret: FfiType.UInt16,
@@ -588,6 +603,11 @@ const DEFINITIONS = {
ret: FfiType.UInt16,
hasRustCallStatus: false,
},
+ "uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy": {
+ args: [],
+ ret: FfiType.UInt16,
+ hasRustCallStatus: false,
+ },
"uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created": {
args: [],
ret: FfiType.UInt16,
@@ -848,8 +868,10 @@ interface NativeModuleInterface {
uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new(uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling(uniffiSelf: bigint, value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(uniffiSelf: bigint, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(uniffiSelf: bigint, value: number, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(uniffiSelf: bigint, value: number, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(uniffiSelf: bigint, value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(uniffiSelf: bigint, value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(uniffiSelf: bigint, value: number, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(uniffiSelf: bigint, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
@@ -891,8 +913,10 @@ interface NativeModuleInterface {
uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new(): number;
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling(): number;
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(): number;
+ uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_idle_ttl_seconds(): number;
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas(): number;
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(): number;
+ uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_policy(): number;
uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_ttl_seconds_after_created(): number;
uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json(): number;
uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json(): number;
diff --git a/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema.ts b/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema.ts
index dea5659839..965793dbf9 100644
--- a/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema.ts
+++ b/libs/fleet/sdk-bindings/ts-uniffi/cyclops_sdk_schema.ts
@@ -1025,11 +1025,53 @@ const FfiConverterTypeWarmPoolAutoscaling = (() => {
return new FFIConverter();
})();
+/**
+ * What the pool-operator deletes when a warm pool's creation TTL
+ * (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+ */
+export enum WarmPoolTtlPolicy {
+ /**
+ * Delete only the warm pool. Its claims and namespace stay.
+ */
+ Retain,
+ /**
+ * Also delete the pool's dead unbound claims (TTL passed, older than
+ * max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ */
+ Cascade
+}
+
+const FfiConverterTypeWarmPoolTtlPolicy = (() => {
+ const ordinalConverter = FfiConverterInt32;
+ type TypeName = WarmPoolTtlPolicy;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ switch (ordinalConverter.read(from)) {
+ case 1: return WarmPoolTtlPolicy.Retain;
+ case 2: return WarmPoolTtlPolicy.Cascade;
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ switch (value) {
+ case WarmPoolTtlPolicy.Retain: return ordinalConverter.write(1, into);
+ case WarmPoolTtlPolicy.Cascade: return ordinalConverter.write(2, into);
+ }
+ }
+ allocationSize(value: TypeName): number {
+ return ordinalConverter.allocationSize(0);
+ }
+ }
+ return new FFIConverter();
+})();
+
export type OsGymSandboxWarmPoolSpec = {
replicas: number,
sandboxTemplateRef: SandboxTemplateRef,
autoscaling?: WarmPoolAutoscaling,
- ttlSecondsAfterCreated?: number
+ ttlSecondsAfterCreated?: number,
+ idleTtlSeconds?: number,
+ ttlPolicy?: WarmPoolTtlPolicy
}
/**
@@ -1037,7 +1079,9 @@ export type OsGymSandboxWarmPoolSpec = {
*/
export const OsGymSandboxWarmPoolSpec = (() => {
const defaults = () => ({
- ttlSecondsAfterCreated: undefined
+ ttlSecondsAfterCreated: undefined,
+ idleTtlSeconds: undefined,
+ ttlPolicy: undefined
});
const create = (() => {
return uniffiCreateRecord<OsGymSandboxWarmPoolSpec, ReturnType<typeof defaults>>(defaults);
@@ -1057,7 +1101,9 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
replicas: FfiConverterUInt32.read(from),
sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),
autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from),
- ttlSecondsAfterCreated: FfiConverterOptionalUInt32.read(from)
+ ttlSecondsAfterCreated: FfiConverterOptionalUInt32.read(from),
+ idleTtlSeconds: FfiConverterOptionalUInt32.read(from),
+ ttlPolicy: FfiConverterOptionalTypeWarmPoolTtlPolicy.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -1065,12 +1111,16 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);
FfiConverterOptionalTypeWarmPoolAutoscaling.write(value.autoscaling, into);
FfiConverterOptionalUInt32.write(value.ttlSecondsAfterCreated, into);
+ FfiConverterOptionalUInt32.write(value.idleTtlSeconds, into);
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.write(value.ttlPolicy, into);
}
allocationSize(value: TypeName): number {
return FfiConverterUInt32.allocationSize(value.replicas) +
FfiConverterTypeSandboxTemplateRef.allocationSize(value.sandboxTemplateRef) +
FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(value.autoscaling) +
- FfiConverterOptionalUInt32.allocationSize(value.ttlSecondsAfterCreated);
+ FfiConverterOptionalUInt32.allocationSize(value.ttlSecondsAfterCreated) +
+ FfiConverterOptionalUInt32.allocationSize(value.idleTtlSeconds) +
+ FfiConverterOptionalTypeWarmPoolTtlPolicy.allocationSize(value.ttlPolicy);
}
};
@@ -1080,7 +1130,9 @@ const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {
export type OsGymSandboxWarmPoolStatus = {
replicas?: number,
readyReplicas?: number,
- selector?: string
+ selector?: string,
+ lastClaimedAt?: string,
+ lastActivityTime?: string
}
/**
@@ -1088,6 +1140,8 @@ export type OsGymSandboxWarmPoolStatus = {
*/
export const OsGymSandboxWarmPoolStatus = (() => {
const defaults = () => ({
+ lastClaimedAt: undefined,
+ lastActivityTime: undefined
});
const create = (() => {
return uniffiCreateRecord<OsGymSandboxWarmPoolStatus, ReturnType<typeof defaults>>(defaults);
@@ -1106,18 +1160,24 @@ const FfiConverterTypeOSGymSandboxWarmPoolStatus = (() => {
return {
replicas: FfiConverterOptionalUInt32.read(from),
readyReplicas: FfiConverterOptionalUInt32.read(from),
- selector: FfiConverterOptionalString.read(from)
+ selector: FfiConverterOptionalString.read(from),
+ lastClaimedAt: FfiConverterOptionalString.read(from),
+ lastActivityTime: FfiConverterOptionalString.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
FfiConverterOptionalUInt32.write(value.replicas, into);
FfiConverterOptionalUInt32.write(value.readyReplicas, into);
FfiConverterOptionalString.write(value.selector, into);
+ FfiConverterOptionalString.write(value.lastClaimedAt, into);
+ FfiConverterOptionalString.write(value.lastActivityTime, into);
}
allocationSize(value: TypeName): number {
return FfiConverterOptionalUInt32.allocationSize(value.replicas) +
FfiConverterOptionalUInt32.allocationSize(value.readyReplicas) +
- FfiConverterOptionalString.allocationSize(value.selector);
+ FfiConverterOptionalString.allocationSize(value.selector) +
+ FfiConverterOptionalString.allocationSize(value.lastClaimedAt) +
+ FfiConverterOptionalString.allocationSize(value.lastActivityTime);
}
};
@@ -1392,6 +1452,9 @@ const FfiConverterOptionalTypeOidcConfig = new FfiConverterOptional(FfiConverter
// FfiConverter for WarmPoolAutoscaling | undefined
const FfiConverterOptionalTypeWarmPoolAutoscaling = new FfiConverterOptional(FfiConverterTypeWarmPoolAutoscaling);
+// FfiConverter for WarmPoolTtlPolicy | undefined
+const FfiConverterOptionalTypeWarmPoolTtlPolicy = new FfiConverterOptional(FfiConverterTypeWarmPoolTtlPolicy);
+
/**
* This should be called before anything else.
@@ -1446,5 +1509,6 @@ export default Object.freeze({
FfiConverterTypeServiceProtocol,
FfiConverterTypeVmTemplate,
FfiConverterTypeWarmPoolAutoscaling,
+ FfiConverterTypeWarmPoolTtlPolicy,
}
});
diff --git a/libs/fleet/sdk-schema/src/lib.rs b/libs/fleet/sdk-schema/src/lib.rs
index 1d05470e89..d3d2baa80b 100644
--- a/libs/fleet/sdk-schema/src/lib.rs
+++ b/libs/fleet/sdk-schema/src/lib.rs
@@ -22,7 +22,7 @@ pub use sandbox::{
};
pub use warmpool::{
OSGymSandboxWarmPool, OSGymSandboxWarmPoolSpec, OSGymSandboxWarmPoolSpecBuilder,
- OSGymSandboxWarmPoolStatus, WarmPoolAutoscaling, WarmPoolAutoscalingBuilder,
+ OSGymSandboxWarmPoolStatus, WarmPoolAutoscaling, WarmPoolAutoscalingBuilder, WarmPoolTtlPolicy,
};
uniffi::setup_scaffolding!("cyclops_sdk_schema");
diff --git a/libs/fleet/sdk-schema/src/warmpool.rs b/libs/fleet/sdk-schema/src/warmpool.rs
index 883f001493..c09ca5f300 100644
--- a/libs/fleet/sdk-schema/src/warmpool.rs
+++ b/libs/fleet/sdk-schema/src/warmpool.rs
@@ -1,6 +1,6 @@
use crate::{
SandboxTemplateRef,
- common::{integer_schema, string_schema},
+ common::{date_time_schema, integer_schema, string_schema},
};
use kube::CustomResource;
use schemars::JsonSchema;
@@ -27,6 +27,21 @@ fn sandbox_template_ref_schema(_: &mut schemars::SchemaGenerator) -> schemars::S
})
}
+fn ttl_policy_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {
+ WarmPoolTtlPolicy::json_schema(generator)
+}
+
+/// What the pool-operator deletes when a warm pool's creation TTL
+/// (`ttlSecondsAfterCreated`) or idle TTL (`idleTtlSeconds`) expires.
+#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, uniffi::Enum)]
+pub enum WarmPoolTtlPolicy {
+ /// Delete only the warm pool. Its claims and namespace stay.
+ Retain,
+ /// Also delete the pool's dead unbound claims (TTL passed, older than
+ /// max(900s, bindDeadline)). Bound claims, the namespace and volumes stay.
+ Cascade,
+}
+
#[derive(
Clone,
Debug,
@@ -124,6 +139,23 @@ pub struct OSGymSandboxWarmPoolSpec {
#[serde(skip_serializing_if = "Option::is_none")]
#[uniffi(default = None)]
pub ttl_seconds_after_created: Option<u32>,
+ #[schemars(
+ default,
+ schema_with = "integer_schema",
+ range(min = 0, max = u32::MAX),
+ description = "Idle TTL in seconds. The pool-operator deletes the pool once it has had no Pending or Bound claims for this long, measured from status.lastActivityTime (or creation when no claim was ever made), when OSGYM_POOL_LIFECYCLE_MODE is enforce. When absent, the pool is never reaped for being idle."
+ )]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[uniffi(default = None)]
+ pub idle_ttl_seconds: Option<u32>,
+ #[schemars(
+ default,
+ schema_with = "ttl_policy_schema",
+ description = "What expiry of ttlSecondsAfterCreated or idleTtlSeconds deletes. Retain (the behaviour when absent) deletes only the pool. Cascade also deletes the pool's dead unbound claims (TTL passed and older than max(900s, bindDeadline)); it never deletes Bound claims, the namespace or volumes."
+ )]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[uniffi(default = None)]
+ pub ttl_policy: Option<WarmPoolTtlPolicy>,
}
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize, JsonSchema, uniffi::Record)]
@@ -142,4 +174,20 @@ pub struct OSGymSandboxWarmPoolStatus {
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub selector: Option<String>,
+ #[schemars(
+ default,
+ schema_with = "date_time_schema",
+ description = "When a claim last bound a Sandbox from this pool."
+ )]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[uniffi(default = None)]
+ pub last_claimed_at: Option<String>,
+ #[schemars(
+ default,
+ schema_with = "date_time_schema",
+ description = "When a claim against this pool was last created, bound or released. The idle TTL (spec.idleTtlSeconds) counts from here."
+ )]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[uniffi(default = None)]
+ pub last_activity_time: Option<String>,
}
diff --git a/libs/fleet/sdk-schema/tests/claim_crds.rs b/libs/fleet/sdk-schema/tests/claim_crds.rs
index bedac1178b..c7c895fb0a 100644
--- a/libs/fleet/sdk-schema/tests/claim_crds.rs
+++ b/libs/fleet/sdk-schema/tests/claim_crds.rs
@@ -167,6 +167,98 @@ fn claim_raw_crd_matches_the_authoritative_field_contract() {
assert_eq!(generated, authoritative);
}
+#[test]
+fn warm_pool_idle_ttl_and_ttl_policy_are_optional_and_bounded() {
+ let crd = serde_json::to_value(OSGymSandboxWarmPool::crd()).unwrap();
+ let spec = crd
+ .pointer("/spec/versions/0/schema/openAPIV3Schema/properties/spec")
+ .unwrap();
+ let required = spec.pointer("/required").and_then(Value::as_array).unwrap();
+ for field in ["idleTtlSeconds", "ttlPolicy"] {
+ assert!(
+ !required.contains(&json!(field)),
+ "{field} must be optional"
+ );
+ }
+
+ let mut idle = spec.pointer("/properties/idleTtlSeconds").cloned().unwrap();
+ idle.as_object_mut().unwrap().remove("description");
+ normalize_numbers(&mut idle);
+ assert_eq!(
+ idle,
+ json!({"type": "integer", "minimum": 0, "maximum": 4_294_967_295u64})
+ );
+
+ let mut policy = spec.pointer("/properties/ttlPolicy").cloned().unwrap();
+ policy.as_object_mut().unwrap().remove("description");
+ // No materialized default: absent keeps today's Retain behaviour without
+ // the apiserver rewriting every stored pool.
+ assert_eq!(
+ policy,
+ json!({"type": "string", "enum": ["Retain", "Cascade"]})
+ );
+
+ let status = crd
+ .pointer("/spec/versions/0/schema/openAPIV3Schema/properties/status/properties")
+ .unwrap();
+ for field in ["lastClaimedAt", "lastActivityTime"] {
+ let mut schema = status.pointer(&format!("/{field}")).cloned().unwrap();
+ schema.as_object_mut().unwrap().remove("description");
+ assert_eq!(schema, json!({"type": "string", "format": "date-time"}));
+ }
+}
+
+#[test]
+fn warm_pool_lifecycle_fields_round_trip_and_stay_absent_when_unset() {
+ use cyclops_sdk_schema::{
+ OSGymSandboxWarmPoolSpec, OSGymSandboxWarmPoolStatus, WarmPoolTtlPolicy,
+ };
+
+ let spec: OSGymSandboxWarmPoolSpec = serde_json::from_value(json!({
+ "replicas": 0,
+ "sandboxTemplateRef": {"name": "p-template"},
+ "idleTtlSeconds": 900,
+ "ttlPolicy": "Cascade",
+ }))
+ .unwrap();
+ assert_eq!(spec.idle_ttl_seconds, Some(900));
+ assert_eq!(spec.ttl_policy, Some(WarmPoolTtlPolicy::Cascade));
+ assert_eq!(serde_json::to_value(&spec).unwrap()["ttlPolicy"], "Cascade");
+
+ let legacy: OSGymSandboxWarmPoolSpec = serde_json::from_value(json!({
+ "replicas": 1,
+ "sandboxTemplateRef": {"name": "p-template"},
+ }))
+ .unwrap();
+ let legacy_json = serde_json::to_value(&legacy).unwrap();
+ assert!(legacy_json.get("idleTtlSeconds").is_none());
+ assert!(legacy_json.get("ttlPolicy").is_none());
+
+ assert!(
+ serde_json::from_value::<OSGymSandboxWarmPoolSpec>(json!({
+ "replicas": 1,
+ "sandboxTemplateRef": {"name": "p-template"},
+ "ttlPolicy": "Orphan",
+ }))
+ .is_err()
+ );
+
+ let status: OSGymSandboxWarmPoolStatus = serde_json::from_value(json!({
+ "replicas": 1,
+ "lastClaimedAt": "2026-09-22T10:00:00Z",
+ "lastActivityTime": "2026-09-22T10:05:00Z",
+ }))
+ .unwrap();
+ assert_eq!(
+ status.last_claimed_at.as_deref(),
+ Some("2026-09-22T10:00:00Z")
+ );
+ assert_eq!(
+ status.last_activity_time.as_deref(),
+ Some("2026-09-22T10:05:00Z")
+ );
+}
+
#[test]
fn claim_secret_ref_is_optional_and_pinned_to_the_gateway_prefix() {
let claim = serde_json::to_value(OSGymSandboxClaim::crd()).unwrap();
diff --git a/libs/fleet/sdk-schema/tests/ffi_models.rs b/libs/fleet/sdk-schema/tests/ffi_models.rs
index 219db6b049..bfee5f569d 100644
--- a/libs/fleet/sdk-schema/tests/ffi_models.rs
+++ b/libs/fleet/sdk-schema/tests/ffi_models.rs
@@ -180,6 +180,8 @@ fn exported_status_records_are_typed_and_round_trip() {
replicas: Some(3),
ready_replicas: Some(2),
selector: Some("osgym.cua.ai/pool=default".into()),
+ last_claimed_at: Some("2026-07-19T12:00:00Z".into()),
+ last_activity_time: Some("2026-07-19T12:05:00Z".into()),
};
let claim_status = OSGymSandboxClaimStatus {
phase: Some("Bound".into()),
diff --git a/libs/fleet/sdk/src/status.rs b/libs/fleet/sdk/src/status.rs
index bae0ee6dc9..66d7ff1a7f 100644
--- a/libs/fleet/sdk/src/status.rs
+++ b/libs/fleet/sdk/src/status.rs
@@ -100,6 +100,7 @@ mod tests {
replicas: Some(1),
ready_replicas: Some(0),
selector: None,
+ ..Default::default()
};
let display = pool_display_status(pool(1, Some(status)));
assert_eq!(display.kind, PoolDisplayStatusKind::Healthy);