@@ -9,6 +9,13 @@ import (
99 "github.com/linode/linodego/internal/parseabletime"
1010)
1111
12+ type InterfaceGeneration string
13+
14+ const (
15+ GenerationLegacyConfig InterfaceGeneration = "legacy_config"
16+ GenerationLinode InterfaceGeneration = "linode"
17+ )
18+
1219/*
1320 * https://techdocs.akamai.com/linode-api/reference/post-linode-instance
1421 */
@@ -41,33 +48,35 @@ const (
4148
4249// Instance represents a linode object
4350type Instance struct {
44- ID int `json:"id"`
45- Created * time.Time `json:"-"`
46- Updated * time.Time `json:"-"`
47- Region string `json:"region"`
48- Alerts * InstanceAlert `json:"alerts"`
49- Backups * InstanceBackup `json:"backups"`
50- Image string `json:"image"`
51- Group string `json:"group"`
52- IPv4 []* net.IP `json:"ipv4"`
53- IPv6 string `json:"ipv6"`
54- Label string `json:"label"`
55- Type string `json:"type"`
56- Status InstanceStatus `json:"status"`
57- HasUserData bool `json:"has_user_data"`
58- Hypervisor string `json:"hypervisor"`
59- HostUUID string `json:"host_uuid"`
60- Specs * InstanceSpec `json:"specs"`
61- WatchdogEnabled bool `json:"watchdog_enabled"`
62- Tags []string `json:"tags"`
63-
64- PlacementGroup * InstancePlacementGroup `json:"placement_group"`
51+ ID int `json:"id"`
52+ Created * time.Time `json:"-"`
53+ Updated * time.Time `json:"-"`
54+ Region string `json:"region"`
55+ Alerts * InstanceAlert `json:"alerts"`
56+ Backups * InstanceBackup `json:"backups"`
57+ Image string `json:"image"`
58+ Group string `json:"group"`
59+ IPv4 []* net.IP `json:"ipv4"`
60+ IPv6 string `json:"ipv6"`
61+ Label string `json:"label"`
62+ Type string `json:"type"`
63+ Status InstanceStatus `json:"status"`
64+ HasUserData bool `json:"has_user_data"`
65+ Hypervisor string `json:"hypervisor"`
66+ HostUUID string `json:"host_uuid"`
67+ Specs * InstanceSpec `json:"specs"`
68+ WatchdogEnabled bool `json:"watchdog_enabled"`
69+ Tags []string `json:"tags"`
70+ PlacementGroup * InstancePlacementGroup `json:"placement_group"`
6571
6672 // NOTE: Disk encryption may not currently be available to all users.
6773 DiskEncryption InstanceDiskEncryption `json:"disk_encryption"`
6874
6975 LKEClusterID int `json:"lke_cluster_id"`
7076 Capabilities []string `json:"capabilities"`
77+
78+ // Note: Linode interfaces may not currently be available to all users.
79+ InterfaceGeneration InterfaceGeneration `json:"interface_generation"`
7180}
7281
7382// InstanceSpec represents a linode spec
@@ -168,22 +177,23 @@ type InstancePasswordResetOptions struct {
168177
169178// InstanceCreateOptions require only Region and Type
170179type InstanceCreateOptions struct {
171- Region string `json:"region"`
172- Type string `json:"type"`
173- Label string `json:"label,omitempty"`
174- RootPass string `json:"root_pass,omitempty"`
175- AuthorizedKeys []string `json:"authorized_keys,omitempty"`
176- AuthorizedUsers []string `json:"authorized_users,omitempty"`
177- StackScriptID int `json:"stackscript_id,omitempty"`
178- StackScriptData map [string ]string `json:"stackscript_data,omitempty"`
179- BackupID int `json:"backup_id,omitempty"`
180- Image string `json:"image,omitempty"`
181- Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
182- BackupsEnabled bool `json:"backups_enabled,omitempty"`
183- PrivateIP bool `json:"private_ip,omitempty"`
184- Tags []string `json:"tags,omitempty"`
185- Metadata * InstanceMetadataOptions `json:"metadata,omitempty"`
186- FirewallID int `json:"firewall_id,omitempty"`
180+ Region string `json:"region"`
181+ Type string `json:"type"`
182+ Label string `json:"label,omitempty"`
183+ RootPass string `json:"root_pass,omitempty"`
184+ AuthorizedKeys []string `json:"authorized_keys,omitempty"`
185+ AuthorizedUsers []string `json:"authorized_users,omitempty"`
186+ StackScriptID int `json:"stackscript_id,omitempty"`
187+ StackScriptData map [string ]string `json:"stackscript_data,omitempty"`
188+ BackupID int `json:"backup_id,omitempty"`
189+ Image string `json:"image,omitempty"`
190+ Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
191+ BackupsEnabled bool `json:"backups_enabled,omitempty"`
192+ PrivateIP bool `json:"private_ip,omitempty"`
193+ Tags []string `json:"tags,omitempty"`
194+ Metadata * InstanceMetadataOptions `json:"metadata,omitempty"`
195+ FirewallID int `json:"firewall_id,omitempty"`
196+ InterfaceGeneration InterfaceGeneration `json:"interface_generation,omitempty"`
187197
188198 // NOTE: Disk encryption may not currently be available to all users.
189199 DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"`
0 commit comments