# Firewalls ## Create `client.gpuDroplets.firewalls.create(FirewallCreateParamsparams?, RequestOptionsoptions?): FirewallCreateResponse` **post** `/v2/firewalls` To create a new firewall, send a POST request to `/v2/firewalls`. The request must contain at least one inbound or outbound access rule. ### Parameters - `params: FirewallCreateParams` - `body?: Body` ### Returns - `FirewallCreateResponse` - `firewall?: Firewall` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const firewall = await client.gpuDroplets.firewalls.create(); console.log(firewall.firewall); ``` ## Retrieve `client.gpuDroplets.firewalls.retrieve(stringfirewallID, RequestOptionsoptions?): FirewallRetrieveResponse` **get** `/v2/firewalls/{firewall_id}` To show information about an existing firewall, send a GET request to `/v2/firewalls/$FIREWALL_ID`. ### Parameters - `firewallID: string` ### Returns - `FirewallRetrieveResponse` - `firewall?: Firewall` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const firewall = await client.gpuDroplets.firewalls.retrieve('bb4b2611-3d72-467b-8602-280330ecd65c'); console.log(firewall.firewall); ``` ## Update `client.gpuDroplets.firewalls.update(stringfirewallID, FirewallUpdateParamsparams, RequestOptionsoptions?): FirewallUpdateResponse` **put** `/v2/firewalls/{firewall_id}` To update the configuration of an existing firewall, send a PUT request to `/v2/firewalls/$FIREWALL_ID`. The request should contain a full representation of the firewall including existing attributes. **Note that any attributes that are not provided will be reset to their default values.**

You must have read access (e.g. `droplet:read`) to all resources attached to the firewall to successfully update the firewall. ### Parameters - `firewallID: string` - `params: FirewallUpdateParams` - `firewall: Firewall` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Returns - `FirewallUpdateResponse` - `firewall?: Firewall` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const firewall = await client.gpuDroplets.firewalls.update('bb4b2611-3d72-467b-8602-280330ecd65c', { firewall: { name: 'frontend-firewall' }, }); console.log(firewall.firewall); ``` ## List `client.gpuDroplets.firewalls.list(FirewallListParamsquery?, RequestOptionsoptions?): FirewallListResponse` **get** `/v2/firewalls` To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`. ### Parameters - `query: FirewallListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `FirewallListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `firewalls?: Array` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `links?: PageLinks` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const firewalls = await client.gpuDroplets.firewalls.list(); console.log(firewalls.meta); ``` ## Delete `client.gpuDroplets.firewalls.delete(stringfirewallID, RequestOptionsoptions?): void` **delete** `/v2/firewalls/{firewall_id}` To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.delete('bb4b2611-3d72-467b-8602-280330ecd65c'); ``` ## Domain Types ### Firewall - `Firewall` - `id?: string` A unique ID that can be used to identify and reference a firewall. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the firewall was created. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets assigned to the firewall.

Requires `droplet:read` scope. - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `name?: string` A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `pending_changes?: Array` An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - `droplet_id?: number` - `removing?: boolean` - `status?: string` - `status?: "waiting" | "succeeded" | "failed"` A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". - `"waiting"` - `"succeeded"` - `"failed"` - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. # Droplets ## Add `client.gpuDroplets.firewalls.droplets.add(stringfirewallID, DropletAddParamsbody, RequestOptionsoptions?): void` **post** `/v2/firewalls/{firewall_id}/droplets` To assign a Droplet to a firewall, send a POST request to `/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there should be a `droplet_ids` attribute containing a list of Droplet IDs. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: DropletAddParams` - `droplet_ids: Array` An array containing the IDs of the Droplets to be assigned to the firewall. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.droplets.add('bb4b2611-3d72-467b-8602-280330ecd65c', { droplet_ids: [49696269], }); ``` ## Remove `client.gpuDroplets.firewalls.droplets.remove(stringfirewallID, DropletRemoveParamsbody, RequestOptionsoptions?): void` **delete** `/v2/firewalls/{firewall_id}/droplets` To remove a Droplet from a firewall, send a DELETE request to `/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there should be a `droplet_ids` attribute containing a list of Droplet IDs. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: DropletRemoveParams` - `droplet_ids: Array` An array containing the IDs of the Droplets to be removed from the firewall. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.droplets.remove('bb4b2611-3d72-467b-8602-280330ecd65c', { droplet_ids: [49696269], }); ``` # Tags ## Add `client.gpuDroplets.firewalls.tags.add(stringfirewallID, TagAddParamsbody, RequestOptionsoptions?): void` **post** `/v2/firewalls/{firewall_id}/tags` To assign a tag representing a group of Droplets to a firewall, send a POST request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the request, there should be a `tags` attribute containing a list of tag names. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: TagAddParams` - `tags: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.tags.add('bb4b2611-3d72-467b-8602-280330ecd65c', { tags: ['frontend'] }); ``` ## Remove `client.gpuDroplets.firewalls.tags.remove(stringfirewallID, TagRemoveParamsbody, RequestOptionsoptions?): void` **delete** `/v2/firewalls/{firewall_id}/tags` To remove a tag representing a group of Droplets from a firewall, send a DELETE request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the request, there should be a `tags` attribute containing a list of tag names. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: TagRemoveParams` - `tags: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.tags.remove('bb4b2611-3d72-467b-8602-280330ecd65c', { tags: ['frontend'], }); ``` # Rules ## Add `client.gpuDroplets.firewalls.rules.add(stringfirewallID, RuleAddParamsbody?, RequestOptionsoptions?): void` **post** `/v2/firewalls/{firewall_id}/rules` To add additional access rules to a firewall, send a POST request to `/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be added. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: RuleAddParams` - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.rules.add('bb4b2611-3d72-467b-8602-280330ecd65c', { inbound_rules: [{ protocol: 'tcp', ports: '3306', sources: { droplet_ids: [49696269] } }], outbound_rules: [{ protocol: 'tcp', ports: '3306', destinations: { droplet_ids: [49696269] } }], }); ``` ## Remove `client.gpuDroplets.firewalls.rules.remove(stringfirewallID, RuleRemoveParamsbody?, RequestOptionsoptions?): void` **delete** `/v2/firewalls/{firewall_id}/rules` To remove access rules from a firewall, send a DELETE request to `/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an `inbound_rules` and/or `outbound_rules` attribute containing an array of rules to be removed. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. ### Parameters - `firewallID: string` - `body: RuleRemoveParams` - `inbound_rules?: Array | null` - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` - `sources: FirewallRuleTarget` An object specifying locations from which inbound traffic will be accepted. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `outbound_rules?: Array | null` - `destinations: FirewallRuleTarget` An object specifying locations to which outbound traffic that will be allowed. - `addresses?: Array` An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. - `droplet_ids?: Array` An array containing the IDs of the Droplets to which the firewall will allow traffic. - `kubernetes_ids?: Array` An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. - `load_balancer_uids?: Array` An array containing the IDs of the load balancers to which the firewall will allow traffic. - `tags?: Array | null` A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires `tag:create` and `tag:read` scopes. - `ports: string` The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - `protocol: "tcp" | "udp" | "icmp"` The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`. - `"tcp"` - `"udp"` - `"icmp"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.firewalls.rules.remove('bb4b2611-3d72-467b-8602-280330ecd65c', { inbound_rules: [{ protocol: 'tcp', ports: '3306', sources: { droplet_ids: [49696269] } }], outbound_rules: [{ protocol: 'tcp', ports: '3306', destinations: { droplet_ids: [49696269] } }], }); ```