create()
Signatur
public function create(ProductHosting $productHosting, array &$productOptionMapping): ServerHostingCreatedResponseBeschreibung
Erstellung / Installation des Hosting-Produkts. Dadurch sollte der gesamte Automatisierungsprozess zur Erstellung des Produkts angelegt werden.
Der Parameter $productOptionMapping enthält ein Key-Value-Array, das aus Deiner konfigurierten getAvailableProductOptions() besteht, die entweder direkt vom Admin im Produkt konfiguriert wurden oder vom Kunden über Produktoptionen konfiguriert/ausgewählt wurden. (die Daten sind immer gleich)
Rückgabewert
ServerHostingCreatedResponse bei Erfolg, Exception mit der Fehlermeldung bei Fehler. Beispiel:
return new ServerHostingCreatedResponse(
true, // if successfull, should always be true!
[ // customFields where additional data is stored, e.g. the account id or passwords
"proxmoxVmId" => $freeVmId,
"proxmoxVirtualization" => $productOptionMapping['virtualization'],
"proxmoxTemplate" => $proxmoxTemplate->templateData,
"proxmoxTemplateId" => $proxmoxTemplate->id,
"proxmoxRootPw" => $rootPassword,
],
ProductHostingStatusEnum::ACTIVE // The new status of the hosting (optional) This can be usefull if the creation has been initiated and must be checked for success asynchron e.g. via scheduled command.
)War das hilfreich?