Skip to content

Commit 2e655a1

Browse files
authored
Merge branch 'main' into v1.6157.0
2 parents 038134d + 9f18271 commit 2e655a1

File tree

13 files changed

+3938
-6
lines changed

13 files changed

+3938
-6
lines changed

packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export type ResourceType =
1313
| 'kube_node'
1414
| 'kube_acl'
1515
| 'keym_key'
16-
| 'iamx_user'
17-
| 'iamx_application'
18-
| 'iamx_group'
19-
| 'iamx_policy'
20-
| 'iamx_api_key'
21-
| 'iamx_ssh_key'
16+
| 'iam_user'
17+
| 'iam_application'
18+
| 'iam_group'
19+
| 'iam_policy'
20+
| 'iam_api_key'
21+
| 'iam_ssh_key'
2222

2323
export interface KeyManagerKeyInfo {}
2424

packages/clients/src/api/baremetal/v1/api.gen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import type {
7070
ListServersResponse,
7171
ListSettingsRequest,
7272
ListSettingsResponse,
73+
MigrateServerToMonthlyOfferRequest,
7374
OS,
7475
Offer,
7576
Option,
@@ -517,6 +518,23 @@ export class API extends ParentAPI {
517518
unmarshalServer,
518519
)
519520

521+
/**
522+
* Migrate server offer. Migrate server with hourly offer to monthly offer.
523+
*
524+
* @param request - The request {@link MigrateServerToMonthlyOfferRequest}
525+
* @returns A Promise of Server
526+
*/
527+
migrateServerToMonthlyOffer = (
528+
request: Readonly<MigrateServerToMonthlyOfferRequest>,
529+
) =>
530+
this.client.fetch<Server>(
531+
{
532+
method: 'POST',
533+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/migrate-offer-monthly`,
534+
},
535+
unmarshalServer,
536+
)
537+
520538
protected pageOfListOffers = (request: Readonly<ListOffersRequest> = {}) =>
521539
this.client.fetch<ListOffersResponse>(
522540
{

packages/clients/src/api/baremetal/v1/content.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [
2424
'deleting',
2525
'ordered',
2626
'resetting',
27+
'migrating',
2728
]

packages/clients/src/api/baremetal/v1/marshalling.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ export const unmarshalOffer = (data: unknown): Offer => {
421421
incompatibleOsIds: data.incompatible_os_ids,
422422
maxBandwidth: data.max_bandwidth,
423423
memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),
424+
monthlyOfferId: data.monthly_offer_id,
424425
name: data.name,
425426
operationPath: data.operation_path,
426427
options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),

packages/clients/src/api/baremetal/v1/types.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export type ServerStatus =
104104
| 'out_of_stock'
105105
| 'ordered'
106106
| 'resetting'
107+
| 'migrating'
107108

108109
export type SettingType = 'unknown' | 'smtp'
109110

@@ -479,6 +480,8 @@ export interface Offer {
479480
tags: string[]
480481
/** GPU specifications of the offer. */
481482
gpus: GPU[]
483+
/** Exist only for hourly offers, to migrate to the monthly offer. */
484+
monthlyOfferId?: string
482485
}
483486

484487
export interface Option {
@@ -900,6 +903,13 @@ export interface ListSettingsResponse {
900903
settings: Setting[]
901904
}
902905

906+
export type MigrateServerToMonthlyOfferRequest = {
907+
/** Zone to target. If none is passed will use default zone from the config. */
908+
zone?: ScwZone
909+
/** ID of the server. */
910+
serverId: string
911+
}
912+
903913
export type PrivateNetworkApiAddServerPrivateNetworkRequest = {
904914
/** Zone to target. If none is passed will use default zone from the config. */
905915
zone?: ScwZone

0 commit comments

Comments
 (0)