From 5685ed69ba9c876a9718be60bf0bc1d5bf29402c Mon Sep 17 00:00:00 2001 From: Cristian Matiut Date: Wed, 17 Jun 2026 14:45:12 +0300 Subject: [PATCH 1/2] Add cloudstack provider --- config.ts | 8 ++++ src/@types/Providers.ts | 1 + src/plugins/cloudstack/OptionsSchemaPlugin.ts | 42 +++++++++++++++++++ tests/mocks/ProvidersMock.ts | 3 ++ 4 files changed, 54 insertions(+) create mode 100644 src/plugins/cloudstack/OptionsSchemaPlugin.ts diff --git a/config.ts b/config.ts index 76f44fea..ce2639ea 100644 --- a/config.ts +++ b/config.ts @@ -141,6 +141,12 @@ const conf: Config = { types: ["destination"], requiredFields: ["cluster"], }, + { + name: "cloudstack", + types: ["destination"], + requiredFields: ["zone"], + relistFields: ["linux_template", "windows_template"], + }, ], /* @@ -170,6 +176,7 @@ const conf: Config = { metal: 4, lxd: 4, libvirt: 4, + cloudstack: 4, nutanix: 4, }, @@ -194,6 +201,7 @@ const conf: Config = { lxd: "LXD", proxmox: "Proxmox VE", libvirt: "Libvirt", + cloudstack: "Cloudstack", nutanix: "Nutanix", }, diff --git a/src/@types/Providers.ts b/src/@types/Providers.ts index 12ba1393..e51ef662 100644 --- a/src/@types/Providers.ts +++ b/src/@types/Providers.ts @@ -33,6 +33,7 @@ export type ProviderTypes = | "rhev" | "lxd" | "libvirt" + | "cloudstack" | "nutanix"; export type Providers = { diff --git a/src/plugins/cloudstack/OptionsSchemaPlugin.ts b/src/plugins/cloudstack/OptionsSchemaPlugin.ts new file mode 100644 index 00000000..5a0f316e --- /dev/null +++ b/src/plugins/cloudstack/OptionsSchemaPlugin.ts @@ -0,0 +1,42 @@ +/* +Copyright (C) 2026 Cloudbase Solutions SRL +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +import type { Field } from "@src/@types/Field"; +import type { SchemaProperties, SchemaDefinitions } from "@src/@types/Schema"; +import OptionsSchemaPluginBase from "../default/OptionsSchemaPlugin"; + +export default class OptionsSchemaParser extends OptionsSchemaPluginBase { + override parseSchemaToFields(opts: { + schema: SchemaProperties; + schemaDefinitions?: SchemaDefinitions | null | undefined; + dictionaryKey?: string; + requiresWindowsImage?: boolean; + }) { + return super.parseSchemaToFields(opts); + } + + override sortFields(fields: Field[]) { + super.sortFields(fields); + fields.sort((f1, f2) => { + // sort zone field first + if (f1.name === "zone") { + return -1; + } + if (f2.name === "zone") { + return 1; + } + return 0; + }); + } +} diff --git a/tests/mocks/ProvidersMock.ts b/tests/mocks/ProvidersMock.ts index fefa179b..c1933aec 100644 --- a/tests/mocks/ProvidersMock.ts +++ b/tests/mocks/ProvidersMock.ts @@ -65,4 +65,7 @@ export const PROVIDERS_MOCK: Providers = { vhi: { types: [], }, + cloudstack: { + types: [], + }, }; From f8fd0fe12459702fd40e1eaba912f21dbcc55884 Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Thu, 25 Jun 2026 10:46:43 +0300 Subject: [PATCH 2/2] Add cloudstack logos Signed-off-by: Mihaela Balutoiu --- .../providerLogos/cloudstack-128-disabled.svg | 363 ++++++++++++++++++ .../providerLogos/cloudstack-128.svg | 362 +++++++++++++++++ .../providerLogos/cloudstack-32-white.svg | 207 ++++++++++ .../resources/providerLogos/cloudstack-32.svg | 206 ++++++++++ .../resources/providerLogos/cloudstack-42.svg | 207 ++++++++++ .../resources/providerLogos/cloudstack-64.svg | 363 ++++++++++++++++++ 6 files changed, 1708 insertions(+) create mode 100644 server/api/resources/providerLogos/cloudstack-128-disabled.svg create mode 100644 server/api/resources/providerLogos/cloudstack-128.svg create mode 100644 server/api/resources/providerLogos/cloudstack-32-white.svg create mode 100644 server/api/resources/providerLogos/cloudstack-32.svg create mode 100644 server/api/resources/providerLogos/cloudstack-42.svg create mode 100644 server/api/resources/providerLogos/cloudstack-64.svg diff --git a/server/api/resources/providerLogos/cloudstack-128-disabled.svg b/server/api/resources/providerLogos/cloudstack-128-disabled.svg new file mode 100644 index 00000000..0785912c --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-128-disabled.svg @@ -0,0 +1,363 @@ + +image/svg+xml + +TM diff --git a/server/api/resources/providerLogos/cloudstack-128.svg b/server/api/resources/providerLogos/cloudstack-128.svg new file mode 100644 index 00000000..14680f5b --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-128.svg @@ -0,0 +1,362 @@ + +image/svg+xml + +TM diff --git a/server/api/resources/providerLogos/cloudstack-32-white.svg b/server/api/resources/providerLogos/cloudstack-32-white.svg new file mode 100644 index 00000000..a24e3dfd --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-32-white.svg @@ -0,0 +1,207 @@ + +image/svg+xml + +TM diff --git a/server/api/resources/providerLogos/cloudstack-32.svg b/server/api/resources/providerLogos/cloudstack-32.svg new file mode 100644 index 00000000..99025377 --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-32.svg @@ -0,0 +1,206 @@ + +image/svg+xml + +TM diff --git a/server/api/resources/providerLogos/cloudstack-42.svg b/server/api/resources/providerLogos/cloudstack-42.svg new file mode 100644 index 00000000..a20900a9 --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-42.svg @@ -0,0 +1,207 @@ + +image/svg+xml + +TM diff --git a/server/api/resources/providerLogos/cloudstack-64.svg b/server/api/resources/providerLogos/cloudstack-64.svg new file mode 100644 index 00000000..b7820860 --- /dev/null +++ b/server/api/resources/providerLogos/cloudstack-64.svg @@ -0,0 +1,363 @@ + +image/svg+xml + +TM