diff --git a/packages_generated/webhosting/src/v1/api.gen.ts b/packages_generated/webhosting/src/v1/api.gen.ts index 5a363e695..233402090 100644 --- a/packages_generated/webhosting/src/v1/api.gen.ts +++ b/packages_generated/webhosting/src/v1/api.gen.ts @@ -33,6 +33,7 @@ import { unmarshalHosting, marshalHostingApiAddCustomDomainRequest, marshalHostingApiCreateHostingRequest, + marshalHostingApiMigrateControlPanelRequest, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiUpdateHostingRequest, unmarshalHostingSummary, @@ -109,6 +110,7 @@ import type { HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, @@ -1007,6 +1009,26 @@ export class HostingAPI extends ParentAPI { ) + /** + * Migrate a hosting to a new control panel.. Migrate a hosting to a new control panel. + * + * @param request - The request {@link HostingApiMigrateControlPanelRequest} + * @returns A Promise of HostingSummary + */ + migrateControlPanel = (request: Readonly) => + this.client.fetch( + { + body: JSON.stringify( + marshalHostingApiMigrateControlPanelRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/migrate-control-panel`, + }, + unmarshalHostingSummary, + ) + + } /** diff --git a/packages_generated/webhosting/src/v1/index.gen.ts b/packages_generated/webhosting/src/v1/index.gen.ts index d07a695c5..c556acd6c 100644 --- a/packages_generated/webhosting/src/v1/index.gen.ts +++ b/packages_generated/webhosting/src/v1/index.gen.ts @@ -82,6 +82,7 @@ export type { HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, diff --git a/packages_generated/webhosting/src/v1/marshalling.gen.ts b/packages_generated/webhosting/src/v1/marshalling.gen.ts index c338029bf..56933a51f 100644 --- a/packages_generated/webhosting/src/v1/marshalling.gen.ts +++ b/packages_generated/webhosting/src/v1/marshalling.gen.ts @@ -67,6 +67,7 @@ import type { CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, @@ -942,6 +943,14 @@ export const marshalHostingApiCreateHostingRequest = ( tags: request.tags, }) +export const marshalHostingApiMigrateControlPanelRequest = ( + request: HostingApiMigrateControlPanelRequest, + defaults: DefaultValues, +): Record => ({ + control_panel_name: request.controlPanelName, + offer_id: request.offerId, +}) + export const marshalHostingApiRemoveCustomDomainRequest = ( request: HostingApiRemoveCustomDomainRequest, defaults: DefaultValues, diff --git a/packages_generated/webhosting/src/v1/types.gen.ts b/packages_generated/webhosting/src/v1/types.gen.ts index b7d1b0f64..4075fc419 100644 --- a/packages_generated/webhosting/src/v1/types.gen.ts +++ b/packages_generated/webhosting/src/v1/types.gen.ts @@ -1609,6 +1609,26 @@ export type HostingApiListHostingsRequest = { } +export type HostingApiMigrateControlPanelRequest = { + /** + * Region to target. If none is passed will use default region from the config. + */ + region?: ScwRegion + /** + * Hosting ID to migrate to a new control panel. + */ + hostingId: string + /** + * Control panel will migrate the hosting to a new server. + */ + controlPanelName: string + /** + * Migration. + */ + offerId: string +} + + export type HostingApiRemoveCustomDomainRequest = { /** * Region to target. If none is passed will use default region from the config.