Update firewall¶
PATCH/
Firewall Management API · Firewalls
Update firewalls with supplied values.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
firewallId | path | string (uuid) | Yes | Firewall ID. |
Request body¶
Content type: application/json
Request body fields
namestringFirewall name.
Must be 3–40 characters long.
Must be 3–40 characters long.
geoLocationobjectGeolocation.
Show child attributesHide child attributes
latitudestringrequiredLatitude.
longitudestringrequiredLongitude.
Request samples¶
curl -X PATCH "https://api-<data-region>.central.sophos.com/firewall/v1/firewalls/<firewallId>" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"name\": \"FW-label\",
\"geoLocation\": {
\"latitude\": \"20.64\",
\"longitude\": \"122.43\"
}
}"
import requests
response = requests.patch(
"https://api-<data-region>.central.sophos.com/firewall/v1/firewalls/<firewallId>",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'name': 'FW-label',
'geoLocation': {'latitude': '20.64', 'longitude': '122.43'}},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"name": "FW-label",
"geoLocation": {
"latitude": "20.64",
"longitude": "122.43"
}
}'
Invoke-RestMethod -Method PATCH -Uri "https://api-<data-region>.central.sophos.com/firewall/v1/firewalls/<firewallId>" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("PATCH", "https://api-<data-region>.central.sophos.com/firewall/v1/firewalls/<firewallId>", strings.NewReader(`{
"name": "FW-label",
"geoLocation": {
"latitude": "20.64",
"longitude": "122.43"
}
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/firewall/v1/firewalls/<firewallId>", {
method: "PATCH",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "FW-label",
"geoLocation": {
"latitude": "20.64",
"longitude": "122.43"
}
}),
});
const data = await response.json();
console.log(data);
Responses¶
200 — Firewall updated successfully.¶
Response fields
idstring (uuid)requiredclusterobjectHigh availability cluster.
Show child attributesHide child attributes
idstring (uuid)requiredmodestring (enum)requiredHigh availability mode.
Must be one of:
Must be one of:
activeActive, activePassive.statusstring (enum)requiredHigh availability status.
Must be one of:
Must be one of:
auxiliary, primary, standalone, fault.peersarray of objectrequiredAuxiliary firewall for high availability primary firewall or vice-versa.
Show child attributesHide child attributes
idstring (uuid)requiredserialNumberstringrequiredtenantobjectrequiredTenant ID.
Show child attributesHide child attributes
idstring (uuid)requiredTenant ID.
serialNumberstringrequiredgroupobjectGroup ID.
Show child attributesHide child attributes
idstring (uuid)requiredGroup ID.
namestringGroup name.
Must be 1–250 characters long.
Must be 1–250 characters long.
hostnamestringrequiredMust be 1–250 characters long.
namestringrequiredMust be 3–40 characters long.
firmwareVersionstringexternalIpv4Addressesarray of string (ipv4)requiredmodelstringstatusobjectrequiredFirewall status.
Show child attributesHide child attributes
managingStatusstring (enum)requiredShows if the firewall is managed.
Must be one of:
Must be one of:
approvedByCustomer, approvalPending, rejectedByCustomer, revokedByCustomer, revokedByPartner, requestNotSent, claimed, unclaimed, waitingForDeployment.reportingStatusstring (enum)requiredShows if Sophos Central Reporting is turned on.
Must be one of:
Must be one of:
approvedByCustomer, approvalPending, requestNotSent.connectedbooleanrequiredsuspendedbooleanrequiredstateChangedAtstring (date-time)capabilitiesarray of stringFirewall capability.
Each item must be one of:
Each item must be one of:
highAvailability, sdwanGroup, configImport, default, sdwanMultiGroup, cloudAutoScale.createdByobjectrequiredShow child attributesHide child attributes
idstringPrincipal email or client ID.
typestring (enum)Principal type.
Must be one of:
Must be one of:
user, service.namestringUser principal name.
accountTypestringrequiredAccount type.
Must be one of:
Must be one of:
partner, tenant.accountIdstring (uuid)requiredAccount ID.
createdAtstring (date-time)requiredupdatedByobjectShow child attributesHide child attributes
idstringPrincipal email or client ID.
typestring (enum)Principal type.
Must be one of:
Must be one of:
user, service.namestringUser principal name.
accountTypestringrequiredAccount type.
Must be one of:
Must be one of:
partner, tenant.accountIdstring (uuid)requiredAccount ID.
updatedAtstring (date-time)geoLocationobjectGeolocation.
Show child attributesHide child attributes
latitudestringrequiredLatitude.
longitudestringrequiredLongitude.
Errors¶
| Status | Meaning |
|---|---|
400 | Invalid firewall ID. |
401 | Authentication required. |
403 | Authorization required. |
404 | Can't find firewall. |
409 | Firewall name already in use. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"id": "39df20ba-7330-41ae-9071-0ac682bdd1e6",
"cluster": {
"id": "6a72014b-ae91-4d50-807a-d3601e44b9b7",
"mode": "activeActive",
"status": "primary",
"peers": {
"id": "e2875239-be72-4b3e-85f2-37ec51fe3cbd",
"serialNumber": "SFDemo-ta-xgs107w-07"
}
},
"tenant": {
"id": "3e382b8e-49fd-4cd9-8360-a364371d7650"
},
"serialNumber": "C01001JYCGB4J30",
"group": {
"id": "ab83681f-aff6-4c2d-b0e5-1e9960fa5ce7",
"name": "Bangalore Group"
},
"hostname": "FW-1",
"name": "fw-label",
"externalIpv4Addresses": [
"111.93.156.226",
"125.16.229.10"
],
"firmwareVersion": "SF01V_SO01_19.0.0.294",
"model": "SFVUNL_SO01_SFOS 19.0.0 GA-Build294",
"status": {
"managing": "approvalPending",
"reporting": "approvalPending",
"connected": true,
"suspended": false
},
"stateChangedAt": "2022-04-01T17:49:26.400Z",
"capabilities": [
"sdwanGroup"
],
"geoLocation": {
"latitude": "20.64",
"longitude": "22.43"
},
"createdBy": {
"id": "9f0a6bf4-1fa6-407a-aa1d-4b888a626bb3",
"type": "user",
"name": "Joe Bloggs",
"accountType": "tenant",
"accountId": "98be8a40-ea9e-488e-b7d1-200d924cdb54"
},
"createdAt": "2021-10-25T05:27:39.467Z",
"updatedAt": "2022-04-01T18:08:26.472Z",
"updatedBy": {
"id": "0ab38272-0d0c-4425-936c-8e45a289169e",
"type": "user",
"name": "Jane Doe",
"accountType": "partner",
"accountId": "b2f5d2d4-a041-494c-a3a2-a45219b6349a"
}
}
See the guide for a narrative walkthrough of this API.