This commit is contained in:
2025-12-25 13:59:50 +01:00
commit 24611e05c9
206 changed files with 13603 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
pub client: reqwest::Client,
pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
}
pub type BasicAuth = (String, Option<String>);
#[derive(Debug, Clone)]
pub struct ApiKey {
pub prefix: Option<String>,
pub key: String,
}
impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
}
}
impl Default for Configuration {
fn default() -> Self {
Configuration {
base_path: "https://www.servercontrolpanel.de/scp-core".to_owned(),
user_agent: Some("OpenAPI-Generator/2025.1218.164029/rust".to_owned()),
client: reqwest::Client::new(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}

File diff suppressed because it is too large Load Diff

116
scp_core/src/apis/mod.rs Normal file
View File

@@ -0,0 +1,116 @@
use std::error;
use std::fmt;
#[derive(Debug, Clone)]
pub struct ResponseContent<T> {
pub status: reqwest::StatusCode,
pub content: String,
pub entity: Option<T>,
}
#[derive(Debug)]
pub enum Error<T> {
Reqwest(reqwest::Error),
Serde(serde_json::Error),
Io(std::io::Error),
ResponseError(ResponseContent<T>),
}
impl <T> fmt::Display for Error<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let (module, e) = match self {
Error::Reqwest(e) => ("reqwest", e.to_string()),
Error::Serde(e) => ("serde", e.to_string()),
Error::Io(e) => ("IO", e.to_string()),
Error::ResponseError(e) => ("response", format!("status code {}", e.status)),
};
write!(f, "error in {}: {}", module, e)
}
}
impl <T: fmt::Debug> error::Error for Error<T> {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
Some(match self {
Error::Reqwest(e) => e,
Error::Serde(e) => e,
Error::Io(e) => e,
Error::ResponseError(_) => return None,
})
}
}
impl <T> From<reqwest::Error> for Error<T> {
fn from(e: reqwest::Error) -> Self {
Error::Reqwest(e)
}
}
impl <T> From<serde_json::Error> for Error<T> {
fn from(e: serde_json::Error) -> Self {
Error::Serde(e)
}
}
impl <T> From<std::io::Error> for Error<T> {
fn from(e: std::io::Error) -> Self {
Error::Io(e)
}
}
pub fn urlencode<T: AsRef<str>>(s: T) -> String {
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
}
pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> {
if let serde_json::Value::Object(object) = value {
let mut params = vec![];
for (key, value) in object {
match value {
serde_json::Value::Object(_) => params.append(&mut parse_deep_object(
&format!("{}[{}]", prefix, key),
value,
)),
serde_json::Value::Array(array) => {
for (i, value) in array.iter().enumerate() {
params.append(&mut parse_deep_object(
&format!("{}[{}][{}]", prefix, key, i),
value,
));
}
},
serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())),
_ => params.push((format!("{}[{}]", prefix, key), value.to_string())),
}
}
return params;
}
unimplemented!("Only objects are supported with style=deepObject")
}
/// Internal use only
/// A content type supported by this client.
#[allow(dead_code)]
enum ContentType {
Json,
Text,
Unsupported(String)
}
impl From<&str> for ContentType {
fn from(content_type: &str) -> Self {
if content_type.starts_with("application") && content_type.contains("json") {
return Self::Json;
} else if content_type.starts_with("text/plain") {
return Self::Text;
} else {
return Self::Unsupported(content_type.to_string());
}
}
}
pub mod default_api;
pub mod configuration;

11
scp_core/src/lib.rs Normal file
View File

@@ -0,0 +1,11 @@
#![allow(unused_imports)]
#![allow(clippy::too_many_arguments)]
extern crate serde_repr;
extern crate serde;
extern crate serde_json;
extern crate url;
extern crate reqwest;
pub mod apis;
pub mod models;

View File

@@ -0,0 +1,34 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiV1ServersServerIdPatchRequest {
ServerStatePatch(Box<models::ServerStatePatch>),
ServerAutostartPatch(Box<models::ServerAutostartPatch>),
ServerBootorderPatch(Box<models::ServerBootorderPatch>),
ServerOsOptimizationPatch(Box<models::ServerOsOptimizationPatch>),
ServerCpuTopologyPatch(Box<models::ServerCpuTopologyPatch>),
ServerUefiPatch(Box<models::ServerUefiPatch>),
ServerHostnamePatch(Box<models::ServerHostnamePatch>),
ServerNicknamePatch(Box<models::ServerNicknamePatch>),
ServerKeyboardLayoutPatch(Box<models::ServerKeyboardLayoutPatch>),
ServerSetRootPasswordPatch(Box<models::ServerSetRootPasswordPatch>),
}
impl Default for ApiV1ServersServerIdPatchRequest {
fn default() -> Self {
Self::ServerStatePatch(Default::default())
}
}

View File

@@ -0,0 +1,38 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Architecture {
#[serde(rename = "AMD64")]
Amd64,
#[serde(rename = "ARM64")]
Arm64,
}
impl std::fmt::Display for Architecture {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Amd64 => write!(f, "AMD64"),
Self::Arm64 => write!(f, "ARM64"),
}
}
}
impl Default for Architecture {
fn default() -> Architecture {
Self::Amd64
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BandwidthClass {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "speedInMBit")]
pub speed_in_m_bit: i32,
}
impl BandwidthClass {
pub fn new(name: String, speed_in_m_bit: i32) -> BandwidthClass {
BandwidthClass {
id: None,
name,
speed_in_m_bit,
}
}
}

View File

@@ -0,0 +1,41 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Bootorder {
#[serde(rename = "HDD")]
Hdd,
#[serde(rename = "CDROM")]
Cdrom,
#[serde(rename = "NETWORK")]
Network,
}
impl std::fmt::Display for Bootorder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Hdd => write!(f, "HDD"),
Self::Cdrom => write!(f, "CDROM"),
Self::Network => write!(f, "NETWORK"),
}
}
}
impl Default for Bootorder {
fn default() -> Bootorder {
Self::Hdd
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CpuTopology {
#[serde(rename = "socketCount", skip_serializing_if = "Option::is_none")]
pub socket_count: Option<i32>,
#[serde(rename = "coresPerSocketCount", skip_serializing_if = "Option::is_none")]
pub cores_per_socket_count: Option<i32>,
}
impl CpuTopology {
pub fn new() -> CpuTopology {
CpuTopology {
socket_count: None,
cores_per_socket_count: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Disk {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "allocationInMiB", skip_serializing_if = "Option::is_none")]
pub allocation_in_mi_b: Option<i64>,
#[serde(rename = "capacityInMiB", skip_serializing_if = "Option::is_none")]
pub capacity_in_mi_b: Option<i64>,
#[serde(rename = "storageDriver", skip_serializing_if = "Option::is_none")]
pub storage_driver: Option<models::StorageDriver>,
}
impl Disk {
pub fn new() -> Disk {
Disk {
name: None,
allocation_in_mi_b: None,
capacity_in_mi_b: None,
storage_driver: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EditDisksDriver {
#[serde(rename = "driver")]
pub driver: models::StorageDriver,
}
impl EditDisksDriver {
pub fn new(driver: models::StorageDriver) -> EditDisksDriver {
EditDisksDriver {
driver,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FailoverIpv4 {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
#[serde(rename = "cidrSuffix", skip_serializing_if = "Option::is_none")]
pub cidr_suffix: Option<i32>,
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
pub user: Option<Box<models::UserMinimal>>,
#[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
pub editable: Option<bool>,
#[serde(rename = "site", skip_serializing_if = "Option::is_none")]
pub site: Option<Box<models::Site>>,
#[serde(rename = "server", skip_serializing_if = "Option::is_none")]
pub server: Option<Box<models::ServerMinimal>>,
}
impl FailoverIpv4 {
pub fn new() -> FailoverIpv4 {
FailoverIpv4 {
id: None,
ip: None,
cidr_suffix: None,
user: None,
editable: None,
site: None,
server: None,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FailoverIpv6 {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "networkPrefix", skip_serializing_if = "Option::is_none")]
pub network_prefix: Option<String>,
#[serde(rename = "networkPrefixLength", skip_serializing_if = "Option::is_none")]
pub network_prefix_length: Option<i32>,
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
pub user: Option<Box<models::UserMinimal>>,
#[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
pub editable: Option<bool>,
#[serde(rename = "site", skip_serializing_if = "Option::is_none")]
pub site: Option<Box<models::Site>>,
#[serde(rename = "server", skip_serializing_if = "Option::is_none")]
pub server: Option<Box<models::ServerMinimal>>,
}
impl FailoverIpv6 {
pub fn new() -> FailoverIpv6 {
FailoverIpv6 {
id: None,
network_prefix: None,
network_prefix_length: None,
user: None,
editable: None,
site: None,
server: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FieldError {
#[serde(rename = "field", skip_serializing_if = "Option::is_none")]
pub field: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl FieldError {
pub fn new() -> FieldError {
FieldError {
field: None,
message: None,
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FirewallAction {
#[serde(rename = "ACCEPT")]
Accept,
#[serde(rename = "DROP")]
Drop,
}
impl std::fmt::Display for FirewallAction {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Accept => write!(f, "ACCEPT"),
Self::Drop => write!(f, "DROP"),
}
}
}
impl Default for FirewallAction {
fn default() -> FirewallAction {
Self::Accept
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirewallPolicy {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<models::FirewallRule>>,
#[serde(rename = "countOfAffectedServers", skip_serializing_if = "Option::is_none")]
pub count_of_affected_servers: Option<i32>,
}
impl FirewallPolicy {
pub fn new() -> FirewallPolicy {
FirewallPolicy {
id: None,
name: None,
description: None,
rules: None,
count_of_affected_servers: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirewallPolicySave {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<models::FirewallRule>>,
}
impl FirewallPolicySave {
pub fn new(name: String) -> FirewallPolicySave {
FirewallPolicySave {
name,
description: None,
rules: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirewallPolicyUpdateResult {
#[serde(rename = "firewallPolicy", skip_serializing_if = "Option::is_none")]
pub firewall_policy: Option<Box<models::FirewallPolicy>>,
#[serde(rename = "taskInfo", skip_serializing_if = "Option::is_none")]
pub task_info: Option<Box<models::TaskInfo>>,
}
impl FirewallPolicyUpdateResult {
pub fn new() -> FirewallPolicyUpdateResult {
FirewallPolicyUpdateResult {
firewall_policy: None,
task_info: None,
}
}
}

View File

@@ -0,0 +1,44 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FirewallProtocol {
#[serde(rename = "TCP")]
Tcp,
#[serde(rename = "UDP")]
Udp,
#[serde(rename = "ICMP")]
Icmp,
#[serde(rename = "ICMPv6")]
Icmpv6,
}
impl std::fmt::Display for FirewallProtocol {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Tcp => write!(f, "TCP"),
Self::Udp => write!(f, "UDP"),
Self::Icmp => write!(f, "ICMP"),
Self::Icmpv6 => write!(f, "ICMPv6"),
}
}
}
impl Default for FirewallProtocol {
fn default() -> FirewallProtocol {
Self::Tcp
}
}

View File

@@ -0,0 +1,55 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirewallRule {
#[serde(rename = "numberOfEffectiveRules", skip_serializing_if = "Option::is_none")]
pub number_of_effective_rules: Option<i32>,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "direction")]
pub direction: models::FirewallRuleDirection,
#[serde(rename = "protocol")]
pub protocol: models::FirewallProtocol,
#[serde(rename = "action")]
pub action: models::FirewallAction,
/// Valid configurations are any IP (null or empty array), IPv4/IPv6 address (f.e. 192.168.10.1 or 0092:e10f:cb66:35a9::) or IPv4 network / IPv6 prefix (f.e. 192.168.10.0/24 or 0092:e10f:cb66:35a9::/64). If more than one IP/network is specified for the source, the destination must be empty (any) or contain only a single IP/network. If IPv4 addresses and IPv6 addresses are mixed in sources, destinations must empty (any).
#[serde(rename = "sources", skip_serializing_if = "Option::is_none")]
pub sources: Option<Vec<String>>,
/// Valid configurations are any port (null), single port (f.e. 1234) or port range (f.e. 1024-65535).
#[serde(rename = "sourcePorts", skip_serializing_if = "Option::is_none")]
pub source_ports: Option<String>,
/// Valid configurations are any IP (null or empty array), IPv4/IPv6 address (f.e. 192.168.10.1 or 0092:e10f:cb66:35a9::) or IPv4 network / IPv6 prefix (f.e. 192.168.10.0/24 or 0092:e10f:cb66:35a9::/64). If more than one IP/network is specified for the destination, the source must be empty (any) or contain only a single IP/network. If IPv4 addresses and IPv6 addresses are mixed in destinations, sources must be empty (any).
#[serde(rename = "destinations", skip_serializing_if = "Option::is_none")]
pub destinations: Option<Vec<String>>,
/// Valid configurations are any port (null), single port (f.e. 1234) or port range (f.e. 1024-65535).
#[serde(rename = "destinationPorts", skip_serializing_if = "Option::is_none")]
pub destination_ports: Option<String>,
}
impl FirewallRule {
pub fn new(direction: models::FirewallRuleDirection, protocol: models::FirewallProtocol, action: models::FirewallAction) -> FirewallRule {
FirewallRule {
number_of_effective_rules: None,
description: None,
direction,
protocol,
action,
sources: None,
source_ports: None,
destinations: None,
destination_ports: None,
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FirewallRuleDirection {
#[serde(rename = "INGRESS")]
Ingress,
#[serde(rename = "EGRESS")]
Egress,
}
impl std::fmt::Display for FirewallRuleDirection {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Ingress => write!(f, "INGRESS"),
Self::Egress => write!(f, "EGRESS"),
}
}
}
impl Default for FirewallRuleDirection {
fn default() -> FirewallRuleDirection {
Self::Ingress
}
}

View File

@@ -0,0 +1,31 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GuestAgentData {
#[serde(rename = "guestAgentAvailable", skip_serializing_if = "Option::is_none")]
pub guest_agent_available: Option<bool>,
/// Information in json format about the qemu guest agent, which may change depending on the version. We do not guarantee backwards compatibility for this data.
#[serde(rename = "guestAgentData", skip_serializing_if = "Option::is_none")]
pub guest_agent_data: Option<serde_json::Value>,
}
impl GuestAgentData {
pub fn new() -> GuestAgentData {
GuestAgentData {
guest_agent_available: None,
guest_agent_data: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IdentifierInt {
#[serde(rename = "id")]
pub id: i32,
}
impl IdentifierInt {
pub fn new(id: i32) -> IdentifierInt {
IdentifierInt {
id,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ImageFlavour {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "alias")]
pub alias: String,
#[serde(rename = "text")]
pub text: String,
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<Box<models::ImageMinimal>>,
}
impl ImageFlavour {
pub fn new(name: String, alias: String, text: String) -> ImageFlavour {
ImageFlavour {
id: None,
name,
alias,
text,
image: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ImageMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
}
impl ImageMinimal {
pub fn new(name: String) -> ImageMinimal {
ImageMinimal {
id: None,
name,
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ImplicitRule {
#[serde(rename = "ACCEPT_ALL")]
AcceptAll,
#[serde(rename = "DROP_ALL")]
DropAll,
}
impl std::fmt::Display for ImplicitRule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::AcceptAll => write!(f, "ACCEPT_ALL"),
Self::DropAll => write!(f, "DROP_ALL"),
}
}
}
impl Default for ImplicitRule {
fn default() -> ImplicitRule {
Self::AcceptAll
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Interface {
#[serde(rename = "mac", skip_serializing_if = "Option::is_none")]
pub mac: Option<String>,
#[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "speedInMBits", skip_serializing_if = "Option::is_none")]
pub speed_in_m_bits: Option<i32>,
#[serde(rename = "ipv4Addresses", skip_serializing_if = "Option::is_none")]
pub ipv4_addresses: Option<Vec<models::ServerIpv4>>,
#[serde(rename = "ipv6Addresses", skip_serializing_if = "Option::is_none")]
pub ipv6_addresses: Option<Vec<models::ServerIpv6>>,
}
impl Interface {
pub fn new() -> Interface {
Interface {
mac: None,
driver: None,
speed_in_m_bits: None,
ipv4_addresses: None,
ipv6_addresses: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Ipv4AddressMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
#[serde(rename = "netmask", skip_serializing_if = "Option::is_none")]
pub netmask: Option<String>,
#[serde(rename = "gateway", skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "broadcast", skip_serializing_if = "Option::is_none")]
pub broadcast: Option<String>,
}
impl Ipv4AddressMinimal {
pub fn new() -> Ipv4AddressMinimal {
Ipv4AddressMinimal {
id: None,
ip: None,
netmask: None,
gateway: None,
broadcast: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Ipv6AddressMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "networkPrefix", skip_serializing_if = "Option::is_none")]
pub network_prefix: Option<String>,
#[serde(rename = "networkPrefixLength", skip_serializing_if = "Option::is_none")]
pub network_prefix_length: Option<i32>,
#[serde(rename = "gateway", skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
}
impl Ipv6AddressMinimal {
pub fn new() -> Ipv6AddressMinimal {
Ipv6AddressMinimal {
id: None,
network_prefix: None,
network_prefix_length: None,
gateway: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Iso {
#[serde(rename = "isoAttached", skip_serializing_if = "Option::is_none")]
pub iso_attached: Option<bool>,
#[serde(rename = "iso", skip_serializing_if = "Option::is_none")]
pub iso: Option<String>,
}
impl Iso {
pub fn new() -> Iso {
Iso {
iso_attached: None,
iso: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IsoImage {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "architecture")]
pub architecture: models::Architecture,
}
impl IsoImage {
pub fn new(name: String, architecture: models::Architecture) -> IsoImage {
IsoImage {
id: None,
name,
description: None,
architecture,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Log {
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<models::LogType>,
#[serde(rename = "executingUser", skip_serializing_if = "Option::is_none")]
pub executing_user: Option<Box<models::UserMinimal>>,
#[serde(rename = "date", skip_serializing_if = "Option::is_none")]
pub date: Option<String>,
#[serde(rename = "logKey", skip_serializing_if = "Option::is_none")]
pub log_key: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl Log {
pub fn new() -> Log {
Log {
r#type: None,
executing_user: None,
date: None,
log_key: None,
message: None,
}
}
}

View File

@@ -0,0 +1,41 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LogType {
#[serde(rename = "ERROR")]
Error,
#[serde(rename = "WARNING")]
Warning,
#[serde(rename = "INFO")]
Info,
}
impl std::fmt::Display for LogType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Error => write!(f, "ERROR"),
Self::Warning => write!(f, "WARNING"),
Self::Info => write!(f, "INFO"),
}
}
}
impl Default for LogType {
fn default() -> LogType {
Self::Error
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Maintenance {
#[serde(rename = "startAt")]
pub start_at: String,
#[serde(rename = "finishAt")]
pub finish_at: String,
}
impl Maintenance {
pub fn new(start_at: String, finish_at: String) -> Maintenance {
Maintenance {
start_at,
finish_at,
}
}
}

188
scp_core/src/models/mod.rs Normal file
View File

@@ -0,0 +1,188 @@
pub mod _api_v1_servers__server_id__patch_request;
pub use self::_api_v1_servers__server_id__patch_request::ApiV1ServersServerIdPatchRequest;
pub mod architecture;
pub use self::architecture::Architecture;
pub mod bandwidth_class;
pub use self::bandwidth_class::BandwidthClass;
pub mod bootorder;
pub use self::bootorder::Bootorder;
pub mod cpu_topology;
pub use self::cpu_topology::CpuTopology;
pub mod disk;
pub use self::disk::Disk;
pub mod edit_disks_driver;
pub use self::edit_disks_driver::EditDisksDriver;
pub mod failover_ipv4;
pub use self::failover_ipv4::FailoverIpv4;
pub mod failover_ipv6;
pub use self::failover_ipv6::FailoverIpv6;
pub mod field_error;
pub use self::field_error::FieldError;
pub mod firewall_action;
pub use self::firewall_action::FirewallAction;
pub mod firewall_policy;
pub use self::firewall_policy::FirewallPolicy;
pub mod firewall_policy_save;
pub use self::firewall_policy_save::FirewallPolicySave;
pub mod firewall_policy_update_result;
pub use self::firewall_policy_update_result::FirewallPolicyUpdateResult;
pub mod firewall_protocol;
pub use self::firewall_protocol::FirewallProtocol;
pub mod firewall_rule;
pub use self::firewall_rule::FirewallRule;
pub mod firewall_rule_direction;
pub use self::firewall_rule_direction::FirewallRuleDirection;
pub mod guest_agent_data;
pub use self::guest_agent_data::GuestAgentData;
pub mod identifier_int;
pub use self::identifier_int::IdentifierInt;
pub mod image_flavour;
pub use self::image_flavour::ImageFlavour;
pub mod image_minimal;
pub use self::image_minimal::ImageMinimal;
pub mod implicit_rule;
pub use self::implicit_rule::ImplicitRule;
pub mod interface;
pub use self::interface::Interface;
pub mod ipv4_address_minimal;
pub use self::ipv4_address_minimal::Ipv4AddressMinimal;
pub mod ipv6_address_minimal;
pub use self::ipv6_address_minimal::Ipv6AddressMinimal;
pub mod iso;
pub use self::iso::Iso;
pub mod iso_image;
pub use self::iso_image::IsoImage;
pub mod log;
pub use self::log::Log;
pub mod log_type;
pub use self::log_type::LogType;
pub mod maintenance;
pub use self::maintenance::Maintenance;
pub mod network_driver;
pub use self::network_driver::NetworkDriver;
pub mod not_found_error;
pub use self::not_found_error::NotFoundError;
pub mod os_optimization;
pub use self::os_optimization::OsOptimization;
pub mod rdns_ipv4;
pub use self::rdns_ipv4::RdnsIpv4;
pub mod rdns_ipv6;
pub use self::rdns_ipv6::RdnsIpv6;
pub mod rescue_system_status;
pub use self::rescue_system_status::RescueSystemStatus;
pub mod response_error;
pub use self::response_error::ResponseError;
pub mod route_failover_ip;
pub use self::route_failover_ip::RouteFailoverIp;
pub mod s3_completed_part;
pub use self::s3_completed_part::S3CompletedPart;
pub mod s3_download_infos;
pub use self::s3_download_infos::S3DownloadInfos;
pub mod s3_no_such_upload_error;
pub use self::s3_no_such_upload_error::S3NoSuchUploadError;
pub mod s3_object;
pub use self::s3_object::S3Object;
pub mod s3_sign_part_url;
pub use self::s3_sign_part_url::S3SignPartUrl;
pub mod s3_upload;
pub use self::s3_upload::S3Upload;
pub mod server;
pub use self::server::Server;
pub mod server_attach_iso;
pub use self::server_attach_iso::ServerAttachIso;
pub mod server_autostart_patch;
pub use self::server_autostart_patch::ServerAutostartPatch;
pub mod server_bootorder_patch;
pub use self::server_bootorder_patch::ServerBootorderPatch;
pub mod server_cpu_topology_patch;
pub use self::server_cpu_topology_patch::ServerCpuTopologyPatch;
pub mod server_create_nic_vlan;
pub use self::server_create_nic_vlan::ServerCreateNicVlan;
pub mod server_disk;
pub use self::server_disk::ServerDisk;
pub mod server_firewall;
pub use self::server_firewall::ServerFirewall;
pub mod server_firewall_save;
pub use self::server_firewall_save::ServerFirewallSave;
pub mod server_hostname_patch;
pub use self::server_hostname_patch::ServerHostnamePatch;
pub mod server_image_setup;
pub use self::server_image_setup::ServerImageSetup;
pub mod server_info;
pub use self::server_info::ServerInfo;
pub mod server_interface;
pub use self::server_interface::ServerInterface;
pub mod server_interface_update;
pub use self::server_interface_update::ServerInterfaceUpdate;
pub mod server_ip_type;
pub use self::server_ip_type::ServerIpType;
pub mod server_ipv4;
pub use self::server_ipv4::ServerIpv4;
pub mod server_ipv6;
pub use self::server_ipv6::ServerIpv6;
pub mod server_keyboard_layout_patch;
pub use self::server_keyboard_layout_patch::ServerKeyboardLayoutPatch;
pub mod server_list_minimal;
pub use self::server_list_minimal::ServerListMinimal;
pub mod server_minimal;
pub use self::server_minimal::ServerMinimal;
pub mod server_nickname_patch;
pub use self::server_nickname_patch::ServerNicknamePatch;
pub mod server_os_optimization_patch;
pub use self::server_os_optimization_patch::ServerOsOptimizationPatch;
pub mod server_set_root_password_patch;
pub use self::server_set_root_password_patch::ServerSetRootPasswordPatch;
pub mod server_snapshot_create;
pub use self::server_snapshot_create::ServerSnapshotCreate;
pub mod server_snapshot_create_check;
pub use self::server_snapshot_create_check::ServerSnapshotCreateCheck;
pub mod server_state;
pub use self::server_state::ServerState;
pub mod server_state1;
pub use self::server_state1::ServerState1;
pub mod server_state_patch;
pub use self::server_state_patch::ServerStatePatch;
pub mod server_template_minimal;
pub use self::server_template_minimal::ServerTemplateMinimal;
pub mod server_uefi_patch;
pub use self::server_uefi_patch::ServerUefiPatch;
pub mod server_user_image_setup;
pub use self::server_user_image_setup::ServerUserImageSetup;
pub mod set_rdns_ipv4;
pub use self::set_rdns_ipv4::SetRdnsIpv4;
pub mod set_rdns_ipv6;
pub use self::set_rdns_ipv6::SetRdnsIpv6;
pub mod site;
pub use self::site::Site;
pub mod snapshot;
pub use self::snapshot::Snapshot;
pub mod snapshot_minimal;
pub use self::snapshot_minimal::SnapshotMinimal;
pub mod ssh_key;
pub use self::ssh_key::SshKey;
pub mod storage_driver;
pub use self::storage_driver::StorageDriver;
pub mod storage_optimization;
pub use self::storage_optimization::StorageOptimization;
pub mod task_info;
pub use self::task_info::TaskInfo;
pub mod task_info_minimal;
pub use self::task_info_minimal::TaskInfoMinimal;
pub mod task_info_step;
pub use self::task_info_step::TaskInfoStep;
pub mod task_progress;
pub use self::task_progress::TaskProgress;
pub mod task_state;
pub use self::task_state::TaskState;
pub mod user;
pub use self::user::User;
pub mod user_minimal;
pub use self::user_minimal::UserMinimal;
pub mod user_save;
pub use self::user_save::UserSave;
pub mod v_lan;
pub use self::v_lan::VLan;
pub mod v_lan_save;
pub use self::v_lan_save::VLanSave;
pub mod validation_error;
pub use self::validation_error::ValidationError;

View File

@@ -0,0 +1,47 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum NetworkDriver {
#[serde(rename = "VIRTIO")]
Virtio,
#[serde(rename = "E1000")]
E1000,
#[serde(rename = "E1000E")]
E1000E,
#[serde(rename = "RTL8139")]
Rtl8139,
#[serde(rename = "VMXNET3")]
Vmxnet3,
}
impl std::fmt::Display for NetworkDriver {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Virtio => write!(f, "VIRTIO"),
Self::E1000 => write!(f, "E1000"),
Self::E1000E => write!(f, "E1000E"),
Self::Rtl8139 => write!(f, "RTL8139"),
Self::Vmxnet3 => write!(f, "VMXNET3"),
}
}
}
impl Default for NetworkDriver {
fn default() -> NetworkDriver {
Self::Virtio
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotFoundError {
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl NotFoundError {
pub fn new() -> NotFoundError {
NotFoundError {
code: None,
message: None,
}
}
}

View File

@@ -0,0 +1,47 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OsOptimization {
#[serde(rename = "LINUX")]
Linux,
#[serde(rename = "WINDOWS")]
Windows,
#[serde(rename = "BSD")]
Bsd,
#[serde(rename = "LINUX_LEGACY")]
LinuxLegacy,
#[serde(rename = "UNKNOWN")]
Unknown,
}
impl std::fmt::Display for OsOptimization {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Linux => write!(f, "LINUX"),
Self::Windows => write!(f, "WINDOWS"),
Self::Bsd => write!(f, "BSD"),
Self::LinuxLegacy => write!(f, "LINUX_LEGACY"),
Self::Unknown => write!(f, "UNKNOWN"),
}
}
}
impl Default for OsOptimization {
fn default() -> OsOptimization {
Self::Linux
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RdnsIpv4 {
#[serde(rename = "rdns", skip_serializing_if = "Option::is_none")]
pub rdns: Option<String>,
}
impl RdnsIpv4 {
pub fn new() -> RdnsIpv4 {
RdnsIpv4 {
rdns: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RdnsIpv6 {
#[serde(rename = "rdns", skip_serializing_if = "Option::is_none")]
pub rdns: Option<std::collections::HashMap<String, String>>,
}
impl RdnsIpv6 {
pub fn new() -> RdnsIpv6 {
RdnsIpv6 {
rdns: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RescueSystemStatus {
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "password", skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
}
impl RescueSystemStatus {
pub fn new() -> RescueSystemStatus {
RescueSystemStatus {
active: None,
password: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResponseError {
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl ResponseError {
pub fn new() -> ResponseError {
ResponseError {
code: None,
message: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RouteFailoverIp {
#[serde(rename = "serverId", skip_serializing_if = "Option::is_none")]
pub server_id: Option<i32>,
}
impl RouteFailoverIp {
pub fn new() -> RouteFailoverIp {
RouteFailoverIp {
server_id: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3CompletedPart {
#[serde(rename = "ETag", skip_serializing_if = "Option::is_none")]
pub e_tag: Option<String>,
#[serde(rename = "partNumber", skip_serializing_if = "Option::is_none")]
pub part_number: Option<i32>,
}
impl S3CompletedPart {
pub fn new() -> S3CompletedPart {
S3CompletedPart {
e_tag: None,
part_number: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3DownloadInfos {
#[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
pub filename: Option<String>,
#[serde(rename = "presignedUrl", skip_serializing_if = "Option::is_none")]
pub presigned_url: Option<String>,
#[serde(rename = "presignedUrlValidityDurationInHours", skip_serializing_if = "Option::is_none")]
pub presigned_url_validity_duration_in_hours: Option<i32>,
#[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
pub headers: Option<std::collections::HashMap<String, Vec<String>>>,
}
impl S3DownloadInfos {
pub fn new() -> S3DownloadInfos {
S3DownloadInfos {
filename: None,
presigned_url: None,
presigned_url_validity_duration_in_hours: None,
headers: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3NoSuchUploadError {
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl S3NoSuchUploadError {
pub fn new() -> S3NoSuchUploadError {
S3NoSuchUploadError {
code: None,
message: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3Object {
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "lastModified", skip_serializing_if = "Option::is_none")]
pub last_modified: Option<String>,
#[serde(rename = "sizeInB", skip_serializing_if = "Option::is_none")]
pub size_in_b: Option<i64>,
}
impl S3Object {
pub fn new() -> S3Object {
S3Object {
key: None,
last_modified: None,
size_in_b: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3SignPartUrl {
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl S3SignPartUrl {
pub fn new() -> S3SignPartUrl {
S3SignPartUrl {
url: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct S3Upload {
#[serde(rename = "uploadId", skip_serializing_if = "Option::is_none")]
pub upload_id: Option<String>,
#[serde(rename = "presignedUrl", skip_serializing_if = "Option::is_none")]
pub presigned_url: Option<String>,
}
impl S3Upload {
pub fn new() -> S3Upload {
S3Upload {
upload_id: None,
presigned_url: None,
}
}
}

View File

@@ -0,0 +1,72 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Server {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "nickname", skip_serializing_if = "Option::is_none")]
pub nickname: Option<String>,
#[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
pub disabled: Option<bool>,
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
pub template: Option<Box<models::ServerTemplateMinimal>>,
#[serde(rename = "serverLiveInfo", skip_serializing_if = "Option::is_none")]
pub server_live_info: Option<Box<models::ServerInfo>>,
#[serde(rename = "ipv4Addresses", skip_serializing_if = "Option::is_none")]
pub ipv4_addresses: Option<Vec<models::Ipv4AddressMinimal>>,
#[serde(rename = "ipv6Addresses", skip_serializing_if = "Option::is_none")]
pub ipv6_addresses: Option<Vec<models::Ipv6AddressMinimal>>,
#[serde(rename = "site", skip_serializing_if = "Option::is_none")]
pub site: Option<Box<models::Site>>,
#[serde(rename = "snapshotCount", skip_serializing_if = "Option::is_none")]
pub snapshot_count: Option<i32>,
#[serde(rename = "maxCpuCount", skip_serializing_if = "Option::is_none")]
pub max_cpu_count: Option<i32>,
#[serde(rename = "disksAvailableSpaceInMiB", skip_serializing_if = "Option::is_none")]
pub disks_available_space_in_mi_b: Option<i64>,
#[serde(rename = "rescueSystemActive", skip_serializing_if = "Option::is_none")]
pub rescue_system_active: Option<bool>,
#[serde(rename = "snapshotAllowed", skip_serializing_if = "Option::is_none")]
pub snapshot_allowed: Option<bool>,
#[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
pub architecture: Option<models::Architecture>,
}
impl Server {
pub fn new() -> Server {
Server {
id: None,
name: None,
hostname: None,
nickname: None,
disabled: None,
template: None,
server_live_info: None,
ipv4_addresses: None,
ipv6_addresses: None,
site: None,
snapshot_count: None,
max_cpu_count: None,
disks_available_space_in_mi_b: None,
rescue_system_active: None,
snapshot_allowed: None,
architecture: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerAttachIso {
#[serde(rename = "isoId", skip_serializing_if = "Option::is_none")]
pub iso_id: Option<i32>,
#[serde(rename = "userIsoName", skip_serializing_if = "Option::is_none")]
pub user_iso_name: Option<String>,
#[serde(rename = "changeBootDeviceToCdrom", skip_serializing_if = "Option::is_none")]
pub change_boot_device_to_cdrom: Option<bool>,
}
impl ServerAttachIso {
pub fn new() -> ServerAttachIso {
ServerAttachIso {
iso_id: None,
user_iso_name: None,
change_boot_device_to_cdrom: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerAutostartPatch {
#[serde(rename = "autostart", skip_serializing_if = "Option::is_none")]
pub autostart: Option<bool>,
}
impl ServerAutostartPatch {
pub fn new() -> ServerAutostartPatch {
ServerAutostartPatch {
autostart: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerBootorderPatch {
#[serde(rename = "bootorder")]
pub bootorder: Vec<models::Bootorder>,
}
impl ServerBootorderPatch {
pub fn new(bootorder: Vec<models::Bootorder>) -> ServerBootorderPatch {
ServerBootorderPatch {
bootorder,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerCpuTopologyPatch {
#[serde(rename = "cpuTopology", skip_serializing_if = "Option::is_none")]
pub cpu_topology: Option<Box<models::CpuTopology>>,
}
impl ServerCpuTopologyPatch {
pub fn new() -> ServerCpuTopologyPatch {
ServerCpuTopologyPatch {
cpu_topology: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerCreateNicVlan {
#[serde(rename = "vlanId")]
pub vlan_id: i32,
#[serde(rename = "networkDriver")]
pub network_driver: models::NetworkDriver,
}
impl ServerCreateNicVlan {
pub fn new(vlan_id: i32, network_driver: models::NetworkDriver) -> ServerCreateNicVlan {
ServerCreateNicVlan {
vlan_id,
network_driver,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerDisk {
#[serde(rename = "dev", skip_serializing_if = "Option::is_none")]
pub dev: Option<String>,
#[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "capacityInMiB", skip_serializing_if = "Option::is_none")]
pub capacity_in_mi_b: Option<i64>,
#[serde(rename = "allocationInMiB", skip_serializing_if = "Option::is_none")]
pub allocation_in_mi_b: Option<i64>,
}
impl ServerDisk {
pub fn new() -> ServerDisk {
ServerDisk {
dev: None,
driver: None,
capacity_in_mi_b: None,
allocation_in_mi_b: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerFirewall {
#[serde(rename = "copiedPolicies", skip_serializing_if = "Option::is_none")]
pub copied_policies: Option<Vec<models::FirewallPolicy>>,
#[serde(rename = "userPolicies", skip_serializing_if = "Option::is_none")]
pub user_policies: Option<Vec<models::FirewallPolicy>>,
#[serde(rename = "ingressImplicitRule", skip_serializing_if = "Option::is_none")]
pub ingress_implicit_rule: Option<models::ImplicitRule>,
#[serde(rename = "egressImplicitRule", skip_serializing_if = "Option::is_none")]
pub egress_implicit_rule: Option<models::ImplicitRule>,
#[serde(rename = "consistent", skip_serializing_if = "Option::is_none")]
pub consistent: Option<bool>,
}
impl ServerFirewall {
pub fn new() -> ServerFirewall {
ServerFirewall {
copied_policies: None,
user_policies: None,
ingress_implicit_rule: None,
egress_implicit_rule: None,
consistent: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerFirewallSave {
#[serde(rename = "copiedPolicies")]
pub copied_policies: Vec<models::IdentifierInt>,
#[serde(rename = "userPolicies")]
pub user_policies: Vec<models::IdentifierInt>,
}
impl ServerFirewallSave {
pub fn new(copied_policies: Vec<models::IdentifierInt>, user_policies: Vec<models::IdentifierInt>) -> ServerFirewallSave {
ServerFirewallSave {
copied_policies,
user_policies,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerHostnamePatch {
#[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
}
impl ServerHostnamePatch {
pub fn new() -> ServerHostnamePatch {
ServerHostnamePatch {
hostname: None,
}
}
}

View File

@@ -0,0 +1,60 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerImageSetup {
#[serde(rename = "imageFlavourId", skip_serializing_if = "Option::is_none")]
pub image_flavour_id: Option<i32>,
#[serde(rename = "diskName", skip_serializing_if = "Option::is_none")]
pub disk_name: Option<String>,
#[serde(rename = "rootPartitionFullDiskSize", skip_serializing_if = "Option::is_none")]
pub root_partition_full_disk_size: Option<bool>,
#[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "locale", skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
#[serde(rename = "additionalUserUsername", skip_serializing_if = "Option::is_none")]
pub additional_user_username: Option<String>,
#[serde(rename = "additionalUserPassword", skip_serializing_if = "Option::is_none")]
pub additional_user_password: Option<String>,
#[serde(rename = "sshKeyIds", skip_serializing_if = "Option::is_none")]
pub ssh_key_ids: Option<Vec<i32>>,
#[serde(rename = "sshPasswordAuthentication", skip_serializing_if = "Option::is_none")]
pub ssh_password_authentication: Option<bool>,
#[serde(rename = "customScript", skip_serializing_if = "Option::is_none")]
pub custom_script: Option<String>,
#[serde(rename = "emailToExecutingUser", skip_serializing_if = "Option::is_none")]
pub email_to_executing_user: Option<bool>,
}
impl ServerImageSetup {
pub fn new() -> ServerImageSetup {
ServerImageSetup {
image_flavour_id: None,
disk_name: None,
root_partition_full_disk_size: None,
hostname: None,
locale: None,
timezone: None,
additional_user_username: None,
additional_user_password: None,
ssh_key_ids: None,
ssh_password_authentication: None,
custom_script: None,
email_to_executing_user: None,
}
}
}

View File

@@ -0,0 +1,90 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerInfo {
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::ServerState>,
#[serde(rename = "autostart", skip_serializing_if = "Option::is_none")]
pub autostart: Option<bool>,
#[serde(rename = "uefi", skip_serializing_if = "Option::is_none")]
pub uefi: Option<bool>,
#[serde(rename = "interfaces", skip_serializing_if = "Option::is_none")]
pub interfaces: Option<Vec<models::ServerInterface>>,
#[serde(rename = "disks", skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<models::ServerDisk>>,
#[serde(rename = "bootorder", skip_serializing_if = "Option::is_none")]
pub bootorder: Option<Vec<models::Bootorder>>,
#[serde(rename = "requiredStorageOptimization", skip_serializing_if = "Option::is_none")]
pub required_storage_optimization: Option<models::StorageOptimization>,
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
pub template: Option<String>,
#[serde(rename = "uptimeInSeconds", skip_serializing_if = "Option::is_none")]
pub uptime_in_seconds: Option<i32>,
#[serde(rename = "currentServerMemoryInMiB", skip_serializing_if = "Option::is_none")]
pub current_server_memory_in_mi_b: Option<i64>,
#[serde(rename = "maxServerMemoryInMiB", skip_serializing_if = "Option::is_none")]
pub max_server_memory_in_mi_b: Option<i64>,
#[serde(rename = "cpuCount", skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i32>,
#[serde(rename = "cpuMaxCount", skip_serializing_if = "Option::is_none")]
pub cpu_max_count: Option<i32>,
#[serde(rename = "sockets", skip_serializing_if = "Option::is_none")]
pub sockets: Option<i32>,
#[serde(rename = "coresPerSocket", skip_serializing_if = "Option::is_none")]
pub cores_per_socket: Option<i32>,
#[serde(rename = "latestQemu", skip_serializing_if = "Option::is_none")]
pub latest_qemu: Option<bool>,
#[serde(rename = "configChanged", skip_serializing_if = "Option::is_none")]
pub config_changed: Option<bool>,
#[serde(rename = "osOptimization", skip_serializing_if = "Option::is_none")]
pub os_optimization: Option<models::OsOptimization>,
#[serde(rename = "nestedGuest", skip_serializing_if = "Option::is_none")]
pub nested_guest: Option<bool>,
#[serde(rename = "machineType", skip_serializing_if = "Option::is_none")]
pub machine_type: Option<String>,
#[serde(rename = "keyboardLayout", skip_serializing_if = "Option::is_none")]
pub keyboard_layout: Option<String>,
#[serde(rename = "cloudinitAttached", skip_serializing_if = "Option::is_none")]
pub cloudinit_attached: Option<bool>,
}
impl ServerInfo {
pub fn new() -> ServerInfo {
ServerInfo {
state: None,
autostart: None,
uefi: None,
interfaces: None,
disks: None,
bootorder: None,
required_storage_optimization: None,
template: None,
uptime_in_seconds: None,
current_server_memory_in_mi_b: None,
max_server_memory_in_mi_b: None,
cpu_count: None,
cpu_max_count: None,
sockets: None,
cores_per_socket: None,
latest_qemu: None,
config_changed: None,
os_optimization: None,
nested_guest: None,
machine_type: None,
keyboard_layout: None,
cloudinit_attached: None,
}
}
}

View File

@@ -0,0 +1,60 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerInterface {
#[serde(rename = "mac", skip_serializing_if = "Option::is_none")]
pub mac: Option<String>,
#[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "mtu", skip_serializing_if = "Option::is_none")]
pub mtu: Option<i32>,
#[serde(rename = "speedInMBits", skip_serializing_if = "Option::is_none")]
pub speed_in_m_bits: Option<i32>,
#[serde(rename = "rxMonthlyInMiB", skip_serializing_if = "Option::is_none")]
pub rx_monthly_in_mi_b: Option<i32>,
#[serde(rename = "txMonthlyInMiB", skip_serializing_if = "Option::is_none")]
pub tx_monthly_in_mi_b: Option<i32>,
#[serde(rename = "ipv4Addresses", skip_serializing_if = "Option::is_none")]
pub ipv4_addresses: Option<Vec<String>>,
#[serde(rename = "ipv6LinkLocalAddresses", skip_serializing_if = "Option::is_none")]
pub ipv6_link_local_addresses: Option<Vec<String>>,
#[serde(rename = "ipv6NetworkPrefixes", skip_serializing_if = "Option::is_none")]
pub ipv6_network_prefixes: Option<Vec<String>>,
#[serde(rename = "trafficThrottled", skip_serializing_if = "Option::is_none")]
pub traffic_throttled: Option<bool>,
#[serde(rename = "vlanInterface", skip_serializing_if = "Option::is_none")]
pub vlan_interface: Option<bool>,
#[serde(rename = "vlanId", skip_serializing_if = "Option::is_none")]
pub vlan_id: Option<i32>,
}
impl ServerInterface {
pub fn new() -> ServerInterface {
ServerInterface {
mac: None,
driver: None,
mtu: None,
speed_in_m_bits: None,
rx_monthly_in_mi_b: None,
tx_monthly_in_mi_b: None,
ipv4_addresses: None,
ipv6_link_local_addresses: None,
ipv6_network_prefixes: None,
traffic_throttled: None,
vlan_interface: None,
vlan_id: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerInterfaceUpdate {
#[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
pub driver: Option<models::NetworkDriver>,
}
impl ServerInterfaceUpdate {
pub fn new() -> ServerInterfaceUpdate {
ServerInterfaceUpdate {
driver: None,
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ServerIpType {
#[serde(rename = "IP")]
Ip,
#[serde(rename = "ROUTED_IP")]
RoutedIp,
}
impl std::fmt::Display for ServerIpType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Ip => write!(f, "IP"),
Self::RoutedIp => write!(f, "ROUTED_IP"),
}
}
}
impl Default for ServerIpType {
fn default() -> ServerIpType {
Self::Ip
}
}

View File

@@ -0,0 +1,51 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerIpv4 {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "interfaceMac", skip_serializing_if = "Option::is_none")]
pub interface_mac: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<models::ServerIpType>,
#[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
#[serde(rename = "cidr", skip_serializing_if = "Option::is_none")]
pub cidr: Option<String>,
#[serde(rename = "gateway", skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "rdns", skip_serializing_if = "Option::is_none")]
pub rdns: Option<String>,
#[serde(rename = "destinationIp", skip_serializing_if = "Option::is_none")]
pub destination_ip: Option<String>,
#[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
pub editable: Option<bool>,
}
impl ServerIpv4 {
pub fn new() -> ServerIpv4 {
ServerIpv4 {
id: None,
interface_mac: None,
r#type: None,
ip: None,
cidr: None,
gateway: None,
rdns: None,
destination_ip: None,
editable: None,
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerIpv6 {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "interfaceMac", skip_serializing_if = "Option::is_none")]
pub interface_mac: Option<String>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<models::ServerIpType>,
#[serde(rename = "networkPrefix", skip_serializing_if = "Option::is_none")]
pub network_prefix: Option<String>,
#[serde(rename = "cidr", skip_serializing_if = "Option::is_none")]
pub cidr: Option<String>,
#[serde(rename = "gateway", skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "linkLocal", skip_serializing_if = "Option::is_none")]
pub link_local: Option<bool>,
#[serde(rename = "rdns", skip_serializing_if = "Option::is_none")]
pub rdns: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "destinationIp", skip_serializing_if = "Option::is_none")]
pub destination_ip: Option<String>,
#[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
pub editable: Option<bool>,
}
impl ServerIpv6 {
pub fn new() -> ServerIpv6 {
ServerIpv6 {
id: None,
interface_mac: None,
r#type: None,
network_prefix: None,
cidr: None,
gateway: None,
link_local: None,
rdns: None,
destination_ip: None,
editable: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerKeyboardLayoutPatch {
#[serde(rename = "keyboardLayout", skip_serializing_if = "Option::is_none")]
pub keyboard_layout: Option<String>,
}
impl ServerKeyboardLayoutPatch {
pub fn new() -> ServerKeyboardLayoutPatch {
ServerKeyboardLayoutPatch {
keyboard_layout: None,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerListMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "nickname", skip_serializing_if = "Option::is_none")]
pub nickname: Option<String>,
#[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
pub disabled: Option<bool>,
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
pub template: Option<Box<models::ServerTemplateMinimal>>,
}
impl ServerListMinimal {
pub fn new() -> ServerListMinimal {
ServerListMinimal {
id: None,
name: None,
hostname: None,
nickname: None,
disabled: None,
template: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl ServerMinimal {
pub fn new() -> ServerMinimal {
ServerMinimal {
id: None,
name: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerNicknamePatch {
#[serde(rename = "nickname", skip_serializing_if = "Option::is_none")]
pub nickname: Option<String>,
}
impl ServerNicknamePatch {
pub fn new() -> ServerNicknamePatch {
ServerNicknamePatch {
nickname: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerOsOptimizationPatch {
#[serde(rename = "os_optimization", skip_serializing_if = "Option::is_none")]
pub os_optimization: Option<models::OsOptimization>,
}
impl ServerOsOptimizationPatch {
pub fn new() -> ServerOsOptimizationPatch {
ServerOsOptimizationPatch {
os_optimization: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerSetRootPasswordPatch {
#[serde(rename = "rootPassword", skip_serializing_if = "Option::is_none")]
pub root_password: Option<String>,
}
impl ServerSetRootPasswordPatch {
pub fn new() -> ServerSetRootPasswordPatch {
ServerSetRootPasswordPatch {
root_password: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerSnapshotCreate {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "diskName", skip_serializing_if = "Option::is_none")]
pub disk_name: Option<String>,
#[serde(rename = "onlineSnapshot", skip_serializing_if = "Option::is_none")]
pub online_snapshot: Option<bool>,
}
impl ServerSnapshotCreate {
pub fn new(name: String) -> ServerSnapshotCreate {
ServerSnapshotCreate {
name,
description: None,
disk_name: None,
online_snapshot: None,
}
}
}

View File

@@ -0,0 +1,31 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerSnapshotCreateCheck {
/// Must be set if attribute onlineSnapshot is false.
#[serde(rename = "diskName", skip_serializing_if = "Option::is_none")]
pub disk_name: Option<String>,
#[serde(rename = "onlineSnapshot", skip_serializing_if = "Option::is_none")]
pub online_snapshot: Option<bool>,
}
impl ServerSnapshotCreateCheck {
pub fn new() -> ServerSnapshotCreateCheck {
ServerSnapshotCreateCheck {
disk_name: None,
online_snapshot: None,
}
}
}

View File

@@ -0,0 +1,59 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ServerState {
#[serde(rename = "NOSTATE")]
Nostate,
#[serde(rename = "RUNNING")]
Running,
#[serde(rename = "BLOCKED")]
Blocked,
#[serde(rename = "PAUSED")]
Paused,
#[serde(rename = "SHUTDOWN")]
Shutdown,
#[serde(rename = "SHUTOFF")]
Shutoff,
#[serde(rename = "CRASHED")]
Crashed,
#[serde(rename = "PMSUSPENDED")]
Pmsuspended,
#[serde(rename = "DISK_SNAPSHOT")]
DiskSnapshot,
}
impl std::fmt::Display for ServerState {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Nostate => write!(f, "NOSTATE"),
Self::Running => write!(f, "RUNNING"),
Self::Blocked => write!(f, "BLOCKED"),
Self::Paused => write!(f, "PAUSED"),
Self::Shutdown => write!(f, "SHUTDOWN"),
Self::Shutoff => write!(f, "SHUTOFF"),
Self::Crashed => write!(f, "CRASHED"),
Self::Pmsuspended => write!(f, "PMSUSPENDED"),
Self::DiskSnapshot => write!(f, "DISK_SNAPSHOT"),
}
}
}
impl Default for ServerState {
fn default() -> ServerState {
Self::Nostate
}
}

View File

@@ -0,0 +1,41 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ServerState1 {
#[serde(rename = "ON")]
On,
#[serde(rename = "OFF")]
Off,
#[serde(rename = "SUSPENDED")]
Suspended,
}
impl std::fmt::Display for ServerState1 {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::On => write!(f, "ON"),
Self::Off => write!(f, "OFF"),
Self::Suspended => write!(f, "SUSPENDED"),
}
}
}
impl Default for ServerState1 {
fn default() -> ServerState1 {
Self::On
}
}

View File

@@ -0,0 +1,29 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ServerStatePatch : Optional query parameters: stateOption.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerStatePatch {
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::ServerState1>,
}
impl ServerStatePatch {
/// Optional query parameters: stateOption.
pub fn new() -> ServerStatePatch {
ServerStatePatch {
state: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerTemplateMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
}
impl ServerTemplateMinimal {
pub fn new(name: String) -> ServerTemplateMinimal {
ServerTemplateMinimal {
id: None,
name,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerUefiPatch {
#[serde(rename = "uefi", skip_serializing_if = "Option::is_none")]
pub uefi: Option<bool>,
}
impl ServerUefiPatch {
pub fn new() -> ServerUefiPatch {
ServerUefiPatch {
uefi: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerUserImageSetup {
#[serde(rename = "userImageName")]
pub user_image_name: String,
#[serde(rename = "diskName", skip_serializing_if = "Option::is_none")]
pub disk_name: Option<String>,
#[serde(rename = "emailNotification", skip_serializing_if = "Option::is_none")]
pub email_notification: Option<bool>,
}
impl ServerUserImageSetup {
pub fn new(user_image_name: String) -> ServerUserImageSetup {
ServerUserImageSetup {
user_image_name,
disk_name: None,
email_notification: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetRdnsIpv4 {
#[serde(rename = "ip")]
pub ip: String,
#[serde(rename = "rdns")]
pub rdns: String,
}
impl SetRdnsIpv4 {
pub fn new(ip: String, rdns: String) -> SetRdnsIpv4 {
SetRdnsIpv4 {
ip,
rdns,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetRdnsIpv6 {
#[serde(rename = "ip")]
pub ip: String,
#[serde(rename = "rdns")]
pub rdns: String,
}
impl SetRdnsIpv6 {
pub fn new(ip: String, rdns: String) -> SetRdnsIpv6 {
SetRdnsIpv6 {
ip,
rdns,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Site {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "city")]
pub city: String,
}
impl Site {
pub fn new(city: String) -> Site {
Site {
id: None,
city,
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Snapshot {
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "disks", skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<String>>,
#[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::ServerState>,
#[serde(rename = "online", skip_serializing_if = "Option::is_none")]
pub online: Option<bool>,
#[serde(rename = "exported", skip_serializing_if = "Option::is_none")]
pub exported: Option<bool>,
#[serde(rename = "exportedSizeInKiB", skip_serializing_if = "Option::is_none")]
pub exported_size_in_ki_b: Option<i64>,
#[serde(rename = "downloadInfos", skip_serializing_if = "Option::is_none")]
pub download_infos: Option<Box<models::S3DownloadInfos>>,
}
impl Snapshot {
pub fn new() -> Snapshot {
Snapshot {
uuid: None,
name: None,
description: None,
disks: None,
creation_time: None,
state: None,
online: None,
exported: None,
exported_size_in_ki_b: None,
download_infos: None,
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SnapshotMinimal {
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "disks", skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<String>>,
#[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::ServerState>,
#[serde(rename = "online", skip_serializing_if = "Option::is_none")]
pub online: Option<bool>,
#[serde(rename = "exported", skip_serializing_if = "Option::is_none")]
pub exported: Option<bool>,
#[serde(rename = "exportedSizeInKiB", skip_serializing_if = "Option::is_none")]
pub exported_size_in_ki_b: Option<i64>,
}
impl SnapshotMinimal {
pub fn new() -> SnapshotMinimal {
SnapshotMinimal {
uuid: None,
name: None,
description: None,
disks: None,
creation_time: None,
state: None,
online: None,
exported: None,
exported_size_in_ki_b: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SshKey {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
}
impl SshKey {
pub fn new(name: String, key: String) -> SshKey {
SshKey {
id: None,
name,
key,
created_at: None,
}
}
}

View File

@@ -0,0 +1,44 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StorageDriver {
#[serde(rename = "VIRTIO")]
Virtio,
#[serde(rename = "VIRTIO_SCSI")]
VirtioScsi,
#[serde(rename = "IDE")]
Ide,
#[serde(rename = "SATA")]
Sata,
}
impl std::fmt::Display for StorageDriver {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Virtio => write!(f, "VIRTIO"),
Self::VirtioScsi => write!(f, "VIRTIO_SCSI"),
Self::Ide => write!(f, "IDE"),
Self::Sata => write!(f, "SATA"),
}
}
}
impl Default for StorageDriver {
fn default() -> StorageDriver {
Self::Virtio
}
}

View File

@@ -0,0 +1,47 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StorageOptimization {
#[serde(rename = "INCONSISTENT")]
Inconsistent,
#[serde(rename = "COMPAT")]
Compat,
#[serde(rename = "SLOW")]
Slow,
#[serde(rename = "FAST")]
Fast,
#[serde(rename = "NO")]
No,
}
impl std::fmt::Display for StorageOptimization {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Inconsistent => write!(f, "INCONSISTENT"),
Self::Compat => write!(f, "COMPAT"),
Self::Slow => write!(f, "SLOW"),
Self::Fast => write!(f, "FAST"),
Self::No => write!(f, "NO"),
}
}
}
impl Default for StorageOptimization {
fn default() -> StorageOptimization {
Self::Inconsistent
}
}

View File

@@ -0,0 +1,60 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TaskInfo {
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::TaskState>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
#[serde(rename = "executingUser", skip_serializing_if = "Option::is_none")]
pub executing_user: Option<Box<models::UserMinimal>>,
#[serde(rename = "taskProgress", skip_serializing_if = "Option::is_none")]
pub task_progress: Option<Box<models::TaskProgress>>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "onRollback", skip_serializing_if = "Option::is_none")]
pub on_rollback: Option<bool>,
#[serde(rename = "steps", skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<models::TaskInfoStep>>,
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<serde_json::Value>,
#[serde(rename = "responseError", skip_serializing_if = "Option::is_none")]
pub response_error: Option<Box<models::ResponseError>>,
}
impl TaskInfo {
pub fn new() -> TaskInfo {
TaskInfo {
uuid: None,
name: None,
state: None,
started_at: None,
finished_at: None,
executing_user: None,
task_progress: None,
message: None,
on_rollback: None,
steps: None,
result: None,
response_error: None,
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TaskInfoMinimal {
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::TaskState>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
#[serde(rename = "executingUser", skip_serializing_if = "Option::is_none")]
pub executing_user: Option<Box<models::UserMinimal>>,
#[serde(rename = "taskProgress", skip_serializing_if = "Option::is_none")]
pub task_progress: Option<Box<models::TaskProgress>>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "onRollback", skip_serializing_if = "Option::is_none")]
pub on_rollback: Option<bool>,
}
impl TaskInfoMinimal {
pub fn new() -> TaskInfoMinimal {
TaskInfoMinimal {
uuid: None,
name: None,
state: None,
started_at: None,
finished_at: None,
executing_user: None,
task_progress: None,
message: None,
on_rollback: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TaskInfoStep {
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::TaskState>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
}
impl TaskInfoStep {
pub fn new() -> TaskInfoStep {
TaskInfoStep {
uuid: None,
name: None,
state: None,
started_at: None,
finished_at: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TaskProgress {
#[serde(rename = "expectedFinishedAt", skip_serializing_if = "Option::is_none")]
pub expected_finished_at: Option<String>,
#[serde(rename = "progressInPercent", skip_serializing_if = "Option::is_none")]
pub progress_in_percent: Option<f32>,
}
impl TaskProgress {
pub fn new() -> TaskProgress {
TaskProgress {
expected_finished_at: None,
progress_in_percent: None,
}
}
}

View File

@@ -0,0 +1,53 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TaskState {
#[serde(rename = "PENDING")]
Pending,
#[serde(rename = "RUNNING")]
Running,
#[serde(rename = "FINISHED")]
Finished,
#[serde(rename = "ERROR")]
Error,
#[serde(rename = "WAITING_FOR_CANCEL")]
WaitingForCancel,
#[serde(rename = "CANCELED")]
Canceled,
#[serde(rename = "ROLLBACK")]
Rollback,
}
impl std::fmt::Display for TaskState {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Pending => write!(f, "PENDING"),
Self::Running => write!(f, "RUNNING"),
Self::Finished => write!(f, "FINISHED"),
Self::Error => write!(f, "ERROR"),
Self::WaitingForCancel => write!(f, "WAITING_FOR_CANCEL"),
Self::Canceled => write!(f, "CANCELED"),
Self::Rollback => write!(f, "ROLLBACK"),
}
}
}
impl Default for TaskState {
fn default() -> TaskState {
Self::Pending
}
}

View File

@@ -0,0 +1,63 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct User {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "username", skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(rename = "firstname", skip_serializing_if = "Option::is_none")]
pub firstname: Option<String>,
#[serde(rename = "lastname", skip_serializing_if = "Option::is_none")]
pub lastname: Option<String>,
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "company", skip_serializing_if = "Option::is_none")]
pub company: Option<String>,
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
#[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
pub time_zone: Option<String>,
#[serde(rename = "showNickname", skip_serializing_if = "Option::is_none")]
pub show_nickname: Option<bool>,
#[serde(rename = "passwordlessMode", skip_serializing_if = "Option::is_none")]
pub passwordless_mode: Option<bool>,
#[serde(rename = "secureMode", skip_serializing_if = "Option::is_none")]
pub secure_mode: Option<bool>,
#[serde(rename = "secureModeAppAccess", skip_serializing_if = "Option::is_none")]
pub secure_mode_app_access: Option<bool>,
#[serde(rename = "apiIpLoginRestrictions", skip_serializing_if = "Option::is_none")]
pub api_ip_login_restrictions: Option<String>,
}
impl User {
pub fn new() -> User {
User {
id: None,
username: None,
firstname: None,
lastname: None,
email: None,
company: None,
language: None,
time_zone: None,
show_nickname: None,
passwordless_mode: None,
secure_mode: None,
secure_mode_app_access: None,
api_ip_login_restrictions: None,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserMinimal {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "username", skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(rename = "firstname", skip_serializing_if = "Option::is_none")]
pub firstname: Option<String>,
#[serde(rename = "lastname", skip_serializing_if = "Option::is_none")]
pub lastname: Option<String>,
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "company", skip_serializing_if = "Option::is_none")]
pub company: Option<String>,
}
impl UserMinimal {
pub fn new() -> UserMinimal {
UserMinimal {
id: None,
username: None,
firstname: None,
lastname: None,
email: None,
company: None,
}
}
}

View File

@@ -0,0 +1,57 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserSave {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "language")]
pub language: String,
#[serde(rename = "timeZone")]
pub time_zone: String,
#[serde(rename = "apiIpLoginRestrictions", skip_serializing_if = "Option::is_none")]
pub api_ip_login_restrictions: Option<String>,
#[serde(rename = "password", skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "oldPassword", skip_serializing_if = "Option::is_none")]
pub old_password: Option<String>,
#[serde(rename = "soapWebservicePassword", skip_serializing_if = "Option::is_none")]
pub soap_webservice_password: Option<String>,
#[serde(rename = "showNickname", skip_serializing_if = "Option::is_none")]
pub show_nickname: Option<bool>,
#[serde(rename = "passwordlessMode", skip_serializing_if = "Option::is_none")]
pub passwordless_mode: Option<bool>,
#[serde(rename = "secureMode", skip_serializing_if = "Option::is_none")]
pub secure_mode: Option<bool>,
#[serde(rename = "secureModeAppAccess", skip_serializing_if = "Option::is_none")]
pub secure_mode_app_access: Option<bool>,
}
impl UserSave {
pub fn new(language: String, time_zone: String) -> UserSave {
UserSave {
id: None,
language,
time_zone,
api_ip_login_restrictions: None,
password: None,
old_password: None,
soap_webservice_password: None,
show_nickname: None,
passwordless_mode: None,
secure_mode: None,
secure_mode_app_access: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VLan {
#[serde(rename = "vlanId", skip_serializing_if = "Option::is_none")]
pub vlan_id: Option<i32>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
pub user: Option<Box<models::UserMinimal>>,
#[serde(rename = "site", skip_serializing_if = "Option::is_none")]
pub site: Option<Box<models::Site>>,
#[serde(rename = "bandwidthClass", skip_serializing_if = "Option::is_none")]
pub bandwidth_class: Option<Box<models::BandwidthClass>>,
}
impl VLan {
pub fn new() -> VLan {
VLan {
vlan_id: None,
name: None,
user: None,
site: None,
bandwidth_class: None,
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VLanSave {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl VLanSave {
pub fn new() -> VLanSave {
VLanSave {
name: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* SCP (Server Control Panel) REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2025.1218.164029
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ValidationError {
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<models::FieldError>>,
}
impl ValidationError {
pub fn new() -> ValidationError {
ValidationError {
code: None,
message: None,
errors: None,
}
}
}