diff --git a/packages/clients/src/api/instance/v1/api.gen.ts b/packages/clients/src/api/instance/v1/api.gen.ts index c60dff38a..62c4a07b4 100644 --- a/packages/clients/src/api/instance/v1/api.gen.ts +++ b/packages/clients/src/api/instance/v1/api.gen.ts @@ -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 diff --git a/packages/clients/src/api/instance/v1/content.gen.ts b/packages/clients/src/api/instance/v1/content.gen.ts index 7cf60bf1e..cbd4f9a7c 100644 --- a/packages/clients/src/api/instance/v1/content.gen.ts +++ b/packages/clients/src/api/instance/v1/content.gen.ts @@ -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, @@ -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'] diff --git a/packages/clients/src/api/instance/v1/index.gen.ts b/packages/clients/src/api/instance/v1/index.gen.ts index e6adc378a..52eafa651 100644 --- a/packages/clients/src/api/instance/v1/index.gen.ts +++ b/packages/clients/src/api/instance/v1/index.gen.ts @@ -66,6 +66,8 @@ export type { Image, ImageState, Ip, + IpState, + IpType, ListBootscriptsRequest, ListBootscriptsResponse, ListDefaultSecurityGroupRulesRequest, @@ -117,6 +119,8 @@ export type { ServerActionRequestVolumeBackupTemplate, ServerActionResponse, ServerIp, + ServerIpIpFamily, + ServerIpProvisioningMode, ServerIpv6, ServerLocation, ServerMaintenance, diff --git a/packages/clients/src/api/instance/v1/marshalling.gen.ts b/packages/clients/src/api/instance/v1/marshalling.gen.ts index 8c8fb92c4..9274c911e 100644 --- a/packages/clients/src/api/instance/v1/marshalling.gen.ts +++ b/packages/clients/src/api/instance/v1/marshalling.gen.ts @@ -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 } @@ -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 } @@ -602,6 +609,7 @@ const unmarshalServer = (data: unknown) => { location: data.location ? unmarshalServerLocation(data.location) : undefined, + macAddress: data.mac_address, maintenances: unmarshalArrayOfObject( data.maintenances, unmarshalServerMaintenance, @@ -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, @@ -1521,7 +1531,11 @@ const marshalServerIp = ( ): Record => ({ address: request.address, dynamic: request.dynamic, + family: request.family, + gateway: request.gateway, id: request.id, + netmask: request.netmask, + provisioning_mode: request.provisioningMode, }) const marshalServerIpv6 = ( @@ -1648,6 +1662,7 @@ export const marshalCreateIpRequest = ( ): Record => ({ server: request.server, tags: request.tags, + type: request.type ?? 'unknown_iptype', ...resolveOneOf([ { default: defaults.defaultProjectId, @@ -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 @@ -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, @@ -2046,6 +2067,7 @@ export const marshalUpdateIpRequest = ( reverse: request.reverse, server: request.server, tags: request.tags, + type: request.type ?? 'unknown_iptype', }) export const marshalUpdatePlacementGroupRequest = ( @@ -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, diff --git a/packages/clients/src/api/instance/v1/types.gen.ts b/packages/clients/src/api/instance/v1/types.gen.ts index 3c559e607..56a43e082 100644 --- a/packages/clients/src/api/instance/v1/types.gen.ts +++ b/packages/clients/src/api/instance/v1/types.gen.ts @@ -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' @@ -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' @@ -267,6 +280,9 @@ export interface Ip { organization: string tags: string[] project: string + type: IpType + state: IpState + prefix: string zone: Zone } @@ -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. */ @@ -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. */ @@ -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. */ @@ -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 = { @@ -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 diff --git a/packages/clients/src/api/instance/v1/types.private.gen.ts b/packages/clients/src/api/instance/v1/types.private.gen.ts index 0362f3abe..958b45301 100644 --- a/packages/clients/src/api/instance/v1/types.private.gen.ts +++ b/packages/clients/src/api/instance/v1/types.private.gen.ts @@ -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. */ @@ -73,8 +75,10 @@ export type CreateServerRequest = { volumes?: Record /** 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`. */ @@ -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. */ @@ -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. */ @@ -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