Skip to content

Commit ed25e3b

Browse files
Add support for Linode-related endpoints and fields
1 parent 5727f10 commit ed25e3b

11 files changed

+1504
-0
lines changed

linode_api4/objects/linode_interfaces.py

+414
Large diffs are not rendered by default.
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"id": 124,
3+
"status": "running",
4+
"type": "g6-standard-1",
5+
"alerts": {
6+
"network_in": 5,
7+
"network_out": 5,
8+
"cpu": 90,
9+
"transfer_quota": 80,
10+
"io": 5000
11+
},
12+
"group": "test",
13+
"hypervisor": "kvm",
14+
"label": "linode124",
15+
"backups": {
16+
"enabled": true,
17+
"schedule": {
18+
"window": "W02",
19+
"day": "Scheduling"
20+
}
21+
},
22+
"specs": {
23+
"memory": 2048,
24+
"disk": 30720,
25+
"vcpus": 1,
26+
"transfer": 2000
27+
},
28+
"ipv6": "1235:abcd::1234:abcd:89ef:67cd/64",
29+
"created": "2017-01-01T00:00:00",
30+
"region": "us-east-1",
31+
"ipv4": [
32+
"124.45.67.89"
33+
],
34+
"updated": "2017-01-01T00:00:00",
35+
"image": "linode/ubuntu24.04",
36+
"tags": ["something"],
37+
"host_uuid": "3b3ddd59d9a78bb8de041391075df44de62bfec8",
38+
"watchdog_enabled": true,
39+
"disk_encryption": "disabled",
40+
"lke_cluster_id": null,
41+
"placement_group": null,
42+
"interface_generation": "linode"
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"interfaces": [
3+
{
4+
"created": "2025-01-01T00:01:01",
5+
"default_route": {
6+
"ipv4": true,
7+
"ipv6": true
8+
},
9+
"id": 123,
10+
"mac_address": "22:00:AB:CD:EF:01",
11+
"public": {
12+
"ipv4": {
13+
"addresses": [
14+
{
15+
"address": "172.30.0.50",
16+
"primary": true
17+
}
18+
],
19+
"shared": [
20+
{
21+
"address": "172.30.0.51",
22+
"linode_id": 125
23+
}
24+
]
25+
},
26+
"ipv6": {
27+
"ranges": [
28+
{
29+
"range": "2600:3cO9:e001:59::/64",
30+
"route_target": "2600:3cO9::ff:feab:cdef"
31+
},
32+
{
33+
"range": "2600:3cO9:e001:5a::/64",
34+
"route_target": "2600:3cO9::ff:feab:cdef"
35+
}
36+
],
37+
"shared": [
38+
{
39+
"range": "2600:3cO9:e001:2a::/64",
40+
"route_target": null
41+
}
42+
],
43+
"slaac": [
44+
{
45+
"address": "2600:3cO9::ff:feab:cdef",
46+
"prefix": 64
47+
}
48+
]
49+
}
50+
},
51+
"updated": "2025-01-01T00:01:01",
52+
"version": 1,
53+
"vlan": null,
54+
"vpc": null
55+
},
56+
{
57+
"id": 456,
58+
"mac_address": "22:00:AB:CD:EF:01",
59+
"created": "2024-01-01T00:01:01",
60+
"updated": "2024-01-01T00:01:01",
61+
"default_route": {
62+
"ipv4": true
63+
},
64+
"version": 1,
65+
"vpc": {
66+
"vpc_id": 123456,
67+
"subnet_id": 789,
68+
"ipv4": {
69+
"addresses": [
70+
{
71+
"address": "192.168.22.3",
72+
"primary": true
73+
}
74+
],
75+
"ranges": [
76+
{
77+
"range": "192.168.22.16/28"
78+
},
79+
{
80+
"range": "192.168.22.32/28"
81+
}
82+
]
83+
}
84+
},
85+
"public": null,
86+
"vlan": null
87+
},
88+
{
89+
"id": 789,
90+
"mac_address": "22:00:AB:CD:EF:01",
91+
"created": "2024-01-01T00:01:01",
92+
"updated": "2024-01-01T00:01:01",
93+
"default_route": {},
94+
"version": 1,
95+
"vpc": null,
96+
"public": null,
97+
"vlan": {
98+
"vlan_label": "my_vlan",
99+
"ipam_address": "10.0.0.1/24"
100+
}
101+
}
102+
]
103+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"created": "2025-01-01T00:01:01",
3+
"default_route": {
4+
"ipv4": true,
5+
"ipv6": true
6+
},
7+
"id": 123,
8+
"mac_address": "22:00:AB:CD:EF:01",
9+
"public": {
10+
"ipv4": {
11+
"addresses": [
12+
{
13+
"address": "172.30.0.50",
14+
"primary": true
15+
}
16+
],
17+
"shared": [
18+
{
19+
"address": "172.30.0.51",
20+
"linode_id": 125
21+
}
22+
]
23+
},
24+
"ipv6": {
25+
"ranges": [
26+
{
27+
"range": "2600:3cO9:e001:59::/64",
28+
"route_target": "2600:3cO9::ff:feab:cdef"
29+
},
30+
{
31+
"range": "2600:3cO9:e001:5a::/64",
32+
"route_target": "2600:3cO9::ff:feab:cdef"
33+
}
34+
],
35+
"shared": [
36+
{
37+
"range": "2600:3cO9:e001:2a::/64",
38+
"route_target": null
39+
}
40+
],
41+
"slaac": [
42+
{
43+
"address": "2600:3cO9::ff:feab:cdef",
44+
"prefix": 64
45+
}
46+
]
47+
}
48+
},
49+
"updated": "2025-01-01T00:01:01",
50+
"version": 1,
51+
"vlan": null,
52+
"vpc": null
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"data": [
3+
{
4+
"created": "2018-01-01T00:01:01",
5+
"id": 123,
6+
"label": "firewall123",
7+
"rules": {
8+
"inbound": [
9+
{
10+
"action": "ACCEPT",
11+
"addresses": {
12+
"ipv4": [
13+
"192.0.2.0/24"
14+
],
15+
"ipv6": [
16+
"2001:DB8::/32"
17+
]
18+
},
19+
"description": "An example firewall rule description.",
20+
"label": "firewallrule123",
21+
"ports": "22-24, 80, 443",
22+
"protocol": "TCP"
23+
}
24+
],
25+
"inbound_policy": "DROP",
26+
"outbound": [
27+
{
28+
"action": "ACCEPT",
29+
"addresses": {
30+
"ipv4": [
31+
"192.0.2.0/24"
32+
],
33+
"ipv6": [
34+
"2001:DB8::/32"
35+
]
36+
},
37+
"description": "An example firewall rule description.",
38+
"label": "firewallrule123",
39+
"ports": "22-24, 80, 443",
40+
"protocol": "TCP"
41+
}
42+
],
43+
"outbound_policy": "DROP"
44+
},
45+
"status": "enabled",
46+
"tags": [
47+
"example tag",
48+
"another example"
49+
],
50+
"updated": "2018-01-02T00:01:01"
51+
}
52+
],
53+
"page": 1,
54+
"pages": 1,
55+
"results": 1
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"id": 456,
3+
"mac_address": "22:00:AB:CD:EF:01",
4+
"created": "2024-01-01T00:01:01",
5+
"updated": "2024-01-01T00:01:01",
6+
"default_route": {
7+
"ipv4":true
8+
},
9+
"version": 1,
10+
"vpc": {
11+
"vpc_id": 123456,
12+
"subnet_id": 789,
13+
"ipv4" : {
14+
"addresses": [
15+
{
16+
"address": "192.168.22.3",
17+
"primary": true
18+
}
19+
],
20+
"ranges": [
21+
{ "range": "192.168.22.16/28"},
22+
{ "range": "192.168.22.32/28"}
23+
]
24+
}
25+
},
26+
"public": null,
27+
"vlan": null
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"id": 789,
3+
"mac_address": "22:00:AB:CD:EF:01",
4+
"created": "2024-01-01T00:01:01",
5+
"updated": "2024-01-01T00:01:01",
6+
"default_route": {},
7+
"version": 1,
8+
"vpc": null,
9+
"public": null,
10+
"vlan": {
11+
"vlan_label": "my_vlan",
12+
"ipam_address": "10.0.0.1/24"
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"network_helper": true,
3+
"default_route": {
4+
"ipv4_interface_id": 123,
5+
"ipv4_eligible_interface_ids": [
6+
123,
7+
456,
8+
789
9+
],
10+
"ipv6_interface_id": 456,
11+
"ipv6_eligible_interface_ids": [
12+
123,
13+
456
14+
]
15+
}
16+
}

0 commit comments

Comments
 (0)