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
1 change: 1 addition & 0 deletions packages/clients/src/api/instance/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export class API extends ParentAPI {
* keep the slot on the hypervisor. `reboot`: Stop the instance and restart
* it. `backup`: Create an image with all the volumes of an Instance.
* `terminate`: Delete the Instance along with all attached volumes.
* `enable_routed_ip`: Migrate the Instance to the new network stack.
*
* Keep in mind that terminating an Instance will result in the deletion of
* all attached volumes, including local and block storage. If you want to
Expand Down
4 changes: 4 additions & 0 deletions packages/clients/src/api/instance/v1/content.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// If you have any remark or suggestion do not hesitate to open an issue.
import type {
ImageState,
IpState,
PrivateNICState,
SecurityGroupState,
ServerState,
Expand All @@ -14,6 +15,9 @@ import type {
/** Lists transient statutes of the enum {@link ImageState}. */
export const IMAGE_TRANSIENT_STATUSES: ImageState[] = ['creating']

/** Lists transient statutes of the enum {@link IpState}. */
export const IP_TRANSIENT_STATUSES: IpState[] = ['pending']

/** Lists transient statutes of the enum {@link PrivateNICState}. */
export const PRIVATE_NIC_TRANSIENT_STATUSES: PrivateNICState[] = ['syncing']

Expand Down
4 changes: 4 additions & 0 deletions packages/clients/src/api/instance/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export type {
Image,
ImageState,
Ip,
IpState,
IpType,
ListBootscriptsRequest,
ListBootscriptsResponse,
ListDefaultSecurityGroupRulesRequest,
Expand Down Expand Up @@ -117,6 +119,8 @@ export type {
ServerActionRequestVolumeBackupTemplate,
ServerActionResponse,
ServerIp,
ServerIpIpFamily,
ServerIpProvisioningMode,
ServerIpv6,
ServerLocation,
ServerMaintenance,
Expand Down
26 changes: 26 additions & 0 deletions packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ const unmarshalServerIp = (data: unknown) => {
return {
address: data.address,
dynamic: data.dynamic,
family: data.family,
gateway: data.gateway,
id: data.id,
netmask: data.netmask,
provisioningMode: data.provisioning_mode,
} as ServerIp
}

Expand Down Expand Up @@ -506,10 +510,13 @@ const unmarshalIp = (data: unknown) => {
address: data.address,
id: data.id,
organization: data.organization,
prefix: data.prefix,
project: data.project,
reverse: data.reverse,
server: data.server ? unmarshalServerSummary(data.server) : undefined,
state: data.state,
tags: data.tags,
type: data.type,
zone: data.zone,
} as Ip
}
Expand Down Expand Up @@ -602,6 +609,7 @@ const unmarshalServer = (data: unknown) => {
location: data.location
? unmarshalServerLocation(data.location)
: undefined,
macAddress: data.mac_address,
maintenances: unmarshalArrayOfObject(
data.maintenances,
unmarshalServerMaintenance,
Expand All @@ -617,6 +625,8 @@ const unmarshalServer = (data: unknown) => {
project: data.project,
protected: data.protected,
publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined,
publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),
routedIpEnabled: data.routed_ip_enabled,
securityGroup: data.security_group
? unmarshalSecurityGroupSummary(data.security_group)
: undefined,
Expand Down Expand Up @@ -1521,7 +1531,11 @@ const marshalServerIp = (
): Record<string, unknown> => ({
address: request.address,
dynamic: request.dynamic,
family: request.family,
gateway: request.gateway,
id: request.id,
netmask: request.netmask,
provisioning_mode: request.provisioningMode,
})

const marshalServerIpv6 = (
Expand Down Expand Up @@ -1648,6 +1662,7 @@ export const marshalCreateIpRequest = (
): Record<string, unknown> => ({
server: request.server,
tags: request.tags,
type: request.type ?? 'unknown_iptype',
...resolveOneOf([
{
default: defaults.defaultProjectId,
Expand Down Expand Up @@ -1754,6 +1769,8 @@ export const marshalCreateServerRequest = (
name: request.name || randomName('srv'),
placement_group: request.placementGroup,
public_ip: request.publicIp,
public_ips: request.publicIps,
routed_ip_enabled: request.routedIpEnabled,
security_group: request.securityGroup,
tags: request.tags,
volumes: request.volumes
Expand Down Expand Up @@ -2003,6 +2020,10 @@ export const marshalSetServerRequest = (
public_ip: request.publicIp
? marshalServerIp(request.publicIp, defaults)
: undefined,
public_ips: request.publicIps
? request.publicIps.map(elt => marshalServerIp(elt, defaults))
: undefined,
routed_ip_enabled: request.routedIpEnabled,
security_group: request.securityGroup
? marshalSecurityGroupSummary(request.securityGroup, defaults)
: undefined,
Expand Down Expand Up @@ -2046,6 +2067,7 @@ export const marshalUpdateIpRequest = (
reverse: request.reverse,
server: request.server,
tags: request.tags,
type: request.type ?? 'unknown_iptype',
})

export const marshalUpdatePlacementGroupRequest = (
Expand Down Expand Up @@ -2086,6 +2108,10 @@ export const marshalUpdateServerRequest = (
? request.privateNics.map(elt => marshalPrivateNIC(elt, defaults))
: undefined,
protected: request.protected,
public_ips: request.publicIps
? request.publicIps.map(elt => marshalServerIp(elt, defaults))
: undefined,
routed_ip_enabled: request.routedIpEnabled,
security_group: request.securityGroup
? marshalSecurityGroupTemplate(request.securityGroup, defaults)
: undefined,
Expand Down
38 changes: 36 additions & 2 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ export type BootType = 'local' | 'bootscript' | 'rescue'

export type ImageState = 'available' | 'creating' | 'error'

export type IpState =
| 'unknown_state'
| 'detached'
| 'attached'
| 'pending'
| 'error'

export type IpType = 'unknown_iptype' | 'nat' | 'routed_ipv4' | 'routed_ipv6'

export type ListServersRequestOrder =
| 'creation_date_desc'
| 'creation_date_asc'
Expand Down Expand Up @@ -38,6 +47,10 @@ export type ServerAction =
| 'terminate'
| 'reboot'

export type ServerIpIpFamily = 'inet' | 'inet6'

export type ServerIpProvisioningMode = 'manual' | 'dhcp' | 'slaac'

export type ServerState =
| 'running'
| 'stopped'
Expand Down Expand Up @@ -267,6 +280,9 @@ export interface Ip {
organization: string
tags: string[]
project: string
type: IpType
state: IpState
prefix: string
zone: Zone
}

Expand Down Expand Up @@ -510,8 +526,10 @@ export interface Server {
commercialType: string
/** Instance creation date. */
creationDate?: Date
/** True if a dynamic IP is required. */
/** True if a dynamic IPv4 is required. */
dynamicIpRequired: boolean
/** True to configure the instance so it uses the new routed IP mode. */
routedIpEnabled: boolean
/** True if IPv6 is enabled. */
enableIpv6: boolean
/** Instance host name. */
Expand All @@ -524,6 +542,10 @@ export interface Server {
privateIp?: string
/** Information about the public IP. */
publicIp?: ServerIp
/** Information about all the public IPs attached to the server. */
publicIps: ServerIp[]
/** The server's MAC address. */
macAddress: string
/** Instance modification date. */
modificationDate?: Date
/** Instance state. */
Expand Down Expand Up @@ -572,10 +594,18 @@ export interface ServerActionResponse {
export interface ServerIp {
/** Unique ID of the IP address. */
id: string
/** Instance public IPv4 IP-Address. */
/** Instance's public IP-Address. */
address: string
/** Gateway's IP address. */
gateway: string
/** CIDR netmask. */
netmask: string
/** IP address family (inet or inet6). */
family: ServerIpIpFamily
/** True if the IP address is dynamic. */
dynamic: boolean
/** Information about this address provisioning mode. */
provisioningMode: ServerIpProvisioningMode
}

/** Server. ipv6. */
Expand Down Expand Up @@ -1591,6 +1621,8 @@ export type CreateIpRequest = {
tags?: string[]
/** UUID of the Instance you want to attach the IP to. */
server?: string
/** IP type to reserve (either 'nat', 'routed_ipv4' or 'routed_ipv6'). */
type?: IpType
}

export type GetIpRequest = {
Expand All @@ -1607,6 +1639,8 @@ export type UpdateIpRequest = {
ip: string
/** Reverse domain name. */
reverse?: string | null
/** Convert a 'nat' IP to a 'routed_ipv4'. */
type?: IpType
/** An array of keywords you want to tag this IP with. */
tags?: string[]
server?: string | null
Expand Down
23 changes: 20 additions & 3 deletions packages/clients/src/api/instance/v1/types.private.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ export type CreateServerRequest = {
zone?: Zone
/** Instance name. */
name?: string
/** Define if a dynamic IP is required for the Instance. */
/** Define if a dynamic IPv4 is required for the Instance. */
dynamicIpRequired?: boolean
/** If true, configure the Instance so it uses the new routed IP mode. */
routedIpEnabled?: boolean
/** Define the Instance commercial type (i.e. GP1-S). */
commercialType: string
/** Instance image ID or label. */
Expand All @@ -73,8 +75,10 @@ export type CreateServerRequest = {
volumes?: Record<string, VolumeServerTemplate>
/** True if IPv6 is enabled on the server. */
enableIpv6: boolean
/** ID of the reserved IP to attach to the server. */
/** ID of the reserved IP to attach to the Instance. */
publicIp?: string
/** A list of reserved IP IDs to attach to the Instance. */
publicIps?: string[]
/** Boot type to use. */
bootType?: BootType
/** @deprecated Bootscript ID to use when `boot_type` is set to `bootscript`. */
Expand Down Expand Up @@ -120,8 +124,13 @@ export type SetServerRequest = {
commercialType: string
/** Instance creation date. */
creationDate?: Date
/** True if a dynamic IP is required. */
/** True if a dynamic IPv4 is required. */
dynamicIpRequired: boolean
/**
* True to configure the instance so it uses the new routed IP mode (once this
* is set to True you cannot set it back to False).
*/
routedIpEnabled?: boolean
/** True if IPv6 is enabled. */
enableIpv6: boolean
/** Instance host name. */
Expand All @@ -134,6 +143,8 @@ export type SetServerRequest = {
privateIp?: string
/** Information about the public IP. */
publicIp?: ServerIp
/** Information about all the public IPs attached to the server. */
publicIps?: ServerIp[]
/** Instance modification date. */
modificationDate?: Date
/** Instance state. */
Expand Down Expand Up @@ -179,6 +190,12 @@ export type UpdateServerRequest = {
/** @deprecated */
bootscript?: string
dynamicIpRequired?: boolean
/**
* True to configure the instance so it uses the new routed IP mode (once this
* is set to True you cannot set it back to False).
*/
routedIpEnabled?: boolean
publicIps?: ServerIp[]
enableIpv6?: boolean
protected?: boolean
securityGroup?: SecurityGroupTemplate
Expand Down