Java Code Examples for com.microsoft.azure.management.resources.fluentcore.arm.Region#US_EAST2

The following examples show how to use com.microsoft.azure.management.resources.fluentcore.arm.Region#US_EAST2 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataLakeStoreManagementTest.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
@Override
protected void initializeClients(RestClient restClient, String defaultSubscription, String domain)
{
    environmentLocation = Region.US_EAST2;
    resourceGroupName = generateRandomResourceName("adlsrg",15);

    // Create the resource group
    resourceManagementClient = ResourceManager
            .authenticate(restClient)
            .withSubscription(defaultSubscription);

    resourceManagementClient.resourceGroups()
            .define(resourceGroupName)
            .withRegion(environmentLocation)
            .create();

    // Create the ADLA client
    dataLakeStoreAccountManagementClient = new DataLakeStoreAccountManagementClientImpl(restClient);
    dataLakeStoreAccountManagementClient.withSubscriptionId(defaultSubscription);
}
 
Example 2
Source File: TestNetwork.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
@Override
public Network createResource(Networks networks) throws Exception {
    Region region = Region.US_EAST2;
    String groupName = "rg" + this.testId;

    String networkName = SdkContext.randomResourceName("net", 15);

    Network network = networks.define(networkName)
            .withRegion(region)
            .withNewResourceGroup(groupName)
            .withNewDdosProtectionPlan()
            .withVmProtection()
            .create();
    Assert.assertTrue(network.isDdosProtectionEnabled());
    Assert.assertNotNull(network.ddosProtectionPlanId());
    Assert.assertTrue(network.isVmProtectionEnabled());

    return network;
}
 
Example 3
Source File: VirtualMachineScaleSetOperationsTests.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
@Test
public void canCreateZoneRedundantVirtualMachineScaleSetWithZoneResilientLoadBalancer() throws Exception {
    // Zone redundant VMSS is the one with multiple zones
    //

    Region REGION2 = Region.US_EAST2;

    ResourceGroup resourceGroup = this.resourceManager.resourceGroups()
            .define(RG_NAME)
            .withRegion(REGION2)
            .create();

    Network network = this.networkManager
            .networks()
            .define("vmssvnet")
            .withRegion(REGION2)
            .withExistingResourceGroup(resourceGroup)
            .withAddressSpace("10.0.0.0/28")
            .withSubnet("subnet1", "10.0.0.0/28")
            .create();

    // Zone redundant VMSS requires STANDARD LB
    //
    // Creates a STANDARD LB with one public frontend ip configuration with two backend pools
    // Each address pool of STANDARD LB can hold different VMSS resource.
    //
    LoadBalancer publicLoadBalancer = createInternetFacingLoadBalancer(REGION2,
            resourceGroup,
            "1",
            LoadBalancerSkuType.STANDARD);

    List<String> backends = new ArrayList<>();
    for (String backend : publicLoadBalancer.backends().keySet()) {
        backends.add(backend);
    }
    Assert.assertTrue(backends.size() == 2);

    final String vmss_name = generateRandomResourceName("vmss", 10);
    // HTTP & HTTPS traffic on port 80, 443 of Internet-facing LB goes to corresponding port in virtual machine scale set
    //
    VirtualMachineScaleSet virtualMachineScaleSet = this.computeManager.virtualMachineScaleSets()
            .define(vmss_name)
            .withRegion(REGION2)
            .withExistingResourceGroup(resourceGroup)
            .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
            .withExistingPrimaryNetworkSubnet(network, "subnet1")
            .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer)
            .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1))
            .withoutPrimaryInternalLoadBalancer()
            .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
            .withRootUsername("jvuser")
            .withRootPassword("123OData!@#123")
            .withAvailabilityZone(AvailabilityZoneId.ZONE_1)  // Zone redundant - zone 1 + zone 2
            .withAvailabilityZone(AvailabilityZoneId.ZONE_2)
            .create();

    // Check zones
    //
    Assert.assertNotNull(virtualMachineScaleSet.availabilityZones());
    Assert.assertEquals(2, virtualMachineScaleSet.availabilityZones().size());

    // Validate Network specific properties (LB, VNet, NIC, IPConfig etc..)
    //
    Assert.assertNull(virtualMachineScaleSet.getPrimaryInternalLoadBalancer());
    Assert.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerBackends().size() == 0);
    Assert.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerInboundNatPools().size() == 0);

    Assert.assertNotNull(virtualMachineScaleSet.getPrimaryInternetFacingLoadBalancer());
    Assert.assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerBackends().size() == 2);
    Assert.assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerInboundNatPools().size() == 2);

    Network primaryNetwork = virtualMachineScaleSet.getPrimaryNetwork();
    Assert.assertNotNull(primaryNetwork.id());
}
 
Example 4
Source File: TestLoadBalancer.java    From azure-libraries-for-java with MIT License 4 votes vote down vote up
/**
 * Tests an internal load balancer with zoned front-end.
 * @param computeManager compute manager
 */
public InternalWithZone(ComputeManager computeManager) {
    REGION = Region.US_EAST2;
    initializeResourceNames();
    this.computeManager = computeManager;
}