Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages_generated/webhosting/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
unmarshalHosting,
marshalHostingApiAddCustomDomainRequest,
marshalHostingApiCreateHostingRequest,
marshalHostingApiMigrateControlPanelRequest,
marshalHostingApiRemoveCustomDomainRequest,
marshalHostingApiUpdateHostingRequest,
unmarshalHostingSummary,
Expand Down Expand Up @@ -109,6 +110,7 @@ import type {
HostingApiGetHostingRequest,
HostingApiGetResourceSummaryRequest,
HostingApiListHostingsRequest,
HostingApiMigrateControlPanelRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiResetHostingPasswordRequest,
HostingApiUpdateHostingRequest,
Expand Down Expand Up @@ -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<HostingApiMigrateControlPanelRequest>) =>
this.client.fetch<HostingSummary>(
{
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,
)


}

/**
Expand Down
1 change: 1 addition & 0 deletions packages_generated/webhosting/src/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export type {
HostingApiGetHostingRequest,
HostingApiGetResourceSummaryRequest,
HostingApiListHostingsRequest,
HostingApiMigrateControlPanelRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiResetHostingPasswordRequest,
HostingApiUpdateHostingRequest,
Expand Down
9 changes: 9 additions & 0 deletions packages_generated/webhosting/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import type {
CreateHostingRequestDomainConfiguration,
OfferOptionRequest,
HostingApiCreateHostingRequest,
HostingApiMigrateControlPanelRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiUpdateHostingRequest,
MailAccountApiChangeMailAccountPasswordRequest,
Expand Down Expand Up @@ -942,6 +943,14 @@ export const marshalHostingApiCreateHostingRequest = (
tags: request.tags,
})

export const marshalHostingApiMigrateControlPanelRequest = (
request: HostingApiMigrateControlPanelRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
control_panel_name: request.controlPanelName,
offer_id: request.offerId,
})

export const marshalHostingApiRemoveCustomDomainRequest = (
request: HostingApiRemoveCustomDomainRequest,
defaults: DefaultValues,
Expand Down
20 changes: 20 additions & 0 deletions packages_generated/webhosting/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down