diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java index b0a923a9b0c4..f2a0262ce8ae 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java @@ -3,6 +3,7 @@ package com.azure.resourcemanager.compute.implementation; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; @@ -72,7 +73,10 @@ import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.Indexable; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.resources.fluentcore.utils.ResourceNamer; import com.azure.resourcemanager.resources.fluentcore.utils.Utils; import com.azure.resourcemanager.storage.models.StorageAccount; @@ -83,10 +87,12 @@ import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; import reactor.core.Exceptions; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.net.MalformedURLException; import java.net.URL; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -110,6 +116,7 @@ class VirtualMachineImpl // Clients private final StorageManager storageManager; private final NetworkManager networkManager; + private final AuthorizationManager authorizationManager; // the name of the virtual machine private final String vmName; // used to generate unique name for any dependency resources @@ -184,6 +191,7 @@ public JsonProperty.Access findPropertyAccess(Annotated annotated) { super(name, innerModel, computeManager); this.storageManager = storageManager; this.networkManager = networkManager; + this.authorizationManager = authorizationManager; this.vmName = name; this.isMarketplaceLinuxImage = false; this.namer = this.manager().sdkContext().getResourceNamerFactory().createResourceNamer(this.vmName); @@ -1675,6 +1683,16 @@ public void beforeGroupCreateOrUpdate() { @Override public Mono createResourceAsync() { // -- set creation-time only properties + return prepareCreateResourceAsync() + .flatMap(virtualMachine -> this.manager().inner().getVirtualMachines() + .createOrUpdateAsync(resourceGroupName(), vmName, inner()) + .map(virtualMachineInner -> { + reset(virtualMachineInner); + return this; + })); + } + + private Mono prepareCreateResourceAsync() { setOSDiskDefaults(); setOSProfileDefaults(); setHardwareProfileDefaults(); @@ -1686,27 +1704,44 @@ public Mono createResourceAsync() { this.handleUnManagedOSAndDataDisksStorageSettings(); this.bootDiagnosticsHandler.handleDiagnosticsSettings(); this.handleNetworkSettings(); - final VirtualMachineImpl self = this; return this .createNewProximityPlacementGroupAsync() - .flatMap( + .map( virtualMachine -> { this.handleAvailabilitySettings(); this.virtualMachineMsiHandler.processCreatedExternalIdentities(); this.virtualMachineMsiHandler.handleExternalIdentities(); - return this - .manager() - .inner() - .getVirtualMachines() - .createOrUpdateAsync(resourceGroupName(), vmName, inner()) - .map( - virtualMachineInner -> { - reset(virtualMachineInner); - return self; - }); + return virtualMachine; }); } + public Accepted beginCreate() { + Flux dependencyTasksAsync = taskGroup().invokeDependencyAsync(taskGroup().newInvocationContext()); + dependencyTasksAsync.blockLast(); + + // same as createResourceAsync + prepareCreateResourceAsync().block(); + + Response> activationResponse = this.manager().inner().getVirtualMachines() + .createOrUpdateWithResponseAsync(resourceGroupName(), vmName, inner()).block(); + + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); + } else { + Accepted accepted = new AcceptedImpl( + activationResponse, + this.manager().inner().getSerializerAdapter(), + this.manager().inner().getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + inner -> new VirtualMachineImpl(inner.name(), inner, this.manager(), + this.storageManager, this.networkManager, this.authorizationManager)); + + reset(accepted.getAcceptedResult().getValue().inner()); + return accepted; + } + } + @Override public Mono updateResourceAsync() { if (isManagedDiskEnabled()) { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java index ac0f38fdbda9..e4c5cd326688 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java @@ -2,6 +2,7 @@ // Licensed under the MIT License. package com.azure.resourcemanager.compute.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.compute.ComputeManager; import com.azure.resourcemanager.compute.models.HardwareProfile; @@ -21,12 +22,19 @@ import com.azure.resourcemanager.authorization.AuthorizationManager; import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.storage.StorageManager; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; + +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import java.util.function.Function; + import reactor.core.Exceptions; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** The implementation for VirtualMachines. */ @@ -197,6 +205,22 @@ public Mono runCommandAsync(String groupName, String name, Run return this.inner().runCommandAsync(groupName, name, inputCommand).map(RunCommandResultImpl::new); } + @Override + public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name) { + Response> activationResponse = + this.inner().deleteWithResponseAsync(resourceGroupName, name).block(); + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); + } else { + return new AcceptedImpl(activationResponse, + manager().inner().getSerializerAdapter(), + manager().inner().getHttpPipeline(), + Void.class, + Void.class, + Function.identity()); + } + } + // Getters @Override public VirtualMachineSizes sizes() { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java index 1acc87dd49f4..ced187094e20 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java @@ -16,6 +16,7 @@ import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.model.Appliable; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; @@ -1636,6 +1637,13 @@ interface WithCreate DefinitionStages.WithSystemAssignedManagedServiceIdentity, DefinitionStages.WithUserAssignedManagedServiceIdentity, DefinitionStages.WithLicenseType { + + /** + * Begins creating the virtual machine resource. + * + * @return the accepted create operation + */ + Accepted beginCreate(); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java index bd784274f991..5abfc5e9bea2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.model.HasInner; import java.util.List; import reactor.core.publisher.Mono; @@ -248,4 +249,13 @@ Mono runShellScriptAsync( * @return handle to the asynchronous execution */ Mono runCommandAsync(String groupName, String name, RunCommandInput inputCommand); + + /** + * Begins deleting a virtual machine from Azure, identifying it by its name and its resource group. + * + * @param resourceGroupName the resource group the resource is part of + * @param name the virtual machine name + * @return the accepted deleting operation + */ + Accepted beginDeleteByResourceGroup(String resourceGroupName, String name); } diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java index 10edcb8b2022..6356e4bc45d7 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java @@ -68,7 +68,7 @@ public void canCreateZonedVirtualMachineWithImplicitZoneForRelatedResources() th .withNewProximityPlacementGroup(proxyGroupName, ProximityPlacementGroupType.STANDARD) .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) // Optionals .withAvailabilityZone(AvailabilityZoneId.ZONE_1) .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2) @@ -165,7 +165,7 @@ public void canCreateZonedVirtualMachineWithExplicitZoneForRelatedResources() th .withExistingPrimaryPublicIPAddress(publicIPAddress) .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) // Optionals .withAvailabilityZone(AvailabilityZoneId.ZONE_1) .withExistingDataDisk(dataDisk) @@ -244,7 +244,7 @@ public void canCreateZonedVirtualMachineWithZoneResilientPublicIP() throws Excep .withExistingPrimaryPublicIPAddress(publicIPAddress) .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) // Optionals .withAvailabilityZone(AvailabilityZoneId.ZONE_1) .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2) @@ -301,7 +301,7 @@ public void canCreateZonedVirtualMachineWithZoneResilientPublicIP() throws Excep .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) // Optionals .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2); @@ -319,7 +319,7 @@ public void canCreateZonedVirtualMachineWithZoneResilientPublicIP() throws Excep .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) // Optionals .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2); @@ -454,7 +454,7 @@ public void canCreateZonedVirtualMachinesAndAssociateThemWithSingleBackendPoolOf .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withAvailabilityZone(AvailabilityZoneId.ZONE_1) // Optionals .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2); @@ -473,7 +473,7 @@ public void canCreateZonedVirtualMachinesAndAssociateThemWithSingleBackendPoolOf .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withAvailabilityZone(AvailabilityZoneId.ZONE_1) // Optionals .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2); diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java index 51a9d672712c..2e49ac258ef9 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java @@ -43,7 +43,7 @@ public void canEnableBootDiagnosticsWithImplicitStorageOnManagedVMCreation() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withBootDiagnostics() .create(); @@ -69,7 +69,7 @@ public void canEnableBootDiagnosticsWithCreatableStorageOnManagedVMCreation() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withBootDiagnostics(creatableStorageAccount) .create(); Assertions.assertNotNull(virtualMachine); @@ -100,7 +100,7 @@ public void canEnableBootDiagnosticsWithExplicitStorageOnManagedVMCreation() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withBootDiagnostics(storageAccount) .create(); @@ -151,7 +151,7 @@ public void bootDiagnosticsShouldUsesOSUnManagedDiskImplicitStorage() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() // The implicit storage account for OS disk should be used for boot diagnostics as // well .withBootDiagnostics() @@ -191,7 +191,7 @@ public void bootDiagnosticsShouldUseUnManagedDisksExplicitStorage() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() .withBootDiagnostics() .withExistingStorageAccount( @@ -217,7 +217,7 @@ public void canEnableBootDiagnosticsWithImplicitStorageOnUnManagedVMCreation() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() .create(); @@ -267,7 +267,7 @@ public void canEnableBootDiagnosticsWithCreatableStorageOnUnManagedVMCreation() .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() .withBootDiagnostics( creatableStorageAccount) // This storage account should be used for BDiagnostics not OS disk storage diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java index 972926081434..7965dbd478c8 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java @@ -106,7 +106,7 @@ public void canCreateUpdateVirtualMachineWithEMSI() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withExistingUserAssignedManagedServiceIdentity(createdIdentity) .withNewUserAssignedManagedServiceIdentity(creatableIdentity) .create(); @@ -315,7 +315,7 @@ public void canCreateVirtualMachineWithLMSIAndEMSI() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withSystemAssignedManagedServiceIdentity() .withSystemAssignedIdentityBasedAccessTo(network.id(), BuiltInRole.CONTRIBUTOR) .withNewUserAssignedManagedServiceIdentity(creatableIdentity) @@ -418,7 +418,7 @@ public void canUpdateVirtualMachineWithEMSIAndLMSI() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .create(); // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java index 22a94703f87b..c45c71adf9bc 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java @@ -53,7 +53,7 @@ public void canSetMSIOnNewOrExistingVMWithoutRoleAssignment() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withSize(VirtualMachineSizeTypes.STANDARD_DS2_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) .withSystemAssignedManagedServiceIdentity() @@ -124,7 +124,7 @@ public void canSetMSIOnNewVMWithRoleAssignedToCurrentResourceGroup() throws Exce .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withSize(VirtualMachineSizeTypes.STANDARD_DS2_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) .withSystemAssignedManagedServiceIdentity() @@ -235,7 +235,7 @@ public void canSetMSIOnNewVMWithMultipleRoleAssignments() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withSize(VirtualMachineSizeTypes.STANDARD_DS2_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) .withSystemAssignedManagedServiceIdentity() @@ -303,7 +303,7 @@ public void canSetMSIOnExistingVMWithRoleAssignments() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withSize(VirtualMachineSizeTypes.STANDARD_DS2_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) .withSystemAssignedManagedServiceIdentity() diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java index a55cdcd4e2b7..22ffec61228a 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java @@ -6,6 +6,8 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; import com.azure.resourcemanager.compute.models.AvailabilitySet; import com.azure.resourcemanager.compute.models.CachingTypes; import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; @@ -27,6 +29,8 @@ import com.azure.resourcemanager.network.models.PublicIpAddress; import com.azure.resourcemanager.network.models.SecurityRuleProtocol; import com.azure.resourcemanager.network.models.Subnet; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; import com.azure.resourcemanager.resources.models.ResourceGroup; import com.azure.resourcemanager.resources.fluentcore.arm.Region; import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; @@ -114,7 +118,7 @@ public void canCreateVirtualMachineWithNetworking() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .create(); NetworkInterface primaryNic = vm.getPrimaryNetworkInterface(); @@ -151,7 +155,7 @@ public void canCreateVirtualMachine() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) .withAdminUsername("Foo12") - .withAdminPassword("abc!@#F0orL") + .withAdminPassword(password()) .withUnmanagedDisks() .withSize(VirtualMachineSizeTypes.STANDARD_D3) .withOSDiskCaching(CachingTypes.READ_WRITE) @@ -186,6 +190,75 @@ public void canCreateVirtualMachine() throws Exception { computeManager.virtualMachines().deleteById(foundVM.id()); } + @Test + public void canCreateVirtualMachineSyncPoll() throws Exception { + Accepted acceptedVirtualMachine = computeManager + .virtualMachines() + .define(vmName) + .withRegion(region) + .withNewResourceGroup(rgName) + .withNewPrimaryNetwork("10.0.0.0/28") + .withPrimaryPrivateIPAddressDynamic() + .withoutPrimaryPublicIPAddress() + .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2016_DATACENTER) + .withAdminUsername("Foo12") + .withAdminPassword(password()) + .withUnmanagedDisks() + .withSize(VirtualMachineSizeTypes.STANDARD_D3) + .withOSDiskCaching(CachingTypes.READ_WRITE) + .withOSDiskName("javatest") + .withLicenseType("Windows_Server") + .beginCreate(); + VirtualMachine createdVirtualMachine = acceptedVirtualMachine.getAcceptedResult().getValue(); + Assertions.assertNotEquals("Succeeded", createdVirtualMachine.provisioningState()); + + LongRunningOperationStatus pollStatus = acceptedVirtualMachine.getAcceptedResult().getStatus(); + int delayInMills = acceptedVirtualMachine.getAcceptedResult().getRetryAfter() == null + ? 0 + : (int) acceptedVirtualMachine.getAcceptedResult().getRetryAfter().toMillis(); + while (pollStatus != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + SdkContext.sleep(delayInMills); + + PollResponse pollResponse = acceptedVirtualMachine.getSyncPoller().poll(); + pollStatus = pollResponse.getStatus(); + delayInMills = pollResponse.getRetryAfter() == null + ? 10000 + : (int) pollResponse.getRetryAfter().toMillis(); + } + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); + VirtualMachine virtualMachine = acceptedVirtualMachine.getFinalResult(); + Assertions.assertEquals("Succeeded", virtualMachine.provisioningState()); + + Accepted acceptedDelete = computeManager.virtualMachines() + .beginDeleteByResourceGroup(virtualMachine.resourceGroupName(), virtualMachine.name()); + + pollStatus = acceptedDelete.getAcceptedResult().getStatus(); + delayInMills = acceptedDelete.getAcceptedResult().getRetryAfter() == null + ? 0 + : (int) acceptedDelete.getAcceptedResult().getRetryAfter().toMillis(); + + while (pollStatus != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + SdkContext.sleep(delayInMills); + + PollResponse pollResponse = acceptedDelete.getSyncPoller().poll(); + pollStatus = pollResponse.getStatus(); + delayInMills = pollResponse.getRetryAfter() == null + ? 10000 + : (int) pollResponse.getRetryAfter().toMillis(); + } + + boolean deleted = false; + try { + computeManager.virtualMachines().getById(virtualMachine.id()); + } catch (ManagementException e) { + if (e.getResponse().getStatusCode() == 404 + && ("NotFound".equals(e.getValue().getCode()) || "ResourceNotFound".equals(e.getValue().getCode()))) { + deleted = true; + } + } + Assertions.assertTrue(deleted); + } + @Test public void canCreateUpdatePriorityAndPrice() throws Exception { // Create @@ -199,7 +272,7 @@ public void canCreateUpdatePriorityAndPrice() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2016_DATACENTER) .withAdminUsername("Foo12") - .withAdminPassword("abc!@#F0orL") + .withAdminPassword(password()) .withUnmanagedDisks() .withSize(VirtualMachineSizeTypes.STANDARD_A2) .withOSDiskCaching(CachingTypes.READ_WRITE) @@ -314,7 +387,7 @@ public void cannotUpdateProximityPlacementGroupForVirtualMachine() throws Except .withProximityPlacementGroup(setCreated.proximityPlacementGroup().id()) .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2019_DATACENTER) .withAdminUsername("Foo12") - .withAdminPassword("abc!@#F0orL") + .withAdminPassword(password()) .withUnmanagedDisks() .withSize(VirtualMachineSizeTypes.STANDARD_DS3_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) @@ -409,7 +482,7 @@ public void canCreateVirtualMachinesAndAvailabilitySetInSameProximityPlacementGr .withProximityPlacementGroup(setCreated.proximityPlacementGroup().id()) .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2019_DATACENTER) .withAdminUsername("Foo12") - .withAdminPassword("abc!@#F0orL") + .withAdminPassword(password()) .withUnmanagedDisks() .withSize(VirtualMachineSizeTypes.STANDARD_DS3_V2) .withOSDiskCaching(CachingTypes.READ_WRITE) @@ -606,7 +679,7 @@ public void canSetStorageAccountForUnmanagedDisk() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() .defineUnmanagedDataDisk("disk1") .withNewVhd(100) @@ -652,7 +725,7 @@ public void canSetStorageAccountForUnmanagedDisk() { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername("Foo12") - .withRootPassword("abc!@#F0orL") + .withRootPassword(password()) .withUnmanagedDisks() .withExistingUnmanagedDataDisk(storageAccount.name(), "diskvhds", "datadisk1vhd.vhd") .withSize(VirtualMachineSizeTypes.STANDARD_DS2_V2) diff --git a/sdk/compute/mgmt/src/test/resources/session-records/canCreateVirtualMachineSyncPoll.json b/sdk/compute/mgmt/src/test/resources/session-records/canCreateVirtualMachineSyncPoll.json new file mode 100644 index 000000000000..4ed274496a45 --- /dev/null +++ b/sdk/compute/mgmt/src/test/resources/session-records/canCreateVirtualMachineSyncPoll.json @@ -0,0 +1,515 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/javacsmrg28724?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:20 GMT", + "content-length" : "225", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "201", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "e6498ea8-43ec-47da-b9e9-487137ed2a72", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024520Z:e6498ea8-43ec-47da-b9e9-487137ed2a72", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "e6498ea8-43ec-47da-b9e9-487137ed2a72", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724\",\"name\":\"javacsmrg28724\",\"type\":\"Microsoft.Resources/resourceGroups\",\"location\":\"eastus\",\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Storage/storageAccounts/stgjavavm37536790d73?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.storage/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:26 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "d0c6d9cb-bcd4-4f89-b83e-3576ecc929c1", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024526Z:d0c6d9cb-bcd4-4f89-b83e-3576ecc929c1", + "content-type" : "text/plain; charset=utf-8", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/7cc118e1-4a3d-43c5-a479-3260c70c0fd7?monitor=true&api-version=2019-06-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "7cc118e1-4a3d-43c5-a479-3260c70c0fd7", + "Body" : "" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.network/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:27 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "azure-asyncnotification" : "Enabled", + "content-length" : "1342", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "28244a24-e6c4-48ac-8ea9-3ffa9efe3fd1", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "55822a62-a252-4532-bd5e-cf78552ae230", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024528Z:28244a24-e6c4-48ac-8ea9-3ffa9efe3fd1", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "a7e9e3e3-0e4f-44ec-a712-a81e7cba937a", + "Body" : "{\r\n \"name\": \"vnet63723f2808\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808\",\r\n \"etag\": \"W/\\\"ae9faceb-4c35-49e3-918e-7dde041cb101\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"645241e1-6de1-4d53-994c-44c2ace20ae6\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/28\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"subnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808/subnets/subnet1\",\r\n \"etag\": \"W/\\\"ae9faceb-4c35-49e3-918e-7dde041cb101\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.0.0/28\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\": false\r\n }\r\n}", + "azure-asyncoperation" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a7e9e3e3-0e4f-44ec-a712-a81e7cba937a?api-version=2019-06-01" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/a7e9e3e3-0e4f-44ec-a712-a81e7cba937a?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:32 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "29", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11999", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "73c8e1c1-6226-4cac-9c8f-8ddfbf74dcd0", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "c57bc338-def0-42b9-a991-595dfd060c00", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024532Z:73c8e1c1-6226-4cac-9c8f-8ddfbf74dcd0", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "418d7bd5-ee5a-4033-aa03-e69d08302388", + "Body" : "{\r\n \"status\": \"Succeeded\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:32 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "1344", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11999", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "20a2c7e4-9316-4210-8ded-be5490603529", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "9df1a966-a475-4311-a596-24a84bfad39c", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024533Z:20a2c7e4-9316-4210-8ded-be5490603529", + "etag" : "W/\"11380395-4bf2-45a7-8971-8b5bd2e11d33\"", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "10e78173-7938-4a27-a66a-370cfe0384e2", + "Body" : "{\r\n \"name\": \"vnet63723f2808\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808\",\r\n \"etag\": \"W/\\\"11380395-4bf2-45a7-8971-8b5bd2e11d33\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"645241e1-6de1-4d53-994c-44c2ace20ae6\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/28\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"subnet1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808/subnets/subnet1\",\r\n \"etag\": \"W/\\\"11380395-4bf2-45a7-8971-8b5bd2e11d33\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/28\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\": false\r\n }\r\n}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.network/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:37 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "azure-asyncnotification" : "Enabled", + "content-length" : "1647", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "1af45a14-7cab-42af-9c5c-f105565326b9", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "5a0525f7-57c8-4847-be3a-cdf97ef41669", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024537Z:1af45a14-7cab-42af-9c5c-f105565326b9", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "71361744-6555-440a-95e0-d090fbf624e5", + "Body" : "{\r\n \"name\": \"nicjavavm375647050\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050\",\r\n \"etag\": \"W/\\\"7796a6dd-eaa2-474b-9ed8-b55054d98415\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"6f8678ec-93e1-467c-8647-da8219e9ae2a\",\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"primary\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050/ipConfigurations/primary\",\r\n \"etag\": \"W/\\\"7796a6dd-eaa2-474b-9ed8-b55054d98415\\\"\",\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808/subnets/subnet1\"\r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": \"2favezhbnvju1gkmitbkzyqk2g.bx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\": false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}", + "azure-asyncoperation" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/71361744-6555-440a-95e0-d090fbf624e5?api-version=2019-06-01" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/7cc118e1-4a3d-43c5-a479-3260c70c0fd7?monitor=true&api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:44 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "1216", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "a29e3b11-6716-4824-95b4-b15137620038", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024544Z:a29e3b11-6716-4824-95b4-b15137620038", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "eedc5e09-05d6-4a9c-9c2b-234c45b8368a", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Storage/storageAccounts/stgjavavm37536790d73\",\"name\":\"stgjavavm37536790d73\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"eastus\",\"tags\":{},\"properties\":{\"privateEndpointConnections\":[],\"networkAcls\":{\"bypass\":\"AzureServices\",\"virtualNetworkRules\":[],\"ipRules\":[],\"defaultAction\":\"Allow\"},\"supportsHttpsTrafficOnly\":true,\"encryption\":{\"services\":{\"file\":{\"keyType\":\"Account\",\"enabled\":true,\"lastEnabledTime\":\"2020-06-18T02:45:26.5523395Z\"},\"blob\":{\"keyType\":\"Account\",\"enabled\":true,\"lastEnabledTime\":\"2020-06-18T02:45:26.5523395Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2020-06-18T02:45:26.4741657Z\",\"primaryEndpoints\":{\"blob\":\"https://stgjavavm37536790d73.blob.core.windows.net/\",\"queue\":\"https://stgjavavm37536790d73.queue.core.windows.net/\",\"table\":\"https://stgjavavm37536790d73.table.core.windows.net/\",\"file\":\"https://stgjavavm37536790d73.file.core.windows.net/\"},\"primaryLocation\":\"eastus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Storage/storageAccounts/stgjavavm37536790d73?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.storage/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:45:44 GMT", + "server" : "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", + "content-length" : "1216", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "5bcf6e8b-11c7-40e1-9525-532d465721b6", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024545Z:5bcf6e8b-11c7-40e1-9525-532d465721b6", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "23be83e8-6271-4440-a594-dc7830e2cb17", + "Body" : "{\"sku\":{\"name\":\"Standard_GRS\",\"tier\":\"Standard\"},\"kind\":\"Storage\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Storage/storageAccounts/stgjavavm37536790d73\",\"name\":\"stgjavavm37536790d73\",\"type\":\"Microsoft.Storage/storageAccounts\",\"location\":\"eastus\",\"tags\":{},\"properties\":{\"privateEndpointConnections\":[],\"networkAcls\":{\"bypass\":\"AzureServices\",\"virtualNetworkRules\":[],\"ipRules\":[],\"defaultAction\":\"Allow\"},\"supportsHttpsTrafficOnly\":true,\"encryption\":{\"services\":{\"file\":{\"keyType\":\"Account\",\"enabled\":true,\"lastEnabledTime\":\"2020-06-18T02:45:26.5523395Z\"},\"blob\":{\"keyType\":\"Account\",\"enabled\":true,\"lastEnabledTime\":\"2020-06-18T02:45:26.5523395Z\"}},\"keySource\":\"Microsoft.Storage\"},\"provisioningState\":\"Succeeded\",\"creationTime\":\"2020-06-18T02:45:26.4741657Z\",\"primaryEndpoints\":{\"blob\":\"https://stgjavavm37536790d73.blob.core.windows.net/\",\"queue\":\"https://stgjavavm37536790d73.queue.core.windows.net/\",\"table\":\"https://stgjavavm37536790d73.table.core.windows.net/\",\"file\":\"https://stgjavavm37536790d73.file.core.windows.net/\"},\"primaryLocation\":\"eastus\",\"statusOfPrimary\":\"available\",\"secondaryLocation\":\"westus\",\"statusOfSecondary\":\"available\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/71361744-6555-440a-95e0-d090fbf624e5?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:46:08 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "29", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "c1cb2c45-03df-4884-9b18-427caa45f855", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "5de35227-e499-457a-b33a-23615874ebb5", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024608Z:c1cb2c45-03df-4884-9b18-427caa45f855", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "787dc730-0b75-4971-b81a-05c87b10f922", + "Body" : "{\r\n \"status\": \"Succeeded\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050?api-version=2019-06-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:46:08 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "1647", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "74fdaabc-7ff1-4543-b73b-e32be9924b8a", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-ms-arm-service-request-id" : "40b765b4-e846-4586-bc38-b1aed2c87e05", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024609Z:74fdaabc-7ff1-4543-b73b-e32be9924b8a", + "etag" : "W/\"7796a6dd-eaa2-474b-9ed8-b55054d98415\"", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "291cec72-1edc-4bd8-a8a5-e0c39535fe24", + "Body" : "{\r\n \"name\": \"nicjavavm375647050\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050\",\r\n \"etag\": \"W/\\\"7796a6dd-eaa2-474b-9ed8-b55054d98415\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"6f8678ec-93e1-467c-8647-da8219e9ae2a\",\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"primary\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050/ipConfigurations/primary\",\r\n \"etag\": \"W/\\\"7796a6dd-eaa2-474b-9ed8-b55054d98415\\\"\",\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/virtualNetworks/vnet63723f2808/subnets/subnet1\"\r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": \"2favezhbnvju1gkmitbkzyqk2g.bx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\": false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.compute/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:46:13 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "azure-asyncnotification" : "Enabled", + "content-length" : "1587", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1197", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "a9a6de76-b00f-428f-ac68-f2eaa0dfd8f6", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024613Z:a9a6de76-b00f-428f-ac68-f2eaa0dfd8f6", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "833be3e2-58cc-4b2f-83dc-50d447b7f9d3", + "Body" : "{\r\n \"name\": \"javavm\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm\",\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"a9e45c44-9246-4852-b1cb-9428071f0463\",\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D3\"\r\n },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\": \"latest\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": \"javatest\",\r\n \"createOption\": \"FromImage\",\r\n \"vhd\": {\r\n \"uri\": \"https://stgjavavm37536790d73.blob.core.windows.net/vhds/javavm-os-disk-250d77d1-42ca-49aa-8ce5-fc3b2c6a8598.vhd\"\r\n },\r\n \"caching\": \"ReadWrite\"\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"javavm\",\r\n \"adminUsername\": \"Foo12\",\r\n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050\",\"properties\":{\"primary\":true}}]},\r\n \"licenseType\": \"Windows_Server\",\r\n \"provisioningState\": \"Creating\"\r\n }\r\n}", + "azure-asyncoperation" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/833be3e2-58cc-4b2f-83dc-50d447b7f9d3?api-version=2019-03-01" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/833be3e2-58cc-4b2f-83dc-50d447b7f9d3?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:46:23 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "134", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "5d72fc03-0f0d-480d-85ca-29294535ab5f", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29999", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024624Z:5d72fc03-0f0d-480d-85ca-29294535ab5f", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "cab2951e-6fe6-45a8-bee3-2c1922cc3d67", + "Body" : "{\r\n \"startTime\": \"2020-06-18T02:46:12.3510457+00:00\",\r\n \"status\": \"InProgress\",\r\n \"name\": \"833be3e2-58cc-4b2f-83dc-50d447b7f9d3\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/833be3e2-58cc-4b2f-83dc-50d447b7f9d3?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:47:14 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "184", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "5e6f0d5f-ed7a-4ba2-ab8e-6f769a8e8da4", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29997", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024715Z:5e6f0d5f-ed7a-4ba2-ab8e-6f769a8e8da4", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "128c55da-f26e-4e2b-83df-a6fe035c3188", + "Body" : "{\r\n \"startTime\": \"2020-06-18T02:46:12.3510457+00:00\",\r\n \"endTime\": \"2020-06-18T02:47:03.2107878+00:00\",\r\n \"status\": \"Succeeded\",\r\n \"name\": \"833be3e2-58cc-4b2f-83dc-50d447b7f9d3\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:47:15 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "1616", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11995", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "8cea9f0c-4f72-4c29-96e2-3748fa853aa2", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31998", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024715Z:8cea9f0c-4f72-4c29-96e2-3748fa853aa2", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "3b33c0eb-0581-498a-b4be-e000d3987473", + "Body" : "{\r\n \"name\": \"javavm\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm\",\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"a9e45c44-9246-4852-b1cb-9428071f0463\",\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D3\"\r\n },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\": \"latest\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": \"javatest\",\r\n \"createOption\": \"FromImage\",\r\n \"vhd\": {\r\n \"uri\": \"https://stgjavavm37536790d73.blob.core.windows.net/vhds/javavm-os-disk-250d77d1-42ca-49aa-8ce5-fc3b2c6a8598.vhd\"\r\n },\r\n \"caching\": \"ReadWrite\",\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"javavm\",\r\n \"adminUsername\": \"Foo12\",\r\n \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n \"enableAutomaticUpdates\": true\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Network/networkInterfaces/nicjavavm375647050\",\"properties\":{\"primary\":true}}]},\r\n \"licenseType\": \"Windows_Server\",\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.compute/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:47:16 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "azure-asyncnotification" : "Enabled", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "d19eae27-2e28-49d3-9c04-031c72e5f2df", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024716Z:d19eae27-2e28-49d3-9c04-031c72e5f2df", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9aca577e-b3bd-4472-8c77-4d5daadf8715?monitor=true&api-version=2019-03-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "9aca577e-b3bd-4472-8c77-4d5daadf8715", + "Body" : "", + "azure-asyncoperation" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9aca577e-b3bd-4472-8c77-4d5daadf8715?api-version=2019-03-01" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9aca577e-b3bd-4472-8c77-4d5daadf8715?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:47:26 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "134", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11994", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "62ec6eb9-6cb0-47fd-9605-a2cbcdfc6daa", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29996", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024726Z:62ec6eb9-6cb0-47fd-9605-a2cbcdfc6daa", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "f6920f2d-fff1-409d-8cca-5082544086fd", + "Body" : "{\r\n \"startTime\": \"2020-06-18T02:47:16.2577196+00:00\",\r\n \"status\": \"InProgress\",\r\n \"name\": \"9aca577e-b3bd-4472-8c77-4d5daadf8715\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9aca577e-b3bd-4472-8c77-4d5daadf8715?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:47:56 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "134", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11995", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "9e1bfd6b-7158-44a7-86e7-f5c53f4e427b", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29995", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024757Z:9e1bfd6b-7158-44a7-86e7-f5c53f4e427b", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "8312b330-6129-4d11-871f-e1551e49a681", + "Body" : "{\r\n \"startTime\": \"2020-06-18T02:47:16.2577196+00:00\",\r\n \"status\": \"InProgress\",\r\n \"name\": \"9aca577e-b3bd-4472-8c77-4d5daadf8715\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9aca577e-b3bd-4472-8c77-4d5daadf8715?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:48:07 GMT", + "server" : "Microsoft-HTTPAPI/2.0", + "content-length" : "184", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11993", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "72c62fce-1a26-4980-a250-b7fa1edb856d", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-resource" : "Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29993", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024808Z:72c62fce-1a26-4980-a250-b7fa1edb856d", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "69e0c981-6458-482b-b0e1-d466cc3fe474", + "Body" : "{\r\n \"startTime\": \"2020-06-18T02:47:16.2577196+00:00\",\r\n \"endTime\": \"2020-06-18T02:48:00.4767546+00:00\",\r\n \"status\": \"Succeeded\",\r\n \"name\": \"9aca577e-b3bd-4472-8c77-4d5daadf8715\"\r\n}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/javacsmrg28724/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2019-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.compute/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:48:08 GMT", + "content-length" : "226", + "expires" : "-1", + "retry-after" : "0", + "StatusCode" : "404", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "edff780e-e476-4c41-9ca3-67739e3e6196", + "x-content-type-options" : "nosniff", + "x-ms-failure-cause" : "gateway", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024809Z:edff780e-e476-4c41-9ca3-67739e3e6196", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "edff780e-e476-4c41-9ca3-67739e3e6196", + "Body" : "{\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The Resource 'Microsoft.Compute/virtualMachines/javavm' under resource group 'javacsmrg28724' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"}}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/javacsmrg28724?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:48:13 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "f9648f8b-1f47-4feb-b6b6-1369561d4efa", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024814Z:f9648f8b-1f47-4feb-b6b6-1369561d4efa", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1KQVZBQ1NNUkcyODcyNC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2019-08-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "f9648f8b-1f47-4feb-b6b6-1369561d4efa", + "Body" : "" + } + } ], + "variables" : [ "javacsmrg28724", "javacsmrg266202", "nicjavavm375647050", "vnet63723f2808", "stgjavavm37536790d73" ] +} \ No newline at end of file diff --git a/sdk/management/azure/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java b/sdk/management/azure/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java index 72e2271f6af9..85fd581a0cc9 100644 --- a/sdk/management/azure/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java +++ b/sdk/management/azure/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; import com.azure.resourcemanager.compute.models.VirtualMachines; +import com.azure.resourcemanager.resources.core.TestBase; import com.azure.resourcemanager.resources.fluentcore.arm.Region; import com.azure.resourcemanager.resources.fluentcore.model.Indexable; import com.google.common.util.concurrent.SettableFuture; @@ -33,7 +34,7 @@ public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exc .withoutPrimaryPublicIPAddress() .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) .withAdminUsername("testuser") - .withAdminPassword("12NewPA$$w0rd!") + .withAdminPassword(TestBase.password()) .withNewDataDisk(150) .withSize(VirtualMachineSizeTypes.STANDARD_D1_V2) .createAsync(); diff --git a/sdk/management/samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppSourceControlAsync.java b/sdk/management/samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppSourceControlAsync.java index 2b92f5ec850a..085e8dbf6220 100644 --- a/sdk/management/samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppSourceControlAsync.java +++ b/sdk/management/samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppSourceControlAsync.java @@ -191,7 +191,7 @@ public static boolean runSample(final Azure azure) { } finally { try { System.out.println("Deleting Resource Group: " + rgName); - azure.resourceGroups().beginDeleteByNameAsync(rgName).block(); + azure.resourceGroups().beginDeleteByName(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/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java index 7a1d6b99029a..adc519040523 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java @@ -12,6 +12,7 @@ import reactor.core.scheduler.Schedulers; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -270,6 +271,29 @@ public Flux invokeAsync(final InvocationContext context) { }); } + /** + * Invokes dependency tasks in the group, but not. + * + * @param context group level shared context that need be passed to invokeAsync(cxt) + * method of each task item in the group when it is selected for invocation. + * @return an observable that emits the result of tasks in the order they finishes. + */ + public Flux invokeDependencyAsync(final InvocationContext context) { + context.put(TaskGroup.InvocationContext.KEY_SKIP_TASKS, Collections.singleton(this.key())); + return Flux.defer(() -> { + if (proxyTaskGroupWrapper.isActive()) { + return Flux.error(new IllegalStateException("postRunDependent is not supported")); + } else { + Set processedKeys = runBeforeGroupInvoke(null); + if (proxyTaskGroupWrapper.isActive()) { + return Flux.error(new IllegalStateException("postRunDependent is not supported")); + } else { + return invokeInternAsync(context, false, null); + } + } + }); + } + /** * Invokes tasks in the group. * @@ -404,7 +428,13 @@ private Flux invokeTaskAsync(final TaskGroupEntry entry, fi boolean ignoreCachedResult = isRootEntry(entry) || (entry.proxy() != null && isRootEntry(entry.proxy())); - Mono taskObservable = entry.invokeTaskAsync(ignoreCachedResult, context); + Mono taskObservable; + Object skipTasks = context.get(InvocationContext.KEY_SKIP_TASKS); + if (skipTasks instanceof Set && ((Set) skipTasks).contains(entry.key())) { + taskObservable = Mono.just(new VoidIndexable(entry.key())); + } else { + taskObservable = entry.invokeTaskAsync(ignoreCachedResult, context); + } return taskObservable.flatMapMany((indexable) -> Flux.just(indexable), (throwable) -> processFaultedTaskAsync(entry, throwable, context), () -> processCompletedTaskAsync(entry, context)); @@ -562,6 +592,8 @@ public interface HasTaskGroup { * of the TaskGroup. */ public static final class InvocationContext { + public static final String KEY_SKIP_TASKS = "SKIP_TASKS"; + private final Map properties; private final TaskGroup taskGroup; private TaskGroupTerminateOnErrorStrategy terminateOnErrorStrategy; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java new file mode 100644 index 000000000000..090b287a4145 --- /dev/null +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.resources.fluentcore.model; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.resources.fluentcore.rest.ActivationResponse; + +/** + * The accepted LRO (long running operation). + * + * @param the type of final result + */ +public interface Accepted { + + /** + * Gets the accepted result of LRO. + * + * @return the accepted result + */ + ActivationResponse getAcceptedResult(); + + /** + * Gets the {@link SyncPoller} of LRO. + * + * @return the sync poller. + */ + SyncPoller getSyncPoller(); + + /** + * Gets the final result of LRO. + * + * @return the final result. + */ + T getFinalResult(); +} diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java new file mode 100644 index 000000000000..040f5bfe853e --- /dev/null +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.resources.fluentcore.model.implementation; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.rest.ActivationResponse; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Objects; +import java.util.function.Function; + +public class AcceptedImpl implements Accepted { + + private final ClientLogger logger = new ClientLogger(getClass()); + + private final Response> activationResponse; + private byte[] responseBytes; + private final SerializerAdapter serializerAdapter; + private final HttpPipeline httpPipeline; + private final Type pollResultType; + private final Type finalResultType; + private final Function wrapOperation; + + private PollerFlux, InnerT> pollerFlux; + private SyncPoller syncPoller; + + public AcceptedImpl(Response> activationResponse, + SerializerAdapter serializerAdapter, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Function wrapOperation) { + this.activationResponse = Objects.requireNonNull(activationResponse); + this.serializerAdapter = Objects.requireNonNull(serializerAdapter); + this.httpPipeline = Objects.requireNonNull(httpPipeline); + this.pollResultType = Objects.requireNonNull(pollResultType); + this.finalResultType = Objects.requireNonNull(finalResultType); + this.wrapOperation = Objects.requireNonNull(wrapOperation); + } + + @Override + public ActivationResponse getAcceptedResult() { + try { + T value = wrapOperation.apply(serializerAdapter.deserialize( + new String(getResponse(), StandardCharsets.UTF_8), + finalResultType, + SerializerEncoding.JSON)); + Duration retryAfter = getRetryAfter(activationResponse.getHeaders()); + return new ActivationResponse<>(activationResponse.getRequest(), activationResponse.getStatusCode(), + activationResponse.getHeaders(), value, + LongRunningOperationStatus.IN_PROGRESS, retryAfter); + } catch (IOException e) { + throw logger.logExceptionAsError( + new IllegalStateException("Failed to deserialize activation response body", e)); + } + } + + private static Duration getRetryAfter(HttpHeaders headers) { + if (headers != null) { + final String value = headers.getValue("Retry-After"); + if (value != null) { + return Duration.ofSeconds(Long.parseLong(value)); + } + } + return null; + } + + @Override + public SyncPoller getSyncPoller() { + if (syncPoller == null) { + syncPoller = new SyncPollerImpl(this.getPollerFlux().getSyncPoller(), wrapOperation); + } + return syncPoller; + } + + private PollerFlux, InnerT> getPollerFlux() { + if (pollerFlux == null) { + Flux content = Flux.just(ByteBuffer.wrap(getResponse())); + Response> clonedResponse = new SimpleResponse<>(activationResponse, content); + + pollerFlux = PollerFactory.create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + SdkContext.getLroRetryDuration(), + Mono.just(clonedResponse) + ); + } + return pollerFlux; + } + + @Override + public T getFinalResult() { + return this.getSyncPoller().getFinalResult(); + } + + private byte[] getResponse() { + if (responseBytes == null) { + responseBytes = FluxUtil.collectBytesInByteBufferStream(activationResponse.getValue()).block(); + } + return responseBytes; + } + + private static class SyncPollerImpl + implements SyncPoller { + + private final SyncPoller, InnerT> syncPoller; + private final Function wrapOperation; + private T finalResult; + + SyncPollerImpl(SyncPoller, InnerT> syncPoller, Function wrapOperation) { + this.syncPoller = syncPoller; + this.wrapOperation = wrapOperation; + } + + @Override + public PollResponse poll() { + return voidResponse(syncPoller.poll()); + } + + @Override + public PollResponse waitForCompletion() { + return voidResponse(syncPoller.waitForCompletion()); + } + + @Override + public PollResponse waitForCompletion(Duration duration) { + return voidResponse(syncPoller.waitForCompletion(duration)); + } + + @Override + public PollResponse waitUntil(LongRunningOperationStatus longRunningOperationStatus) { + return voidResponse(syncPoller.waitUntil(longRunningOperationStatus)); + } + + @Override + public PollResponse waitUntil(Duration duration, LongRunningOperationStatus longRunningOperationStatus) { + return voidResponse(syncPoller.waitUntil(duration, longRunningOperationStatus)); + } + + @Override + public T getFinalResult() { + if (finalResult == null) { + finalResult = wrapOperation.apply(syncPoller.getFinalResult()); + } + return finalResult; + } + + @Override + public void cancelOperation() { + syncPoller.cancelOperation(); + } + + private PollResponse voidResponse(PollResponse> pollResponse) { + return new PollResponse<>(pollResponse.getStatus(), null, pollResponse.getRetryAfter()); + } + } +} diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java index c92176fba8ff..d214c79511d9 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java @@ -121,7 +121,7 @@ protected String addDependency(Creatable creatable) { * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency */ @SuppressWarnings("unchecked") - protected String addeDependency(Appliable appliable) { + protected String addDependency(Appliable appliable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; return this.addDependency(dependency); } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java new file mode 100644 index 000000000000..9abd366f849e --- /dev/null +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.resources.fluentcore.rest; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; + +import java.time.Duration; + +/** + * REST LRO activation response with a strongly-typed content specified. + * + * @param The deserialized type of the response content. + */ +public class ActivationResponse extends SimpleResponse { + + private final LongRunningOperationStatus status; + private final Duration retryAfter; + + /** + * Creates a {@link ActivationResponse}. + * + * @param request The request which resulted in this response. + * @param statusCode The status code of the HTTP response. + * @param headers The headers of the HTTP response. + * @param value The deserialized value of the HTTP response. + * @param status Mandatory operation status as defined in {@link LongRunningOperationStatus}. + * @param retryAfter Represents the delay the service has requested until the next polling operation is performed. A + * {@code null}, zero or negative value will be taken to mean that the poller should determine on its + * own when the next poll operation is to occur. + */ + public ActivationResponse(HttpRequest request, int statusCode, HttpHeaders headers, T value, + LongRunningOperationStatus status, Duration retryAfter) { + super(request, statusCode, headers, value); + this.status = status; + this.retryAfter = retryAfter; + } + + /** + * Represents the status of the long-running operation at the time the last polling operation finished successfully. + * @return A {@link LongRunningOperationStatus} representing the result of the poll operation. + */ + public LongRunningOperationStatus getStatus() { + return status; + } + + /** + * Returns the delay the service has requested until the next polling operation is performed. A null or negative + * value will be taken to mean that the poller should determine on its own when the next poll operation is + * to occur. + * @return Duration How long to wait before next retry. + */ + public Duration getRetryAfter() { + return retryAfter; + } +} diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java new file mode 100644 index 000000000000..5c2f1c6697f3 --- /dev/null +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the base classes for resources azure http rest. + */ +package com.azure.resourcemanager.resources.fluentcore.rest; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java index 39546a4b17ad..0fe0d9b90b9e 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java @@ -3,7 +3,12 @@ package com.azure.resourcemanager.resources.implementation; +import com.azure.core.http.rest.Response; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.model.Indexable; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.resources.models.DebugSetting; import com.azure.resourcemanager.resources.models.Dependency; import com.azure.resourcemanager.resources.models.Deployment; @@ -26,15 +31,16 @@ import com.azure.resourcemanager.resources.fluentcore.arm.Region; import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import com.azure.resourcemanager.resources.fluent.inner.DeploymentExtendedInner; import com.azure.resourcemanager.resources.fluent.inner.DeploymentInner; import com.azure.resourcemanager.resources.fluent.inner.ProviderInner; import com.fasterxml.jackson.databind.ObjectMapper; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.io.IOException; +import java.nio.ByteBuffer; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; @@ -50,6 +56,8 @@ public final class DeploymentImpl extends Deployment.Update, Deployment.Execution { + private final ClientLogger logger = new ClientLogger(DeploymentImpl.class); + private final ResourceManager resourceManager; private String resourceGroupName; private Creatable creatableResourceGroup; @@ -297,13 +305,26 @@ private DeploymentInner createRequestFromInner() { } @Override - public DeploymentImpl beginCreate() { + public Accepted beginCreate() { if (this.creatableResourceGroup != null) { this.creatableResourceGroup.create(); } - setInner(this.manager().inner().getDeployments() - .beginCreateOrUpdateWithoutPolling(resourceGroupName(), name(), createRequestFromInner())); - return this; + + Response> activationResponse = this.manager().inner().getDeployments() + .createOrUpdateWithResponseAsync(resourceGroupName(), name(), createRequestFromInner()).block(); + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); + } else { + Accepted accepted = new AcceptedImpl(activationResponse, + this.manager().inner().getSerializerAdapter(), + this.manager().inner().getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + inner -> new DeploymentImpl(inner, inner.name(), resourceManager)); + + setInner(accepted.getAcceptedResult().getValue().inner()); + return accepted; + } } @Override diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java index de466d831c5e..3b3652b4a160 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java @@ -5,6 +5,10 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.resources.ResourceManager; import com.azure.resourcemanager.resources.models.ResourceGroup; import com.azure.resourcemanager.resources.models.ResourceGroups; @@ -12,8 +16,12 @@ import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; import com.azure.resourcemanager.resources.fluentcore.utils.Utils; import com.azure.resourcemanager.resources.fluent.inner.ResourceGroupInner; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.nio.ByteBuffer; +import java.util.function.Function; + /** * The implementation for ResourceGroups. */ @@ -21,6 +29,8 @@ public final class ResourceGroupsImpl extends CreatableResourcesImpl implements ResourceGroups { + private final ClientLogger logger = new ClientLogger(ResourceGroupsImpl.class); + private final ResourceManager resourceManager; public ResourceGroupsImpl(final ResourceManager resourceManager) { @@ -89,15 +99,26 @@ protected ResourceGroupImpl wrapModel(ResourceGroupInner inner) { } @Override - public void beginDeleteByName(String id) { - beginDeleteByNameAsync(id).block(); + public Accepted beginDeleteByName(String name) { + Response> activationResponse = manager().inner().getResourceGroups() + .deleteWithResponseAsync(name).block(); + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); + } else { + return new AcceptedImpl(activationResponse, + manager().inner().getSerializerAdapter(), + manager().inner().getHttpPipeline(), + Void.class, + Void.class, + Function.identity()); + } } - @Override - public Mono beginDeleteByNameAsync(String name) { - // DELETE - return manager().inner().getResourceGroups().beginDeleteWithoutPollingAsync(name); - } +// @Override +// public Mono beginDeleteByNameAsync(String name) { +// // DELETE +// return client.beginDeleteWithoutPollingAsync(name); +// } @Override public Mono deleteByIdAsync(String id) { diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java index ff11595dd209..a813a6a11fc6 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.model.Appliable; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.HasInner; @@ -260,7 +261,12 @@ interface WithMode { * deployment in the cloud, but exposing additional optional inputs to specify. */ interface WithCreate extends Creatable { - Deployment beginCreate(); + /** + * Begins creating the deployment resource. + * + * @return the accepted create operation + */ + Accepted beginCreate(); Mono beginCreateAsync(); } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java index a6054eec8cc7..da31f7340445 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java @@ -8,11 +8,11 @@ import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBeginDeletingByName; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByTag; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; /** * Entry point to resource group management API. @@ -24,7 +24,7 @@ public interface ResourceGroups extends SupportsGettingByName, SupportsCreating, SupportsDeletingByName, - SupportsBeginDeletingByName, + //SupportsBeginDeletingByName, SupportsBatchCreation, HasManager { @@ -35,4 +35,12 @@ public interface ResourceGroups extends * @return true of exists, otherwise false */ boolean contain(String name); + + /** + * Begins deleting a resource group from Azure, identifying it by its name. + * + * @param name the resource group name + * @return the accepted deleting operation + */ + Accepted beginDeleteByName(String name); } diff --git a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java index fa586f1b5724..fbd78b6197b6 100644 --- a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java +++ b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java @@ -5,9 +5,13 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; import com.azure.resourcemanager.resources.core.TestUtilities; import com.azure.resourcemanager.resources.fluentcore.arm.Region; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; import com.azure.resourcemanager.resources.models.Deployment; import com.azure.resourcemanager.resources.models.DeploymentMode; import com.azure.resourcemanager.resources.models.DeploymentOperation; @@ -197,13 +201,14 @@ public void canUpdateVirtualNetworkDeployment() throws Exception { final String dp = "dpC" + testId; // Begin create - Deployment createdDeployment = resourceClient.deployments() + Accepted acceptedDeployment = resourceClient.deployments() .define(dp) .withExistingResourceGroup(rgName) .withTemplateLink(templateUri, contentVersion) .withParametersLink(parametersUri, contentVersion) .withMode(DeploymentMode.COMPLETE) .beginCreate(); + Deployment createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); Assertions.assertEquals(createdDeployment.correlationId(), deployment.correlationId()); Assertions.assertEquals(dp, deployment.name()); @@ -224,4 +229,37 @@ public void canUpdateVirtualNetworkDeployment() throws Exception { Assertions.assertNotNull(genericVnet); resourceClient.genericResources().delete(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet2", "2015-06-15"); } + + @Test + public void canDeployVirtualNetworkSyncPoll() throws Exception { + final String dp = "dpD" + testId; + + // Begin create + Accepted acceptedDeployment = resourceClient.deployments() + .define(dp) + .withExistingResourceGroup(rgName) + .withTemplateLink(templateUri, contentVersion) + .withParametersLink(parametersUri, contentVersion) + .withMode(DeploymentMode.COMPLETE) + .beginCreate(); + Deployment createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); + Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); + + LongRunningOperationStatus pollStatus = acceptedDeployment.getAcceptedResult().getStatus(); + int delayInMills = acceptedDeployment.getAcceptedResult().getRetryAfter() == null + ? 0 + : (int) acceptedDeployment.getAcceptedResult().getRetryAfter().toMillis(); + while (pollStatus != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + SdkContext.sleep(delayInMills); + + PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); + pollStatus = pollResponse.getStatus(); + delayInMills = pollResponse.getRetryAfter() == null + ? 10000 + : (int) pollResponse.getRetryAfter().toMillis(); + } + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); + Deployment deployment = acceptedDeployment.getFinalResult(); + Assertions.assertEquals("Succeeded", deployment.provisioningState()); + } } diff --git a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/core/TestBase.java b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/core/TestBase.java index 932750eaa1a2..d4865fa32ed7 100644 --- a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/core/TestBase.java +++ b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/core/TestBase.java @@ -56,7 +56,7 @@ public String generateRandomResourceName(String prefix, int maxLen) { return sdkContext.randomResourceName(prefix, maxLen); } - public String password() { + public static String password() { // do not record String password = new SdkContext().randomResourceName("Pa5$", 12); System.out.printf("Password: %s%n", password); diff --git a/sdk/resources/mgmt/src/test/resources/session-records/canDeployVirtualNetworkSyncPoll.json b/sdk/resources/mgmt/src/test/resources/session-records/canDeployVirtualNetworkSyncPoll.json new file mode 100644 index 000000000000..d27457e91500 --- /dev/null +++ b/sdk/resources/mgmt/src/test/resources/session-records/canDeployVirtualNetworkSyncPoll.json @@ -0,0 +1,606 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:38:58 GMT", + "content-length" : "225", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "201", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "531f6bf1-70ef-4a4a-b72f-50c4f42cfa78", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023858Z:531f6bf1-70ef-4a4a-b72f-50c4f42cfa78", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "531f6bf1-70ef-4a4a-b72f-50c4f42cfa78", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699\",\"name\":\"rg4fd28699\",\"type\":\"Microsoft.Resources/resourceGroups\",\"location\":\"southcentralus\",\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:04 GMT", + "content-length" : "2556", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "913b9705-bbe7-4df1-a8db-de014ef923f7", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023904Z:913b9705-bbe7-4df1-a8db-de014ef923f7", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "913b9705-bbe7-4df1-a8db-de014ef923f7", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699\",\"name\":\"dpD4fd28699\",\"type\":\"Microsoft.Resources/deployments\",\"properties\":{\"templateLink\":{\"uri\":\"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.json\",\"contentVersion\":\"1.0.0.0\"},\"templateHash\":\"12083796291331454487\",\"parametersLink\":{\"uri\":\"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.parameters.json\",\"contentVersion\":\"1.0.0.0\"},\"parameters\":{\"vnetName\":{\"type\":\"String\",\"value\":\"VNet1\"},\"vnetAddressPrefix\":{\"type\":\"String\",\"value\":\"10.0.0.0/16\"},\"subnet1Prefix\":{\"type\":\"String\",\"value\":\"10.0.0.0/24\"},\"subnet1Name\":{\"type\":\"String\",\"value\":\"Subnet1\"},\"subnet2Prefix\":{\"type\":\"String\",\"value\":\"10.0.1.0/24\"},\"subnet2Name\":{\"type\":\"String\",\"value\":\"Subnet2\"},\"location\":{\"type\":\"String\",\"value\":\"southcentralus\"}},\"mode\":\"Complete\",\"provisioningState\":\"Accepted\",\"timestamp\":\"2020-06-18T02:39:03.422585Z\",\"duration\":\"PT2.8070224S\",\"correlationId\":\"913b9705-bbe7-4df1-a8db-de014ef923f7\",\"providers\":[{\"namespace\":\"Microsoft.Network\",\"resourceTypes\":[{\"resourceType\":\"virtualNetworks\",\"locations\":[\"southcentralus\"]},{\"resourceType\":\"virtualNetworks/subnets\",\"locations\":[\"southcentralus\"]}]}],\"dependencies\":[{\"dependsOn\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks\",\"resourceName\":\"VNet1\"}],\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet1\"},{\"dependsOn\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks\",\"resourceName\":\"VNet1\"},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet1\"}],\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet2\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet2\"}]}}", + "azure-asyncoperation" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:05 GMT", + "content-length" : "21", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11999", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "08d22016-89c2-437f-a0e1-f66c85e321e8", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023905Z:08d22016-89c2-437f-a0e1-f66c85e321e8", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "08d22016-89c2-437f-a0e1-f66c85e321e8", + "Body" : "{\"status\":\"Accepted\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:15 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "babb6d3b-6047-4af1-bca8-5edce9388fcb", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023916Z:babb6d3b-6047-4af1-bca8-5edce9388fcb", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "babb6d3b-6047-4af1-bca8-5edce9388fcb", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:26 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "f14a67d9-e6f7-4e87-a171-9d4d07fbbfd7", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023927Z:f14a67d9-e6f7-4e87-a171-9d4d07fbbfd7", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "f14a67d9-e6f7-4e87-a171-9d4d07fbbfd7", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:37 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "b6ad9333-a0dd-4a2b-86d1-cdca8a12137a", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023937Z:b6ad9333-a0dd-4a2b-86d1-cdca8a12137a", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "b6ad9333-a0dd-4a2b-86d1-cdca8a12137a", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:47 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11995", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "97b73f62-7793-4a55-b1bc-2caa416f0451", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023948Z:97b73f62-7793-4a55-b1bc-2caa416f0451", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "97b73f62-7793-4a55-b1bc-2caa416f0451", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:39:58 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11994", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "98584a77-c834-45bf-ace6-5c656bf47f3f", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T023959Z:98584a77-c834-45bf-ace6-5c656bf47f3f", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "98584a77-c834-45bf-ace6-5c656bf47f3f", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:40:09 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11993", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "6173b7b0-0415-4cd1-850c-a0a38af3ded7", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024010Z:6173b7b0-0415-4cd1-850c-a0a38af3ded7", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "6173b7b0-0415-4cd1-850c-a0a38af3ded7", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:40:20 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11992", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "0448ed9c-a192-457a-9842-c4f3e8fdc55b", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024020Z:0448ed9c-a192-457a-9842-c4f3e8fdc55b", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "0448ed9c-a192-457a-9842-c4f3e8fdc55b", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:40:31 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11991", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "3589d51f-645d-4349-960f-c5b972855ad5", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024031Z:3589d51f-645d-4349-960f-c5b972855ad5", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "3589d51f-645d-4349-960f-c5b972855ad5", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:40:42 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11990", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "22385723-664e-4cb8-ae26-9881af255694", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024042Z:22385723-664e-4cb8-ae26-9881af255694", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "22385723-664e-4cb8-ae26-9881af255694", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:40:52 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11989", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "641b05e0-6e75-489e-9535-0fa5222815f8", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024053Z:641b05e0-6e75-489e-9535-0fa5222815f8", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "641b05e0-6e75-489e-9535-0fa5222815f8", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:03 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11988", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "2379ebf8-e8c2-4fb4-9964-efb4accb3605", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024103Z:2379ebf8-e8c2-4fb4-9964-efb4accb3605", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "2379ebf8-e8c2-4fb4-9964-efb4accb3605", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:14 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11987", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "76f0013b-23b4-495e-80bc-08d9d4fb8fe0", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024114Z:76f0013b-23b4-495e-80bc-08d9d4fb8fe0", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "76f0013b-23b4-495e-80bc-08d9d4fb8fe0", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:24 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11986", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "4286ff6c-236e-4223-a2ac-5b26c5c0f8ff", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024125Z:4286ff6c-236e-4223-a2ac-5b26c5c0f8ff", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "4286ff6c-236e-4223-a2ac-5b26c5c0f8ff", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:35 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11985", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "29703c2d-2318-4fce-972f-a24d5a675cd2", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024136Z:29703c2d-2318-4fce-972f-a24d5a675cd2", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "29703c2d-2318-4fce-972f-a24d5a675cd2", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:45 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11984", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "7f8e69a8-d5df-4a5a-be53-ca91572b04c2", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024146Z:7f8e69a8-d5df-4a5a-be53-ca91572b04c2", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "7f8e69a8-d5df-4a5a-be53-ca91572b04c2", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:41:56 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11983", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "4f35356e-47fb-4dc9-85f9-798f187e43c9", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024157Z:4f35356e-47fb-4dc9-85f9-798f187e43c9", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "4f35356e-47fb-4dc9-85f9-798f187e43c9", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:07 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11982", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "80f50f8c-3a41-4a0c-90d9-ec4168bde7ce", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024208Z:80f50f8c-3a41-4a0c-90d9-ec4168bde7ce", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "80f50f8c-3a41-4a0c-90d9-ec4168bde7ce", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:19 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11981", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "33cb0fb6-f746-4c92-b728-14460413706a", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024219Z:33cb0fb6-f746-4c92-b728-14460413706a", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "33cb0fb6-f746-4c92-b728-14460413706a", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:29 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11980", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "d1571974-9133-46ec-8ad9-8f5af28117fc", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024229Z:d1571974-9133-46ec-8ad9-8f5af28117fc", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "d1571974-9133-46ec-8ad9-8f5af28117fc", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:40 GMT", + "content-length" : "20", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11979", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "6716d22d-f26b-4a11-9e8d-7cabce8711cf", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024240Z:6716d22d-f26b-4a11-9e8d-7cabce8711cf", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "6716d22d-f26b-4a11-9e8d-7cabce8711cf", + "Body" : "{\"status\":\"Running\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699/operationStatuses/08586091589448620927?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:50 GMT", + "content-length" : "22", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11978", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "11a32af7-4b03-43cd-91e9-e6372513a11f", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024251Z:11a32af7-4b03-43cd-91e9-e6372513a11f", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "11a32af7-4b03-43cd-91e9-e6372513a11f", + "Body" : "{\"status\":\"Succeeded\"}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources.fluentcore.policy/null (14.0.1; Windows 10 10.0)" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:51 GMT", + "content-length" : "3024", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11977", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "3dacda89-b65d-442c-bce9-5d1b535af372", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024251Z:3dacda89-b65d-442c-bce9-5d1b535af372", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "3dacda89-b65d-442c-bce9-5d1b535af372", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Resources/deployments/dpD4fd28699\",\"name\":\"dpD4fd28699\",\"type\":\"Microsoft.Resources/deployments\",\"properties\":{\"templateLink\":{\"uri\":\"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.json\",\"contentVersion\":\"1.0.0.0\"},\"templateHash\":\"12083796291331454487\",\"parametersLink\":{\"uri\":\"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.parameters.json\",\"contentVersion\":\"1.0.0.0\"},\"parameters\":{\"vnetName\":{\"type\":\"String\",\"value\":\"VNet1\"},\"vnetAddressPrefix\":{\"type\":\"String\",\"value\":\"10.0.0.0/16\"},\"subnet1Prefix\":{\"type\":\"String\",\"value\":\"10.0.0.0/24\"},\"subnet1Name\":{\"type\":\"String\",\"value\":\"Subnet1\"},\"subnet2Prefix\":{\"type\":\"String\",\"value\":\"10.0.1.0/24\"},\"subnet2Name\":{\"type\":\"String\",\"value\":\"Subnet2\"},\"location\":{\"type\":\"String\",\"value\":\"southcentralus\"}},\"mode\":\"Complete\",\"provisioningState\":\"Succeeded\",\"timestamp\":\"2020-06-18T02:42:48.3217752Z\",\"duration\":\"PT3M47.7062126S\",\"correlationId\":\"913b9705-bbe7-4df1-a8db-de014ef923f7\",\"providers\":[{\"namespace\":\"Microsoft.Network\",\"resourceTypes\":[{\"resourceType\":\"virtualNetworks\",\"locations\":[\"southcentralus\"]},{\"resourceType\":\"virtualNetworks/subnets\",\"locations\":[\"southcentralus\"]}]}],\"dependencies\":[{\"dependsOn\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks\",\"resourceName\":\"VNet1\"}],\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet1\"},{\"dependsOn\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks\",\"resourceName\":\"VNet1\"},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet1\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet1\"}],\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet2\",\"resourceType\":\"Microsoft.Network/virtualNetworks/subnets\",\"resourceName\":\"VNet1/Subnet2\"}],\"outputResources\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1\"},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet1\"},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg4fd28699/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/Subnet2\"}]}}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg4fd28699?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0 (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Thu, 18 Jun 2020 02:42:55 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "250aa12e-4731-478b-8288-be46918958ce", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200618T024256Z:250aa12e-4731-478b-8288-be46918958ce", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzRGRDI4Njk5LVNPVVRIQ0VOVFJBTFVTIiwiam9iTG9jYXRpb24iOiJzb3V0aGNlbnRyYWx1cyJ9?api-version=2019-08-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "250aa12e-4731-478b-8288-be46918958ce", + "Body" : "" + } + } ], + "variables" : [ "4fd28699" ] +} \ No newline at end of file