diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccounts.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccounts.java index 23ed07eae6ff..0bb56a503767 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccounts.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccounts.java @@ -14,7 +14,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -27,7 +27,7 @@ public interface BatchAccounts extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { /** diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java index 39e0d24ca7c8..1e728e5b01a2 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java @@ -42,7 +42,7 @@ protected BatchAccountsImpl( } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-batch/src/test/java/com/microsoft/azure/management/batch/BatchAccountOperationsTests.java b/azure-mgmt-batch/src/test/java/com/microsoft/azure/management/batch/BatchAccountOperationsTests.java index f24047607019..671eca66c529 100644 --- a/azure-mgmt-batch/src/test/java/com/microsoft/azure/management/batch/BatchAccountOperationsTests.java +++ b/azure-mgmt-batch/src/test/java/com/microsoft/azure/management/batch/BatchAccountOperationsTests.java @@ -7,7 +7,6 @@ package com.microsoft.azure.management.batch; import com.microsoft.azure.CloudException; -import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.fluentcore.arm.Region; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import org.joda.time.DateTime; @@ -30,7 +29,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test @@ -165,7 +164,7 @@ public void canCRUDBatchAccount() throws Exception { .withoutApplicationPackage(applicationPackage1Name) .parent() .apply(); - batchManager.batchAccounts().delete(batchAccount.resourceGroupName(), batchAccount.name()); + batchManager.batchAccounts().deleteByGroup(batchAccount.resourceGroupName(), batchAccount.name()); try { batchManager.batchAccounts().getById(batchAccount.id()); Assert.assertTrue(false); @@ -217,7 +216,7 @@ public void canCreateBatchAccountWithApplication() throws Exception { Assert.assertEquals(application.displayName(), applicationDisplayName); Assert.assertEquals(application.updatesAllowed(), allowUpdates); - batchManager.batchAccounts().delete(batchAccount.resourceGroupName(), batchAccount.name()); + batchManager.batchAccounts().deleteByGroup(batchAccount.resourceGroupName(), batchAccount.name()); try { batchManager.batchAccounts().getById(batchAccount.id()); Assert.assertTrue(false); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySets.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySets.java index c43dc03fcf44..4a1c93a6c66d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySets.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySets.java @@ -7,7 +7,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -20,7 +20,7 @@ public interface AvailabilitySets extends SupportsGettingById, SupportsListing, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSets.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSets.java index b275e1bd0e91..61b73992a668 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSets.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSets.java @@ -8,7 +8,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import java.io.IOException; @@ -23,7 +23,7 @@ public interface VirtualMachineScaleSets extends SupportsGettingByGroup, SupportsGettingById, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { /** diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachines.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachines.java index 9824338d673b..9723dba0dba9 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachines.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachines.java @@ -7,7 +7,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -20,7 +20,7 @@ public interface VirtualMachines extends SupportsGettingByGroup, SupportsGettingById, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java index e0bb13afd865..cf96a2981282 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java @@ -61,7 +61,7 @@ public AvailabilitySetImpl define(String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index 4fd2ea3d9013..ce54a09aeac5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -56,7 +56,7 @@ public PagedList list() { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index 8a4c5b788c0a..be5c56f854ff 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -74,7 +74,7 @@ public VirtualMachine getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineOperationsTests.java index b71949c1fc4f..0ea7cd8e5176 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineOperationsTests.java @@ -18,7 +18,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test @@ -62,6 +62,6 @@ public void canCreateVirtualMachine() throws Exception { Assert.assertNotNull(instanceView.statuses().size() > 0); // Delete VM - computeManager.virtualMachines().delete(foundedVM.id()); + computeManager.virtualMachines().deleteById(foundedVM.id()); } } diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java index 149477c5af75..47acc6fbdc61 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java @@ -29,7 +29,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Groups.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Groups.java index 059c06b0284d..136c65a34ae3 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Groups.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Groups.java @@ -9,7 +9,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import java.io.IOException; @@ -22,7 +22,7 @@ public interface Groups extends SupportsCreating, SupportsListing, - SupportsDeleting { + SupportsDeletingById { /** * Gets the information about a group. * diff --git a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/Vaults.java b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/Vaults.java index d7cb26fc0fbe..fbd9385e09cd 100644 --- a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/Vaults.java +++ b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/Vaults.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -22,7 +22,7 @@ public interface Vaults extends SupportsListing, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java index cbb5b66374fe..04779d2a5e57 100644 --- a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java +++ b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java @@ -59,7 +59,7 @@ public Vault getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-keyvault/src/test/java/com/microsoft/azure/management/keyvault/VaultTests.java b/azure-mgmt-keyvault/src/test/java/com/microsoft/azure/management/keyvault/VaultTests.java index 45a505e37618..03ca4596ce43 100644 --- a/azure-mgmt-keyvault/src/test/java/com/microsoft/azure/management/keyvault/VaultTests.java +++ b/azure-mgmt-keyvault/src/test/java/com/microsoft/azure/management/keyvault/VaultTests.java @@ -25,7 +25,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - //resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancers.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancers.java index a9541b7ea0de..c1074567616d 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancers.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancers.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; @@ -26,7 +26,7 @@ public interface LoadBalancers extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfaces.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfaces.java index 51c61a9f8a16..af3a462ff529 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfaces.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterfaces.java @@ -7,7 +7,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -20,7 +20,7 @@ public interface NetworkInterfaces extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroups.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroups.java index 8e47ab56d0d5..cbfade76ed16 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroups.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkSecurityGroups.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; @@ -26,7 +26,7 @@ public interface NetworkSecurityGroups extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Networks.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Networks.java index f1df7656f1c5..87574f2b64e0 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Networks.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Networks.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; @@ -26,7 +26,7 @@ public interface Networks extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIpAddresses.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIpAddresses.java index c5d58c91c44c..4c501b975e7a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIpAddresses.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicIpAddresses.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; @@ -23,7 +23,7 @@ public interface PublicIpAddresses extends SupportsListing, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTables.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTables.java index 7a4f2601cdc9..e85bdd0c5622 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTables.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/RouteTables.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -25,7 +25,7 @@ public interface RouteTables extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java index 5a43055892aa..d2f1d6fb0cd1 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java @@ -47,7 +47,7 @@ public LoadBalancerImpl getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java index 2fcc8bd564b2..0ef730dc1853 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java @@ -45,7 +45,7 @@ public NetworkInterface getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java index 5731eee4d49f..5d4c6702d0ba 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java @@ -47,7 +47,7 @@ public NetworkSecurityGroupImpl getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java index 555507c8e4a3..1883001630c4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java @@ -51,7 +51,7 @@ public NetworkImpl getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java index abbb4429b0b8..17d284391a05 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java @@ -48,7 +48,7 @@ public PublicIpAddressImpl getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesImpl.java index 788c520e0b57..a7298b1e4b8e 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesImpl.java @@ -47,7 +47,7 @@ public RouteTableImpl getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-network/src/test/java/com/microsoft/azure/management/network/NetworkInterfaceOperationsTests.java b/azure-mgmt-network/src/test/java/com/microsoft/azure/management/network/NetworkInterfaceOperationsTests.java index 1df082c97874..77b15193ec48 100644 --- a/azure-mgmt-network/src/test/java/com/microsoft/azure/management/network/NetworkInterfaceOperationsTests.java +++ b/azure-mgmt-network/src/test/java/com/microsoft/azure/management/network/NetworkInterfaceOperationsTests.java @@ -14,7 +14,6 @@ public class NetworkInterfaceOperationsTests extends NetworkManagementTestBase { private static String RG_NAME = "javanwmrg"; - private static String resourceGroupId = null; @BeforeClass public static void setup() throws Exception { @@ -23,9 +22,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - if (resourceGroupId != null) { - resourceManager.resourceGroups().delete(resourceGroupId); - } + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisCaches.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisCaches.java index bd0faae274ce..9c62b737c668 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisCaches.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisCaches.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -26,7 +26,7 @@ public interface RedisCaches extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java index 373fc5e07f89..31cdd3a00247 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java @@ -52,7 +52,7 @@ public RedisCache getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-redis/src/test/java/com/microsoft/azure/management/redis/RedisCacheOperationsTests.java b/azure-mgmt-redis/src/test/java/com/microsoft/azure/management/redis/RedisCacheOperationsTests.java index 374f7d1882e7..c037f08498b1 100644 --- a/azure-mgmt-redis/src/test/java/com/microsoft/azure/management/redis/RedisCacheOperationsTests.java +++ b/azure-mgmt-redis/src/test/java/com/microsoft/azure/management/redis/RedisCacheOperationsTests.java @@ -36,8 +36,8 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); - resourceManager.resourceGroups().delete(RG_NAME_SECOND); + resourceManager.resourceGroups().deleteByName(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME_SECOND); } @Test @@ -148,7 +148,7 @@ public void canCRUDRedisCache() throws Exception { redisCache.refresh(); // delete - redisManager.redisCaches().delete(redisCache.id()); + redisManager.redisCaches().deleteById(redisCache.id()); // Premium SKU Functionality RedisCachePremium premiumCache = redisCachePremium.asPremium(); diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployments.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployments.java index 5b3c5b294160..883ea5663f9f 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployments.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployments.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -27,7 +27,7 @@ public interface Deployments extends SupportsGettingByName, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup { /** * Checks if a deployment exists in a resource group. diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/GenericResources.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/GenericResources.java index 093ebedc635e..16ace75db3a6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/GenericResources.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/GenericResources.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingInGroupByTag; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import java.util.List; @@ -24,7 +25,8 @@ public interface GenericResources extends SupportsListingByGroup, SupportsListingInGroupByTag, SupportsGettingById, - SupportsCreating { + SupportsCreating, + SupportsDeletingById { /** * Checks if a resource exists in a resource group. * @@ -44,6 +46,14 @@ boolean checkExistence( String resourceName, String apiVersion); + /** + * Checks if a resource exists. + * + * @param id the ID of the resource. + * @return true if the resource exists; false otherwise + */ + boolean checkExistenceById(String id); + /** * Returns a resource belonging to a resource group. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignments.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignments.java index 9ad54a0b46b7..71af545b9911 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignments.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyAssignments.java @@ -11,7 +11,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -23,7 +23,7 @@ public interface PolicyAssignments extends SupportsListingByGroup, SupportsGettingById, SupportsCreating, - SupportsDeleting { + SupportsDeletingById { /** * List policy assignments of the resource. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyDefinitions.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyDefinitions.java index a4439c3aaec7..7d138bf0a9c6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyDefinitions.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/PolicyDefinitions.java @@ -9,7 +9,7 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -20,5 +20,5 @@ public interface PolicyDefinitions extends SupportsListing, SupportsGettingByName, SupportsCreating, - SupportsDeleting { + SupportsDeletingById { } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroups.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroups.java index 0c54ed0a63c3..2df433572542 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroups.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroups.java @@ -9,8 +9,9 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBeginDeletingByName; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingByName; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListingByTag; @@ -23,7 +24,8 @@ public interface ResourceGroups extends SupportsListingByTag, SupportsGettingByName, SupportsCreating, - SupportsDeleting, + SupportsDeletingByName, + SupportsBeginDeletingByName, SupportsBatchCreation { /** * Checks whether resource group exists. diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java index 8527432921ce..6fefb6054288 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java @@ -25,7 +25,7 @@ public interface SupportsDeletingByGroup { * @param groupName The group the resource is part of * @param name The name of the resource */ - void delete(String groupName, String name); + void deleteByGroup(String groupName, String name); /** * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. @@ -35,7 +35,7 @@ public interface SupportsDeletingByGroup { * @param callback the callback to call on success or failure * @return a handle to cancel the request */ - ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback); + ServiceCall deleteByGroupAsync(String groupName, String name, ServiceCallback callback); /** * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. @@ -44,5 +44,5 @@ public interface SupportsDeletingByGroup { * @param name The name of the resource * @return an observable to the request */ - Observable deleteAsync(String groupName, String name); + Observable deleteByGroupAsync(String groupName, String name); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByParent.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByParent.java index 92eb1a4566a8..cb52ba0cd933 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByParent.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByParent.java @@ -25,7 +25,7 @@ public interface SupportsDeletingByParent { * @param parentName the name of parent resource. * @param name The name of the resource */ - void delete(String groupName, String parentName, String name); + void deleteByParent(String groupName, String parentName, String name); /** * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. @@ -36,7 +36,7 @@ public interface SupportsDeletingByParent { * @param callback the callback to call on success or failure * @return a handle to cancel the request */ - ServiceCall deleteAsync(String groupName, String parentName, String name, ServiceCallback callback); + ServiceCall deleteByParentAsync(String groupName, String parentName, String name, ServiceCallback callback); /** * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. @@ -46,5 +46,5 @@ public interface SupportsDeletingByParent { * @param name The name of the resource * @return an observable to the request */ - Observable deleteAsync(String groupName, String parentName, String name); + Observable deleteByParentAsync(String groupName, String parentName, String name); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java index 7774c752a234..496491a3654c 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java @@ -5,7 +5,7 @@ */ package com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceResponse; @@ -22,7 +22,7 @@ public abstract class CreatableWrappersImpl extends ReadableWrappersImpl implements // Assume anything creatable is deletable - SupportsDeleting { + SupportsDeletingById { protected CreatableWrappersImpl() { } @@ -30,13 +30,13 @@ protected CreatableWrappersImpl() { protected abstract ImplT wrapModel(String name); @Override - public void delete(String id) { - deleteAsync(id).toBlocking().subscribe(); + public void deleteById(String id) { + deleteByIdAsync(id).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String id, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(id).map(new Func1>() { + public ServiceCall deleteByIdAsync(String id, ServiceCallback callback) { + return ServiceCall.create(deleteByIdAsync(id).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java index 0934806ddc5e..0b4667fe15c5 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java @@ -56,13 +56,13 @@ public T getById(String id) { } @Override - public void delete(String groupName, String name) { - deleteAsync(groupName, name).toBlocking().subscribe(); + public void deleteByGroup(String groupName, String name) { + deleteByGroupAsync(groupName, name).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(groupName, name).map(new Func1>() { + public ServiceCall deleteByGroupAsync(String groupName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteByGroupAsync(groupName, name).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); @@ -71,7 +71,7 @@ public ServiceResponse call(Void aVoid) { } @Override - public Observable deleteAsync(String id) { - return deleteAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); + public Observable deleteByIdAsync(String id) { + return deleteByGroupAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java index f9fa3bb3dccf..bd9a55eff244 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java @@ -70,13 +70,13 @@ public PagedList listByParent(GroupableResource parentResource) { @Override - public void delete(String groupName, String parentName, String name) { - deleteAsync(groupName, parentName, name).toBlocking().subscribe(); + public void deleteByParent(String groupName, String parentName, String name) { + deleteByParentAsync(groupName, parentName, name).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String groupName, String parentName, String name, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(groupName, parentName, name).map(new Func1>() { + public ServiceCall deleteByParentAsync(String groupName, String parentName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteByParentAsync(groupName, parentName, name).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); @@ -85,8 +85,8 @@ public ServiceResponse call(Void aVoid) { } @Override - public Observable deleteAsync(String id) { + public Observable deleteByIdAsync(String id) { ResourceId resourceId = ResourceId.parseResourceId(id); - return deleteAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); + return deleteByParentAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java index eeaba404b80d..5ed3f1190eee 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java @@ -15,7 +15,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.implementation.ManagerBase; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.microsoft.azure.management.resources.fluentcore.arm.models.IndependentChild; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceResponse; @@ -42,7 +42,7 @@ public abstract class IndependentChildrenImpl< SupportsGettingById, SupportsGettingByParent, SupportsListingByParent, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByParent { protected final InnerCollectionT innerCollection; protected final ManagerT manager; @@ -70,13 +70,13 @@ public PagedList listByParent(GroupableResource parentResource) { } @Override - public void delete(String groupName, String parentName, String name) { - deleteAsync(groupName, parentName, name).toBlocking().subscribe(); + public void deleteByParent(String groupName, String parentName, String name) { + deleteByParentAsync(groupName, parentName, name).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String groupName, String parentName, String name, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(groupName, parentName, name).map(new Func1>() { + public ServiceCall deleteByParentAsync(String groupName, String parentName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteByParentAsync(groupName, parentName, name).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); @@ -85,8 +85,8 @@ public ServiceResponse call(Void aVoid) { } @Override - public Observable deleteAsync(String id) { + public Observable deleteByIdAsync(String id) { ResourceId resourceId = ResourceId.parseResourceId(id); - return deleteAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); + return deleteByParentAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsBeginDeletingByName.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsBeginDeletingByName.java new file mode 100644 index 000000000000..f016847532ce --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsBeginDeletingByName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.management.resources.fluentcore.collection; + +import com.microsoft.azure.management.apigeneration.LangDefinition; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import rx.Observable; + +/** + * Provides access to deleting a resource from Azure, identifying it by its resource ID. + *

+ * (Note: this interface is not intended to be implemented by user code) + */ +@LangDefinition(ContainerName = "CollectionActions", CreateAsyncMethods = true) +public interface SupportsBeginDeletingByName { + /** + * Begins deleting a resource from Azure, identifying it by its resource name. The + * resource will stay until get() returns null. + * + * @param name the name of the resource to delete + */ + void beginDeleteByName(String name); + + /** + * Asynchronously begins deleting a resource from Azure, identifying it by its resource name. + * The resource will stay until get() returns null. + * + * @param name the name of the resource to delete + * @param callback the callback on success or failure + * @return a handle to cancel the request + */ + ServiceCall beginDeleteByNameAsync(String name, ServiceCallback callback); + + /** + * Asynchronously begins deleting a resource from Azure, identifying it by its resource name. + * The resource will stay until get() returns null. + * + * @param name the name the resource to delete + * @return an observable of the request + */ + Observable beginDeleteByNameAsync(String name); +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingById.java similarity index 86% rename from azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java rename to azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingById.java index 79880137bb1b..21d39608f737 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingById.java @@ -17,13 +17,13 @@ * (Note: this interface is not intended to be implemented by user code) */ @LangDefinition(ContainerName = "CollectionActions", CreateAsyncMethods = true) -public interface SupportsDeleting { +public interface SupportsDeletingById { /** * Deletes a resource from Azure, identifying it by its resource ID. * * @param id the resource ID of the resource to delete */ - void delete(String id); + void deleteById(String id); /** * Asynchronously delete a resource from Azure, identifying it by its resource ID. @@ -32,7 +32,7 @@ public interface SupportsDeleting { * @param callback the callback on success or failure * @return a handle to cancel the request */ - ServiceCall deleteAsync(String id, ServiceCallback callback); + ServiceCall deleteByIdAsync(String id, ServiceCallback callback); /** * Asynchronously delete a resource from Azure, identifying it by its resource ID. @@ -40,5 +40,5 @@ public interface SupportsDeleting { * @param id the resource ID of the resource to delete * @return an observable of the request */ - Observable deleteAsync(String id); + Observable deleteByIdAsync(String id); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingByName.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingByName.java new file mode 100644 index 000000000000..01377a945e61 --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeletingByName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.management.resources.fluentcore.collection; + +import com.microsoft.azure.management.apigeneration.LangDefinition; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import rx.Observable; + +/** + * Provides access to deleting a resource from Azure, identifying it by its resource name. + *

+ * (Note: this interface is not intended to be implemented by user code) + */ +@LangDefinition(ContainerName = "CollectionActions", CreateAsyncMethods = true) +public interface SupportsDeletingByName { + /** + * Deletes a resource from Azure, identifying it by its resource name. + * + * @param name the name of the resource to delete + */ + void deleteByName(String name); + + /** + * Asynchronously delete a resource from Azure, identifying it by its resource name. + * + * @param name the name of the resource to delete + * @param callback the callback on success or failure + * @return a handle to cancel the request + */ + ServiceCall deleteByNameAsync(String name, ServiceCallback callback); + + /** + * Asynchronously delete a resource from Azure, identifying it by its resource name. + * + * @param name the name of the resource to delete + * @return an observable of the request + */ + Observable deleteByNameAsync(String name); +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java index 137d58be04dd..607b9982c62e 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java @@ -78,13 +78,13 @@ public Deployment getByGroup(String groupName, String name) { } @Override - public void delete(String groupName, String name) { - deleteAsync(groupName, name).toBlocking().subscribe(); + public void deleteByGroup(String groupName, String name) { + deleteByGroupAsync(groupName, name).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(groupName, name).map(new Func1>() { + public ServiceCall deleteByGroupAsync(String groupName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteByGroupAsync(groupName, name).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); @@ -93,7 +93,7 @@ public ServiceResponse call(Void aVoid) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return client.deleteAsync(groupName, name); } @@ -127,13 +127,13 @@ public Deployment getById(String id) { } @Override - public void delete(String id) { - deleteAsync(id).toBlocking().subscribe(); + public void deleteById(String id) { + deleteByIdAsync(id).toBlocking().subscribe(); } @Override - public ServiceCall deleteAsync(String id, ServiceCallback callback) { - return ServiceCall.create(deleteAsync(id).map(new Func1>() { + public ServiceCall deleteByIdAsync(String id, ServiceCallback callback) { + return ServiceCall.create(deleteByIdAsync(id).map(new Func1>() { @Override public ServiceResponse call(Void aVoid) { return new ServiceResponse<>(aVoid, null); @@ -142,7 +142,7 @@ public ServiceResponse call(Void aVoid) { } @Override - public Observable deleteAsync(String id) { - return deleteAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); + public Observable deleteByIdAsync(String id) { + return deleteByGroupAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java index 6fb022b8a7fc..aeb74b6faaff 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java @@ -15,6 +15,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.resources.fluentcore.utils.Utils; import rx.Observable; +import rx.functions.Func1; import java.util.List; @@ -75,6 +76,12 @@ public boolean checkExistence(String resourceGroupName, String resourceProviderN apiVersion); } + @Override + public boolean checkExistenceById(String id) { + String apiVersion = getApiVersionFromId(id).toBlocking().single(); + return innerCollection.checkExistenceById(id, apiVersion); + } + @Override public GenericResource getById(String id) { Provider provider = myManager.providers().getByName(ResourceUtils.resourceProviderFromResourceId(id)); @@ -189,8 +196,29 @@ public GenericResource getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { // Not needed, can't be supported, provided only to satisfy GroupableResourceImpl's requirements throw new UnsupportedOperationException("Delete just by resource group and name is not supported. Please use other overloads."); } + + @Override + public Observable deleteByIdAsync(final String id) { + return getApiVersionFromId(id) + .flatMap(new Func1>() { + @Override + public Observable call(String apiVersion) { + return innerCollection.deleteByIdAsync(id, apiVersion); + } + }); + } + + private Observable getApiVersionFromId(final String id) { + return myManager.providers().getByNameAsync(ResourceUtils.resourceProviderFromResourceId(id)) + .map(new Func1() { + @Override + public String call(Provider provider) { + return ResourceUtils.defaultApiVersion(id, provider); + } + }); + } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsImpl.java index 915f8487a380..db3c490daffc 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsImpl.java @@ -38,7 +38,7 @@ public PagedList list() { } @Override - public Observable deleteAsync(String id) { + public Observable deleteByIdAsync(String id) { return client.deleteByIdAsync(id).map(new Func1() { @Override public Void call(PolicyAssignmentInner policyAssignmentInner) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsImpl.java index 54c6b05ef503..281c222053e7 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsImpl.java @@ -42,7 +42,7 @@ public PolicyDefinitionImpl getByName(String name) { } @Override - public Observable deleteAsync(String name) { + public Observable deleteByIdAsync(String name) { return client.deleteAsync(name); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java index 4bb0003bdb25..38d160f8c20b 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java @@ -9,9 +9,14 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.ResourceGroups; +import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; import com.microsoft.azure.management.resources.fluentcore.utils.Utils; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; import rx.Observable; +import rx.functions.Func1; /** * The implementation for {@link ResourceGroups} and its parent interfaces. @@ -48,7 +53,17 @@ public ResourceGroupImpl getByName(String name) { } @Override - public Observable deleteAsync(String name) { + public void deleteByName(String name) { + deleteByNameAsync(name).toBlocking().subscribe(); + } + + @Override + public ServiceCall deleteByNameAsync(String name, ServiceCallback callback) { + return ServiceCall.create(client.deleteWithServiceResponseAsync(name), callback); + } + + @Override + public Observable deleteByNameAsync(String name) { return client.deleteAsync(name); } @@ -76,4 +91,30 @@ protected ResourceGroupImpl wrapModel(ResourceGroupInner inner) { } return new ResourceGroupImpl(inner, serviceClient); } + + @Override + public void beginDeleteByName(String id) { + beginDeleteByNameAsync(id).toBlocking().subscribe(); + } + + @Override + public ServiceCall beginDeleteByNameAsync(String name, ServiceCallback callback) { + return ServiceCall.create(beginDeleteByNameAsync(name) + .flatMap(new Func1>>() { + @Override + public Observable> call(Void aVoid) { + return null; + } + }), callback); + } + + @Override + public Observable beginDeleteByNameAsync(String name) { + return client.beginDeleteAsync(name); + } + + @Override + public Observable deleteByIdAsync(String id) { + return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); + } } diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/DeploymentsTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/DeploymentsTests.java index 3e865b1299b5..9f2718d5ddfe 100644 --- a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/DeploymentsTests.java +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/DeploymentsTests.java @@ -36,7 +36,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceGroups.delete(rgName); + resourceGroups.deleteByName(rgName); } @Test diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/GenericResourcesTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/GenericResourcesTests.java index 2253cd1cce9e..da1a9167bdea 100644 --- a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/GenericResourcesTests.java +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/GenericResourcesTests.java @@ -35,8 +35,8 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceGroups.delete(newRgName); - resourceGroups.delete(rgName); + resourceGroups.beginDeleteByName(newRgName); + resourceGroups.beginDeleteByName(rgName); } @Test @@ -72,5 +72,8 @@ public void canCreateUpdateMoveResource() throws Exception { resource.update() .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Dynamic\"}")) .apply(); + // Delete + genericResources.deleteById(resource.id()); + Assert.assertFalse(genericResources.checkExistence(newRgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion())); } } diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/PolicyTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/PolicyTests.java index 5972aa58b402..4795776876b9 100644 --- a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/PolicyTests.java +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/PolicyTests.java @@ -61,7 +61,7 @@ public void canCRUDPolicyDefinition() throws Exception { Assert.assertNotNull(definition); Assert.assertEquals("My Policy", definition.displayName()); // Delete - resourceManager.policyDefinitions().delete(definition.id()); + resourceManager.policyDefinitions().deleteById(definition.id()); } @Test @@ -101,7 +101,7 @@ public void canCRUDPolicyAssignment() throws Exception { } // Delete resourceManager.resourceGroups().define(group.name()); - resourceManager.policyAssignments().delete(assignment.id()); - resourceManager.policyDefinitions().delete(definition.id()); + resourceManager.policyAssignments().deleteById(assignment.id()); + resourceManager.policyDefinitions().deleteById(definition.id()); } } diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsTests.java index ce8cecbf0dc4..9bf25e2d8267 100644 --- a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsTests.java +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/ResourceGroupsTests.java @@ -47,7 +47,7 @@ public void canCreateResourceGroup() throws Exception { Assert.assertEquals("value1", updatedGroup.tags().get("tag1")); Assert.assertEquals(location, getGroup.regionName()); // Delete - resourceGroups.delete(rgName); + resourceGroups.deleteByName(rgName); Assert.assertFalse(resourceGroups.checkExistence(rgName)); } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlDatabases.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlDatabases.java index 8b49fa4335b7..c49ee35d0423 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlDatabases.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlDatabases.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point to SQL Database management API. @@ -21,7 +21,7 @@ @Fluent public interface SqlDatabases extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsGettingById, SupportsBatchCreation, SupportsDeletingByParent { diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlElasticPools.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlElasticPools.java index b1597f112d43..b790a7271e4d 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlElasticPools.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlElasticPools.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point to SQL Elastic Pool management API. @@ -21,7 +21,7 @@ @Fluent public interface SqlElasticPools extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsGettingById, SupportsBatchCreation, SupportsDeletingByParent { diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlFirewallRules.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlFirewallRules.java index 7014ba118aa8..5c66f705862a 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlFirewallRules.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlFirewallRules.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point to SQL FirewallRule management API. @@ -20,7 +20,7 @@ @Fluent public interface SqlFirewallRules extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsGettingById, SupportsDeletingByParent { diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServers.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServers.java index bec9de305882..600f7472414c 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServers.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SqlServers.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -26,7 +26,7 @@ public interface SqlServers extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlDatabasesImpl.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlDatabasesImpl.java index e441361074b8..358b3fbca43d 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlDatabasesImpl.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlDatabasesImpl.java @@ -64,7 +64,7 @@ public SqlDatabase.DefinitionStages.Blank define(String name) { } @Override - public Observable deleteAsync(String groupName, String parentName, String name) { + public Observable deleteByParentAsync(String groupName, String parentName, String name) { return this.innerCollection.deleteAsync(groupName, parentName, name); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlElasticPoolsImpl.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlElasticPoolsImpl.java index 9bd82e4abe04..9a815404f73a 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlElasticPoolsImpl.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlElasticPoolsImpl.java @@ -63,7 +63,7 @@ public SqlElasticPool.DefinitionStages.Blank define(String name) { } @Override - public Observable deleteAsync(String groupName, String parentName, String name) { + public Observable deleteByParentAsync(String groupName, String parentName, String name) { return this.innerCollection.deleteAsync(groupName, parentName, name); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlFirewallRulesImpl.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlFirewallRulesImpl.java index af968715b381..8cbde65ebdf0 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlFirewallRulesImpl.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlFirewallRulesImpl.java @@ -63,7 +63,7 @@ public SqlFirewallRule.DefinitionStages.Blank define(String name) { } @Override - public Observable deleteAsync(String groupName, String parentName, String name) { + public Observable deleteByParentAsync(String groupName, String parentName, String name) { return this.innerCollection.deleteFirewallRulesAsync(groupName, parentName, name); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlServersImpl.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlServersImpl.java index 45cc6ee74a14..a9a591ee2950 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlServersImpl.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlServersImpl.java @@ -22,7 +22,7 @@ protected SqlServersImpl( } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-sql/src/test/java/com/microsoft/azure/management/sql/SqlServerOperationsTests.java b/azure-mgmt-sql/src/test/java/com/microsoft/azure/management/sql/SqlServerOperationsTests.java index 4a6d2827fe6b..be0d2582127a 100644 --- a/azure-mgmt-sql/src/test/java/com/microsoft/azure/management/sql/SqlServerOperationsTests.java +++ b/azure-mgmt-sql/src/test/java/com/microsoft/azure/management/sql/SqlServerOperationsTests.java @@ -35,7 +35,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test @@ -66,7 +66,7 @@ public void canCRUDSqlServer() throws Exception { sqlServer = sqlServerManager.sqlServers().getByGroup(RG_NAME, SQL_SERVER_NAME); Assert.assertNotNull(sqlServer); - sqlServerManager.sqlServers().delete(sqlServer.resourceGroupName(), sqlServer.name()); + sqlServerManager.sqlServers().deleteByGroup(sqlServer.resourceGroupName(), sqlServer.name()); validateSqlServerNotFound(sqlServer); } @@ -102,7 +102,7 @@ public void canCRUDSqlDatabase() throws Exception { validateListSqlDatabase(sqlServerManager.sqlDatabases().listBySqlServer(sqlServer.resourceGroupName(), sqlServer.name())); validateListSqlDatabase(sqlServerManager.sqlDatabases().listBySqlServer(sqlServer)); - sqlServerManager.sqlDatabases().delete(sqlDatabase.id()); + sqlServerManager.sqlDatabases().deleteById(sqlDatabase.id()); // Add another database to the server sqlDatabase = sqlServerManager.sqlDatabases() @@ -111,9 +111,9 @@ public void canCRUDSqlDatabase() throws Exception { .withEdition(DatabaseEditions.STANDARD) .withExistingSqlServer(sqlServer) .createAsync().toBlocking().first(); - sqlServerManager.sqlDatabases().delete(sqlDatabase.resourceGroupName(), sqlDatabase.sqlServerName(), sqlDatabase.name()); + sqlServerManager.sqlDatabases().deleteByParent(sqlDatabase.resourceGroupName(), sqlDatabase.sqlServerName(), sqlDatabase.name()); - sqlServerManager.sqlServers().delete(sqlServer.resourceGroupName(), sqlServer.name()); + sqlServerManager.sqlServers().deleteByGroup(sqlServer.resourceGroupName(), sqlServer.name()); validateSqlServerNotFound(sqlServer); } @@ -161,7 +161,7 @@ public void canCRUDSqlDatabaseWithElasticPool() throws Exception { validateListSqlDatabase(sqlServerManager.sqlDatabases().listBySqlServer(sqlServer.resourceGroupName(), sqlServer.name())); validateListSqlDatabase(sqlServerManager.sqlDatabases().listBySqlServer(sqlServer)); - sqlServerManager.sqlDatabases().delete(sqlDatabase.id()); + sqlServerManager.sqlDatabases().deleteById(sqlDatabase.id()); validateSqlDatabaseNotFound(SQL_DATABASE_NAME); // Add another database to the server @@ -172,10 +172,10 @@ public void canCRUDSqlDatabaseWithElasticPool() throws Exception { .withExistingElasticPoolName(sqlElasticPool) .withExistingSqlServer(sqlServer) .createAsync().toBlocking().first(); - sqlServerManager.sqlDatabases().delete(sqlDatabase.resourceGroupName(), sqlDatabase.sqlServerName(), sqlDatabase.name()); + sqlServerManager.sqlDatabases().deleteByParent(sqlDatabase.resourceGroupName(), sqlDatabase.sqlServerName(), sqlDatabase.name()); validateSqlDatabaseNotFound("newDatabase"); - sqlServerManager.sqlServers().delete(sqlServer.resourceGroupName(), sqlServer.name()); + sqlServerManager.sqlServers().deleteByGroup(sqlServer.resourceGroupName(), sqlServer.name()); validateSqlServerNotFound(sqlServer); } @@ -210,7 +210,7 @@ public void canCRUDSqlElasticPool() throws Exception { validateListSqlElasticPool(sqlServerManager.sqlElasticPools().listBySqlServer(sqlServer.resourceGroupName(), sqlServer.name())); validateListSqlElasticPool(sqlServerManager.sqlElasticPools().listBySqlServer(sqlServer)); - sqlServerManager.sqlElasticPools().delete(sqlElasticPool.id()); + sqlServerManager.sqlElasticPools().deleteById(sqlElasticPool.id()); validateSqlElasticPoolNotFound(SQL_ELASTIC_POOL_NAME); // Add another database to the server @@ -219,10 +219,10 @@ public void canCRUDSqlElasticPool() throws Exception { .withEdition(ElasticPoolEditions.STANDARD) .withExistingSqlServer(sqlServer) .createAsync().toBlocking().first(); - sqlServerManager.sqlElasticPools().delete(sqlElasticPool.resourceGroupName(), sqlElasticPool.sqlServerName(), sqlElasticPool.name()); + sqlServerManager.sqlElasticPools().deleteByParent(sqlElasticPool.resourceGroupName(), sqlElasticPool.sqlServerName(), sqlElasticPool.name()); validateSqlElasticPoolNotFound("newElasticPool"); - sqlServerManager.sqlServers().delete(sqlServer.resourceGroupName(), sqlServer.name()); + sqlServerManager.sqlServers().deleteByGroup(sqlServer.resourceGroupName(), sqlServer.name()); validateSqlServerNotFound(sqlServer); } @@ -260,7 +260,7 @@ public void canCRUDSqlFirewallRule() throws Exception { validateListSqlFirewallRule(sqlServerManager.sqlFirewallRules().listBySqlServer(sqlServer.resourceGroupName(), sqlServer.name())); validateListSqlFirewallRule(sqlServerManager.sqlFirewallRules().listBySqlServer(sqlServer)); - sqlServerManager.sqlFirewallRules().delete(sqlFirewallRule.id()); + sqlServerManager.sqlFirewallRules().deleteById(sqlFirewallRule.id()); validateSqlFirewallRuleNotFound(); // Add firewall rule again with existing server. @@ -270,7 +270,7 @@ public void canCRUDSqlFirewallRule() throws Exception { .withEndIpAddress(END_IPADDRESS) .withExistingSqlServer(sqlServer) .createAsync().toBlocking().first(); - sqlServerManager.sqlFirewallRules().delete(sqlFirewallRule.resourceGroupName(), sqlFirewallRule.sqlServerName(), sqlFirewallRule.name()); + sqlServerManager.sqlFirewallRules().deleteByParent(sqlFirewallRule.resourceGroupName(), sqlFirewallRule.sqlServerName(), sqlFirewallRule.name()); validateSqlFirewallRuleNotFound(); // Add firewall rule again with existing server. @@ -280,10 +280,10 @@ public void canCRUDSqlFirewallRule() throws Exception { .withEndIpAddress(END_IPADDRESS) .withExistingSqlServer(sqlServer.resourceGroupName(), sqlServer.name()) .createAsync().toBlocking().first(); - sqlServerManager.sqlFirewallRules().delete(sqlFirewallRule.resourceGroupName(), sqlFirewallRule.sqlServerName(), sqlFirewallRule.name()); + sqlServerManager.sqlFirewallRules().deleteByParent(sqlFirewallRule.resourceGroupName(), sqlFirewallRule.sqlServerName(), sqlFirewallRule.name()); validateSqlFirewallRuleNotFound(); - sqlServerManager.sqlServers().delete(sqlServer.resourceGroupName(), sqlServer.name()); + sqlServerManager.sqlServers().deleteByGroup(sqlServer.resourceGroupName(), sqlServer.name()); validateSqlServerNotFound(sqlServer); } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccounts.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccounts.java index 652048cfd6d3..5b3cf372ad5a 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccounts.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccounts.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -23,7 +23,7 @@ public interface StorageAccounts extends SupportsListing, SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java index 0fe0e41f3092..5badb8a87d37 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java @@ -53,7 +53,7 @@ public StorageAccount getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-storage/src/test/java/com/microsoft/azure/management/storage/StorageAccountOperationsTests.java b/azure-mgmt-storage/src/test/java/com/microsoft/azure/management/storage/StorageAccountOperationsTests.java index abf4fba44904..cdb690b0ea2d 100644 --- a/azure-mgmt-storage/src/test/java/com/microsoft/azure/management/storage/StorageAccountOperationsTests.java +++ b/azure-mgmt-storage/src/test/java/com/microsoft/azure/management/storage/StorageAccountOperationsTests.java @@ -29,7 +29,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficManagerProfiles.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficManagerProfiles.java index 3e53d21a96b6..b30df92e420d 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficManagerProfiles.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficManagerProfiles.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; /** @@ -25,7 +25,7 @@ public interface TrafficManagerProfiles extends SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, - SupportsDeleting, + SupportsDeletingById, SupportsDeletingByGroup, SupportsBatchCreation { diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerProfilesImpl.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerProfilesImpl.java index 4bf38a5ff63a..8e869afa5966 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerProfilesImpl.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerProfilesImpl.java @@ -62,7 +62,7 @@ public TrafficManagerProfile getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return this.innerCollection.deleteAsync(groupName, name); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java index ad6769e33cf7..d39ff5380b27 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/AppServicePlans.java @@ -11,14 +11,14 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point for storage accounts management API. */ public interface AppServicePlans extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java index d661ac834a80..11c820b5b18f 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/CertificateOrders.java @@ -11,14 +11,14 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point for storage accounts management API. */ public interface CertificateOrders extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java index 809627a7ad73..f354bcdc8a37 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/Certificates.java @@ -11,14 +11,14 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point for storage accounts management API. */ public interface Certificates extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java index 5b32e48df08f..66f37bb95b11 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/WebApps.java @@ -11,14 +11,14 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; /** * Entry point for storage accounts management API. */ public interface WebApps extends SupportsCreating, - SupportsDeleting, + SupportsDeletingById, SupportsListingByGroup, SupportsGettingByGroup, SupportsGettingById, diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java index 3d0f053d2a63..9814c51d577a 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java @@ -35,7 +35,7 @@ public AppServicePlan getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return innerCollection.deleteAsync(groupName, name) .map(new Func1() { @Override diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java index dd1297bbd5cf..840330b5b603 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java @@ -36,7 +36,7 @@ public CertificateOrder getByGroup(String groupName, String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return innerCollection.deleteCertificateOrderAsync(groupName, name) .map(new Func1() { @Override diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java index 46a3c37249aa..f2e9a437d41a 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java @@ -59,7 +59,7 @@ public CertificateImpl define(String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return innerCollection.deleteAsync(groupName, name) .map(new Func1() { @Override diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java index bdb5575d5906..9bfa837cba2d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java @@ -58,7 +58,7 @@ public WebAppImpl define(String name) { } @Override - public Observable deleteAsync(String groupName, String name) { + public Observable deleteByGroupAsync(String groupName, String name) { return innerCollection.deleteAsync(groupName, name) .map(new Func1() { @Override diff --git a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/AppServicePlansTests.java b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/AppServicePlansTests.java index 9ef92ce18aae..ad4f2c24cc53 100644 --- a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/AppServicePlansTests.java +++ b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/AppServicePlansTests.java @@ -25,7 +25,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/CertificateOrdersTests.java b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/CertificateOrdersTests.java index a39f2f2c331f..ecf144f51a4d 100644 --- a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/CertificateOrdersTests.java +++ b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/CertificateOrdersTests.java @@ -27,7 +27,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - resourceManager.resourceGroups().delete(RG_NAME); + resourceManager.resourceGroups().deleteByName(RG_NAME); } @Test diff --git a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/WebAppTests.java b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/WebAppTests.java index b07d4ffd3133..5c263b19b9e9 100644 --- a/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/WebAppTests.java +++ b/azure-mgmt-website/src/test/java/com/microsoft/azure/management/website/WebAppTests.java @@ -26,7 +26,7 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - //resourceManager.resourceGroups().delete(RG_NAME); + //resourceManager.resourceGroups().deleteByName(RG_NAME); } @Ignore diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/batch/samples/ManageBatchAccount.java b/azure-samples/src/main/java/com/microsoft/azure/management/batch/samples/ManageBatchAccount.java index 8bd8762de896..9b53c8620281 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/batch/samples/ManageBatchAccount.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/batch/samples/ManageBatchAccount.java @@ -222,13 +222,13 @@ public static void main(String[] args) { batchAccount.update().withoutApplication(applicationEntry.getKey()).apply(); } - azure.batchAccounts().delete(batchAccount.id()); + azure.batchAccounts().deleteById(batchAccount.id()); System.out.println("Deleted batch account"); if (batchAccount2 != null) { System.out.println("Deleting second batch account - " + batchAccount2.name()); - azure.batchAccounts().delete(batchAccount2.id()); + azure.batchAccounts().deleteById(batchAccount2.id()); System.out.println("Deleted second batch account"); } } catch (Exception f) { @@ -237,7 +237,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (Exception e) { diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java index 7e6c583e5c71..6b85ec22a2a4 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java @@ -146,7 +146,7 @@ public static void main(String[] args) { // Deleting the virtual machine System.out.println("Deleting VM: " + linuxVM2.id()); - azure.virtualMachines().delete(linuxVM2.id()); // VM required to be deleted to be able to attach it's + azure.virtualMachines().deleteById(linuxVM2.id()); // VM required to be deleted to be able to attach it's // OS Disk VHD to another VM (Deallocate is not sufficient) System.out.println("Deleted VM"); @@ -178,7 +178,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java index da7fe3d34297..985635a291d6 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java @@ -183,7 +183,7 @@ public static void main(String[] args) { System.out.println("Deleting an availability set: " + availSet2.id()); - azure.availabilitySets().delete(availSet2.id()); + azure.availabilitySets().deleteById(availSet2.id()); System.out.println("Deleted availability set: " + availSet2.id()); @@ -196,7 +196,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java index 0ca85430b028..31a284b54c26 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java @@ -240,7 +240,7 @@ public static void main(String[] args) { // Delete the virtual machine System.out.println("Deleting VM: " + windowsVM.id()); - azure.virtualMachines().delete(windowsVM.id()); + azure.virtualMachines().deleteById(windowsVM.id()); System.out.println("Deleted VM: " + windowsVM.id()); @@ -253,7 +253,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineExtension.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineExtension.java index ea1728c4c0f1..bc1af57692eb 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineExtension.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineExtension.java @@ -294,7 +294,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineScaleSet.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineScaleSet.java index b46d16fea8da..1300315010f5 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineScaleSet.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineScaleSet.java @@ -299,7 +299,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachinesInParallel.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachinesInParallel.java index 60629e054b74..30d0ed6d6962 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachinesInParallel.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachinesInParallel.java @@ -120,7 +120,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/keyvault/samples/ManageKeyVault.java b/azure-samples/src/main/java/com/microsoft/azure/management/keyvault/samples/ManageKeyVault.java index c5c6a0dc725d..e623da1b4665 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/keyvault/samples/ManageKeyVault.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/keyvault/samples/ManageKeyVault.java @@ -142,15 +142,15 @@ public static void main(String[] args) { //============================================================ // Delete key vaults System.out.println("Deleting the key vaults"); - azure.vaults().delete(vault1.id()); - azure.vaults().delete(vault2.id()); + azure.vaults().deleteById(vault1.id()); + azure.vaults().deleteById(vault2.id()); System.out.println("Deleted the key vaults"); } catch (Exception e) { System.err.println(e.getMessage()); } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java index 978aec33b57f..693e2df92d3f 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java @@ -162,14 +162,14 @@ public static void main(String[] args) { //============================================================ // Delete the public ip System.out.println("Deleting the public IP address"); - azure.publicIpAddresses().delete(publicIpAddress.id()); + azure.publicIpAddresses().deleteById(publicIpAddress.id()); System.out.println("Deleted the public IP address"); } catch (Exception e) { System.err.println(e.getMessage()); } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternalLoadBalancer.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternalLoadBalancer.java index 721d8011aeeb..e57a4cfd0a07 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternalLoadBalancer.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternalLoadBalancer.java @@ -450,7 +450,7 @@ public static void main(String[] args) { System.out.println("Deleting load balancer " + loadBalancerName4 + "(" + loadBalancer4.id() + ")"); - azure.loadBalancers().delete(loadBalancer4.id()); + azure.loadBalancers().deleteById(loadBalancer4.id()); System.out.println("Deleted load balancer" + loadBalancerName4); @@ -462,7 +462,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternetFacingLoadBalancer.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternetFacingLoadBalancer.java index 55859b3c06f7..2845556139b1 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternetFacingLoadBalancer.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageInternetFacingLoadBalancer.java @@ -511,7 +511,7 @@ public static void main(String[] args) { System.out.println("Deleting load balancer " + loadBalancerName2 + "(" + loadBalancer2.id() + ")"); - azure.loadBalancers().delete(loadBalancer2.id()); + azure.loadBalancers().deleteById(loadBalancer2.id()); System.out.println("Deleted load balancer" + loadBalancerName2); @@ -523,7 +523,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java index 03359f1dd791..1bcc93708672 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java @@ -190,9 +190,9 @@ public static void main(String[] args) { System.out.println("Deleting a network interface: " + networkInterface2.id()); System.out.println("First, deleting the vm"); - azure.virtualMachines().delete(vm.id()); + azure.virtualMachines().deleteById(vm.id()); System.out.println("Second, deleting the network interface"); - azure.networkInterfaces().delete(networkInterface2.id()); + azure.networkInterfaces().deleteById(networkInterface2.id()); System.out.println("Deleted network interface"); System.out.println("============================================================"); @@ -210,7 +210,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java index aa3fa968a603..64698a6e6844 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java @@ -302,7 +302,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java index 603b52a4a677..cf477f955596 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java @@ -248,7 +248,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java index 164110730cc6..a94948e4bd2a 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java @@ -256,14 +256,14 @@ public static void main(String[] args) { //============================================================ // Delete a virtual network System.out.println("Deleting the virtual network"); - azure.networks().delete(virtualNetwork2.id()); + azure.networks().deleteById(virtualNetwork2.id()); System.out.println("Deleted the virtual network"); } catch (Exception e) { System.err.println(e.getMessage()); } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/rediscache/samples/ManageRedisCache.java b/azure-samples/src/main/java/com/microsoft/azure/management/rediscache/samples/ManageRedisCache.java index c97cbbbf69db..7ca5be2326ea 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/rediscache/samples/ManageRedisCache.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/rediscache/samples/ManageRedisCache.java @@ -153,7 +153,7 @@ public static void main(String[] args) { System.out.println("Deleting a Redis Cache - " + redisCache1.name()); - azure.redisCaches().delete(redisCache1.id()); + azure.redisCaches().deleteById(redisCache1.id()); System.out.println("Deleted Redis Cache"); } catch (Exception f) { @@ -162,7 +162,7 @@ public static void main(String[] args) { } finally { if (azure.resourceGroups().getByName(rgName) != null) { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } else { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplate.java b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplate.java index a157b7993b5d..7886c06d2945 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplate.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplate.java @@ -91,7 +91,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithProgress.java b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithProgress.java index 4344a42e4f89..c6910f00d9b3 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithProgress.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithProgress.java @@ -100,7 +100,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithTags.java b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithTags.java index fc98de81f392..6941b2263c4e 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithTags.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/DeployUsingARMTemplateWithTags.java @@ -119,7 +119,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResource.java b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResource.java index 3927d853f435..e55adc5d93d1 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResource.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResource.java @@ -120,7 +120,7 @@ public static void main(String[] args) { System.out.println("Deleting storage account: " + resourceName2); - azure.storageAccounts().delete(storageAccount2.id()); + azure.storageAccounts().deleteById(storageAccount2.id()); System.out.println("Deleted storage account: " + resourceName2); @@ -133,7 +133,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResourceGroup.java b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResourceGroup.java index 83ecb77dec5b..379ba52ad022 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResourceGroup.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/resources/samples/ManageResourceGroup.java @@ -109,7 +109,7 @@ public static void main(String[] args) { System.out.println("Deleting resource group: " + rgName2); - azure.resourceGroups().delete(rgName2); + azure.resourceGroups().deleteByName(rgName2); System.out.println("Deleted resource group: " + rgName2); @@ -122,7 +122,7 @@ public static void main(String[] args) { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (NullPointerException npe) { System.out.println("Did not create any resources in Azure. No clean up is necessary"); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java b/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java index 563ba67104ad..3c4b3378eacf 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java @@ -120,7 +120,7 @@ public static void main(String[] args) { System.out.println("Deleting a storage account - " + storageAccount.name() + " created @ " + storageAccount.creationTime()); - azure.storageAccounts().delete(storageAccount.id()); + azure.storageAccounts().deleteById(storageAccount.id()); System.out.println("Deleted storage account"); } catch (Exception f) { @@ -129,7 +129,7 @@ public static void main(String[] args) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().delete(rgName); + azure.resourceGroups().deleteByName(rgName); System.out.println("Deleted Resource Group: " + rgName); } catch (Exception e) { diff --git a/azure/src/test/java/com/microsoft/azure/management/AzureTests.java b/azure/src/test/java/com/microsoft/azure/management/AzureTests.java index 01eaa86f72da..520c9a5b0bee 100644 --- a/azure/src/test/java/com/microsoft/azure/management/AzureTests.java +++ b/azure/src/test/java/com/microsoft/azure/management/AzureTests.java @@ -111,7 +111,7 @@ public void setup() throws Exception { .create(); System.out.println("Created deployment: " + deployment.correlationId()); - azure.resourceGroups().delete("rg" + testId); + azure.resourceGroups().deleteByName("rg" + testId); } diff --git a/azure/src/test/java/com/microsoft/azure/management/TestTemplate.java b/azure/src/test/java/com/microsoft/azure/management/TestTemplate.java index 3e654fec4648..6d2aecc44bf3 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestTemplate.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestTemplate.java @@ -11,7 +11,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import org.junit.Assert; @@ -24,7 +24,7 @@ */ public abstract class TestTemplate< T extends GroupableResource, - C extends SupportsListing & SupportsGettingByGroup & SupportsDeleting & SupportsGettingById> { + C extends SupportsListing & SupportsGettingByGroup & SupportsDeletingById & SupportsGettingById> { protected String testId = String.valueOf(System.currentTimeMillis() % 100000L); private T resource; @@ -80,8 +80,8 @@ public T verifyGetting() throws CloudException, IOException { */ public void verifyDeleting() throws Exception { final String groupName = this.resource.resourceGroupName(); - this.collection.delete(this.resource.id()); - this.resourceGroups.delete(groupName); + this.collection.deleteById(this.resource.id()); + this.resourceGroups.deleteByName(groupName); } /**