-
Notifications
You must be signed in to change notification settings - Fork 390
upcoming: [M3-9535] - Support VPC interfaces on updated Linode Create Networking flow #11847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
020c05c
6dbb533
295f00c
8383903
ecc443b
cdc5d70
68ff981
056388f
391d8a2
e1e76a2
450f87e
a5d558d
ffd9d14
ff4395e
5fc42d0
42a3772
499b744
4bf1265
ad8acdd
6d02652
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,7 +201,23 @@ export interface Interface { | |
| ip_ranges?: string[]; | ||
| } | ||
|
|
||
| export type InterfacePayload = Omit<Interface, 'id' | 'active'>; | ||
| export interface InterfacePayload { | ||
| /** | ||
| * Required to specify a VLAN | ||
| */ | ||
| label?: string | null; | ||
| purpose: InterfacePurpose; | ||
| /** | ||
| * Used for VLAN, but is optional | ||
| */ | ||
| ipam_address?: string | null; | ||
| primary?: boolean; | ||
| subnet_id?: number | null; | ||
| vpc_id?: number | null; | ||
| ipv4?: ConfigInterfaceIPv4; | ||
| ipv6?: ConfigInterfaceIPv6; | ||
| ip_ranges?: string[] | null; | ||
| } | ||
|
|
||
| export interface ConfigInterfaceOrderPayload { | ||
| ids: number[]; | ||
|
|
@@ -527,7 +543,7 @@ export interface CreateLinodeRequest { | |
| * This is used to set the swap disk size for the newly-created Linode. | ||
| * @default 512 | ||
| */ | ||
| swap_size?: number; | ||
| swap_size?: number | null; | ||
| /** | ||
| * An Image ID to deploy the Linode Disk from. | ||
| */ | ||
|
|
@@ -540,7 +556,7 @@ export interface CreateLinodeRequest { | |
| * A list of public SSH keys that will be automatically appended to the root userβs | ||
| * `~/.ssh/authorized_keys`file when deploying from an Image. | ||
| */ | ||
| authorized_keys?: string[]; | ||
| authorized_keys?: string[] | null; | ||
| /** | ||
| * If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. | ||
| * This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed. | ||
|
|
@@ -549,7 +565,7 @@ export interface CreateLinodeRequest { | |
| * | ||
| * @default false | ||
| */ | ||
| backups_enabled?: boolean; | ||
| backups_enabled?: boolean | null; | ||
| /** | ||
| * This field is required only if the StackScript being deployed requires input data from the User for successful completion | ||
| */ | ||
|
|
@@ -560,29 +576,29 @@ export interface CreateLinodeRequest { | |
| * @default true if the Linode is created with an Image or from a Backup. | ||
| * @default false if using new Linode Interfaces and no interfaces are defined | ||
| */ | ||
| booted?: boolean; | ||
| booted?: boolean | null; | ||
| /** | ||
| * The Linodeβs label is for display purposes only. | ||
| * If no label is provided for a Linode, a default will be assigned. | ||
| */ | ||
| label?: string; | ||
| label?: string | null; | ||
| /** | ||
| * An array of tags applied to this object. | ||
| * | ||
| * Tags are for organizational purposes only. | ||
| */ | ||
| tags?: string[]; | ||
| tags?: string[] | null; | ||
| /** | ||
| * If true, the created Linode will have private networking enabled and assigned a private IPv4 address. | ||
| * @default false | ||
| */ | ||
| private_ip?: boolean; | ||
| private_ip?: boolean | null; | ||
| /** | ||
| * A list of usernames. If the usernames have associated SSH keys, | ||
| * the keys will be appended to the root users `~/.ssh/authorized_keys` | ||
| * file automatically when deploying from an Image. | ||
| */ | ||
| authorized_users?: string[]; | ||
| authorized_users?: string[] | null; | ||
| /** | ||
| * An array of Network Interfaces to add to this Linodeβs Configuration Profile. | ||
| */ | ||
|
|
@@ -598,7 +614,7 @@ export interface CreateLinodeRequest { | |
| * | ||
| * Default value on depends on interfaces_for_new_linodes field in AccountSettings object. | ||
| */ | ||
| interface_generation?: InterfaceGenerationType; | ||
| interface_generation?: InterfaceGenerationType | null; | ||
| /** | ||
| * Default value mirrors network_helper in AccountSettings object. Should only be | ||
| * present when using Linode Interfaces. | ||
|
|
@@ -612,20 +628,20 @@ export interface CreateLinodeRequest { | |
| /** | ||
| * An object containing user-defined data relevant to the creation of Linodes. | ||
| */ | ||
| metadata?: UserData; | ||
| metadata?: UserData | null; | ||
| /** | ||
| * The `id` of the Firewall to attach this Linode to upon creation. | ||
| */ | ||
| firewall_id?: number | null; | ||
| /** | ||
| * An object that assigns this the Linode to a placement group upon creation. | ||
| */ | ||
| placement_group?: CreateLinodePlacementGroupPayload; | ||
| placement_group?: CreateLinodePlacementGroupPayload | null; | ||
| /** | ||
| * A property with a string literal type indicating whether the Linode is encrypted or unencrypted. | ||
| * @default 'enabled' (if the region supports LDE) | ||
| */ | ||
| disk_encryption?: EncryptionStatus; | ||
| disk_encryption?: EncryptionStatus | null; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine, but does it open the door to having ALL our APIv4 POST/PUT payload types have to inherit this pattern eventually? Nothing wrong with it, but this is a considerable change to bring to the table.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think api-v4 and validation should always match what the API supports, which usually means treating null and omitting the value the same. I'm sure apiv4 is inconstant with this and I'm confident validation is even more inconstant with it |
||
| } | ||
|
|
||
| export interface MigrateLinodeRequest { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Tech Stories | ||
| --- | ||
|
|
||
| Improved type-safety of Linode Create flow form ([#11847](https://github.com/linode/manager/pull/11847)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Initial support for VPCs using Linode Interfaces on the Linode create flow ([#11847](https://github.com/linode/manager/pull/11847)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the type-safety is largely improved, I had to make these changes so that this type matches our validation schema
In most cases, if the API allows a value to be omitted, it will also gracefully handle
nulland treat it the same.