diff --git a/account.go b/account.go index d7abb697a..a743e7785 100644 --- a/account.go +++ b/account.go @@ -29,6 +29,7 @@ type Account struct { BillingSource string `json:"billing_source"` Capabilities []string `json:"capabilities"` ActiveSince *time.Time `json:"active_since"` + ActivePromotions []Promotion `json:"active_promotions"` } // AccountUpdateOptions fields are those accepted by UpdateAccount diff --git a/account_events.go b/account_events.go index 678fc57ab..faf4186ec 100644 --- a/account_events.go +++ b/account_events.go @@ -46,6 +46,12 @@ type Event struct { // When this Event was created. Created *time.Time `json:"-"` + + // Provides additional information about the event. + Message string `json:"message"` + + // The total duration in seconds that it takes for the Event to complete. + Duration float64 `json:"duration"` } // EventAction constants start with Action and include all known Linode API Event Actions. diff --git a/account_invoices.go b/account_invoices.go index afc88209f..52b131ab7 100644 --- a/account_invoices.go +++ b/account_invoices.go @@ -10,23 +10,33 @@ import ( // Invoice structs reflect an invoice for billable activity on the account. type Invoice struct { - ID int `json:"id"` - Label string `json:"label"` - Total float32 `json:"total"` - Date *time.Time `json:"-"` + ID int `json:"id"` + Label string `json:"label"` + Total float32 `json:"total"` + Date *time.Time `json:"-"` + Tax float32 `json:"tax"` + Subtotal float32 `json:"subtotal"` + BillingSource string `json:"billing_source"` + TaxSummary []InvoiceTaxSummary `json:"tax_summary"` +} + +type InvoiceTaxSummary struct { + Tax float32 `json:"tax"` + Name string `json:"name"` } // InvoiceItem structs reflect a single billable activity associate with an Invoice type InvoiceItem struct { Label string `json:"label"` Type string `json:"type"` - UnitPrice int `json:"unitprice"` + UnitPrice float32 `json:"unit_price"` Quantity int `json:"quantity"` Amount float32 `json:"amount"` Tax float32 `json:"tax"` Region *string `json:"region"` From *time.Time `json:"-"` To *time.Time `json:"-"` + Total float32 `json:"total"` } // ListInvoices gets a paginated list of Invoices against the Account diff --git a/profile.go b/profile.go index b07e842a1..bc5761dbf 100644 --- a/profile.go +++ b/profile.go @@ -26,17 +26,19 @@ type ProfileReferrals struct { // Profile represents a Profile object type Profile struct { - UID int `json:"uid"` - Username string `json:"username"` - Email string `json:"email"` - Timezone string `json:"timezone"` - EmailNotifications bool `json:"email_notifications"` - IPWhitelistEnabled bool `json:"ip_whitelist_enabled"` - TwoFactorAuth bool `json:"two_factor_auth"` - Restricted bool `json:"restricted"` - LishAuthMethod LishAuthMethod `json:"lish_auth_method"` - Referrals ProfileReferrals `json:"referrals"` - AuthorizedKeys []string `json:"authorized_keys"` + UID int `json:"uid"` + Username string `json:"username"` + Email string `json:"email"` + Timezone string `json:"timezone"` + EmailNotifications bool `json:"email_notifications"` + IPWhitelistEnabled bool `json:"ip_whitelist_enabled"` + TwoFactorAuth bool `json:"two_factor_auth"` + Restricted bool `json:"restricted"` + LishAuthMethod LishAuthMethod `json:"lish_auth_method"` + Referrals ProfileReferrals `json:"referrals"` + AuthorizedKeys []string `json:"authorized_keys"` + AuthenticationType string `json:"authentication_type"` + VerifiedPhoneNumber string `json:"verified_phone_number,omitempty"` } // ProfileUpdateOptions fields are those accepted by UpdateProfile diff --git a/support.go b/support.go index 4af871ecf..2fb2d7b22 100644 --- a/support.go +++ b/support.go @@ -19,6 +19,7 @@ type Ticket struct { Summary string `json:"summary"` Updated *time.Time `json:"-"` UpdatedBy string `json:"updated_by"` + Closeable bool `json:"closeable"` } // TicketEntity refers a ticket to a specific entity diff --git a/test/integration/account_invoice_test.go b/test/integration/account_invoice_test.go deleted file mode 100644 index a02b83ab1..000000000 --- a/test/integration/account_invoice_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package integration - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestInvoice_List(t *testing.T) { - warnSensitiveTest(t) - client, teardown := createTestClient(t, "fixtures/TestInvoice_List") - defer teardown() - - invoices, err := client.ListInvoices(context.Background(), nil) - require.NoError(t, err, "Error getting Invoices, expected struct") - require.NotEmpty(t, invoices, "Expected to see invoices returned") -} - -func TestInvoice_Get(t *testing.T) { - warnSensitiveTest(t) - client, teardown := createTestClient(t, "fixtures/TestInvoice_Get") - defer teardown() - - invoice, err := client.GetInvoice(context.Background(), 123) - require.NoError(t, err, "Error getting Invoice, expected struct") - require.Equal(t, 123, invoice.ID, "Expected Invoice ID to be 123") - require.Equal(t, "Invoice", invoice.Label, "Expected Invoice Label to be 'Invoice'") - require.Equal(t, 132.5, float64(invoice.Total), "Expected Invoice Total to be 132.5") -} - -func TestInvoiceItems_List(t *testing.T) { - warnSensitiveTest(t) - client, teardown := createTestClient(t, "fixtures/TestInvoiceItems_List") - defer teardown() - - items, err := client.ListInvoiceItems(context.Background(), 123, nil) - require.NoError(t, err, "Error getting Invoice Items, expected struct") - require.NotEmpty(t, items, "Expected to see invoice items returned") - - item := items[0] - require.Equal(t, "Linode 2GB", item.Label, "Expected item label to be 'Linode 2GB'") - require.Equal(t, 10.0, float64(item.Amount), "Expected item amount to be 10") -} diff --git a/test/integration/fixtures/TestAccountEvents_List.yaml b/test/integration/fixtures/TestAccountEvents_List.yaml index 67bd09208..32a0be91f 100644 --- a/test/integration/fixtures/TestAccountEvents_List.yaml +++ b/test/integration/fixtures/TestAccountEvents_List.yaml @@ -15,27 +15,28 @@ interactions: method: GET response: body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": - ["Linodes", "Backups", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", - "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", - "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.105.34.5, - 172.105.35.5, 172.105.36.5, 172.105.37.5, 172.105.38.5, 172.105.39.5, 172.105.40.5, - 172.105.41.5, 172.105.42.5, 172.105.43.5", "ipv6": "1234::5678, + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": + {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, 172.105.38.5, + 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", "ipv6": + "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678"}, - "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": - 5}, "site_type": "core"}, {"id": "ca-central", "label": "Toronto, CA", "country": - "ca", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed - Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": - "172.105.0.5, 172.105.3.5, 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, - 172.105.8.5, 172.105.9.5, 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, + 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": + null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "ca-central", + "label": "Toronto, CA", "country": "ca", "capabilities": ["Linodes", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement + Group"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, 172.105.4.5, + 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, 172.105.10.5, + 172.105.11.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678"}, - "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": - 5}, "site_type": "core"}, {"id": "ap-southeast", "label": "Sydney, AU", "country": - "au", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "ap-southeast", "label": "Sydney, AU", "country": "au", "capabilities": + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, @@ -45,28 +46,30 @@ interactions: 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-iad", "label": - "Washington, DC", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", - "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", - "VPCs", "Managed Databases", "Metadata", "Premium Plans", "Placement Group"], - "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, - 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, - 139.144.192.52, 139.144.192.68", "ipv6": "1234::5678, 1234::5678, + "Washington, DC", "country": "us", "capabilities": ["Linodes", "Block Storage + Encryption", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Managed + Databases", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", + "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, + 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, + 139.144.192.68", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": - ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "GPU - Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", - "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, - 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", "ipv6": - "1234::5678, 1234::5678, 1234::5678, + ["Linodes", "Block Storage Encryption", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium Plans", "Placement + Group"], "status": "ok", "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, + 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, + 172.232.0.15, 172.232.0.18", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "fr-par", "label": - "Paris, FR", "country": "fr", "capabilities": ["Linodes", "Backups", "NodeBalancers", + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": + ["Linodes", "Block Storage Encryption", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, @@ -77,17 +80,18 @@ interactions: 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": - ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "GPU - Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium - Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.160.19, - 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, 172.232.160.8, - 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", "ipv6": "1234::5678, + ["Linodes", "Block Storage Encryption", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": + "ok", "resolvers": {"ipv4": "172.232.160.19, 172.232.160.21, 172.232.160.17, + 172.232.160.15, 172.232.160.18, 172.232.160.8, 172.232.160.12, 172.232.160.11, + 172.232.160.14, 172.232.160.16", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678"}, - "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": - 5}, "site_type": "core"}, {"id": "br-gru", "label": "Sao Paulo, BR", "country": - "br", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "br-gru", "label": "Sao Paulo, BR", "country": "br", "capabilities": + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, @@ -97,9 +101,10 @@ interactions: 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "nl-ams", "label": "Amsterdam, NL", "country": - "nl", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", - "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + "nl", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium + Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, @@ -107,9 +112,10 @@ interactions: 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "se-sto", "label": "Stockholm, SE", "country": - "se", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", - "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.128.24, + "se", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium + Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, @@ -117,19 +123,17 @@ interactions: 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "es-mad", "label": "Madrid, ES", "country": - "es", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", - "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.111.6, - 172.233.111.17, 172.233.111.21, 172.233.111.25, 172.233.111.19, 172.233.111.12, - 172.233.111.26, 172.233.111.16, 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, - 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678"}, + "es", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": + {"ipv4": "172.233.111.6,172.233.111.17,172.233.111.21,172.233.111.25,172.233.111.19,172.233.111.12,172.233.111.26,172.233.111.16,172.233.111.18,172.233.111.9", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "in-maa", "label": "Chennai, IN", "country": - "in", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", - "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + "in", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium + Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, @@ -137,47 +141,50 @@ interactions: 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "jp-osa", "label": "Osaka, JP", "country": - "jp", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", - "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, - 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", - "ipv6": "1234::5678, 1234::5678, 1234::5678, + "jp", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium Plans", "Placement + Group"], "status": "ok", "resolvers": {"ipv4": "172.233.64.44, 172.233.64.43, + 172.233.64.37, 172.233.64.40, 172.233.64.46, 172.233.64.41, 172.233.64.39, 172.233.64.42, + 172.233.64.45, 172.233.64.38", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "it-mil", "label": - "Milan, IT", "country": "it", "capabilities": ["Linodes", "Backups", "NodeBalancers", - "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", - "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, 172.232.192.20, 172.232.192.24, - 172.232.192.21, 172.232.192.22, 172.232.192.17, 172.232.192.15, 172.232.192.23", - "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "it-mil", "label": "Milan, IT", "country": "it", "capabilities": + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.232.192.19, + 172.232.192.18, 172.232.192.16, 172.232.192.20, 172.232.192.24, 172.232.192.21, + 172.232.192.22, 172.232.192.17, 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-mia", "label": - "Miami, FL", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", - "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", - "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, - 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", - "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "us-mia", "label": "Miami, FL", "country": + "us", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium + Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.160.34, + 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, 172.233.160.28, + 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "id-cgk", "label": - "Jakarta, ID", "country": "id", "capabilities": ["Linodes", "Backups", "NodeBalancers", - "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", - "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "172.232.224.23, 172.232.224.32, 172.232.224.26, 172.232.224.27, 172.232.224.21, - 172.232.224.24, 172.232.224.22, 172.232.224.20, 172.232.224.31, 172.232.224.28", - "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "id-cgk", "label": "Jakarta, ID", "country": + "id", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], + "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, 172.232.224.26, + 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, 172.232.224.20, + 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-lax", "label": - "Los Angeles, CA", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "Block Storage Encryption", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, 172.233.128.34, @@ -186,122 +193,109 @@ interactions: 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-den-edge-1", - "label": "Edge - Denver, CO", "country": "us", "capabilities": ["Linodes", "Cloud - Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "de-ham-edge-1", - "label": "Edge - Hamburg, DE", "country": "de", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "fr-mrs-edge-1", - "label": "Edge - Marseille, FR", "country": "fr", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "za-jnb-edge-1", - "label": "Edge - Johannesburg, ZA\t", "country": "za", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "my-kul-edge-1", - "label": "Edge - Kuala Lumpur, MY", "country": "my", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "co-bog-edge-1", - "label": "Edge - Bogot\u00e1, CO", "country": "co", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "mx-qro-edge-1", - "label": "Edge - Quer\u00e9taro, MX", "country": "mx", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "us-hou-edge-1", - "label": "Edge - Houston, TX", "country": "us", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "cl-scl-edge-1", - "label": "Edge - Santiago, CL", "country": "cl", "capabilities": ["Linodes", - "Cloud Firewall", "Distributed Plans", "Placement Group"], "status": "ok", "resolvers": - {"ipv4": "173.223.100.53, 173.223.101.53", "ipv6": "1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "distributed"}, {"id": "us-central", - "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "Backups", - "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block + null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "gb-lon", "label": + "London 2, UK", "country": "gb", "capabilities": ["Linodes", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], "status": + "ok", "resolvers": {"ipv4": "172.236.0.46,172.236.0.50,172.236.0.47,172.236.0.53,172.236.0.52,172.236.0.45,172.236.0.49,172.236.0.51,172.236.0.54,172.236.0.48", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "au-mel", "label": "Melbourne, AU", "country": + "au", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.236.32.23,172.236.32.35,172.236.32.30,172.236.32.28,172.236.32.32,172.236.32.33,172.236.32.27,172.236.32.37,172.236.32.29,172.236.32.34", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "in-bom-2", "label": "Mumbai 2, IN", "country": + "in", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans", + "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.236.171.41,172.236.171.42,172.236.171.25,172.236.171.44,172.236.171.26,172.236.171.45,172.236.171.24,172.236.171.43,172.236.171.27,172.236.171.28", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "de-fra-2", "label": "Frankfurt 2, DE", "country": + "de", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", + "Metadata", "Premium Plans", "Placement Group"], "status": "ok", "resolvers": + {"ipv4": "172.236.203.9,172.236.203.16,172.236.203.19,172.236.203.15,172.236.203.17,172.236.203.11,172.236.203.18,172.236.203.14,172.236.203.13,172.236.203.12", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "sg-sin-2", "label": "Singapore 2, SG", "country": + "sg", "capabilities": ["Linodes", "Block Storage Encryption", "Disk Encryption", + "Backups", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans", "Placement Group"], + "status": "ok", "resolvers": {"ipv4": "172.236.129.8,172.236.129.42,172.236.129.41,172.236.129.19,172.236.129.46,172.236.129.23,172.236.129.48,172.236.129.20,172.236.129.21,172.236.129.47", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "jp-tyo-3", "label": "Tokyo 3, JP", "country": + "jp", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "172.237.4.15,172.237.4.19,172.237.4.17,172.237.4.21,172.237.4.16,172.237.4.18,172.237.4.23,172.237.4.24,172.237.4.20,172.237.4.14", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "us-central", "label": "Dallas, TX", "country": + "us", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": + {"ipv4": "72.14.179.5, 72.14.188.5, 173.255.199.5, 66.228.53.5, 96.126.122.5, + 96.126.124.5, 96.126.127.5, 198.58.107.5, 198.58.111.5, 23.239.24.5", "ipv6": + "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "us-west", "label": "Fremont, CA", "country": "us", "capabilities": + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": + "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, 173.255.219.5, + 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", "ipv6": + "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": + {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": + "core"}, {"id": "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": + ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases", "Metadata", "Placement Group"], "status": + "ok", "resolvers": {"ipv4": "74.207.231.5,173.230.128.5,173.230.129.5,173.230.136.5,173.230.140.5,66.228.59.5,66.228.62.5,50.116.35.5,50.116.41.5,23.239.18.5", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "us-east", "label": "Newark, NJ", "country": + "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement Group"], "status": - "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, 173.255.199.5, 66.228.53.5, - 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, 198.58.111.5, 23.239.24.5", + "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, 50.116.53.5, 50.116.58.5, + 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": - "core"}, {"id": "us-west", "label": "Fremont, CA", "country": "us", "capabilities": + "core"}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", - "Placement Group"], "status": "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, - 173.230.155.5, 173.255.212.5, 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, - 74.207.241.5, 74.207.242.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + "Placement Group"], "status": "ok", "resolvers": {"ipv4": "178.79.182.5, 176.58.107.5, + 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, + 109.74.193.20, 109.74.194.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, - "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-southeast", "label": - "Atlanta, GA", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", + "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "ap-south", "label": + "Singapore, SG", "country": "sg", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement - Group"], "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, - 173.230.129.5, 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, - 50.116.41.5, 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, - "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "us-east", "label": - "Newark, NJ", "country": "us", "capabilities": ["Linodes", "Backups", "NodeBalancers", - "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement - Group"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, 50.116.53.5, - 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, 207.192.69.4, - 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, + Group"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5,139.162.13.5,139.162.14.5,139.162.15.5,139.162.16.5,139.162.21.5,139.162.27.5,103.3.60.18,103.3.60.19,103.3.60.20", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": - 5}, "site_type": "core"}, {"id": "eu-west", "label": "London, UK", "country": - "gb", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", - "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed - Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": - "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, - 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", "ipv6": "1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "ap-south", - "label": "Singapore, SG", "country": "sg", "capabilities": ["Linodes", "Backups", - "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", - "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", - "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, - 139.162.13.5, 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, - 103.3.60.18, 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "eu-central", - "label": "Frankfurt, DE", "country": "de", "capabilities": ["Linodes", "Backups", - "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", - "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", - "Metadata", "Placement Group"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, - 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, - 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678"}, "placement_group_limits": {"maximum_pgs_per_customer": - null, "maximum_linodes_per_pg": 5}, "site_type": "core"}, {"id": "ap-northeast", - "label": "Tokyo, JP", "country": "jp", "capabilities": ["Linodes", "Backups", - "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block + 5}, "site_type": "core"}, {"id": "eu-central", "label": "Frankfurt, DE", "country": + "de", "capabilities": ["Linodes", "Backups", "NodeBalancers", "Block Storage", + "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases", "Metadata", "Placement Group"], "status": - "ok", "resolvers": {"ipv4": "139.162.66.5, 139.162.67.5, 139.162.68.5, 139.162.69.5, - 139.162.70.5, 139.162.71.5, 139.162.72.5, 139.162.73.5, 139.162.74.5, 139.162.75.5", - "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, - 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}, "placement_group_limits": - {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": 5}, "site_type": - "core"}], "page": 1, "pages": 1, "results": 34}' + "ok", "resolvers": {"ipv4": "139.162.130.5,139.162.131.5,139.162.132.5,139.162.133.5,139.162.134.5,139.162.135.5,139.162.136.5,139.162.137.5,139.162.138.5,139.162.139.5", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}, {"id": "ap-northeast", "label": "Tokyo 2, JP", "country": + "jp", "capabilities": ["Linodes", "Disk Encryption", "Backups", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases", "Metadata", "Placement Group"], "status": "ok", "resolvers": + {"ipv4": "139.162.66.5,139.162.67.5,139.162.68.5,139.162.69.5,139.162.70.5,139.162.71.5,139.162.72.5,139.162.73.5,139.162.74.5,139.162.75.5", + "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}, + "placement_group_limits": {"maximum_pgs_per_customer": null, "maximum_linodes_per_pg": + 5}, "site_type": "core"}], "page": 1, "pages": 1, "results": 31}' headers: Access-Control-Allow-Credentials: - "true" @@ -324,7 +318,7 @@ interactions: Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:03 GMT + - Fri, 08 Nov 2024 14:56:10 GMT Pragma: - no-cache Strict-Transport-Security: @@ -341,19 +335,16 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-9t15okq9p55z","root_pass":"iV998k`L|Y\u003eRlFs2{u-!CN#2EfjT1JhS1Oe9hK\u003c12O3c376x)i2n-~U+]r-k+C4\u003c","image":"linode/debian9","firewall_id":692854,"booted":false}' + body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-bm057s6gwc45","root_pass":"^07IK!9Q/8dXDbadb391O0Ar@f9\u0026xM7NwH@,dWeA''Hx@W203r}h\u003cQr{-50.f#L1#","image":"linode/debian9","firewall_id":1160422,"booted":false}' form: {} headers: Accept: @@ -365,16 +356,17 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 61874159, "label": "go-test-ins-9t15okq9p55z", "group": "", "status": + body: '{"id": 66787226, "label": "go-test-ins-bm057s6gwc45", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["45.79.122.198"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.105.60.170"], "ipv6": "1234::5678/128", "image": "linode/debian9", "region": "ap-west", "site_type": "core", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": true, "available": false, "schedule": {"day": null, "window": null}, "last_successful": null}, "hypervisor": "kvm", "watchdog_enabled": - true, "tags": [], "host_uuid": "0be889ff8efab8e9f1cbbb28b1799aa440e95149", "has_user_data": - false, "placement_group": null, "lke_cluster_id": null}' + true, "tags": [], "host_uuid": "c37a9389a8780ce12d745d3f703cbee667a6278e", "has_user_data": + false, "placement_group": null, "disk_encryption": "enabled", "lke_cluster_id": + null, "capabilities": ["SMTP Enabled"]}' headers: Access-Control-Allow-Credentials: - "true" @@ -392,20 +384,19 @@ interactions: - max-age=0, no-cache, no-store Connection: - keep-alive - Content-Length: - - "810" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:04 GMT + - Fri, 08 Nov 2024 14:56:11 GMT Pragma: - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - linodes:read_write X-Content-Type-Options: @@ -414,12 +405,9 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "10" + - "5" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -435,11 +423,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/61874159/configs + url: https://api.linode.com/v4beta/linode/instances/66787226/configs method: POST response: - body: '{"id": 65094623, "label": "test-config", "helpers": {"updatedb_disabled": - true, "distro": true, "modules_dep": true, "network": false, "devtmpfs_automount": + body: '{"id": 70105769, "label": "test-config", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, @@ -463,13 +451,13 @@ interactions: Connection: - keep-alive Content-Length: - - "526" + - "525" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:04 GMT + - Fri, 08 Nov 2024 14:56:11 GMT Pragma: - no-cache Strict-Transport-Security: @@ -484,12 +472,9 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -506,16 +491,16 @@ interactions: User-Agent: - linodego/dev https://github.com/linode/linodego X-Filter: - - '{"action":"linode_config_create","entity.id":61874159,"entity.type":"linode"}' + - '{"action":"linode_config_create","entity.id":66787226,"entity.type":"linode"}' url: https://api.linode.com/v4beta/account/events?page=1 method: GET response: - body: '{"data": [{"id": 788220794, "created": "2018-01-02T03:04:05", "seen": false, + body: '{"data": [{"id": 874986920, "created": "2018-01-02T03:04:05", "seen": false, "read": false, "percent_complete": null, "time_remaining": null, "rate": null, - "duration": null, "action": "linode_config_create", "username": "ychen123", - "entity": {"label": "go-test-ins-9t15okq9p55z", "id": 61874159, "type": "linode", - "url": "/v4/linode/instances/61874159"}, "status": "notification", "secondary_entity": - {"id": 65094623, "type": "linode_config", "label": "test-config", "url": "/v4/linode/instances/61874159/configs/65094623"}, + "duration": null, "action": "linode_config_create", "username": "ErikZilber", + "entity": {"label": "go-test-ins-bm057s6gwc45", "id": 66787226, "type": "linode", + "url": "/v4/linode/instances/66787226"}, "status": "notification", "secondary_entity": + {"id": 70105769, "type": "linode_config", "label": "test-config", "url": "/v4/linode/instances/66787226/configs/70105769"}, "message": ""}], "page": 1, "pages": 1, "results": 1}' headers: Access-Control-Allow-Credentials: @@ -535,13 +520,13 @@ interactions: Connection: - keep-alive Content-Length: - - "578" + - "580" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:04 GMT + - Fri, 08 Nov 2024 14:56:11 GMT Pragma: - no-cache Strict-Transport-Security: @@ -557,12 +542,9 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -578,7 +560,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/61874159 + url: https://api.linode.com/v4beta/linode/instances/66787226 method: DELETE response: body: '{}' @@ -606,7 +588,7 @@ interactions: Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:05 GMT + - Fri, 08 Nov 2024 14:56:13 GMT Pragma: - no-cache Strict-Transport-Security: @@ -621,12 +603,9 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestAccount_Get.yaml b/test/integration/fixtures/TestAccount_Get.yaml index 748e13de2..4f34d34ef 100644 --- a/test/integration/fixtures/TestAccount_Get.yaml +++ b/test/integration/fixtures/TestAccount_Get.yaml @@ -14,15 +14,17 @@ interactions: url: https://api.linode.com/v4beta/account method: GET response: - body: '{"company": "", "email": "yechen@akamai.com", "first_name": "", "last_name": - "", "address_1": "", "address_2": "", "city": "", "state": "", "zip": "", "country": - "", "phone": "", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card": - {"last_four": null, "expiry": null}, "balance_uninvoiced": 0.0, "active_since": - "2018-01-02T03:04:05", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", - "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", - "Machine Images", "VPCs", "LKE Network Access Control List (IP ACL)", "Placement - Group", "Object Storage Access Key Regions"], "active_promotions": [], "euuid": - "4D76E527-6B98-41BB-BE6936746C131930"}' + body: '{"company": "Akamai Technologies - Compute - Individual", "email": "ezilber@akamai.com", + "first_name": "", "last_name": "", "address_1": "", "address_2": "", "city": + "", "state": "MA", "zip": "02142", "country": "US", "phone": "", "balance": + 0.0, "tax_id": "", "billing_source": "linode", "credit_card": {"last_four": + null, "expiry": null}, "balance_uninvoiced": 0.0, "active_since": "2018-01-02T03:04:05", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", "Block Storage + Encryption", "Machine Images", "Managed Databases", "Managed Databases Beta", + "VPCs", "LKE Network Access Control List (IP ACL)", "Placement Group", "Object + Storage Access Key Regions", "Disk Encryption", "SMTP Enabled"], "active_promotions": + [], "euuid": "8151FBB7-C6D6-4480-8DF1A91D15E8AA0B"}' headers: Access-Control-Allow-Credentials: - "true" @@ -40,14 +42,12 @@ interactions: - max-age=0, no-cache, no-store Connection: - keep-alive - Content-Length: - - "700" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Thu, 25 Jul 2024 17:44:08 GMT + - Fri, 08 Nov 2024 14:32:02 GMT Pragma: - no-cache Strict-Transport-Security: @@ -55,6 +55,7 @@ interactions: Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_only X-Content-Type-Options: @@ -63,12 +64,9 @@ interactions: - DENY - DENY X-Oauth-Scopes: - - account:read_write databases:read_write domains:read_write events:read_write - firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write - longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write - volumes:read_write vpc:read_write + - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestInvoiceItems_List.yaml b/test/integration/fixtures/TestInvoiceItems_List.yaml deleted file mode 100644 index 5a37102bd..000000000 --- a/test/integration/fixtures/TestInvoiceItems_List.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.linode.com/v4beta/account/invoices/123/items?page=1 - method: GET - response: - body: '{"data": [{"label": "Linode 2GB", "type": "linode", "unitprice": 10, "quantity": 1, "amount": 10, "tax": 0.6, "region": "us-east", "from": "2018-01-01T00:00:00", "to": "2018-01-31T23:59:59"}], "page": 1, "pages": 1, "results": 1}' - headers: - Content-Type: - - application/json - status: 200 - code: 200 - duration: "" \ No newline at end of file diff --git a/test/integration/fixtures/TestInvoice_Get.yaml b/test/integration/fixtures/TestInvoice_Get.yaml deleted file mode 100644 index 79809d4c6..000000000 --- a/test/integration/fixtures/TestInvoice_Get.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.linode.com/v4beta/account/invoices/123 - method: GET - response: - body: '{"id": 123, "label": "Invoice", "date": "2018-01-01T00:01:01", "subtotal": 120.25, "tax": 12.25, "tax_summary": [{"name": "PA STATE TAX", "tax": 12.25}], "total": 132.5, "billing_source": "linode"}' - headers: - Content-Type: - - application/json - status: 200 - code: 200 - duration: "" diff --git a/test/integration/fixtures/TestInvoice_List.yaml b/test/integration/fixtures/TestInvoice_List.yaml deleted file mode 100644 index 8b77641ea..000000000 --- a/test/integration/fixtures/TestInvoice_List.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.linode.com/v4beta/account/invoices?page=1 - method: GET - response: - body: '{"data": [{"billing_source": "linode", "date": "2018-01-01T00:01:01", "id": 123, "label": "Invoice", "subtotal": 120.25, "tax": 12.25, "tax_summary": [{"name": "PA STATE TAX", "tax": 12.25}], "total": 132.5}], "page": 1, "pages": 1, "results": 1}' - headers: - Content-Type: - - application/json - status: 200 - code: 200 - duration: "" \ No newline at end of file diff --git a/test/integration/fixtures/TestProfile_Get.yaml b/test/integration/fixtures/TestProfile_Get.yaml index 655383f04..2cd1914ed 100644 --- a/test/integration/fixtures/TestProfile_Get.yaml +++ b/test/integration/fixtures/TestProfile_Get.yaml @@ -18,7 +18,7 @@ interactions: "verified_phone_number": null, "timezone": "GMT", "email_notifications": true, "referrals": {"code": "", "url": "", "total": 0, "completed": 0, "pending": 0, "credit": 0}, "ip_whitelist_enabled": false, "lish_auth_method": "password_keys", - "authorized_keys": null, "two_factor_auth": false, "restricted": false, "authentication_type": + "authorized_keys": null, "two_factor_auth": true, "restricted": false, "authentication_type": "password", "user_type": "default"}' headers: Access-Control-Allow-Credentials: @@ -38,13 +38,13 @@ interactions: Connection: - keep-alive Content-Length: - - "444" + - "443" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Wed, 10 Jul 2024 18:09:42 GMT + - Fri, 08 Nov 2024 18:15:26 GMT Pragma: - no-cache Strict-Transport-Security: @@ -62,7 +62,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestProfile_Update.yaml b/test/integration/fixtures/TestProfile_Update.yaml index e12fa170b..7439b5226 100644 --- a/test/integration/fixtures/TestProfile_Update.yaml +++ b/test/integration/fixtures/TestProfile_Update.yaml @@ -18,7 +18,7 @@ interactions: "verified_phone_number": null, "timezone": "GMT", "email_notifications": true, "referrals": {"code": "", "url": "", "total": 0, "completed": 0, "pending": 0, "credit": 0}, "ip_whitelist_enabled": false, "lish_auth_method": "password_keys", - "authorized_keys": null, "two_factor_auth": false, "restricted": false, "authentication_type": + "authorized_keys": null, "two_factor_auth": true, "restricted": false, "authentication_type": "password", "user_type": "default"}' headers: Access-Control-Allow-Credentials: @@ -38,13 +38,13 @@ interactions: Connection: - keep-alive Content-Length: - - "444" + - "443" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Wed, 10 Jul 2024 18:10:23 GMT + - Fri, 08 Nov 2024 18:19:10 GMT Pragma: - no-cache Strict-Transport-Security: @@ -62,14 +62,14 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"email":"ezilber@akamai.com","timezone":"GMT","email_notifications":true,"ip_whitelist_enabled":false,"lish_auth_method":"password_keys","authorized_keys":[],"two_factor_auth":false,"restricted":false}' + body: '{"email":"ezilber@akamai.com","timezone":"GMT","email_notifications":true,"ip_whitelist_enabled":false,"lish_auth_method":"password_keys","authorized_keys":[],"two_factor_auth":true,"restricted":false}' form: {} headers: Accept: @@ -85,7 +85,7 @@ interactions: "verified_phone_number": null, "timezone": "GMT", "email_notifications": true, "referrals": {"code": "", "url": "", "total": 0, "completed": 0, "pending": 0, "credit": 0}, "ip_whitelist_enabled": false, "lish_auth_method": "password_keys", - "authorized_keys": null, "two_factor_auth": false, "restricted": false, "authentication_type": + "authorized_keys": null, "two_factor_auth": true, "restricted": false, "authentication_type": "password", "user_type": "default"}' headers: Access-Control-Allow-Credentials: @@ -105,13 +105,13 @@ interactions: Connection: - keep-alive Content-Length: - - "444" + - "443" Content-Security-Policy: - default-src 'none' Content-Type: - application/json Expires: - - Wed, 10 Jul 2024 18:10:23 GMT + - Fri, 08 Nov 2024 18:19:10 GMT Pragma: - no-cache Strict-Transport-Security: @@ -128,7 +128,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "400" + - "800" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestTicket_Get.yaml b/test/integration/fixtures/TestTicket_Get.yaml deleted file mode 100644 index f9aa8cb02..000000000 --- a/test/integration/fixtures/TestTicket_Get.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.linode.com/v4beta/support/tickets/123 - method: GET - response: - body: '{"id": 123, "attachments": [], "closed": null, "description": "Test description", "entity": {"id": 1, "label": "Test Entity", "type": "linode", "url": "/v4beta/linode/instances/1"}, "gravatar_id": "", "opened": "2024-06-01T12:00:00", "opened_by": "user", "status": "open", "summary": "Test summary", "updated": "2024-06-02T12:00:00", "updated_by": "user2"}' - headers: - Content-Type: - - application/json - status: 200 - code: 200 - duration: "" \ No newline at end of file diff --git a/test/integration/fixtures/TestTicket_List.yaml b/test/integration/fixtures/TestTicket_List.yaml deleted file mode 100644 index 5c25f0608..000000000 --- a/test/integration/fixtures/TestTicket_List.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.linode.com/v4beta/support/tickets?page=1 - method: GET - response: - body: '{"data": [{"id": 123, "attachments": [], "closed": null, "description": "Test description", "entity": {"id": 1, "label": "Test Entity", "type": "linode", "url": "/v4beta/linode/instances/1"}, "gravatar_id": "", "opened": "2024-06-01T12:00:00", "opened_by": "user", "status": "open", "summary": "Test summary", "updated": "2024-06-02T12:00:00", "updated_by": "user2"}], "page": 1, "pages": 1, "results": 1}' - headers: - Content-Type: - - application/json - status: 200 - code: 200 - duration: "" \ No newline at end of file diff --git a/test/integration/support_ticket_test.go b/test/integration/support_ticket_test.go deleted file mode 100644 index 0857af261..000000000 --- a/test/integration/support_ticket_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package integration - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestTicket_List(t *testing.T) { - warnSensitiveTest(t) - client, teardown := createTestClient(t, "fixtures/TestTicket_List") - defer teardown() - - tickets, err := client.ListTickets(context.Background(), nil) - require.NoError(t, err, "Error getting Tickets, expected struct") - - require.NotEmpty(t, tickets, "Expected to see tickets returned") - - require.Equal(t, 123, tickets[0].ID, "Expected ticket ID 123") -} - -func TestTicket_Get(t *testing.T) { - warnSensitiveTest(t) - client, teardown := createTestClient(t, "fixtures/TestTicket_Get") - defer teardown() - - ticket, err := client.GetTicket(context.Background(), 123) - require.NoError(t, err, "Error getting Ticket, expected struct") - - require.Equal(t, 123, ticket.ID, "Expected ticket ID 123") - require.Equal(t, "Test description", ticket.Description, "Expected ticket description 'Test description'") -} diff --git a/test/unit/account_events_test.go b/test/unit/account_events_test.go new file mode 100644 index 000000000..0a525520c --- /dev/null +++ b/test/unit/account_events_test.go @@ -0,0 +1,76 @@ +package unit + +import ( + "context" + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestAccountEvents_List(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_events_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account/events", fixtureData) + + events, err := base.Client.ListEvents(context.Background(), nil) + if err != nil { + t.Fatalf("Error listing events: %v", err) + } + + assert.Equal(t, 1, len(events)) + event := events[0] + assert.Equal(t, linodego.EventAction("ticket_create"), event.Action) + assert.Equal(t, 300.56, event.Duration) + assert.Equal(t, float64(11111), event.Entity.ID) + assert.Equal(t, "Problem booting my Linode", event.Entity.Label) + assert.Equal(t, linodego.EntityType("ticket"), event.Entity.Type) + assert.Equal(t, "/v4/support/tickets/11111", event.Entity.URL) + assert.Equal(t, 123, event.ID) + assert.Equal(t, "None", event.Message) + assert.Equal(t, true, event.Read) + assert.Equal(t, true, event.Seen) + assert.Equal(t, linodego.EventStatus("failed"), event.Status) + assert.Equal(t, "exampleUser", event.Username) + assert.Equal(t, "linode/debian9", event.SecondaryEntity.ID) + assert.Equal(t, "linode1234", event.SecondaryEntity.Label) + assert.Equal(t, linodego.EntityType("linode"), event.SecondaryEntity.Type) + assert.Equal(t, "/v4/linode/instances/1234", event.SecondaryEntity.URL) +} + +func TestAccountEvents_Get(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_events_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account/events/11111", fixtureData) + + event, err := base.Client.GetEvent(context.Background(), 11111) + if err != nil { + t.Fatalf("Error getting event: %v", err) + } + + assert.Equal(t, linodego.EventAction("ticket_create"), event.Action) + assert.Equal(t, 300.56, event.Duration) + assert.Equal(t, float64(11111), event.Entity.ID) + assert.Equal(t, "Problem booting my Linode", event.Entity.Label) + assert.Equal(t, linodego.EntityType("ticket"), event.Entity.Type) + assert.Equal(t, "/v4/support/tickets/11111", event.Entity.URL) + assert.Equal(t, 123, event.ID) + assert.Equal(t, "None", event.Message) + assert.Equal(t, true, event.Read) + assert.Equal(t, true, event.Seen) + assert.Equal(t, linodego.EventStatus("failed"), event.Status) + assert.Equal(t, "exampleUser", event.Username) + assert.Equal(t, "linode/debian9", event.SecondaryEntity.ID) + assert.Equal(t, "linode1234", event.SecondaryEntity.Label) + assert.Equal(t, linodego.EntityType("linode"), event.SecondaryEntity.Type) + assert.Equal(t, "/v4/linode/instances/1234", event.SecondaryEntity.URL) +} diff --git a/test/unit/account_invoices_test.go b/test/unit/account_invoices_test.go new file mode 100644 index 000000000..3a4478f0b --- /dev/null +++ b/test/unit/account_invoices_test.go @@ -0,0 +1,86 @@ +package unit + +import ( + "context" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestAccountInvoices_List(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_invoices_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account/invoices", fixtureData) + + invoices, err := base.Client.ListInvoices(context.Background(), nil) + if err != nil { + t.Fatalf("Error listing invoices: %v", err) + } + + assert.Equal(t, 1, len(invoices)) + invoice := invoices[0] + assert.Equal(t, "linode", invoice.BillingSource) + assert.Equal(t, 123, invoice.ID) + assert.Equal(t, "Invoice", invoice.Label) + assert.Equal(t, float32(120.25), invoice.Subtotal) + assert.Equal(t, float32(12.25), invoice.Tax) + assert.Equal(t, "PA STATE TAX", invoice.TaxSummary[0].Name) + assert.Equal(t, float32(12.25), invoice.TaxSummary[0].Tax) + assert.Equal(t, float32(132.5), invoice.Total) +} + +func TestAccountInvoices_Get(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_invoices_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account/invoices/123", fixtureData) + + invoice, err := base.Client.GetInvoice(context.Background(), 123) + if err != nil { + t.Fatalf("Error getting invoice: %v", err) + } + + assert.Equal(t, "linode", invoice.BillingSource) + assert.Equal(t, 123, invoice.ID) + assert.Equal(t, "Invoice", invoice.Label) + assert.Equal(t, float32(120.25), invoice.Subtotal) + assert.Equal(t, float32(12.25), invoice.Tax) + assert.Equal(t, "PA STATE TAX", invoice.TaxSummary[0].Name) + assert.Equal(t, float32(12.25), invoice.TaxSummary[0].Tax) + assert.Equal(t, float32(132.5), invoice.Total) +} + +func TestAccountInvoiceItems_List(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_invoice_items_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account/invoices/123/items", fixtureData) + + invoiceitems, err := base.Client.ListInvoiceItems(context.Background(), 123, nil) + if err != nil { + t.Fatalf("Error listing invoice items: %v", err) + } + + assert.Equal(t, 1, len(invoiceitems)) + invoiceItem := invoiceitems[0] + assert.Equal(t, float32(20.2), invoiceItem.Amount) + assert.Equal(t, "Linode 123", invoiceItem.Label) + assert.Equal(t, 4, invoiceItem.Quantity) + assert.Equal(t, "us-west", *invoiceItem.Region) + assert.Equal(t, float32(1.25), invoiceItem.Tax) + assert.Equal(t, float32(21.45), invoiceItem.Total) + assert.Equal(t, "hourly", invoiceItem.Type) + assert.Equal(t, float32(5.05), invoiceItem.UnitPrice) +} diff --git a/test/unit/account_test.go b/test/unit/account_test.go index 03f002b67..23d54b13f 100644 --- a/test/unit/account_test.go +++ b/test/unit/account_test.go @@ -7,6 +7,50 @@ import ( "testing" ) +func TestAccount_Get(t *testing.T) { + fixtureData, err := fixtures.GetFixture("account_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("account", fixtureData) + + accountInfo, err := base.Client.GetAccount(context.Background()) + assert.NoError(t, err) + + assert.Equal(t, "John", accountInfo.FirstName) + assert.Equal(t, "Smith", accountInfo.LastName) + assert.Equal(t, "john.smith@linode.com", accountInfo.Email) + assert.Equal(t, "Linode LLC", accountInfo.Company) + assert.Equal(t, "123 Main Street", accountInfo.Address1) + assert.Equal(t, "Suite A", accountInfo.Address2) + assert.Equal(t, float32(200), accountInfo.Balance) + assert.Equal(t, float32(145), accountInfo.BalanceUninvoiced) + assert.Equal(t, "19102-1234", accountInfo.Zip) + assert.Equal(t, "US", accountInfo.Country) + assert.Equal(t, "ATU99999999", accountInfo.TaxID) + assert.Equal(t, "215-555-1212", accountInfo.Phone) + if accountInfo.CreditCard != nil { + assert.Equal(t, "11/2022", accountInfo.CreditCard.Expiry) + assert.Equal(t, "1111", accountInfo.CreditCard.LastFour) + } + assert.Equal(t, "E1AF5EEC-526F-487D-B317EBEB34C87D71", accountInfo.EUUID) + assert.Equal(t, "akamai", accountInfo.BillingSource) + assert.Equal(t, []string{"Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Placement Groups", "Block Storage Encryption"}, accountInfo.Capabilities) + assert.Equal(t, "Philadelphia", accountInfo.City) + assert.Equal(t, "PA", accountInfo.State) + + assert.Equal(t, "10.00", accountInfo.ActivePromotions[0].CreditMonthlyCap) + assert.Equal(t, "50.00", accountInfo.ActivePromotions[0].CreditRemaining) + assert.Equal(t, "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.", accountInfo.ActivePromotions[0].Description) + assert.Equal(t, "https://linode.com/10_a_month_promotion.svg", accountInfo.ActivePromotions[0].ImageURL) + assert.Equal(t, "all", accountInfo.ActivePromotions[0].ServiceType) + assert.Equal(t, "$10 off your Linode a month!", accountInfo.ActivePromotions[0].Summary) + assert.Equal(t, "10.00", accountInfo.ActivePromotions[0].ThisMonthCreditRemaining) +} + func TestAccount_Update(t *testing.T) { fixtureData, err := fixtures.GetFixture("account_update") assert.NoError(t, err) diff --git a/test/unit/fixtures/account_events_get.json b/test/unit/fixtures/account_events_get.json new file mode 100644 index 000000000..1a645dcb0 --- /dev/null +++ b/test/unit/fixtures/account_events_get.json @@ -0,0 +1,26 @@ +{ + "action": "ticket_create", + "created": "2018-01-01T00:01:01", + "duration": 300.56, + "entity": { + "id": 11111, + "label": "Problem booting my Linode", + "type": "ticket", + "url": "/v4/support/tickets/11111" + }, + "id": 123, + "message": "None", + "percent_complete": null, + "rate": null, + "read": true, + "secondary_entity": { + "id": "linode/debian9", + "label": "linode1234", + "type": "linode", + "url": "/v4/linode/instances/1234" + }, + "seen": true, + "status": "failed", + "time_remaining": null, + "username": "exampleUser" +} \ No newline at end of file diff --git a/test/unit/fixtures/account_events_list.json b/test/unit/fixtures/account_events_list.json new file mode 100644 index 000000000..fa5ea5dbe --- /dev/null +++ b/test/unit/fixtures/account_events_list.json @@ -0,0 +1,33 @@ +{ + "data": [ + { + "action": "ticket_create", + "created": "2018-01-01T00:01:01", + "duration": 300.56, + "entity": { + "id": 11111, + "label": "Problem booting my Linode", + "type": "ticket", + "url": "/v4/support/tickets/11111" + }, + "id": 123, + "message": "None", + "percent_complete": null, + "rate": null, + "read": true, + "secondary_entity": { + "id": "linode/debian9", + "label": "linode1234", + "type": "linode", + "url": "/v4/linode/instances/1234" + }, + "seen": true, + "status": "failed", + "time_remaining": null, + "username": "exampleUser" + } + ], + "page": 1, + "pages": 1, + "results": 1 +} \ No newline at end of file diff --git a/test/unit/fixtures/account_get.json b/test/unit/fixtures/account_get.json new file mode 100644 index 000000000..55f6f0cea --- /dev/null +++ b/test/unit/fixtures/account_get.json @@ -0,0 +1,43 @@ +{ + "active_promotions": [ + { + "credit_monthly_cap": "10.00", + "credit_remaining": "50.00", + "description": "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.", + "expire_dt": "2018-01-31T23:59:59", + "image_url": "https://linode.com/10_a_month_promotion.svg", + "service_type": "all", + "summary": "$10 off your Linode a month!", + "this_month_credit_remaining": "10.00" + } + ], + "active_since": "2018-01-01T00:01:01", + "address_1": "123 Main Street", + "address_2": "Suite A", + "balance": 200, + "balance_uninvoiced": 145, + "billing_source": "akamai", + "capabilities": [ + "Linodes", + "NodeBalancers", + "Block Storage", + "Object Storage", + "Placement Groups", + "Block Storage Encryption" + ], + "city": "Philadelphia", + "company": "Linode LLC", + "country": "US", + "credit_card": { + "expiry": "11/2022", + "last_four": "1111" + }, + "email": "john.smith@linode.com", + "euuid": "E1AF5EEC-526F-487D-B317EBEB34C87D71", + "first_name": "John", + "last_name": "Smith", + "phone": "215-555-1212", + "state": "PA", + "tax_id": "ATU99999999", + "zip": "19102-1234" +} \ No newline at end of file diff --git a/test/unit/fixtures/account_invoice_items_list.json b/test/unit/fixtures/account_invoice_items_list.json new file mode 100644 index 000000000..b9623f4a8 --- /dev/null +++ b/test/unit/fixtures/account_invoice_items_list.json @@ -0,0 +1,19 @@ +{ + "data": [ + { + "amount": 20.2, + "from": "2018-01-01T00:01:01", + "label": "Linode 123", + "quantity": 4, + "region": "us-west", + "tax": 1.25, + "to": "2018-01-31T11:59:59", + "total": 21.45, + "type": "hourly", + "unit_price": 5.05 + } + ], + "page": 1, + "pages": 1, + "results": 1 +} \ No newline at end of file diff --git a/test/unit/fixtures/account_invoices_get.json b/test/unit/fixtures/account_invoices_get.json new file mode 100644 index 000000000..076e341f6 --- /dev/null +++ b/test/unit/fixtures/account_invoices_get.json @@ -0,0 +1,15 @@ +{ + "billing_source": "linode", + "date": "2018-01-01T00:01:01", + "id": 123, + "label": "Invoice", + "subtotal": 120.25, + "tax": 12.25, + "tax_summary": [ + { + "name": "PA STATE TAX", + "tax": 12.25 + } + ], + "total": 132.5 +} \ No newline at end of file diff --git a/test/unit/fixtures/account_invoices_list.json b/test/unit/fixtures/account_invoices_list.json new file mode 100644 index 000000000..3d61b1a01 --- /dev/null +++ b/test/unit/fixtures/account_invoices_list.json @@ -0,0 +1,22 @@ +{ + "data": [ + { + "billing_source": "linode", + "date": "2018-01-01T00:01:01", + "id": 123, + "label": "Invoice", + "subtotal": 120.25, + "tax": 12.25, + "tax_summary": [ + { + "name": "PA STATE TAX", + "tax": 12.25 + } + ], + "total": 132.5 + } + ], + "page": 1, + "pages": 1, + "results": 1 +} \ No newline at end of file diff --git a/test/unit/fixtures/profile_get.json b/test/unit/fixtures/profile_get.json new file mode 100644 index 000000000..c9ec4a6f8 --- /dev/null +++ b/test/unit/fixtures/profile_get.json @@ -0,0 +1,21 @@ +{ + "authentication_type": "password", + "authorized_keys": null, + "email": "example-user@gmail.com", + "email_notifications": true, + "lish_auth_method": "keys_only", + "referrals": { + "code": "871be32f49c1411b14f29f618aaf0c14637fb8d3", + "completed": 0, + "credit": 0, + "pending": 0, + "total": 0, + "url": "https://www.linode.com/?r=871be32f49c1411b14f29f618aaf0c14637fb8d3" + }, + "restricted": false, + "timezone": "US/Eastern", + "two_factor_auth": true, + "uid": 1234, + "username": "exampleUser", + "verified_phone_number": "+5555555555" +} \ No newline at end of file diff --git a/test/unit/fixtures/profile_update.json b/test/unit/fixtures/profile_update.json new file mode 100644 index 000000000..f197db660 --- /dev/null +++ b/test/unit/fixtures/profile_update.json @@ -0,0 +1,21 @@ +{ + "authentication_type": "password", + "authorized_keys": null, + "email": "example-user-new@gmail.com", + "email_notifications": true, + "lish_auth_method": "keys_only", + "referrals": { + "code": "871be32f49c1411b14f29f618aaf0c14637fb8d3", + "completed": 0, + "credit": 0, + "pending": 0, + "total": 0, + "url": "https://www.linode.com/?r=871be32f49c1411b14f29f618aaf0c14637fb8d3" + }, + "restricted": false, + "timezone": "US/Eastern", + "two_factor_auth": true, + "uid": 1234, + "username": "exampleUser", + "verified_phone_number": "+5555555555" +} \ No newline at end of file diff --git a/test/unit/fixtures/support_ticket_get.json b/test/unit/fixtures/support_ticket_get.json new file mode 100644 index 000000000..c0f11435d --- /dev/null +++ b/test/unit/fixtures/support_ticket_get.json @@ -0,0 +1,23 @@ +{ + "attachments": [ + "screenshot.jpg", + "screenshot.txt" + ], + "closable": false, + "closed": "2015-06-04T16:07:03", + "description": "I am having trouble setting the root password on my Linode. I tried following the instructions but something is not working. Can you please help me figure out how I can reset it?", + "entity": { + "id": 10400, + "label": "linode123456", + "type": "linode", + "url": "/v4/linode/instances/123456" + }, + "gravatar_id": "474a1b7373ae0be4132649e69c36ce30", + "id": 11223344, + "opened": "2015-06-04T14:16:44", + "opened_by": "some_user", + "status": "open", + "summary": "Having trouble resetting root password on my Linode", + "updated": "2015-06-04T16:07:03", + "updated_by": "some_other_user" +} \ No newline at end of file diff --git a/test/unit/fixtures/support_ticket_list.json b/test/unit/fixtures/support_ticket_list.json new file mode 100644 index 000000000..f6ca0b1bc --- /dev/null +++ b/test/unit/fixtures/support_ticket_list.json @@ -0,0 +1,30 @@ +{ + "data": [ + { + "attachments": [ + "screenshot.jpg", + "screenshot.txt" + ], + "closable": false, + "closed": "2015-06-04T16:07:03", + "description": "I am having trouble setting the root password on my Linode. I tried following the instructions but something is not working. Can you please help me figure out how I can reset it?", + "entity": { + "id": 10400, + "label": "linode123456", + "type": "linode", + "url": "/v4/linode/instances/123456" + }, + "gravatar_id": "474a1b7373ae0be4132649e69c36ce30", + "id": 11223344, + "opened": "2015-06-04T14:16:44", + "opened_by": "some_user", + "status": "open", + "summary": "Having trouble resetting root password on my Linode", + "updated": "2015-06-04T16:07:03", + "updated_by": "some_other_user" + } + ], + "page": 1, + "pages": 1, + "results": 1 +} \ No newline at end of file diff --git a/test/unit/profile_test.go b/test/unit/profile_test.go new file mode 100644 index 000000000..8099a150b --- /dev/null +++ b/test/unit/profile_test.go @@ -0,0 +1,74 @@ +package unit + +import ( + "context" + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestProfile_Get(t *testing.T) { + fixtureData, err := fixtures.GetFixture("profile_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("profile", fixtureData) + + profile, err := base.Client.GetProfile(context.Background()) + assert.NoError(t, err) + + assert.Equal(t, "password", profile.AuthenticationType) + assert.Equal(t, "example-user@gmail.com", profile.Email) + assert.Equal(t, true, profile.EmailNotifications) + assert.Equal(t, linodego.LishAuthMethod("keys_only"), profile.LishAuthMethod) + assert.Equal(t, "871be32f49c1411b14f29f618aaf0c14637fb8d3", profile.Referrals.Code) + assert.Equal(t, 0, profile.Referrals.Completed) + assert.Equal(t, float64(0), profile.Referrals.Credit) + assert.Equal(t, 0, profile.Referrals.Pending) + assert.Equal(t, 0, profile.Referrals.Total) + assert.Equal(t, "https://www.linode.com/?r=871be32f49c1411b14f29f618aaf0c14637fb8d3", profile.Referrals.URL) + assert.Equal(t, false, profile.Restricted) + assert.Equal(t, "US/Eastern", profile.Timezone) + assert.Equal(t, true, profile.TwoFactorAuth) + assert.Equal(t, 1234, profile.UID) + assert.Equal(t, "exampleUser", profile.Username) + assert.Equal(t, "+5555555555", profile.VerifiedPhoneNumber) +} + +func TestProfile_Update(t *testing.T) { + fixtureData, err := fixtures.GetFixture("profile_update") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + requestData := linodego.ProfileUpdateOptions{ + Email: "example-user-new@gmail.com", + } + + base.MockPut("profile", fixtureData) + + profile, err := base.Client.UpdateProfile(context.Background(), requestData) + assert.NoError(t, err) + + assert.Equal(t, "password", profile.AuthenticationType) + assert.Equal(t, "example-user-new@gmail.com", profile.Email) + assert.Equal(t, true, profile.EmailNotifications) + assert.Equal(t, linodego.LishAuthMethod("keys_only"), profile.LishAuthMethod) + assert.Equal(t, "871be32f49c1411b14f29f618aaf0c14637fb8d3", profile.Referrals.Code) + assert.Equal(t, 0, profile.Referrals.Completed) + assert.Equal(t, float64(0), profile.Referrals.Credit) + assert.Equal(t, 0, profile.Referrals.Pending) + assert.Equal(t, 0, profile.Referrals.Total) + assert.Equal(t, "https://www.linode.com/?r=871be32f49c1411b14f29f618aaf0c14637fb8d3", profile.Referrals.URL) + assert.Equal(t, false, profile.Restricted) + assert.Equal(t, "US/Eastern", profile.Timezone) + assert.Equal(t, true, profile.TwoFactorAuth) + assert.Equal(t, 1234, profile.UID) + assert.Equal(t, "exampleUser", profile.Username) + assert.Equal(t, "+5555555555", profile.VerifiedPhoneNumber) +} diff --git a/test/unit/support_test.go b/test/unit/support_test.go new file mode 100644 index 000000000..1bd64dbbc --- /dev/null +++ b/test/unit/support_test.go @@ -0,0 +1,71 @@ +package unit + +import ( + "context" + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestSupportTicket_List(t *testing.T) { + fixtureData, err := fixtures.GetFixture("support_ticket_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("support/tickets", fixtureData) + + tickets, err := base.Client.ListTickets(context.Background(), nil) + if err != nil { + t.Fatalf("Error listing tickets: %v", err) + } + + assert.Equal(t, 1, len(tickets)) + ticket := tickets[0] + + assert.Equal(t, []string{"screenshot.jpg", "screenshot.txt"}, ticket.Attachments) + assert.Equal(t, false, ticket.Closeable) + assert.Equal(t, "I am having trouble setting the root password on my Linode. I tried following the instructions but something is not working. Can you please help me figure out how I can reset it?", ticket.Description) + assert.Equal(t, 10400, ticket.Entity.ID) + assert.Equal(t, "linode123456", ticket.Entity.Label) + assert.Equal(t, "linode", ticket.Entity.Type) + assert.Equal(t, "/v4/linode/instances/123456", ticket.Entity.URL) + assert.Equal(t, "474a1b7373ae0be4132649e69c36ce30", ticket.GravatarID) + assert.Equal(t, 11223344, ticket.ID) + assert.Equal(t, "some_user", ticket.OpenedBy) + assert.Equal(t, linodego.TicketStatus("open"), ticket.Status) + assert.Equal(t, "Having trouble resetting root password on my Linode", ticket.Summary) + assert.Equal(t, "some_other_user", ticket.UpdatedBy) +} + +func TestSupportTicket_Get(t *testing.T) { + fixtureData, err := fixtures.GetFixture("support_ticket_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("support/tickets/11223344", fixtureData) + + ticket, err := base.Client.GetTicket(context.Background(), 11223344) + if err != nil { + t.Fatalf("Error getting ticket: %v", err) + } + + assert.Equal(t, []string{"screenshot.jpg", "screenshot.txt"}, ticket.Attachments) + assert.Equal(t, false, ticket.Closeable) + assert.Equal(t, "I am having trouble setting the root password on my Linode. I tried following the instructions but something is not working. Can you please help me figure out how I can reset it?", ticket.Description) + assert.Equal(t, 10400, ticket.Entity.ID) + assert.Equal(t, "linode123456", ticket.Entity.Label) + assert.Equal(t, "linode", ticket.Entity.Type) + assert.Equal(t, "/v4/linode/instances/123456", ticket.Entity.URL) + assert.Equal(t, "474a1b7373ae0be4132649e69c36ce30", ticket.GravatarID) + assert.Equal(t, 11223344, ticket.ID) + assert.Equal(t, "some_user", ticket.OpenedBy) + assert.Equal(t, linodego.TicketStatus("open"), ticket.Status) + assert.Equal(t, "Having trouble resetting root password on my Linode", ticket.Summary) + assert.Equal(t, "some_other_user", ticket.UpdatedBy) +}