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
4 changes: 2 additions & 2 deletions packages/clients/src/api/rdb/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ export class RdbV1GenAPI extends API {
)

/**
* Upgrade your current `node_type` or enable high availability on your
* standalone database instance.
* Upgrade your current instance specifications like node type, high
* availability, volume, or db engine version.
*
* @param request - The request {@link UpgradeInstanceRequest}
* @returns A Promise of Instance
Expand Down
24 changes: 24 additions & 0 deletions packages/clients/src/api/rdb/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import type {
UpdateInstanceRequest,
UpdateSnapshotRequest,
UpdateUserRequest,
UpgradableVersion,
UpgradeInstanceRequest,
User,
Volume,
Expand Down Expand Up @@ -290,6 +291,21 @@ export const unmarshalReadReplica = (data: unknown) => {
} as ReadReplica
}

const unmarshalUpgradableVersion = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`,
)
}

return {
id: data.id,
minorVersion: data.minor_version,
name: data.name,
version: data.version,
} as UpgradableVersion
}

const unmarshalVolume = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -413,6 +429,10 @@ export const unmarshalInstance = (data: unknown) => {
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
status: data.status,
tags: data.tags,
upgradableVersion: unmarshalArrayOfObject(
data.upgradable_version,
unmarshalUpgradableVersion,
),
volume: data.volume ? unmarshalVolume(data.volume) : undefined,
} as Instance
}
Expand Down Expand Up @@ -1118,5 +1138,9 @@ export const marshalUpgradeInstanceRequest = (
param: 'volume_type',
value: request.volumeType,
},
{
param: 'upgradable_version_id',
value: request.upgradableVersionId,
},
]),
})
25 changes: 21 additions & 4 deletions packages/clients/src/api/rdb/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ export interface Instance {
status: InstanceStatus
/** Database engine of the database (PostgreSQL, MySQL, ...) */
engine: string
/** Available database engine versions for upgrade */
upgradableVersion: Array<UpgradableVersion>
/** @deprecated Endpoint of the instance */
endpoint?: Endpoint
/** List of tags applied to the instance */
Expand Down Expand Up @@ -679,6 +681,13 @@ export interface Snapshot {
region: Region
}

export interface UpgradableVersion {
id: string
name: string
version: string
minorVersion: string
}

/** User */
export interface User {
/**
Expand Down Expand Up @@ -805,30 +814,38 @@ export type UpgradeInstanceRequest = {
* Node type of the instance you want to upgrade to.
*
* One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
* 'volumeSize', 'volumeType' could be set.
* 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
*/
nodeType?: string
/**
* Set to true to enable high availability on your instance.
*
* One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
* 'volumeSize', 'volumeType' could be set.
* 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
*/
enableHa?: boolean
/**
* Increase your block storage volume size.
*
* One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
* 'volumeSize', 'volumeType' could be set.
* 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
*/
volumeSize?: number
/**
* Change your instance storage type.
*
* One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
* 'volumeSize', 'volumeType' could be set.
* 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
*/
volumeType?: VolumeType
/**
* This will create a new Database Instance with same instance specification
* as the current one and perform a Database Engine upgrade.
*
* One-of ('upgradeTarget'): at most one of 'nodeType', 'enableHa',
* 'volumeSize', 'volumeType', 'upgradableVersionId' could be set.
*/
upgradableVersionId?: string
}

export type ListInstancesRequest = {
Expand Down