From ca7f31fec4662c0f304354329cd767334f327920 Mon Sep 17 00:00:00 2001 From: Sachin Panchal Date: Tue, 26 Nov 2024 15:18:46 +0530 Subject: [PATCH 1/3] Added example files for ring buffer --- ...kWatcherPacketCaptureRingBufferCreate.json | 50 ++++++++++++++ ...acketCaptureRingBufferWithErrorCreate.json | 31 +++++++++ ...acketCaptureRingBufferWithFalseCreate.json | 67 +++++++++++++++++++ .../stable/2024-05-01/networkWatcher.json | 9 +++ 4 files changed, 157 insertions(+) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json new file mode 100644 index 000000000000..f49e536c5290 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2024-05-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "networkWatcherName": "nw1", + "packetCaptureName": "pc1", + "parameters": { + "properties": { + "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1", + "storageLocation": { + "storageId": "null", + "localPath": "D:\\capture\\pc1.cap" + }, + "captureSettings": { + "fileCount": 10, + "fileSizeInBytes": 102400, + "sessionTimeLimitInSeconds": 600 + }, + "continuousCapture": true, + "filters": [] + } + } + }, + "responses": { + "201": { + "body": { + "name": "pc1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1", + "properties": { + "provisioningState": "Updating", + "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1", + "bytesToCapturePerPacket": 0, + "storageLocation": { + "storagePath": "", + "localPath": "D:\\capture\\pc1.cap" + }, + "continuousCapture": true, + "captureSettings": { + "fileCount": 10, + "fileSizeInBytes": 102400, + "sessionTimeLimitInSeconds": 600 + }, + "filters": [] + } + } + } + } +} + diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json new file mode 100644 index 000000000000..f01d3c37731c --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2024-05-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "networkWatcherName": "nw1", + "packetCaptureName": "pc1", + "parameters": { + "properties": { + "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1", + "storageLocation": { + "storageId": "null", + "filePath": "D:\\capture\\pc1.cap" + }, + "continuousCapture": true, + "filters": [] + } + } + }, + "responses": { + "200": { + "body": { + "error": { + "code": "InvalidRequestPropertiesInPacketCaptureRequest", + "message": "FilePath is not supported in packet capture request.", + "details": [] + } + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json new file mode 100644 index 000000000000..488f571ce2cb --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json @@ -0,0 +1,67 @@ +{ + "parameters": { + "api-version": "2024-05-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "networkWatcherName": "nw1", + "packetCaptureName": "pc1", + "parameters": { + "properties": { + "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1", + "storageLocation": { + "storageId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/testcapsa", + "localPath": "D:\\capture\\pc1.cap" + }, + "captureSettings": { + "fileCount": 10, + "fileSizeInBytes": 102400, + "sessionTimeLimitInSeconds": 600 + }, + "continuousCapture": false, + "filters": [ + { + "remoteIPAddress": "13.107.226.38" + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "name": "pc1", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1", + "properties": { + "provisioningState": "Updating", + "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1", + "scope": { + "include": [], + "exclude": [] + }, + "bytesToCapturePerPacket": 0, + "storageLocation": { + "storageId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/testcapsa", + "storagePath": "dummyaddress/subscriptions/subid/resourcegroups/rg2/providers/microsoft.compute/virtualmachines/vm1/2024/02/16/pc1.cap", + "localPath": "D:\\capture\\pc1.cap" + }, + "continuousCapture": false, + "captureSettings": { + "fileCount": 2, + "fileSizeInBytes": 102400, + "sessionTimeLimitInSeconds": 300 + }, + "filters": [ + { + "protocol": "Any", + "localIPAddress": "", + "localPort": "", + "remoteIPAddress": "13.107.226.38", + "remotePort": "" + } + ] + } + } + } + } +} + diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json index 34d26143d73d..bca43a7554a2 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json @@ -669,6 +669,15 @@ "x-ms-examples": { "Create packet capture": { "$ref": "./examples/NetworkWatcherPacketCaptureCreate.json" + }, + "Create packet capture ring buffer": { + "$ref": "./examples/NetworkWatcherPacketCaptureRingBufferCreate.json" + }, + "Create packet capture ring buffer with error": { + "$ref": "./examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json" + }, + "Create packet capture ring buffer with false continous capture": { + "$ref": "./examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json" } }, "x-ms-long-running-operation": true, From e8b3cc5a1d589f624122d98ff6b88f5cd3790395 Mon Sep 17 00:00:00 2001 From: Sachin Panchal Date: Fri, 29 Nov 2024 12:52:46 +0530 Subject: [PATCH 2/3] resolve spell check and prettier check --- .../examples/NetworkWatcherPacketCaptureRingBufferCreate.json | 1 - .../NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json | 1 - .../Microsoft.Network/stable/2024-05-01/networkWatcher.json | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json index f49e536c5290..73597382b62a 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferCreate.json @@ -47,4 +47,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json index 488f571ce2cb..462e7ce40280 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json @@ -64,4 +64,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json index bca43a7554a2..f6ac3004bb74 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/networkWatcher.json @@ -676,7 +676,7 @@ "Create packet capture ring buffer with error": { "$ref": "./examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json" }, - "Create packet capture ring buffer with false continous capture": { + "Create packet capture ring buffer with false continuous capture": { "$ref": "./examples/NetworkWatcherPacketCaptureRingBufferWithFalseCreate.json" } }, From 552a4c6f88b7b2ab0952cdbf90b5d24aba5a512b Mon Sep 17 00:00:00 2001 From: Sachin Panchal Date: Fri, 29 Nov 2024 13:59:05 +0530 Subject: [PATCH 3/3] added 201 --- .../NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json index f01d3c37731c..6402fb7f16b9 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherPacketCaptureRingBufferWithErrorCreate.json @@ -18,7 +18,7 @@ } }, "responses": { - "200": { + "201": { "body": { "error": { "code": "InvalidRequestPropertiesInPacketCaptureRequest",