Skip to content

Commit 81a7e6a

Browse files
authored
Enable Cloud Firewall support to NodeBalancers (#863)
* Added NodeBalancer Firewalls List * Added nodebalancer entity type to Firewall commands * Fixed firewalls-list cli command
1 parent 7d484b9 commit 81a7e6a

File tree

1 file changed

+124
-31
lines changed

1 file changed

+124
-31
lines changed

openapi.yaml

Lines changed: 124 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8016,7 +8016,7 @@ paths:
80168016
parameters:
80178017
- name: linodeId
80188018
in: path
8019-
description: ID of the Linode to look up.
8019+
description: ID of the Linode to access.
80208020
required: true
80218021
schema:
80228022
type: integer
@@ -8030,7 +8030,7 @@ paths:
80308030
- Linode Instances
80318031
summary: Firewalls List
80328032
description: >
8033-
View Firewall information for Firewalls associated with this Linode.
8033+
View Firewall information for Firewalls assigned to this Linode.
80348034
operationId: getLinodeFirewalls
80358035
x-linode-cli-action: firewalls-list
80368036
security:
@@ -8039,7 +8039,7 @@ paths:
80398039
- linodes:read_only
80408040
responses:
80418041
'200':
8042-
description: Returns a paginated list of Firewalls associated with this Linode.
8042+
description: Returns a paginated list of Firewalls assigned to this Linode.
80438043
content:
80448044
application/json:
80458045
schema:
@@ -13318,11 +13318,11 @@ paths:
1331813318
* Use the `rules` property to create inbound and outbound access rules.
1331913319

1332013320
* Use the `devices` property to assign the Firewall to a service and apply its Rules to the device. Requires `read_write` [User's Grants](/docs/api/account/#users-grants-view) to the device.
13321-
Currently, Firewalls can only be assigned to Linode instances.
13321+
Currently, Firewalls can be assigned to Linode compute instances and NodeBalancers.
1332213322

13323-
* A Firewall can be assigned to multiple Linode instances at a time.
13323+
* A Firewall can be assigned to multiple services at a time.
1332413324

13325-
* A Linode instance can have one active, assigned Firewall at a time.
13325+
* A service can have one active, assigned Firewall at a time.
1332613326
Additional disabled Firewalls can be assigned to a service, but they cannot be enabled if another active Firewall is already assigned to the same service.
1332713327

1332813328
* Firewalls apply to all of a Linode's non-`vlan` purpose Configuration Profile Interfaces.
@@ -13337,7 +13337,7 @@ paths:
1333713337
- oauth:
1333813338
- firewall:read_write
1333913339
requestBody:
13340-
description: Creates a Firewall object that can be applied to a Linode service to filter the service's network traffic.
13340+
description: Creates a Firewall object that can be applied to a service to filter the service's network traffic.
1334113341
content:
1334213342
application/json:
1334313343
schema:
@@ -13352,7 +13352,9 @@ paths:
1335213352
description: |
1335313353
Devices to create for this Firewall.
1335413354
When a Device is created, the Firewall is assigned to its associated service.
13355-
Currently, Devices can only be created for Linode instances.
13355+
Currently, Devices can be created for Linode compute instances and NodeBalancers.
13356+
13357+
Additional devices can be assigned after Firewall creation by using the [Firewall Device Create](#firewall-device-create) command.
1335613358
properties:
1335713359
linodes:
1335813360
description: >
@@ -13363,6 +13365,17 @@ paths:
1336313365
example:
1336413366
- 123
1336513367
- 456
13368+
nodebalancers:
13369+
description: |
13370+
An array containing a NodeBalancer ID. A Firewall Device is created for the ID.
13371+
13372+
* Only one NodeBalancer can be assigned to a Firewall at a time.
13373+
* Firewalls only apply to inbound TCP traffic to NodeBalancers.
13374+
type: array
13375+
items:
13376+
type: integer
13377+
example:
13378+
- 321
1336613379
rules:
1336713380
required:
1336813381
- inbound_policy
@@ -13436,8 +13449,12 @@ paths:
1343613449
},
1343713450
"devices": {
1343813451
"linodes": [
13439-
123
13440-
]
13452+
123,
13453+
456
13454+
],
13455+
"nodebalancers": [
13456+
321
13457+
]
1344113458
},
1344213459
"tags": [
1344313460
"example tag",
@@ -13520,7 +13537,7 @@ paths:
1352013537
- A Firewall's Devices cannot be set with this endpoint. Instead, use the
1352113538
[Create Firewall Device](/docs/api/networking/#firewall-device-create)
1352213539
and [Delete Firewall Device](/docs/api/networking/#firewall-device-delete)
13523-
endpoints to assign and remove this Firewall from Linode services.
13540+
endpoints to assign and remove this Firewall from services.
1352413541

1352513542
- A Firewall's Rules cannot be changed with this endpoint. Instead, use the
1352613543
[Update Firewall Rules](/docs/api/networking/#firewall-rules-update)
@@ -13597,8 +13614,8 @@ paths:
1359713614
- oauth:
1359813615
- firewall:read_write
1359913616
description: |
13600-
Delete a Firewall resource by its ID. This will remove all of the Firewall's Rules
13601-
from any Linode services that the Firewall was assigned to.
13617+
Delete a Firewall resource by its ID. This removes all of the Firewall's Rules
13618+
from any services that the Firewall was assigned to.
1360213619

1360313620
* Assigned Linodes must not have any ongoing live migrations.
1360413621

@@ -13643,9 +13660,7 @@ paths:
1364313660
- $ref: '#/components/parameters/pageSize'
1364413661
summary: Firewall Devices List
1364513662
description: |
13646-
Returns a paginated list of a Firewall's Devices. A Firewall Device assigns a
13647-
Firewall to a Linode service (referred to as the Device's `entity`). Currently,
13648-
only Devices with an entity of type `linode` are accepted.
13663+
Returns a paginated list of a Firewall's Devices. A Firewall Device assigns a Firewall to a service (referred to as the Device's `entity`).
1364913664
operationId: getFirewallDevices
1365013665
x-linode-cli-action: devices-list
1365113666
security:
@@ -13664,6 +13679,29 @@ paths:
1366413679
type: array
1366513680
items:
1366613681
$ref: '#/components/schemas/FirewallDevices'
13682+
example:
13683+
- {
13684+
"created": "2018-01-01T00:01:01",
13685+
"entity": {
13686+
"id": 123,
13687+
"label": "my-linode",
13688+
"type": "linode",
13689+
"url": "/v4/linode/instances/123"
13690+
},
13691+
"id": 456,
13692+
"updated": "2018-01-02T00:01:01"
13693+
}
13694+
- {
13695+
"created": "2018-01-01T00:01:01",
13696+
"entity": {
13697+
"id": 321,
13698+
"label": "my-nodebalancer",
13699+
"type": "nodebalancer",
13700+
"url": "/v4/nodebalancers/123"
13701+
},
13702+
"id": 654,
13703+
"updated": "2018-01-02T00:01:01"
13704+
}
1366713705
page:
1366813706
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
1366913707
pages:
@@ -13691,11 +13729,13 @@ paths:
1369113729
Creates a Firewall Device, which assigns a Firewall to a service (referred to
1369213730
as the Device's `entity`) and applies the Firewall's Rules to the device.
1369313731

13694-
* Currently, only Devices with an entity of type `linode` are accepted.
13732+
* Currently, Devices with `linode` and `nodebalancer` entity types are accepted.
1369513733

13696-
* A Firewall can be assigned to multiple Linode instances at a time.
13734+
* Firewalls only apply to inbound TCP traffic to NodeBalancers.
1369713735

13698-
* A Linode instance can have one active, assigned Firewall at a time.
13736+
* A Firewall can be assigned to multiple services at a time.
13737+
13738+
* A service can have one active, assigned Firewall at a time.
1369913739
Additional disabled Firewalls can be assigned to a service, but they cannot be enabled if another active Firewall is already assigned to the same service.
1370013740

1370113741
* Assigned Linodes must not have any ongoing live migrations.
@@ -13767,8 +13807,7 @@ paths:
1376713807
summary: Firewall Device View
1376813808
description: |
1376913809
Returns information for a Firewall Device, which assigns a Firewall
13770-
to a Linode service (referred to as the Device's `entity`). Currently,
13771-
only Devices with an entity of type `linode` are accepted.
13810+
to a service (referred to as the Device's `entity`).
1377213811
operationId: getFirewallDevice
1377313812
x-linode-cli-action: device-view
1377413813
security:
@@ -13807,10 +13846,10 @@ paths:
1380713846
- oauth:
1380813847
- firewall:read_write
1380913848
description: |
13810-
Removes a Firewall Device, which removes a Firewall from the Linode service it was
13811-
assigned to by the Device. This will remove all of the Firewall's Rules from the Linode
13812-
service. If any other Firewalls have been assigned to the Linode service, then those Rules
13813-
will remain in effect.
13849+
Removes a Firewall Device, which removes a Firewall from the service it was
13850+
assigned to by the Device. This removes all of the Firewall's Rules from the
13851+
service. If any other Firewalls have been assigned to the service, then those Rules
13852+
remain in effect.
1381413853

1381513854
* Assigned Linodes must not have any ongoing live migrations.
1381613855

@@ -14135,6 +14174,13 @@ paths:
1413514174
$ref: '#/components/schemas/NodeBalancer/properties/label'
1413614175
client_conn_throttle:
1413714176
$ref: '#/components/schemas/NodeBalancer/properties/client_conn_throttle'
14177+
firewall_id:
14178+
type: integer
14179+
description: |
14180+
The ID of the Firewall to assign to the NodeBalancer.
14181+
14182+
* Only one NodeBalancer can be assigned to a Firewall at a time.
14183+
* Firewalls only apply to inbound TCP traffic to NodeBalancers.
1413814184
tags:
1413914185
description: |
1414014186
An array of Tags applied to this object. Tags are for organizational purposes only.
@@ -15069,6 +15115,52 @@ paths:
1506915115
source: >
1507015116
linode-cli nodebalancers node-delete \
1507115117
12345 4567 54321
15118+
/nodebalancers/{nodeBalancerId}/firewalls:
15119+
x-linode-cli-command: nodebalancers
15120+
parameters:
15121+
- name: nodeBalancerId
15122+
in: path
15123+
description: The ID of the NodeBalancer to access.
15124+
required: true
15125+
schema:
15126+
type: integer
15127+
get:
15128+
operationId: getNodeBalancerFirewalls
15129+
x-linode-grant: read_only
15130+
tags:
15131+
- NodeBalancers
15132+
summary: Firewalls List
15133+
description: >
15134+
View information for Firewalls assigned to this NodeBalancer.
15135+
x-linode-cli-action: firewalls
15136+
security:
15137+
- personalAccessToken: []
15138+
- oauth:
15139+
- nodebalancers:read_only
15140+
responses:
15141+
'200':
15142+
description: Returns a paginated list of Firewalls assigned to this NodeBalancer.
15143+
content:
15144+
application/json:
15145+
schema:
15146+
allOf:
15147+
- $ref: '#/components/schemas/PaginationEnvelope'
15148+
- type: object
15149+
properties:
15150+
data:
15151+
type: array
15152+
items:
15153+
$ref: '#/components/schemas/Firewall'
15154+
default:
15155+
$ref: '#/components/responses/ErrorResponse'
15156+
x-code-samples:
15157+
- lang: Shell
15158+
source: >
15159+
curl https://api.linode.com/v4/nodebalancers/$nodeBalancerId/firewalls \
15160+
-H "Authorization: Bearer $TOKEN"
15161+
- lang: CLI
15162+
source: >
15163+
linode-cli nodebalancers firewalls $nodeBalancerId
1507215164
/nodebalancers/{nodeBalancerId}/stats:
1507315165
x-linode-cli-command: nodebalancers
1507415166
parameters:
@@ -21336,9 +21428,9 @@ components:
2133621428
Firewall:
2133721429
type: object
2133821430
description: >
21339-
A resource that controls incoming and outgoing network traffic to a Linode service. Only one Firewall can be attached to a Linode at any given time.
21431+
A resource that controls incoming and outgoing network traffic to a compute service. Only one enabled Firewall can be attached to a particular service at any given time.
2134021432
[Create a Firewall Device](/docs/api/networking/#firewall-create)
21341-
to assign a Firewall to a Linode service. Currently, Firewalls can only be assigned to Linode instances.
21433+
to assign a Firewall to a service. Currently, Firewalls can assigned to Linode compute instances and NodeBalancers.
2134221434
properties:
2134321435
id:
2134421436
x-linode-filterable: true
@@ -21531,8 +21623,8 @@ components:
2153121623
FirewallDevices:
2153221624
type: object
2153321625
description: >
21534-
Associates a Firewall with a Linode service. A Firewall can be assigned
21535-
to a single Linode service at a time. Additional disabled Firewalls can be
21626+
Associates a Firewall with a Linode or NodeBalancer service. A Firewall can be assigned
21627+
to a single entity at a time. Additional disabled Firewalls can be
2153621628
assigned to a service, but they cannot be enabled if another active Firewall
2153721629
is already assigned to the same service.
2153821630
properties:
@@ -21565,7 +21657,7 @@ components:
2156521657
type: object
2156621658
readOnly: true
2156721659
description: >
21568-
The Linode service that this Firewall has been applied to.
21660+
The compute service that this Firewall has been applied to.
2156921661
properties:
2157021662
id:
2157121663
description: The entity's ID
@@ -21576,6 +21668,7 @@ components:
2157621668
type: string
2157721669
enum:
2157821670
- linode
21671+
- nodebalancer
2157921672
example: linode
2158021673
label:
2158121674
description: The entity's label.
@@ -21584,7 +21677,7 @@ components:
2158421677
example: my-linode
2158521678
url:
2158621679
description: >
21587-
The URL you can use to access this entity.
21680+
The API URL path you can use to access this entity.
2158821681
type: string
2158921682
format: url
2159021683
readOnly: true

0 commit comments

Comments
 (0)