Skip to content

Commit f90dabb

Browse files
Remove support for deprecated fields and endpoints (#696)
* Removed deprecated methods, fields, and structs * Fix lint
1 parent 47c640f commit f90dabb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+503
-2678
lines changed

account_events.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,6 @@ const (
207207
ActionVPCSubnetCreate EventAction = "subnet_create"
208208
ActionVPCSubnetDelete EventAction = "subnet_delete"
209209
ActionVPCSubnetUpdate EventAction = "subnet_update"
210-
211-
// Deprecated: incorrect spelling,
212-
// to be removed in the next major version release.
213-
ActionVolumeDelte EventAction = "volume_delete"
214-
215-
// Deprecated: incorrect spelling,
216-
// to be removed in the next major version
217-
ActionCreateCardUpdated = ActionCreditCardUpdated
218210
)
219211

220212
// EntityType constants start with Entity and include Linode API Event Entity Types

account_settings.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ type AccountSettingsUpdateOptions struct {
2727
// The default backups enrollment status for all new Linodes for all users on the account. When enabled, backups are mandatory per instance.
2828
BackupsEnabled *bool `json:"backups_enabled,omitempty"`
2929

30-
// A plan name like "longview-3"..."longview-100", or a nil value for to cancel any existing subscription plan.
31-
// Deprecated: Use PUT /longview/plan instead to update the LongviewSubscription
32-
LongviewSubscription *string `json:"longview_subscription,omitempty"`
33-
3430
// The default network helper setting for all new Linodes and Linode Configs for all users on the account.
3531
NetworkHelper *bool `json:"network_helper,omitempty"`
3632
}

databases.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ type Database struct {
8383
// Members has dynamic keys so it is a map
8484
Members map[string]DatabaseMemberType `json:"members"`
8585

86-
// Deprecated: ReplicationType is a deprecated property, as it is no longer supported in DBaaS V2.
87-
ReplicationType string `json:"replication_type"`
88-
// Deprecated: SSLConnection is a deprecated property, as it is no longer supported in DBaaS V2.
89-
SSLConnection bool `json:"ssl_connection"`
90-
// Deprecated: Encrypted is a deprecated property, as it is no longer supported in DBaaS V2.
91-
Encrypted bool `json:"encrypted"`
92-
9386
AllowList []string `json:"allow_list"`
9487
InstanceURI string `json:"instance_uri"`
9588
Created *time.Time `json:"-"`
@@ -118,9 +111,6 @@ type DatabaseMaintenanceWindow struct {
118111
HourOfDay int `json:"hour_of_day"`
119112

120113
Pending []DatabaseMaintenanceWindowPending `json:"pending,omitempty"`
121-
122-
// Deprecated: WeekOfMonth is a deprecated property, as it is no longer supported in DBaaS V2.
123-
WeekOfMonth *int `json:"week_of_month,omitempty"`
124114
}
125115

126116
type DatabaseMaintenanceWindowPending struct {

domains.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ type Domain struct {
1515
// If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave).
1616
Type DomainType `json:"type"` // Enum:"master" "slave"
1717

18-
// Deprecated: The group this Domain belongs to. This is for display purposes only.
19-
Group string `json:"group"`
20-
2118
// Used to control whether this Domain is currently being rendered.
2219
Status DomainStatus `json:"status"` // Enum:"disabled" "active" "edit_mode" "has_errors"
2320

@@ -64,9 +61,6 @@ type DomainCreateOptions struct {
6461
// Enum:"master" "slave"
6562
Type DomainType `json:"type"`
6663

67-
// Deprecated: The group this Domain belongs to. This is for display purposes only.
68-
Group *string `json:"group,omitempty"`
69-
7064
// Used to control whether this Domain is currently being rendered.
7165
// Enum:"disabled" "active" "edit_mode" "has_errors"
7266
Status *DomainStatus `json:"status,omitempty"`
@@ -109,9 +103,6 @@ type DomainUpdateOptions struct {
109103
// Enum:"master" "slave"
110104
Type *DomainType `json:"type,omitempty"`
111105

112-
// Deprecated: The group this Domain belongs to. This is for display purposes only.
113-
Group *string `json:"group,omitempty"`
114-
115106
// Used to control whether this Domain is currently being rendered.
116107
// Enum:"disabled" "active" "edit_mode" "has_errors"
117108
Status *DomainStatus `json:"status,omitempty"`
@@ -178,7 +169,6 @@ type DomainImportOptions struct {
178169
func (d Domain) GetUpdateOptions() (du DomainUpdateOptions) {
179170
du.Domain = &d.Domain
180171
du.Type = &d.Type
181-
du.Group = &d.Group
182172
du.Status = &d.Status
183173
du.Description = &d.Description
184174
du.SOAEmail = &d.SOAEmail

instance_ips.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public
120120
}
121121

122122
// UpdateInstanceIPAddress updates the IPAddress with the specified instance id and IP address
123-
func (c *Client) UpdateInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string, opts IPAddressUpdateOptions) (*InstanceIP, error) {
123+
func (c *Client) UpdateInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string, opts IPAddressUpdateOptionsV2) (*InstanceIP, error) {
124124
e := formatAPIPath("linode/instances/%d/ips/%s", linodeID, ipAddress)
125125
return doPUTRequest[InstanceIP](ctx, c, e, opts)
126126
}

instances.go

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,9 @@ type InstanceCreateOptions struct {
178178
PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
179179

180180
// Creation fields that need to be set explicitly false, "", or 0 use pointers
181-
SwapSize *int `json:"swap_size,omitempty"`
182-
Booted *bool `json:"booted,omitempty"`
183-
184-
// Deprecated: group is a deprecated property denoting a group label for the Linode.
185-
Group *string `json:"group,omitempty"`
186-
187-
IPv4 []string `json:"ipv4,omitempty"`
181+
SwapSize *int `json:"swap_size,omitempty"`
182+
Booted *bool `json:"booted,omitempty"`
183+
IPv4 []string `json:"ipv4,omitempty"`
188184
}
189185

190186
// InstanceCreatePlacementGroupOptions represents the placement group
@@ -201,9 +197,6 @@ type InstanceUpdateOptions struct {
201197
Alerts *InstanceAlert `json:"alerts,omitempty"`
202198
WatchdogEnabled *bool `json:"watchdog_enabled,omitempty"`
203199
Tags []string `json:"tags,omitempty"`
204-
205-
// Deprecated: group is a deprecated property denoting a group label for the Linode.
206-
Group *string `json:"group,omitempty"`
207200
}
208201

209202
// UnmarshalJSON implements the json.Unmarshaler interface
@@ -252,7 +245,6 @@ func (backup *InstanceBackup) UnmarshalJSON(b []byte) error {
252245
func (i *Instance) GetUpdateOptions() InstanceUpdateOptions {
253246
return InstanceUpdateOptions{
254247
Label: &i.Label,
255-
Group: &i.Group,
256248
Backups: i.Backups,
257249
Alerts: i.Alerts,
258250
WatchdogEnabled: &i.WatchdogEnabled,
@@ -274,9 +266,6 @@ type InstanceCloneOptions struct {
274266
PrivateIP *bool `json:"private_ip,omitempty"`
275267
Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
276268
PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
277-
278-
// Deprecated: group is a deprecated property denoting a group label for the Linode.
279-
Group *string `json:"group,omitempty"`
280269
}
281270

282271
// InstanceResizeOptions is an options struct used when resizing an instance
@@ -428,12 +417,6 @@ func (c *Client) ShutdownInstance(ctx context.Context, id int) error {
428417
return c.simpleInstanceAction(ctx, "shutdown", id)
429418
}
430419

431-
// Deprecated: Please use UpgradeInstance instead.
432-
// MutateInstance Upgrades a Linode to its next generation.
433-
func (c *Client) MutateInstance(ctx context.Context, id int) error {
434-
return c.simpleInstanceAction(ctx, "mutate", id)
435-
}
436-
437420
// InstanceUpgradeOptions is a struct representing the options for upgrading a Linode
438421
type InstanceUpgradeOptions struct {
439422
// Automatically resize disks when resizing a Linode.

lke_cluster_pools.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

mysql.go

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ type MySQLDatabase struct {
3333
// Members has dynamic keys so it is a map
3434
Members map[string]DatabaseMemberType `json:"members"`
3535

36-
// Deprecated: ReplicationType is a deprecated property, as it is no longer supported in DBaaS V2.
37-
ReplicationType string `json:"replication_type"`
38-
// Deprecated: SSLConnection is a deprecated property, as it is no longer supported in DBaaS V2.
39-
SSLConnection bool `json:"ssl_connection"`
40-
// Deprecated: Encrypted is a deprecated property, as it is no longer supported in DBaaS V2.
41-
Encrypted bool `json:"encrypted"`
42-
4336
AllowList []string `json:"allow_list"`
4437
InstanceURI string `json:"instance_uri"`
4538
Created *time.Time `json:"-"`
@@ -83,13 +76,6 @@ type MySQLCreateOptions struct {
8376
AllowList []string `json:"allow_list,omitempty"`
8477
ClusterSize *int `json:"cluster_size,omitempty"`
8578

86-
// Deprecated: ReplicationType is a deprecated property, as it is no longer supported in DBaaS V2.
87-
ReplicationType *string `json:"replication_type,omitempty"`
88-
// Deprecated: Encrypted is a deprecated property, as it is no longer supported in DBaaS V2.
89-
Encrypted *bool `json:"encrypted,omitempty"`
90-
// Deprecated: SSLConnection is a deprecated property, as it is no longer supported in DBaaS V2.
91-
SSLConnection *bool `json:"ssl_connection,omitempty"`
92-
9379
Fork *DatabaseFork `json:"fork,omitempty"`
9480
}
9581

@@ -103,42 +89,6 @@ type MySQLUpdateOptions struct {
10389
Version *string `json:"version,omitempty"`
10490
}
10591

106-
// MySQLDatabaseBackup is information for interacting with a backup for the existing MySQL Database
107-
// Deprecated: MySQLDatabaseBackup is a deprecated struct, as the backup endpoints are no longer supported in DBaaS V2.
108-
// In DBaaS V2, databases can be backed up via database forking.
109-
type MySQLDatabaseBackup struct {
110-
ID int `json:"id"`
111-
Label string `json:"label"`
112-
Type string `json:"type"`
113-
Created *time.Time `json:"-"`
114-
}
115-
116-
// MySQLBackupCreateOptions are options used for CreateMySQLDatabaseBackup(...)
117-
// Deprecated: MySQLBackupCreateOptions is a deprecated struct, as the backup endpoints are no longer supported in DBaaS V2.
118-
// In DBaaS V2, databases can be backed up via database forking.
119-
type MySQLBackupCreateOptions struct {
120-
Label string `json:"label"`
121-
Target MySQLDatabaseTarget `json:"target"`
122-
}
123-
124-
func (d *MySQLDatabaseBackup) UnmarshalJSON(b []byte) error {
125-
type Mask MySQLDatabaseBackup
126-
127-
p := struct {
128-
*Mask
129-
Created *parseabletime.ParseableTime `json:"created"`
130-
}{
131-
Mask: (*Mask)(d),
132-
}
133-
134-
if err := json.Unmarshal(b, &p); err != nil {
135-
return err
136-
}
137-
138-
d.Created = (*time.Time)(p.Created)
139-
return nil
140-
}
141-
14292
// MySQLDatabaseCredential is the Root Credentials to access the Linode Managed Database
14393
type MySQLDatabaseCredential struct {
14494
Username string `json:"username"`
@@ -155,13 +105,6 @@ func (c *Client) ListMySQLDatabases(ctx context.Context, opts *ListOptions) ([]M
155105
return getPaginatedResults[MySQLDatabase](ctx, c, "databases/mysql/instances", opts)
156106
}
157107

158-
// ListMySQLDatabaseBackups lists all MySQL Database Backups associated with the given MySQL Database
159-
// Deprecated: ListMySQLDatabaseBackups is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
160-
// In DBaaS V2, databases can be backed up via database forking.
161-
func (c *Client) ListMySQLDatabaseBackups(ctx context.Context, databaseID int, opts *ListOptions) ([]MySQLDatabaseBackup, error) {
162-
return getPaginatedResults[MySQLDatabaseBackup](ctx, c, formatAPIPath("databases/mysql/instances/%d/backups", databaseID), opts)
163-
}
164-
165108
// GetMySQLDatabase returns a single MySQL Database matching the id
166109
func (c *Client) GetMySQLDatabase(ctx context.Context, databaseID int) (*MySQLDatabase, error) {
167110
e := formatAPIPath("databases/mysql/instances/%d", databaseID)
@@ -203,30 +146,6 @@ func (c *Client) ResetMySQLDatabaseCredentials(ctx context.Context, databaseID i
203146
return doPOSTRequestNoRequestResponseBody(ctx, c, e)
204147
}
205148

206-
// GetMySQLDatabaseBackup returns a specific MySQL Database Backup with the given ids
207-
// Deprecated: GetMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
208-
// In DBaaS V2, databases can be backed up via database forking.
209-
func (c *Client) GetMySQLDatabaseBackup(ctx context.Context, databaseID int, backupID int) (*MySQLDatabaseBackup, error) {
210-
e := formatAPIPath("databases/mysql/instances/%d/backups/%d", databaseID, backupID)
211-
return doGETRequest[MySQLDatabaseBackup](ctx, c, e)
212-
}
213-
214-
// RestoreMySQLDatabaseBackup returns the given MySQL Database with the given Backup
215-
// Deprecated: RestoreMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
216-
// In DBaaS V2, databases can be backed up via database forking.
217-
func (c *Client) RestoreMySQLDatabaseBackup(ctx context.Context, databaseID int, backupID int) error {
218-
e := formatAPIPath("databases/mysql/instances/%d/backups/%d/restore", databaseID, backupID)
219-
return doPOSTRequestNoRequestResponseBody(ctx, c, e)
220-
}
221-
222-
// CreateMySQLDatabaseBackup creates a snapshot for the given MySQL database
223-
// Deprecated: CreateMySQLDatabaseBackup is a deprecated method, as the backup endpoints are no longer supported in DBaaS V2.
224-
// In DBaaS V2, databases can be backed up via database forking.
225-
func (c *Client) CreateMySQLDatabaseBackup(ctx context.Context, databaseID int, opts MySQLBackupCreateOptions) error {
226-
e := formatAPIPath("databases/mysql/instances/%d/backups", databaseID)
227-
return doPOSTRequestNoResponseBody(ctx, c, e, opts)
228-
}
229-
230149
// PatchMySQLDatabase applies security patches and updates to the underlying operating system of the Managed MySQL Database
231150
func (c *Client) PatchMySQLDatabase(ctx context.Context, databaseID int) error {
232151
e := formatAPIPath("databases/mysql/instances/%d/patch", databaseID)

network_ips.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ type IPAddressUpdateOptionsV2 struct {
1616
RDNS **string `json:"rdns,omitempty"`
1717
}
1818

19-
// IPAddressUpdateOptions fields are those accepted by UpdateIPAddress.
20-
// Deprecated: Please use IPAddressUpdateOptionsV2 for all new implementations.
21-
type IPAddressUpdateOptions struct {
22-
RDNS *string `json:"rdns"`
23-
}
24-
2519
// LinodeIPAssignment stores an assignment between an IP address and a Linode instance.
2620
type LinodeIPAssignment struct {
2721
Address string `json:"address"`
@@ -65,13 +59,6 @@ func (i InstanceIP) GetUpdateOptionsV2() IPAddressUpdateOptionsV2 {
6559
}
6660
}
6761

68-
// GetUpdateOptions converts a IPAddress to IPAddressUpdateOptions for use in UpdateIPAddress.
69-
// Deprecated: Please use GetUpdateOptionsV2 for all new implementations.
70-
func (i InstanceIP) GetUpdateOptions() (o IPAddressUpdateOptions) {
71-
o.RDNS = copyString(&i.RDNS)
72-
return
73-
}
74-
7562
// ListIPAddresses lists IPAddresses.
7663
func (c *Client) ListIPAddresses(ctx context.Context, opts *ListOptions) ([]InstanceIP, error) {
7764
return getPaginatedResults[InstanceIP](ctx, c, "networking/ips", opts)
@@ -89,13 +76,6 @@ func (c *Client) UpdateIPAddressV2(ctx context.Context, address string, opts IPA
8976
return doPUTRequest[InstanceIP](ctx, c, e, opts)
9077
}
9178

92-
// UpdateIPAddress updates the IP address with the specified id.
93-
// Deprecated: Please use UpdateIPAddressV2 for all new implementation.
94-
func (c *Client) UpdateIPAddress(ctx context.Context, id string, opts IPAddressUpdateOptions) (*InstanceIP, error) {
95-
e := formatAPIPath("networking/ips/%s", id)
96-
return doPUTRequest[InstanceIP](ctx, c, e, opts)
97-
}
98-
9979
// InstancesAssignIPs assigns multiple IPv4 addresses and/or IPv6 ranges to multiple Linodes in one Region.
10080
// This allows swapping, shuffling, or otherwise reorganizing IPs to your Linodes.
10181
func (c *Client) InstancesAssignIPs(ctx context.Context, opts LinodesAssignIPsOptions) error {

object_storage_bucket_certs.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ import (
44
"context"
55
)
66

7-
// Deprecated: Please use ObjectStorageBucketCertV2 for all new implementations.
8-
type ObjectStorageBucketCert struct {
9-
SSL bool `json:"ssl"`
10-
}
11-
127
type ObjectStorageBucketCertV2 struct {
138
SSL *bool `json:"ssl"`
149
}
@@ -18,20 +13,6 @@ type ObjectStorageBucketCertUploadOptions struct {
1813
PrivateKey string `json:"private_key"`
1914
}
2015

21-
// UploadObjectStorageBucketCert uploads a TLS/SSL Cert to be used with an Object Storage Bucket.
22-
// Deprecated: Please use UploadObjectStorageBucketCertV2 for all new implementations.
23-
func (c *Client) UploadObjectStorageBucketCert(ctx context.Context, clusterOrRegionID, bucket string, opts ObjectStorageBucketCertUploadOptions) (*ObjectStorageBucketCert, error) {
24-
e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)
25-
return doPOSTRequest[ObjectStorageBucketCert](ctx, c, e, opts)
26-
}
27-
28-
// GetObjectStorageBucketCert gets an ObjectStorageBucketCert
29-
// Deprecated: Please use GetObjectStorageBucketCertV2 for all new implementations.
30-
func (c *Client) GetObjectStorageBucketCert(ctx context.Context, clusterOrRegionID, bucket string) (*ObjectStorageBucketCert, error) {
31-
e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)
32-
return doGETRequest[ObjectStorageBucketCert](ctx, c, e)
33-
}
34-
3516
// UploadObjectStorageBucketCert uploads a TLS/SSL Cert to be used with an Object Storage Bucket.
3617
func (c *Client) UploadObjectStorageBucketCertV2(ctx context.Context, clusterOrRegionID, bucket string, opts ObjectStorageBucketCertUploadOptions) (*ObjectStorageBucketCertV2, error) {
3718
e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)

0 commit comments

Comments
 (0)