diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/azureFirewall.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/azureFirewall.json index 2d93a0564897..c980f6e7ab54 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/azureFirewall.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/azureFirewall.json @@ -505,6 +505,78 @@ "final-state-via": "location" } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCaptureOperation": { + "post": { + "tags": [ + "AzureFirewalls" + ], + "operationId": "AzureFirewalls_PacketCaptureOperation", + "description": "Runs a packet capture operation on AzureFirewall.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "azureFirewallName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[A-Za-z0-9][\\w\\-._]{0,54}[A-Za-z0-9_]$", + "description": "The name of the azure firewall." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FirewallPacketCaptureParameters" + }, + "description": "Parameters supplied to run packet capture on azure firewall." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Azure Firewall Packet Capture Response", + "schema": { + "$ref": "#/definitions/AzureFirewallPacketCaptureResponse" + } + }, + "202": { + "description": "Accepted and the operation will complete asynchronously.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "AzureFirewallPacketCaptureOperation": { + "$ref": "./examples/AzureFirewallPacketCaptureOperation.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + } } }, "definitions": { @@ -1273,6 +1345,10 @@ }, "description": "Rules to filter packet captures.", "x-ms-identifiers": [] + }, + "operation": { + "$ref": "#/definitions/AzureFirewallPacketCaptureOperationType", + "description": "The Azure Firewall packet capture operation to perform" } }, "description": "Azure Firewall Packet Capture Parameters." @@ -1349,6 +1425,54 @@ } }, "description": "Azure Firewall Autoscale Configuration parameters." + }, + "AzureFirewallPacketCaptureResponse": { + "type": "object", + "properties": { + "azureFirewallPacketCaptureResponseCode": { + "$ref": "#/definitions/AzureFirewallPacketCaptureResponseCode", + "description": "The response code of the performed packet capture operation" + }, + "message": { + "type": "string", + "description": "Localized Message String of The Result Of The Azure Firewall Packet Capture Operation" + } + }, + "description": "Response of an Azure Firewall Packet Capture Operation." + }, + "AzureFirewallPacketCaptureOperationType": { + "type": "string", + "description": "The packet capture operation to perform.", + "enum": [ + "Start", + "Status", + "Stop" + ], + "default": "Start", + "x-ms-enum": { + "name": "AzureFirewallPacketCaptureOperationType", + "modelAsString": true + } + }, + "AzureFirewallPacketCaptureResponseCode": { + "type": "string", + "description": "The packet capture operation to perform.", + "enum": [ + "NotImplemented", + "AzureFirewallPacketCaptureStartSucceeded", + "AzureFirewallPacketCaptureStartFailed", + "AzureFirewallPacketCaptureStartFailedToUpload", + "AzureFirewallPacketCaptureStartFailure", + "AzureFirewallPacketCaptureInProgress", + "AzureFirewallPacketCaptureNotInProgress", + "AzureFirewallPacketCaptureStopSucceeded", + "AzureFirewallPacketCaptureFailed", + "AzureFirewallPacketCaptureCompleted" + ], + "x-ms-enum": { + "name": "AzureFirewallPacketCaptureResponseCode", + "modelAsString": true + } } } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/examples/AzureFirewallPacketCaptureOperation.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/examples/AzureFirewallPacketCaptureOperation.json new file mode 100644 index 000000000000..e371ebcc6055 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-10-01/examples/AzureFirewallPacketCaptureOperation.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "api-version": "2024-10-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "azureFirewallName": "azureFirewall1", + "parameters": { + "durationInSeconds": 300, + "numberOfPacketsToCapture": 5000, + "sasUrl": "someSASURL", + "fileName": "azureFirewallPacketCapture", + "protocol": "Any", + "flags": [ + { + "type": "syn" + }, + { + "type": "fin" + } + ], + "filters": [ + { + "sources": [ + "20.1.1.0" + ], + "destinations": [ + "20.1.2.0" + ], + "destinationPorts": [ + "4500" + ] + }, + { + "sources": [ + "10.1.1.0", + "10.1.1.1" + ], + "destinations": [ + "10.1.2.0" + ], + "destinationPorts": [ + "123", + "80" + ] + } + ], + "operation": "Status" + } + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2025-01-01", + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2025-01-01" + } + }, + "200": { + "body": { + "azureFirewallPacketCaptureResponseCode": "AzureFirewallPacketCaptureInProgress", + "message": "Packet capture in progress. Please wait till it is finished or stop the current capture before starting another." + } + } + } +}