Skip to main content

UpCloudApi

Trait UpCloudApi 

Source
pub trait UpCloudApi {
Show 31 methods // Required methods fn describe(&self) -> String; fn is_the_account(&self) -> bool; fn account(&self) -> Result<Reply, String>; fn price(&self) -> Result<Reply, String>; fn servers(&self) -> Result<Reply, String>; fn servers_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>; fn server(&self, uuid: &str) -> Result<Reply, String>; fn firewall_rules(&self, uuid: &str) -> Result<Reply, String>; fn storages_private(&self) -> Result<Reply, String>; fn storages_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>; fn storage(&self, uuid: &str) -> Result<Reply, String>; fn zones(&self) -> Result<Reply, String>; fn plans(&self) -> Result<Reply, String>; fn create_server(&self, document: &Value) -> Result<Reply, String>; fn stop_server(&self, uuid: &str, stop: Stop) -> Result<Reply, String>; fn start_server(&self, uuid: &str) -> Result<Reply, String>; fn modify_server_plan( &self, uuid: &str, plan: &str, ) -> Result<Reply, String>; fn set_boot_order( &self, uuid: &str, order: BootOrder, ) -> Result<Reply, String>; fn set_console( &self, uuid: &str, console: Console<'_>, ) -> Result<Reply, String>; fn attach_storage( &self, server: &str, kind: DeviceKind, storage: &str, at: Option<&str>, ) -> Result<Reply, String>; fn detach_storage( &self, server: &str, address: &str, ) -> Result<Reply, String>; fn eject_cdrom(&self, server: &str) -> Result<Reply, String>; fn delete_server( &self, uuid: &str, with: WithStorages, ) -> Result<Reply, String>; fn create_storage(&self, new: &NewStorage<'_>) -> Result<Reply, String>; fn clone_storage( &self, uuid: &str, title: &str, zone: &str, tier: &str, ) -> Result<Reply, String>; fn import_direct_upload(&self, uuid: &str) -> Result<Reply, String>; fn upload_direct(&self, url: &str, file: &Path) -> Result<Reply, String>; fn modify_storage_size(&self, uuid: &str, gb: u64) -> Result<Reply, String>; fn resize_filesystem(&self, uuid: &str) -> Result<Reply, String>; fn delete_storage( &self, uuid: &str, backups: Backups, ) -> Result<Reply, String>; // Provided method fn modify_storage_size_as( &self, uuid: &str, gb: u64, spelling: SizeSpelling, ) -> Result<Reply, String> { ... }
}
Expand description

The UpCloud API 1.3 surface the nordisk estates actually use. Typed in, typed out. Not one method takes a path, a query string or a base URL.

Required Methods§

Source

fn describe(&self) -> String

A word for what answered, for a report that must never read as a measurement of the account when it was not one.

Source

fn is_the_account(&self) -> bool

Is this the real account? A question about the implementation, never a handle to one.

Source

fn account(&self) -> Result<Reply, String>

GET /account. Callers: private-gunnar-ops, gunnar-loadbench, private-holger-ops, monetize-cloud-impl (credential probe, grow judge).

Source

fn price(&self) -> Result<Reply, String>

GET /price. Caller: monetize-cloud-impl price.

Source

fn servers(&self) -> Result<Reply, String>

GET /server. Callers: private-gunnar-ops / private-holger-ops orphan sweeps, gunnar-loadbench.

Source

fn servers_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

GET /server?label=… — every label must match. Caller: monetize-cloud-impl (the label search, and the inventory with none).

Source

fn server(&self, uuid: &str) -> Result<Reply, String>

GET /server/{uuid}. Callers: everywhere.

Source

fn firewall_rules(&self, uuid: &str) -> Result<Reply, String>

GET /server/{uuid}/firewall_rule. Caller: private-gunnar-ops estate.

Source

fn storages_private(&self) -> Result<Reply, String>

GET /storage/private. Callers: the orphan sweeps, gunnar-upcloud (adopting media already on the account).

Source

fn storages_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

GET /storage?label=… — every label must match; no label lists everything the account can see. Caller: monetize-cloud-impl.

Source

fn storage(&self, uuid: &str) -> Result<Reply, String>

GET /storage/{uuid}. Callers: grow, gunnar-upcloud’s online wait, monetize-cloud-impl.

Source

fn zones(&self) -> Result<Reply, String>

GET /zone. Caller: gunnar-loadbench --from-upcloud.

Source

fn plans(&self) -> Result<Reply, String>

GET /plan. Caller: gunnar-loadbench --from-upcloud.

Source

fn create_server(&self, document: &Value) -> Result<Reply, String>

POST /server with the caller’s server document ({"server": {…}}). The DOCUMENT is the caller’s — a plan, a template clone, labels, SSH keys; the PATH is not. Caller: monetize-cloud-impl ensure.

Source

fn stop_server(&self, uuid: &str, stop: Stop) -> Result<Reply, String>

POST /server/{uuid}/stop.

Source

fn start_server(&self, uuid: &str) -> Result<Reply, String>

POST /server/{uuid}/start.

Source

fn modify_server_plan(&self, uuid: &str, plan: &str) -> Result<Reply, String>

PUT /server/{uuid} with a plan — a plan change, which ALSO mints a Resize Backup. Callers: private-gunnar-ops grow, monetize-cloud-impl.

Source

fn set_boot_order(&self, uuid: &str, order: BootOrder) -> Result<Reply, String>

PUT /server/{uuid} with a boot order. Caller: gunnar-upcloud.

Source

fn set_console(&self, uuid: &str, console: Console<'_>) -> Result<Reply, String>

PUT /server/{uuid} toggling the VNC console. Caller: gunnar-upcloud console::open (the toggle that defeats the stale port).

Source

fn attach_storage( &self, server: &str, kind: DeviceKind, storage: &str, at: Option<&str>, ) -> Result<Reply, String>

POST /server/{uuid}/storage/attach, optionally AT an address (virtio, virtio:5). Callers: gunnar-upcloud (no address), monetize-cloud-impl (always an address).

Source

fn detach_storage(&self, server: &str, address: &str) -> Result<Reply, String>

POST /server/{uuid}/storage/detach — names an ADDRESS (ide:0:0, virtio:5), never a storage uuid. Callers: gunnar-upcloud, monetize-cloud-impl.

Source

fn eject_cdrom(&self, server: &str) -> Result<Reply, String>

POST /server/{uuid}/cdrom/eject — legal on a STARTED server (MEASURED). Caller: gunnar-upcloud (the never-loop primitive).

Source

fn delete_server(&self, uuid: &str, with: WithStorages) -> Result<Reply, String>

DELETE /server/{uuid}. This really deletes.

Source

fn create_storage(&self, new: &NewStorage<'_>) -> Result<Reply, String>

POST /storage. Callers: gunnar-upcloud (the seed a medium is imported into), monetize-cloud-impl (a labelled volume).

Source

fn clone_storage( &self, uuid: &str, title: &str, zone: &str, tier: &str, ) -> Result<Reply, String>

POST /storage/{uuid}/clone. Caller: gunnar-upcloud clone_probe.

Source

fn import_direct_upload(&self, uuid: &str) -> Result<Reply, String>

POST /storage/{uuid}/import with source: direct_upload — the reply carries the URL UpCloudApi::upload_direct PUTs to. Caller: gunnar-upcloud.

Source

fn upload_direct(&self, url: &str, file: &Path) -> Result<Reply, String>

PUT <direct_upload_url> with the file’s bytes. The URL is the one UpCloudApi::import_direct_upload answered, is itself a credential (never printed whole; no bearer sent), and must belong to the same cloud this implementation talks to — the account’s upload host for the account, loopback for a mock. Caller: gunnar-upcloud.

Source

fn modify_storage_size(&self, uuid: &str, gb: u64) -> Result<Reply, String>

PUT /storage/{uuid} with a new size as a STRING ("64") — the volume grows. Caller: private-gunnar-ops grow (its spelling since before this crate; unchanged by the port).

Source

fn resize_filesystem(&self, uuid: &str) -> Result<Reply, String>

POST /storage/{uuid}/resize — the FILESYSTEM grows, and the provider mints a Resize Backup that nothing deletes.

Source

fn delete_storage(&self, uuid: &str, backups: Backups) -> Result<Reply, String>

DELETE /storage/{uuid}. This really deletes.

Provided Methods§

Source

fn modify_storage_size_as( &self, uuid: &str, gb: u64, spelling: SizeSpelling, ) -> Result<Reply, String>

PUT /storage/{uuid} with the size spelled as the CALLER has always sent it. A port must not change a request’s wire format, and the two callers disagree: private-gunnar-ops sends a string, monetize-cloud-impl (the live money path) a number — and UpCloud’s own SDK declares sizes int (T7, 2026-09-21). Nobody here holds a recorded account answer that either spelling is accepted where the other is, so neither is chosen for the other. Caller: monetize-cloud-impl grow (SizeSpelling::Number).

The provided body serves String through UpCloudApi::modify_storage_size and REFUSES Number, so an implementation that does not know the other spelling cannot silently send the wrong one; Over implements both.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: UpCloudApi + ?Sized> UpCloudApi for &T

Source§

fn describe(&self) -> String

Source§

fn is_the_account(&self) -> bool

Source§

fn account(&self) -> Result<Reply, String>

Source§

fn price(&self) -> Result<Reply, String>

Source§

fn servers(&self) -> Result<Reply, String>

Source§

fn servers_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

Source§

fn server(&self, uuid: &str) -> Result<Reply, String>

Source§

fn firewall_rules(&self, uuid: &str) -> Result<Reply, String>

Source§

fn storages_private(&self) -> Result<Reply, String>

Source§

fn storages_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

Source§

fn storage(&self, uuid: &str) -> Result<Reply, String>

Source§

fn zones(&self) -> Result<Reply, String>

Source§

fn plans(&self) -> Result<Reply, String>

Source§

fn create_server(&self, document: &Value) -> Result<Reply, String>

Source§

fn stop_server(&self, uuid: &str, stop: Stop) -> Result<Reply, String>

Source§

fn start_server(&self, uuid: &str) -> Result<Reply, String>

Source§

fn modify_server_plan(&self, uuid: &str, plan: &str) -> Result<Reply, String>

Source§

fn set_boot_order(&self, uuid: &str, order: BootOrder) -> Result<Reply, String>

Source§

fn set_console(&self, uuid: &str, console: Console<'_>) -> Result<Reply, String>

Source§

fn attach_storage( &self, server: &str, kind: DeviceKind, storage: &str, at: Option<&str>, ) -> Result<Reply, String>

Source§

fn detach_storage(&self, server: &str, address: &str) -> Result<Reply, String>

Source§

fn eject_cdrom(&self, server: &str) -> Result<Reply, String>

Source§

fn delete_server(&self, uuid: &str, with: WithStorages) -> Result<Reply, String>

Source§

fn create_storage(&self, new: &NewStorage<'_>) -> Result<Reply, String>

Source§

fn clone_storage( &self, uuid: &str, title: &str, zone: &str, tier: &str, ) -> Result<Reply, String>

Source§

fn import_direct_upload(&self, uuid: &str) -> Result<Reply, String>

Source§

fn upload_direct(&self, url: &str, file: &Path) -> Result<Reply, String>

Source§

fn modify_storage_size(&self, uuid: &str, gb: u64) -> Result<Reply, String>

Source§

fn modify_storage_size_as( &self, uuid: &str, gb: u64, spelling: SizeSpelling, ) -> Result<Reply, String>

Source§

fn resize_filesystem(&self, uuid: &str) -> Result<Reply, String>

Source§

fn delete_storage(&self, uuid: &str, backups: Backups) -> Result<Reply, String>

Source§

impl<T: UpCloudApi + ?Sized> UpCloudApi for Box<T>

Source§

fn describe(&self) -> String

Source§

fn is_the_account(&self) -> bool

Source§

fn account(&self) -> Result<Reply, String>

Source§

fn price(&self) -> Result<Reply, String>

Source§

fn servers(&self) -> Result<Reply, String>

Source§

fn servers_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

Source§

fn server(&self, uuid: &str) -> Result<Reply, String>

Source§

fn firewall_rules(&self, uuid: &str) -> Result<Reply, String>

Source§

fn storages_private(&self) -> Result<Reply, String>

Source§

fn storages_labelled(&self, labels: &[Label<'_>]) -> Result<Reply, String>

Source§

fn storage(&self, uuid: &str) -> Result<Reply, String>

Source§

fn zones(&self) -> Result<Reply, String>

Source§

fn plans(&self) -> Result<Reply, String>

Source§

fn create_server(&self, document: &Value) -> Result<Reply, String>

Source§

fn stop_server(&self, uuid: &str, stop: Stop) -> Result<Reply, String>

Source§

fn start_server(&self, uuid: &str) -> Result<Reply, String>

Source§

fn modify_server_plan(&self, uuid: &str, plan: &str) -> Result<Reply, String>

Source§

fn set_boot_order(&self, uuid: &str, order: BootOrder) -> Result<Reply, String>

Source§

fn set_console(&self, uuid: &str, console: Console<'_>) -> Result<Reply, String>

Source§

fn attach_storage( &self, server: &str, kind: DeviceKind, storage: &str, at: Option<&str>, ) -> Result<Reply, String>

Source§

fn detach_storage(&self, server: &str, address: &str) -> Result<Reply, String>

Source§

fn eject_cdrom(&self, server: &str) -> Result<Reply, String>

Source§

fn delete_server(&self, uuid: &str, with: WithStorages) -> Result<Reply, String>

Source§

fn create_storage(&self, new: &NewStorage<'_>) -> Result<Reply, String>

Source§

fn clone_storage( &self, uuid: &str, title: &str, zone: &str, tier: &str, ) -> Result<Reply, String>

Source§

fn import_direct_upload(&self, uuid: &str) -> Result<Reply, String>

Source§

fn upload_direct(&self, url: &str, file: &Path) -> Result<Reply, String>

Source§

fn modify_storage_size(&self, uuid: &str, gb: u64) -> Result<Reply, String>

Source§

fn modify_storage_size_as( &self, uuid: &str, gb: u64, spelling: SizeSpelling, ) -> Result<Reply, String>

Source§

fn resize_filesystem(&self, uuid: &str) -> Result<Reply, String>

Source§

fn delete_storage(&self, uuid: &str, backups: Backups) -> Result<Reply, String>

Implementors§