diff --git a/config.ts b/config.ts index 8858b582..0c0c0195 100644 --- a/config.ts +++ b/config.ts @@ -94,6 +94,12 @@ const conf: Config = { requiredFields: ["compartment", "availability_domain", "vcn_compartment"], relistFields: ["migr_image_map", "migr_image"], }, + { + name: "o3c", + types: ["destination"], + requiredFields: ["compartment", "availability_domain", "vcn_compartment"], + relistFields: ["migr_image_map", "migr_image"], + }, { name: "vmware_vsphere", types: ["destination"], @@ -121,6 +127,7 @@ const conf: Config = { oracle_vm: 3, olvm: 3, opca: 3, + o3c: 3, rhev: 3, metal: 4, lxd: 4, @@ -135,7 +142,8 @@ const conf: Config = { kubevirt: "KubeVirt", scvmm: "SCVMM", oci: "OCI", - opca: "Oracle PCA X9-2", + opca: "Oracle Private Cloud Appliance", + o3c: "Oracle Cloud Compute@Customer", opc: "Oracle Cloud", oracle_vm: "Oracle VM", olvm: "OLVM", diff --git a/server/api/resources/providerLogos/o3c-128-disabled.svg b/server/api/resources/providerLogos/o3c-128-disabled.svg new file mode 100644 index 00000000..c270e5e4 --- /dev/null +++ b/server/api/resources/providerLogos/o3c-128-disabled.svg @@ -0,0 +1,57 @@ + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/o3c-128.svg b/server/api/resources/providerLogos/o3c-128.svg new file mode 100644 index 00000000..dded5335 --- /dev/null +++ b/server/api/resources/providerLogos/o3c-128.svg @@ -0,0 +1,56 @@ + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/o3c-32-white.svg b/server/api/resources/providerLogos/o3c-32-white.svg new file mode 100644 index 00000000..afedcc5c --- /dev/null +++ b/server/api/resources/providerLogos/o3c-32-white.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/o3c-32.svg b/server/api/resources/providerLogos/o3c-32.svg new file mode 100644 index 00000000..d3c41563 --- /dev/null +++ b/server/api/resources/providerLogos/o3c-32.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/o3c-42.svg b/server/api/resources/providerLogos/o3c-42.svg new file mode 100644 index 00000000..1cb370a2 --- /dev/null +++ b/server/api/resources/providerLogos/o3c-42.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/o3c-64.svg b/server/api/resources/providerLogos/o3c-64.svg new file mode 100644 index 00000000..83f4fed7 --- /dev/null +++ b/server/api/resources/providerLogos/o3c-64.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + Compute Cloud@Customer + + diff --git a/server/api/resources/providerLogos/oci-32-white.svg b/server/api/resources/providerLogos/oci-32-white.svg index e402133e..5ffaaf80 100644 --- a/server/api/resources/providerLogos/oci-32-white.svg +++ b/server/api/resources/providerLogos/oci-32-white.svg @@ -1,7 +1,70 @@ - - - - - + + + + + + + + + + Compute Cloud@Customer + diff --git a/src/@types/Providers.ts b/src/@types/Providers.ts index 3518558d..3441f6df 100644 --- a/src/@types/Providers.ts +++ b/src/@types/Providers.ts @@ -17,6 +17,7 @@ export type ProviderTypes = | "openstack" | "opc" | "opca" + | "o3c" | "oracle_vm" | "vmware_vsphere" | "aws" diff --git a/src/plugins/index.ts b/src/plugins/index.ts index eb5945e6..fb158a99 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -18,6 +18,7 @@ import AzureConnectionSchemaPlugin from "./azure/ConnectionSchemaPlugin"; import OpenstackConnectionSchemaPlugin from "./openstack/ConnectionSchemaPlugin"; import OciConnectionSchemaPlugin from "./oci/ConnectionSchemaPlugin"; import OpcaConnectionSchemaPlugin from "./opca/ConnectionSchemaPlugin"; +import O3cConnectionSchemaPlugin from "./o3c/ConnectionSchemaPlugin"; import KubevirtConnectionSchemaPlugin from "./kubevirt/ConnectionSchemaPlugin"; import DefaultContentPlugin from "./default/ContentPlugin"; @@ -51,6 +52,7 @@ export const ConnectionSchemaPlugin = { openstack: new OpenstackConnectionSchemaPlugin(), oci: new OciConnectionSchemaPlugin(), opca: new OpcaConnectionSchemaPlugin(), + o3c: new O3cConnectionSchemaPlugin(), kubevirt: new KubevirtConnectionSchemaPlugin(), }; if (hasKey(map, provider)) { diff --git a/src/plugins/o3c/ConnectionSchemaPlugin.ts b/src/plugins/o3c/ConnectionSchemaPlugin.ts new file mode 100644 index 00000000..e3b84f4f --- /dev/null +++ b/src/plugins/o3c/ConnectionSchemaPlugin.ts @@ -0,0 +1,32 @@ +/* +Copyright (C) 2024 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 { Schema } from "@src/@types/Schema"; +import type { Field } from "@src/@types/Field"; + +import ConnectionSchemaParserBase from "@src/plugins/default/ConnectionSchemaPlugin"; + +const TEXT_AREA_FIELDS = ["private_key_data", "custom_certificate_bundle"]; + +export default class ConnectionSchemaParser extends ConnectionSchemaParserBase { + override parseSchemaToFields(schema: Schema): Field[] { + const fields = super.parseSchemaToFields(schema); + fields.forEach(field => { + if (TEXT_AREA_FIELDS.includes(field.name)) { + field.useTextArea = true; + } + }); + return fields; + } +} diff --git a/tests/mocks/ProvidersMock.ts b/tests/mocks/ProvidersMock.ts index e6677ba6..e764a9fc 100644 --- a/tests/mocks/ProvidersMock.ts +++ b/tests/mocks/ProvidersMock.ts @@ -17,6 +17,9 @@ export const PROVIDERS_MOCK: Providers = { opca: { types: [], }, + o3c: { + types: [], + }, oracle_vm: { types: [], },