From 566ac2339282b37551c40e3b21e254ba7b4cc67a Mon Sep 17 00:00:00 2001 From: Dani Estevez Date: Mon, 9 Jul 2018 12:35:53 -0400 Subject: [PATCH] Adds listAll to PublicIPAddressAPI Adds listAll to NetworkInterfaceCardApi Addresses comments on tests Sets resourcegroup pathparam as nullable for NetworkInterfaceCardApi and PublicIPAddressApi --- .../azurecompute/arm/AzureComputeApi.java | 6 +- .../arm/features/NetworkInterfaceCardApi.java | 16 ++- .../arm/features/PublicIPAddressApi.java | 16 ++- .../NetworkInterfaceCardApiLiveTest.java | 9 +- .../NetworkInterfaceCardApiMockTest.java | 39 ++++++- .../features/PublicIPAddressApiLiveTest.java | 13 ++- .../features/PublicIPAddressApiMockTest.java | 45 ++++++-- .../resources/PublicIPAddressListAll.json | 102 ++++++++++++++++++ .../resources/listallnetworkinterfaces.json | 100 +++++++++++++++++ 9 files changed, 320 insertions(+), 26 deletions(-) create mode 100644 providers/azurecompute-arm/src/test/resources/PublicIPAddressListAll.json create mode 100644 providers/azurecompute-arm/src/test/resources/listallnetworkinterfaces.json diff --git a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeApi.java b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeApi.java index ba2fdd4f73..324d8dc925 100644 --- a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeApi.java +++ b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeApi.java @@ -17,7 +17,6 @@ package org.jclouds.azurecompute.arm; import java.io.Closeable; - import javax.ws.rs.PathParam; import org.jclouds.azurecompute.arm.domain.ServicePrincipal; @@ -48,6 +47,7 @@ import org.jclouds.azurecompute.arm.features.VirtualMachineScaleSetApi; import org.jclouds.azurecompute.arm.features.VirtualNetworkApi; import org.jclouds.azurecompute.arm.features.VirtualNetworkGatewayApi; import org.jclouds.azurecompute.arm.features.VirtualNetworkGatewayConnectionApi; +import org.jclouds.javax.annotation.Nullable; import org.jclouds.rest.annotations.Delegate; import com.google.common.base.Supplier; @@ -115,7 +115,7 @@ public interface AzureComputeApi extends Closeable { * @see docs */ @Delegate - NetworkInterfaceCardApi getNetworkInterfaceCardApi(@PathParam("resourcegroup") String resourcegroup); + NetworkInterfaceCardApi getNetworkInterfaceCardApi(@Nullable @PathParam("resourcegroup") String resourcegroup); /** * The Public IP Address API includes operations for managing public ID Addresses for NICs in your subscription. @@ -123,7 +123,7 @@ public interface AzureComputeApi extends Closeable { * @see docs */ @Delegate - PublicIPAddressApi getPublicIPAddressApi(@PathParam("resourcegroup") String resourcegroup); + PublicIPAddressApi getPublicIPAddressApi(@Nullable @PathParam("resourcegroup") String resourcegroup); /** diff --git a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApi.java b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApi.java index 5d2773f67a..78c4547073 100644 --- a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApi.java +++ b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApi.java @@ -19,7 +19,6 @@ package org.jclouds.azurecompute.arm.features; import java.net.URI; import java.util.List; import java.util.Map; - import javax.inject.Named; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -45,19 +44,26 @@ import org.jclouds.rest.annotations.ResponseParser; import org.jclouds.rest.annotations.SelectJson; import org.jclouds.rest.binders.BindToJsonPayload; -@Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/networkInterfaces") @RequestFilters({ OAuthFilter.class, ApiVersionFilter.class }) @Consumes(MediaType.APPLICATION_JSON) public interface NetworkInterfaceCardApi { @Named("networkinterfacecard:list") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/networkInterfaces") @SelectJson("value") @GET @Fallback(EmptyListOnNotFoundOr404.class) List list(); + @Named("networkinterfacecard:list_all") + @Path("/providers/Microsoft.Network/networkInterfaces") + @SelectJson("value") + @GET + @Fallback(EmptyListOnNotFoundOr404.class) + List listAllInSubscription(); + @Named("networkinterfacecard:create_or_update") - @Path("/{networkinterfacecardname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/networkInterfaces/{networkinterfacecardname}") @MapBinder(BindToJsonPayload.class) @PUT NetworkInterfaceCard createOrUpdate(@PathParam("networkinterfacecardname") String networkinterfacecardname, @@ -66,13 +72,13 @@ public interface NetworkInterfaceCardApi { @Nullable @PayloadParam("tags") Map tags); @Named("networkinterfacecard:get") - @Path("/{networkinterfacecardname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/networkInterfaces/{networkinterfacecardname}") @GET @Fallback(NullOnNotFoundOr404.class) NetworkInterfaceCard get(@PathParam("networkinterfacecardname") String networkinterfacecardname); @Named("networkinterfacecard:delete") - @Path("/{networkinterfacecardname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/networkInterfaces/{networkinterfacecardname}") @DELETE @ResponseParser(URIParser.class) @Fallback(NullOnNotFoundOr404.class) diff --git a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApi.java b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApi.java index 75af4ff988..1632613885 100644 --- a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApi.java +++ b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApi.java @@ -18,7 +18,6 @@ package org.jclouds.azurecompute.arm.features; import java.util.List; import java.util.Map; - import javax.inject.Named; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -44,19 +43,26 @@ import org.jclouds.rest.annotations.ResponseParser; import org.jclouds.rest.annotations.SelectJson; import org.jclouds.rest.binders.BindToJsonPayload; -@Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses") @RequestFilters({ OAuthFilter.class, ApiVersionFilter.class }) @Consumes(MediaType.APPLICATION_JSON) public interface PublicIPAddressApi { @Named("publicipaddress:list") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses") @SelectJson("value") @GET @Fallback(EmptyListOnNotFoundOr404.class) List list(); + @Named("publicipaddress:list_all") + @Path("/providers/Microsoft.Network/publicIPAddresses") + @SelectJson("value") + @GET + @Fallback(EmptyListOnNotFoundOr404.class) + List listAllInSubscription(); + @Named("publicipaddress:create_or_update") - @Path("/{publicipaddressname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses/{publicipaddressname}") @MapBinder(BindToJsonPayload.class) @PUT PublicIPAddress createOrUpdate(@PathParam("publicipaddressname") String publicipaddressname, @@ -65,13 +71,13 @@ public interface PublicIPAddressApi { @PayloadParam("properties") PublicIPAddressProperties properties); @Named("publicipaddress:get") - @Path("/{publicipaddressname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses/{publicipaddressname}") @GET @Fallback(NullOnNotFoundOr404.class) PublicIPAddress get(@PathParam("publicipaddressname") String publicipaddressname); @Named("publicipaddress:delete") - @Path("/{publicipaddressname}") + @Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses/{publicipaddressname}") @DELETE @ResponseParser(FalseOn204.class) boolean delete(@PathParam("publicipaddressname") String publicipaddressname); diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiLiveTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiLiveTest.java index 0d1e6ca17e..5b300a9265 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiLiveTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiLiveTest.java @@ -105,7 +105,14 @@ public class NetworkInterfaceCardApiLiveTest extends BaseAzureComputeApiLiveTest assertTrue(nicList.contains(api().get(nicName))); } - @Test(dependsOnMethods = {"listNetworkInterfaceCards", "getNetworkInterfaceCard"}) + @Test(dependsOnMethods = "createNetworkInterfaceCard") + public void listAllNetworkInterfaceCardsInSubscription() { + List nicList = api.getNetworkInterfaceCardApi(null).listAllInSubscription(); + assertTrue(nicList.contains(api().get(nicName))); + } + + @Test(dependsOnMethods = { "listNetworkInterfaceCards", "listAllNetworkInterfaceCardsInSubscription", + "getNetworkInterfaceCard" }) public void deleteNetworkInterfaceCard() { URI uri = api().delete(nicName); assertResourceDeleted(uri); diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiMockTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiMockTest.java index 5aae6bdfc9..46aad731e7 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiMockTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiMockTest.java @@ -17,6 +17,7 @@ package org.jclouds.azurecompute.arm.features; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; @@ -87,13 +88,49 @@ public class NetworkInterfaceCardApiMockTest extends BaseAzureComputeApiMockTest assertEquals(nicList.get(1).properties().ipConfigurations().get(0).properties().privateIPAllocationMethod(), "Static"); } + public void listAllNetworkInterfaceCardsInSubscription() throws InterruptedException { + server.enqueue(jsonResponse("/listallnetworkinterfaces.json")); + + final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(null); + List nicList = nicApi.listAllInSubscription(); + String path = String + .format("/subscriptions/%s/providers/Microsoft.Network/networkInterfaces?%s", subscriptionid, apiVersion); + + assertSent(server, "GET", path); + assertTrue(nicList.size() == 3); + assertTrue(nicList.get(0).properties().ipConfigurations().size() > 0); + assertEquals(nicList.get(0).properties().ipConfigurations().get(0).properties().privateIPAllocationMethod(), + "Dynamic"); + assertTrue(nicList.get(1).properties().ipConfigurations().size() > 0); + assertEquals(nicList.get(1).properties().ipConfigurations().get(0).properties().privateIPAllocationMethod(), + "Static"); + assertTrue(nicList.get(2).properties().ipConfigurations().size() > 0); + assertNotEquals(IdReference.extractResourceGroup(nicList.get(2).id()), resourcegroup); + assertEquals(nicList.get(2).properties().ipConfigurations().get(0).properties().privateIPAllocationMethod(), + "Static"); + } + + public void listAllNetworkInterfaceCardsInSubscriptionEmpty() throws Exception { + server.enqueue(new MockResponse().setResponseCode(404)); + + final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(null); + + assertTrue(nicApi.listAllInSubscription().isEmpty()); + String path = String + .format("/subscriptions/%s/providers/Microsoft.Network/networkInterfaces?%s", subscriptionid, apiVersion); + + assertSent(server, "GET", path); + } + public void listNetworkInterfaceCardsEmpty() throws Exception { server.enqueue(new MockResponse().setResponseCode(404)); final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(resourcegroup); assertTrue(nicApi.list().isEmpty()); - String path = String.format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Network/networkInterfaces?%s", subscriptionid, resourcegroup, apiVersion); + String path = String + .format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Network/networkInterfaces?%s", + subscriptionid, resourcegroup, apiVersion); assertSent(server, "GET", path); } diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiLiveTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiLiveTest.java index 9519ed6633..3d393dbd19 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiLiveTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiLiveTest.java @@ -119,7 +119,18 @@ public class PublicIPAddressApiLiveTest extends BaseAzureComputeApiLiveTest { assertTrue(ipList.size() > 0); } - @Test(groups = "live", dependsOnMethods = {"listPublicIPAddresses", "getPublicIPAddress"}, alwaysRun = true) + @Test(groups = "live", dependsOnMethods = "createPublicIPAddress") + public void listAllPublicIPAddressesInSubscription() { + + final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(null); + + List ipList = ipApi.listAllInSubscription(); + + assertTrue(ipList.size() > 0); + } + + @Test(groups = "live", dependsOnMethods = { "listPublicIPAddresses", "listAllPublicIPAddressesInSubscription", + "getPublicIPAddress" }, alwaysRun = true) public void deletePublicIPAddress() { final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourceGroupName); boolean status = ipApi.delete(publicIpAddressName); diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiMockTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiMockTest.java index b510580655..9ab8059d0c 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiMockTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/PublicIPAddressApiMockTest.java @@ -16,22 +16,23 @@ */ package org.jclouds.azurecompute.arm.features; -import com.google.common.collect.ImmutableMap; -import com.squareup.okhttp.mockwebserver.MockResponse; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; + +import java.util.List; +import java.util.Map; + import org.jclouds.azurecompute.arm.domain.DnsSettings; import org.jclouds.azurecompute.arm.domain.PublicIPAddress; import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties; import org.jclouds.azurecompute.arm.internal.BaseAzureComputeApiMockTest; import org.testng.annotations.Test; -import java.util.List; -import java.util.Map; - -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; +import com.google.common.collect.ImmutableMap; +import com.squareup.okhttp.mockwebserver.MockResponse; @Test(groups = "unit", testName = "NetworkInterfaceCardApiMockTest", singleThreaded = true) @@ -103,6 +104,30 @@ public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest { assertEquals(ipList.size(), 0); } + public void listAllPublicIPAddressesInSubscription() throws InterruptedException { + server.enqueue(jsonResponse("/PublicIPAddressListAll.json")); + + final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(null); + List ipList = ipApi.listAllInSubscription(); + + String path = String + .format("/subscriptions/%s/providers/Microsoft.Network/publicIPAddresses?%s", subscriptionid, apiVersion); + assertSent(server, "GET", path); + assertEquals(ipList.size(), 5); + } + + public void listAllPublicIPAddressesInSubscriptionEmpty() throws InterruptedException { + server.enqueue(new MockResponse().setResponseCode(404)); + + final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(null); + List ipList = ipApi.listAllInSubscription(); + + String path = String + .format("/subscriptions/%s/providers/Microsoft.Network/publicIPAddresses?%s", subscriptionid, apiVersion); + assertSent(server, "GET", path); + assertEquals(ipList.size(), 0); + } + public void createPublicIPAddress() throws InterruptedException { server.enqueue(jsonResponse("/PublicIPAddressCreate.json").setStatus("HTTP/1.1 201 Created")); diff --git a/providers/azurecompute-arm/src/test/resources/PublicIPAddressListAll.json b/providers/azurecompute-arm/src/test/resources/PublicIPAddressListAll.json new file mode 100644 index 0000000000..18dad2142c --- /dev/null +++ b/providers/azurecompute-arm/src/test/resources/PublicIPAddressListAll.json @@ -0,0 +1,102 @@ +{ + "value": [ + { + "name": "my2ndpublicaddress", + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/publicIPAddresses/my2ndpublicaddress", + "etag": "W/\"b83fa879-46ee-48a9-8120-26572449788f\"", + "type": "Microsoft.Network/publicIPAddresses", + "location": "northeurope", + "tags": { + "testkey": "testvalue" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "ebe3f160-2484-447a-8980-c587b214b16f", + "publicIPAllocationMethod": "Dynamic", + "idleTimeoutInMinutes": 4, + "dnsSettings": { + "domainNameLabel": "foobar123", + "fqdn": "foobar123.northeurope.cloudapp.azure.com" + } + } + }, + { + "name": "my3rdpublicaddress", + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/publicIPAddresses/my3rdpublicaddress", + "etag": "W/\"17d2cf9a-7aa8-4c53-a5b8-ebc2ccb7bf93\"", + "type": "Microsoft.Network/publicIPAddresses", + "location": "northeurope", + "tags": { + "testkey": "testvalue" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "e1107240-79c5-4829-ba16-f7a00c2763df", + "ipAddress": "12.12.123.123", + "publicIPAllocationMethod": "Static", + "idleTimeoutInMinutes": 4 + } + }, + { + "name": "my4thpublicaddress", + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/publicIPAddresses/my4thpublicaddress", + "etag": "W/\"c32275e9-e1fc-465a-a5de-728c1359e123\"", + "type": "Microsoft.Network/publicIPAddresses", + "location": "northeurope", + "tags": { + "testkey": "testvalue" + }, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "dbde9a83-8c1a-43f4-8d81-0fa469703e8a", + "ipAddress": "12.12.123.124", + "publicIPAllocationMethod": "Static", + "idleTimeoutInMinutes": 4 + } + }, + { + "name": "mypublicaddress", + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/publicIPAddresses/mypublicaddress", + "etag": "W/\"0b020646-202f-4ac6-b1a7-f9645db7c371\"", + "type": "Microsoft.Network/publicIPAddresses", + "location": "northeurope", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "eb0da01e-2a30-4e84-b7a4-0ce9dde019f5", + "ipAddress": "12.123.12.125", + "publicIPAllocationMethod": "Static", + "idleTimeoutInMinutes": 4, + "dnsSettings": { + "domainNameLabel": "foobar", + "fqdn": "foobar.northeurope.cloudapp.azure.com" + }, + "ipConfiguration": { + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/networkInterfaces/myNic/ipConfigurations/myip1" + } + } + }, + { + "name": "mypublicaddressinanotherResourceGroup", + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/anotherresourcegroup/providers/Microsoft.Network/publicIPAddresses/mypublicaddress", + "etag": "W/\"0b020646-202f-4ac6-b1a7-f9645db7c371\"", + "type": "Microsoft.Network/publicIPAddresses", + "location": "northeurope", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "eb0da01e-2a30-4e84-b7a4-0ce9dde019f5", + "ipAddress": "12.123.12.126", + "publicIPAllocationMethod": "Static", + "idleTimeoutInMinutes": 4, + "dnsSettings": { + "domainNameLabel": "foobar", + "fqdn": "foobarotherrg.northeurope.cloudapp.azure.com" + }, + "ipConfiguration": { + "id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/anotherresourcegroup/providers/Microsoft.Network/networkInterfaces/myNic/ipConfigurations/myip2" + } + } + } + ] +} diff --git a/providers/azurecompute-arm/src/test/resources/listallnetworkinterfaces.json b/providers/azurecompute-arm/src/test/resources/listallnetworkinterfaces.json new file mode 100644 index 0000000000..1a3bba5f38 --- /dev/null +++ b/providers/azurecompute-arm/src/test/resources/listallnetworkinterfaces.json @@ -0,0 +1,100 @@ +{ + "value": [ + { + "name": "AnotherNIC", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/azurearmtesting/providers/Microsoft.Network/networkInterfaces/AnotherNIC", + "etag": "W/\"e4ed4253-64b6-4184-bfaa-554f470d20c5\"", + "type": "Microsoft.Network/networkInterfaces", + "location": "northeurope", + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "7fcf6704-21c5-4983-bd9f-017e0873f22f", + "ipConfigurations": [ + { + "name": "ipconfig1", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/azurearmtesting/providers/Microsoft.Network/networkInterfaces/AnotherNIC/ipConfigurations/ipconfig1", + "etag": "W/\"e4ed4253-64b6-4184-bfaa-554f470d20c5\"", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "10.2.1.4", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/armlivetesting/providers/Microsoft.Network/virtualNetworks/jclouds-virtual-network-live-test/subnets/anothersubnet" + }, + "primary": true + } + } + ], + "dnsSettings": { + "dnsServers": [], + "appliedDnsServers": [] + }, + "enableIPForwarding": false + } + }, + { + "name": "MyNic", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/azurearmtesting/providers/Microsoft.Network/networkInterfaces/MyNic", + "etag": "W/\"a37d25ff-3f62-4ee2-a111-f355beb5ff69\"", + "type": "Microsoft.Network/networkInterfaces", + "location": "northeurope", + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "35908409-a081-4411-86a9-51f9ea99321f", + "ipConfigurations": [ + { + "name": "ipconfig1", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/azurearmtesting/providers/Microsoft.Network/networkInterfaces/MyNic/ipConfigurations/ipconfig1", + "etag": "W/\"a37d25ff-3f62-4ee2-a111-f355beb5ff69\"", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "10.2.0.100", + "privateIPAllocationMethod": "Static", + "subnet": { + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/armlivetesting/providers/Microsoft.Network/virtualNetworks/jclouds-virtual-network-live-test/subnets/default" + }, + "primary": true + } + } + ], + "dnsSettings": { + "dnsServers": [], + "appliedDnsServers": [] + }, + "enableIPForwarding": false + } + }, + { + "name": "MyNicInAnotherRG", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/otherazurearmtesting/providers/Microsoft.Network/networkInterfaces/MyNic", + "etag": "W/\"a37d25ff-3f62-4ee2-a111-f355beb5ff69\"", + "type": "Microsoft.Network/networkInterfaces", + "location": "northeurope", + "properties": { + "provisioningState": "Succeeded", + "resourceGuid": "35908409-a081-4411-86a9-51f9ea99321f", + "ipConfigurations": [ + { + "name": "ipconfig1", + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/otherazurearmtesting/providers/Microsoft.Network/networkInterfaces/MyNic/ipConfigurations/ipconfig1", + "etag": "W/\"a37d25ff-3f62-4ee2-a111-f355beb5ff69\"", + "properties": { + "provisioningState": "Succeeded", + "privateIPAddress": "10.2.0.101", + "privateIPAllocationMethod": "Static", + "subnet": { + "id": "/subscriptions/12345678-2749-4e68-9dcf-123456789abc/resourceGroups/otherazurearmtesting/providers/Microsoft.Network/virtualNetworks/jclouds-virtual-network-live-test/subnets/default" + }, + "primary": true + } + } + ], + "dnsSettings": { + "dnsServers": [], + "appliedDnsServers": [] + }, + "enableIPForwarding": false + } + } + ] +}