diff --git a/src/azure-cli/azure/cli/command_modules/network/private_link_resource_and_endpoint_connections/custom.py b/src/azure-cli/azure/cli/command_modules/network/private_link_resource_and_endpoint_connections/custom.py index b66b2f164ab..bafde5a4ab3 100644 --- a/src/azure-cli/azure/cli/command_modules/network/private_link_resource_and_endpoint_connections/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/private_link_resource_and_endpoint_connections/custom.py @@ -84,6 +84,7 @@ def register_providers(): _register_one_provider("Microsoft.DocumentDB/mongoClusters", '2023-03-01-preview', True) _register_one_provider('Microsoft.DBforPostgreSQL/flexibleServers', '2023-06-01-preview', False) _register_one_provider('Microsoft.App/managedEnvironments', '2024-02-02-preview', True) + _register_one_provider('Microsoft.FluidRelay/fluidRelayServers', '2025-03-10-preview', True) def _register_one_provider(provider, api_version, support_list_or_not, resource_get_api_version=None, support_connection_operation=True): # pylint: disable=line-too-long diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_fluid_relay.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_fluid_relay.yaml new file mode 100644 index 00000000000..e7171d7bc29 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_fluid_relay.yaml @@ -0,0 +1,48 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --name -g --type + User-Agent: + - python/3.8.3 (Windows-10-10.0.18362-SP0) AZURECLI/2.29.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_fr_plc000002000001/providers/Microsoft.FluidRelay/fluidRelayServers/frplr000002/privateEndpointConnections?api-version=2025-03-10-preview + response: + body: + string: '{"value": [{"id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/myResourceGroup/providers/Microsoft.FluidRelay/fluidRelayServers/myFluidRelayServer/privateEndpointConnections/myPrivateEndpointConnection1", "name": "myPrivateEndpointConnection1", "type": "Microsoft.FluidRelay/fluidRelayServers/privateEndpointConnections", "properties": {"provisioningState": "Succeeded", "privateEndpoint": {"id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/privateEndpoint1"}, "privateLinkServiceConnectionState": {"status": "Approved", "description": "Auto-Approved", "actionsRequired": "None"}}}, {"id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/myResourceGroup/providers/Microsoft.FluidRelay/fluidRelayServers/myFluidRelayServer/privateEndpointConnections/myPrivateEndpointConnection2", "name": "myPrivateEndpointConnection2", "type": "Microsoft.FluidRelay/fluidRelayServers/privateEndpointConnections", "properties": {"provisioningState": "Succeeded", "privateEndpoint": {"id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/privateEndpoint2"}, "privateLinkServiceConnectionState": {"status": "Approved", "description": "Auto-Approved", "actionsRequired": "None"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2663' + content-type: + - application/json + date: + - Mon, 16 May 2025 14:06:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_fluid_relay.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_fluid_relay.yaml new file mode 100644 index 00000000000..280853da45f --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_fluid_relay.yaml @@ -0,0 +1,48 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --name -g --type + User-Agent: + - python/3.8.3 (Windows-10-10.0.18362-SP0) AZURECLI/2.29.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_fr_plr000001000001/providers/Microsoft.FluidRelay/fluidRelayServers/frplr000001/privateLinkResources?api-version=2025-03-10-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_fr_plr000001000001/providers/Microsoft.FluidRelay/fluidRelayServers/frplr000001/privateLinkResources/FluidRelayServers","name":"FluidRelayServers","type":"Microsoft.FluidRelay/fluidRelayServers/privateLinkResources","properties":{"groupId":"FluidRelayServers","requiredMembers":["test-alfred","test-nexus","test-historian"],"requiredZoneNames":["privatelink.fluidrelay.azure.com"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2663' + content-type: + - application/json + date: + - Mon, 16 May 2025 14:06:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py index 797988635d7..223789c14d0 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py @@ -270,6 +270,25 @@ def test_hsm_private_endpoint_connection2(self, resource_group, managed_hsm): self.cmd('network private-endpoint delete -g {rg} -n {pe}') +class NetworkPrivateLinkFluidRelayScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_fr_plr000001') + def test_private_link_resource_fluid_relay(self): + self.kwargs.update({ + 'fluidrelay': 'frplr000001' + }) + self.cmd('network private-link-resource list --name {fluidrelay} -g {rg} --type Microsoft.FluidRelay/fluidRelayServers', checks=[ + self.check('length(@)', 1), + ]) + + @ResourceGroupPreparer(name_prefix='cli_test_fr_plc000002') + def test_private_endpoint_connection_fluid_relay(self): + self.kwargs.update({ + 'fluidrelay': 'frplr000002' + }) + self.cmd('network private-endpoint-connection list --name {fluidrelay} -g {rg} --type Microsoft.FluidRelay/fluidRelayServers', checks=[ + self.check('length(@)', 2), + ]) + class NetworkPrivateLinkStorageAccountScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_sa_plr') @StorageAccountPreparer(name_prefix='saplr', kind='StorageV2', sku='Standard_LRS')