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(cua-fleet): reconcile named pools without listing

r33drichardseb8af4086dae
diff --git a/libs/fleet/scripts/generate-sdk-bindings.sh b/libs/fleet/scripts/generate-sdk-bindings.sh
index c708ca8eba..77bf3ab4d4 100755
--- a/libs/fleet/scripts/generate-sdk-bindings.sh
+++ b/libs/fleet/scripts/generate-sdk-bindings.sh
@@ -798,8 +798,8 @@ def replace_buffer(match):
f"{indent})"
)
text, buffer_replacements = re.subn(buffer_pattern, replace_buffer, text)
-if buffer_replacements != 11:
- raise SystemExit(f"expected 11 Ruby Rust-buffer future wrappers, found {buffer_replacements}")
+if buffer_replacements != 12:
+ raise SystemExit(f"expected 12 Ruby Rust-buffer future wrappers, found {buffer_replacements}")
void_pattern = r"(?m)^(\s*)FleetSdk\.rust_call_with_error\(([^,]+),:([a-z0-9_]+),(.*)\)$"
def replace_void(match):
diff --git a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
index f55bee71a5..15983904db 100644
--- a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
+++ b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
@@ -717,6 +717,8 @@ internal object IntegrityCheckingUniffiLib {
): Short
external fun uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools(
): Short
+ external fun uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool(
+ ): Short
external fun uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool(
): Short
external fun uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request(
@@ -763,171 +765,173 @@ internal object UniffiLib {
}
external fun uniffi_cyclops_sdk_fn_clone_cyclopsclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_free_cyclopsclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(`configuration`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_and_native_http_client(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(`configuration`: RustBuffer.ByValue,`tokenProvider`: Long,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider_and_native_http_client(`configuration`: RustBuffer.ByValue,`tokenProvider`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_native_http_client(`configuration`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(`ptr`: Long,`request`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims(`ptr`: Long,`namespace`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(`ptr`: Long,`request`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool(`ptr`: Long,`pool`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(`ptr`: Long,`name`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(`ptr`: Long,`namespace`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(`ptr`: Long,`pool`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(`ptr`: Long,`sandbox`: RustBuffer.ByValue,`service`: RustBuffer.ByValue,`path`: RustBuffer.ByValue,`request`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_clone_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_free_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(`vtable`: UniffiVTableCallbackInterfaceAccessTokenProvider,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(`ptr`: Long,`forceRefresh`: Byte,
- ): Long
- external fun uniffi_cyclops_sdk_fn_clone_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_free_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(`vtable`: UniffiVTableCallbackInterfaceHttpClient,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_method_httpclient_execute(`ptr`: Long,`request`: RustBuffer.ByValue,
- ): Long
- external fun uniffi_cyclops_sdk_fn_clone_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_fn_free_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun uniffi_cyclops_sdk_fn_constructor_cyclopscredentials_new(`clientId`: RustBuffer.ByValue,`clientSecret`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun ffi_cyclops_sdk_rustbuffer_alloc(`size`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun ffi_cyclops_sdk_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_rust_future_poll_u8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_u8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_u8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_u8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Byte
- external fun ffi_cyclops_sdk_rust_future_poll_i8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_i8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_i8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_i8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Byte
- external fun ffi_cyclops_sdk_rust_future_poll_u16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_u16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_u16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_u16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Short
- external fun ffi_cyclops_sdk_rust_future_poll_i16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_i16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_i16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_i16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Short
- external fun ffi_cyclops_sdk_rust_future_poll_u32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_u32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_u32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_u32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Int
- external fun ffi_cyclops_sdk_rust_future_poll_i32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_i32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_i32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_i32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Int
- external fun ffi_cyclops_sdk_rust_future_poll_u64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_u64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_u64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_u64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun ffi_cyclops_sdk_rust_future_poll_i64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_i64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_i64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_i64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun ffi_cyclops_sdk_rust_future_poll_f32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_f32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_f32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_f32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Float
- external fun ffi_cyclops_sdk_rust_future_poll_f64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_f64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_f64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_f64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Double
- external fun ffi_cyclops_sdk_rust_future_poll_rust_buffer(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_rust_buffer(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_rust_buffer(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_rust_buffer(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_rust_future_poll_void(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_cancel_void(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_free_void(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
+): Long
+external fun uniffi_cyclops_sdk_fn_free_cyclopsclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(`configuration`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_and_native_http_client(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(`configuration`: RustBuffer.ByValue,`tokenProvider`: Long,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider_and_native_http_client(`configuration`: RustBuffer.ByValue,`tokenProvider`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_native_http_client(`configuration`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(`ptr`: Long,`request`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims(`ptr`: Long,`namespace`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(`ptr`: Long,`request`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool(`ptr`: Long,`pool`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(`ptr`: Long,`name`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(`ptr`: Long,`namespace`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(`ptr`: Long,`request`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(`ptr`: Long,`pool`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(`ptr`: Long,`sandbox`: RustBuffer.ByValue,`service`: RustBuffer.ByValue,`path`: RustBuffer.ByValue,`request`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_clone_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_free_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(`vtable`: UniffiVTableCallbackInterfaceAccessTokenProvider,
+): Unit
+external fun uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(`ptr`: Long,`forceRefresh`: Byte,
+): Long
+external fun uniffi_cyclops_sdk_fn_clone_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_free_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(`vtable`: UniffiVTableCallbackInterfaceHttpClient,
+): Unit
+external fun uniffi_cyclops_sdk_fn_method_httpclient_execute(`ptr`: Long,`request`: RustBuffer.ByValue,
+): Long
+external fun uniffi_cyclops_sdk_fn_clone_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_free_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_constructor_cyclopscredentials_new(`clientId`: RustBuffer.ByValue,`clientSecret`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_rustbuffer_alloc(`size`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun ffi_cyclops_sdk_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_rust_future_poll_u8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_u8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_u8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_u8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Byte
+external fun ffi_cyclops_sdk_rust_future_poll_i8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_i8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_i8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_i8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Byte
+external fun ffi_cyclops_sdk_rust_future_poll_u16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_u16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_u16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_u16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Short
+external fun ffi_cyclops_sdk_rust_future_poll_i16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_i16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_i16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_i16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Short
+external fun ffi_cyclops_sdk_rust_future_poll_u32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_u32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_u32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_u32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Int
+external fun ffi_cyclops_sdk_rust_future_poll_i32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_i32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_i32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_i32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Int
+external fun ffi_cyclops_sdk_rust_future_poll_u64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_u64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_u64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_u64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_rust_future_poll_i64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_i64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_i64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_i64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_rust_future_poll_f32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_f32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_f32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_f32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Float
+external fun ffi_cyclops_sdk_rust_future_poll_f64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_f64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_f64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_f64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Double
+external fun ffi_cyclops_sdk_rust_future_poll_rust_buffer(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_rust_buffer(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_rust_buffer(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_rust_buffer(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_rust_future_poll_void(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_cancel_void(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_free_void(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
}
@@ -970,6 +974,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() != 27984.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool() != 53919.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() != 17695.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
@@ -1943,6 +1950,8 @@ public interface CyclopsClientInterface {
suspend fun `listPools`(`namespace`: kotlin.String): List<Pool>
+ suspend fun `reconcilePool`(`request`: CreatePoolRequest): Pool
+
suspend fun `updatePool`(`pool`: Pool): Pool
suspend fun `serviceRequest`(`sandbox`: Sandbox, `service`: kotlin.String, `path`: kotlin.String, `request`: HttpRequest): HttpResponse
@@ -2238,6 +2247,27 @@ open class CyclopsClient: Disposable, AutoCloseable, CyclopsClientInterface
}
+ @Throws(SdkException::class)
+ @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
+ override suspend fun `reconcilePool`(`request`: CreatePoolRequest) : Pool {
+ return uniffiRustCallAsync(
+ callWithHandle { uniffiHandle ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(
+ uniffiHandle,
+ FfiConverterTypeCreatePoolRequest.lower(`request`),
+ )
+ },
+ { future, callback, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },
+ { future, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer(future, continuation) },
+ { future -> UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer(future) },
+ // lift function
+ { FfiConverterTypePool.lift(it) },
+ // Error FFI converter
+ SdkException.ErrorHandler,
+ )
+ }
+
+
@Throws(SdkException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `updatePool`(`pool`: Pool) : Pool {
diff --git a/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py b/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
index f8bff792a4..3e6f725a6b 100644
--- a/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
+++ b/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
@@ -512,6 +512,8 @@ def _uniffi_check_api_checksums(lib):
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() != 27984:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool() != 53919:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() != 46699:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() != 17695:
@@ -952,6 +954,11 @@ _UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools.argtypes = (
_UniffiRustBuffer,
)
_UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool.restype = ctypes.c_uint64
_UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
@@ -1032,6 +1039,9 @@ _UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_claims.restype
_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request.restype = ctypes.c_uint16
@@ -2682,6 +2692,8 @@ class CyclopsClientProtocol(typing.Protocol):
raise NotImplementedError
async def list_pools(self, namespace: str) -> typing.List[Pool]:
raise NotImplementedError
+ async def reconcile_pool(self, request: CreatePoolRequest) -> Pool:
+ raise NotImplementedError
async def service_request(self, sandbox: Sandbox,service: str,path: str,request: HttpRequest) -> HttpResponse:
raise NotImplementedError
async def update_pool(self, pool: Pool) -> Pool:
@@ -2978,6 +2990,23 @@ class CyclopsClient(CyclopsClientProtocol):
_uniffi_lift_return,
_uniffi_error_converter,
)
+ async def reconcile_pool(self, request: CreatePoolRequest) -> Pool:
+
+ _UniffiFfiConverterTypeCreatePoolRequest.check_lower(request)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeCreatePoolRequest.lower(request),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypePool.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkError
+ return await _uniffi_rust_call_async(
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(*_uniffi_lowered_args),
+ _UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer,
+ _UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer,
+ _UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer,
+ _uniffi_lift_return,
+ _uniffi_error_converter,
+ )
async def service_request(self, sandbox: Sandbox,service: str,path: str,request: HttpRequest) -> HttpResponse:
_UniffiFfiConverterTypeSandbox.check_lower(sandbox)
diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
index 0cf5d223e8..b9e5092dd6 100644
--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
@@ -1914,6 +1914,9 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools,
[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
:uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
attach_function :uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool,
[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
:uint64
@@ -2020,6 +2023,9 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool,
[RustCallStatus.by_ref],
:uint16
@@ -2590,6 +2596,15 @@ end
)
return result.consumeIntoSequenceTypePool
end
+ def reconcile_pool(request)
+ request = request
+ RustBuffer.check_lower_TypeCreatePoolRequest(request)
+ result = FleetSdk.uniffi_rust_future_rust_buffer(
+ SdkError,
+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreatePoolRequest(request),RustCallStatus.new),
+ )
+ return result.consumeIntoTypePool
+ end
def update_pool(pool)
pool = pool
RustBuffer.check_lower_TypePool(pool)
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
index 943aee896e..eb2e244281 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
@@ -790,6 +790,8 @@ public protocol CyclopsClientProtocol: AnyObject, Sendable {
func listPools(namespace: String) async throws -> [Pool]
+ func reconcilePool(request: CreatePoolRequest) async throws -> Pool
+
func updatePool(pool: Pool) async throws -> Pool
func serviceRequest(sandbox: Sandbox, service: String, path: String, request: HttpRequest) async throws -> HttpResponse
@@ -1065,6 +1067,23 @@ open func listPools(namespace: String)async throws -> [Pool] {
)
}
+open func reconcilePool(request: CreatePoolRequest)async throws -> Pool {
+ return
+ try await uniffiRustCallAsync(
+ rustFutureFunc: {
+ uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeCreatePoolRequest_lower(request)
+ )
+ },
+ pollFunc: ffi_cyclops_sdk_rust_future_poll_rust_buffer,
+ completeFunc: ffi_cyclops_sdk_rust_future_complete_rust_buffer,
+ freeFunc: ffi_cyclops_sdk_rust_future_free_rust_buffer,
+ liftFunc: FfiConverterTypePool_lift,
+ errorHandler: FfiConverterTypeSdkError_lift
+ )
+}
+
open func updatePool(pool: Pool)async throws -> Pool {
return
try await uniffiRustCallAsync(
@@ -2899,6 +2918,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() != 27984) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool() != 53919) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() != 17695) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
index 90ff87732b..2fdd3b12f5 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
@@ -363,6 +363,11 @@ uint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(uint64_t ptr, RustB
uint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(uint64_t ptr, RustBuffer namespace
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_RECONCILE_POOL
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_RECONCILE_POOL
+uint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_reconcile_pool(uint64_t ptr, RustBuffer request
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_UPDATE_POOL
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_UPDATE_POOL
uint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(uint64_t ptr, RustBuffer pool
@@ -740,6 +745,12 @@ uint16_t uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_pool(void
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CYCLOPSCLIENT_LIST_POOLS
uint16_t uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CYCLOPSCLIENT_RECONCILE_POOL
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CYCLOPSCLIENT_RECONCILE_POOL
+uint16_t uniffi_cyclops_sdk_checksum_method_cyclopsclient_reconcile_pool(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CYCLOPSCLIENT_UPDATE_POOL
diff --git a/libs/fleet/sdk/src/pools.rs b/libs/fleet/sdk/src/pools.rs
index 51d64500c2..9315c416c0 100644
--- a/libs/fleet/sdk/src/pools.rs
+++ b/libs/fleet/sdk/src/pools.rs
@@ -90,6 +90,22 @@ impl CyclopsClient {
.await
}
+ pub async fn reconcile_pool(
+ self: Arc<Self>,
+ request: CreatePoolRequest,
+ ) -> Result<Pool, SdkError> {
+ match self.clone().get_pool(request.namespace.clone()).await {
+ Ok(mut pool) => {
+ pool.spec = request.spec;
+ self.update_pool(pool).await
+ }
+ Err(SdkError::Status {
+ status: 403 | 404, ..
+ }) => self.create_pool(request).await,
+ Err(error) => Err(error),
+ }
+ }
+
pub async fn update_pool(self: Arc<Self>, pool: Pool) -> Result<Pool, SdkError> {
let item_url = self.pool_item_url(&pool)?;
let body = to_json(&pool)?;
diff --git a/libs/fleet/sdk/tests/binding_generation.rs b/libs/fleet/sdk/tests/binding_generation.rs
index 24d9291f35..ee179850af 100644
--- a/libs/fleet/sdk/tests/binding_generation.rs
+++ b/libs/fleet/sdk/tests/binding_generation.rs
@@ -53,6 +53,8 @@ fn generated_bindings_hide_raw_credentials_and_claim_update() {
assert!(!kotlin.contains("PoolFailed"));
assert!(python.contains("def connect_with_native_http_client"));
assert!(python.contains("def connect_with_access_token_and_native_http_client"));
+ assert!(python.contains("async def reconcile_pool"));
+ assert!(kotlin.contains("suspend fun `reconcilePool`"));
fs::remove_dir_all(output).unwrap();
}
diff --git a/libs/fleet/sdk/tests/pool_flow.rs b/libs/fleet/sdk/tests/pool_flow.rs
index 5e4bf83790..8273c03714 100644
--- a/libs/fleet/sdk/tests/pool_flow.rs
+++ b/libs/fleet/sdk/tests/pool_flow.rs
@@ -402,6 +402,169 @@ async fn gets_named_pool_and_updates_typed_pools() {
assert_merge_patch_request(&requests[1], ITEM, Some(&json_bytes(&updated)));
}
+#[tokio::test]
+async fn reconcile_updates_an_existing_named_pool() {
+ let current = pool();
+ let updated = Pool {
+ spec: serde_json::from_value(serde_json::json!({
+ "replicas": 2,
+ "template": { "containerDiskImage": "registry.example/updated:latest" },
+ }))
+ .unwrap(),
+ ..pool()
+ };
+ let http = Arc::new(ScriptedHttpClient::new([
+ Ok(token()),
+ Ok(json_response(200, &current)),
+ Ok(json_response(200, &updated)),
+ ]));
+ let client = client(Arc::clone(&http));
+
+ assert_eq!(
+ client
+ .reconcile_pool(CreatePoolRequest {
+ namespace: NAMESPACE.into(),
+ spec: updated.spec.clone(),
+ })
+ .await
+ .unwrap(),
+ updated.clone()
+ );
+
+ let requests = resource_requests(&http).await;
+ assert_request(&requests[0], "GET", ITEM, None);
+ assert_merge_patch_request(&requests[1], ITEM, Some(&json_bytes(&updated)));
+}
+
+#[tokio::test]
+async fn reconcile_creates_after_named_pool_is_not_found() {
+ let created = pool();
+ let http = Arc::new(ScriptedHttpClient::new([
+ Ok(token()),
+ Ok(response(404, b"not found")),
+ Ok(response(409, b"namespace already exists")),
+ Ok(json_response(201, &created)),
+ ]));
+ let client = client(Arc::clone(&http));
+
+ assert_eq!(
+ client
+ .reconcile_pool(CreatePoolRequest {
+ namespace: NAMESPACE.into(),
+ spec: pool_spec(),
+ })
+ .await
+ .unwrap(),
+ created
+ );
+
+ let requests = resource_requests(&http).await;
+ assert_request(&requests[0], "GET", ITEM, None);
+ assert_request(
+ &requests[1],
+ "POST",
+ NAMESPACE_COLLECTION,
+ Some(br#"{"name":"example-pool"}"#),
+ );
+ assert_request(&requests[2], "POST", COLLECTION, Some(&json_bytes(&pool())));
+}
+
+#[tokio::test]
+async fn reconcile_attempts_create_after_named_pool_is_forbidden() {
+ let created = pool();
+ let http = Arc::new(ScriptedHttpClient::new([
+ Ok(token()),
+ Ok(response(403, b"get forbidden")),
+ Ok(response(409, b"namespace already exists")),
+ Ok(json_response(201, &created)),
+ ]));
+ let client = client(Arc::clone(&http));
+
+ assert_eq!(
+ client
+ .reconcile_pool(CreatePoolRequest {
+ namespace: NAMESPACE.into(),
+ spec: pool_spec(),
+ })
+ .await
+ .unwrap(),
+ created
+ );
+
+ let requests = resource_requests(&http).await;
+ assert_request(&requests[0], "GET", ITEM, None);
+ assert_request(
+ &requests[1],
+ "POST",
+ NAMESPACE_COLLECTION,
+ Some(br#"{"name":"example-pool"}"#),
+ );
+ assert_request(&requests[2], "POST", COLLECTION, Some(&json_bytes(&pool())));
+}
+
+#[tokio::test]
+async fn reconcile_returns_create_error_after_named_pool_is_forbidden() {
+ let http = Arc::new(ScriptedHttpClient::new([
+ Ok(token()),
+ Ok(response(403, b"get forbidden")),
+ Ok(response(409, b"namespace already exists")),
+ Ok(response(422, b"create rejected")),
+ ]));
+ let client = client(Arc::clone(&http));
+
+ assert!(matches!(
+ client
+ .reconcile_pool(CreatePoolRequest {
+ namespace: NAMESPACE.into(),
+ spec: pool_spec(),
+ })
+ .await,
+ Err(SdkError::Status {
+ ref operation,
+ status: 422,
+ ref body,
+ }) if operation == "create pool" && body == "create rejected"
+ ));
+
+ let requests = resource_requests(&http).await;
+ assert_eq!(requests.len(), 3);
+ assert_request(&requests[0], "GET", ITEM, None);
+ assert_request(
+ &requests[1],
+ "POST",
+ NAMESPACE_COLLECTION,
+ Some(br#"{"name":"example-pool"}"#),
+ );
+ assert_request(&requests[2], "POST", COLLECTION, Some(&json_bytes(&pool())));
+}
+
+#[tokio::test]
+async fn reconcile_returns_unrelated_named_pool_read_error_without_creating() {
+ let http = Arc::new(ScriptedHttpClient::new([
+ Ok(token()),
+ Ok(response(500, b"read failed")),
+ ]));
+ let client = client(Arc::clone(&http));
+
+ assert!(matches!(
+ client
+ .reconcile_pool(CreatePoolRequest {
+ namespace: NAMESPACE.into(),
+ spec: pool_spec(),
+ })
+ .await,
+ Err(SdkError::Status {
+ ref operation,
+ status: 500,
+ ref body,
+ }) if operation == "get pool" && body == "read failed"
+ ));
+
+ let requests = resource_requests(&http).await;
+ assert_eq!(requests.len(), 1);
+ assert_request(&requests[0], "GET", ITEM, None);
+}
+
#[tokio::test]
async fn deletes_pool_before_namespace_and_accepts_empty_delete_bodies() {
let http = Arc::new(ScriptedHttpClient::new([