use of com.microsoft.azure.management.resources.fluentcore.arm.Region in project azure-tools-for-java by Microsoft.
the class AzureNewDockerHostStep method updateDockerLocationGroup.
private void updateDockerLocationGroup() {
AzureDockerSubscription currentSubscription = (AzureDockerSubscription) dockerSubscriptionComboBox.getSelectedItem();
updateDockerLocationComboBox(currentSubscription);
dockerLocationComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
AzureDockerSubscription currentSubscription = (AzureDockerSubscription) dockerSubscriptionComboBox.getSelectedItem();
// updateDockerHostSelectRGComboBox(currentSubscription);
String region = (String) dockerLocationComboBox.getSelectedItem();
if (!region.equals(SELECT_REGION)) {
Region regionObj = Region.findByLabelOrName(region);
String selectedRegion = regionObj != null ? regionObj.name() : region;
if (preferredLocation == null && selectedRegion != null) {
// remove the SELECT_REGION entry (first entry in the list)
dockerLocationComboBox.removeItemAt(0);
dockerLocationLabel.setVisible(false);
}
preferredLocation = selectedRegion;
updateDockerSelectVnetComboBox(currentSubscription, selectedRegion);
setDialogButtonsState(doValidate(false) == null);
} else {
updateDockerSelectVnetComboBox(currentSubscription, null);
setDialogButtonsState(false);
}
updateDockerHostVMSizeComboBox(dockerHostVMPreferredSizesCheckBox.isSelected());
}
});
}
use of com.microsoft.azure.management.resources.fluentcore.arm.Region in project azure-sdk-for-java by Azure.
the class ServiceBusOperationsTests method canCRUDOnSimpleNamespace.
@Test
public void canCRUDOnSimpleNamespace() {
Region region = Region.US_EAST;
Creatable<ResourceGroup> rgCreatable = resourceManager.resourceGroups().define(RG_NAME).withRegion(region);
String namespaceDNSLabel = generateRandomResourceName("jvsbns", 15);
serviceBusManager.namespaces().define(namespaceDNSLabel).withRegion(region).withNewResourceGroup(rgCreatable).withSku(NamespaceSku.PREMIUM_CAPACITY1).create();
ServiceBusNamespace namespace = serviceBusManager.namespaces().getByResourceGroup(RG_NAME, namespaceDNSLabel);
Assert.assertNotNull(namespace);
Assert.assertNotNull(namespace.inner());
PagedList<ServiceBusNamespace> namespaces = serviceBusManager.namespaces().listByResourceGroup(RG_NAME);
Assert.assertNotNull(namespaces);
Assert.assertTrue(namespaces.size() > 0);
boolean found = false;
for (ServiceBusNamespace n : namespaces) {
if (n.name().equalsIgnoreCase(namespace.name())) {
found = true;
break;
}
}
Assert.assertTrue(found);
Assert.assertNotNull(namespace.dnsLabel());
Assert.assertTrue(namespace.dnsLabel().equalsIgnoreCase(namespaceDNSLabel));
Assert.assertNotNull(namespace.fqdn());
Assert.assertTrue(namespace.fqdn().contains(namespaceDNSLabel));
Assert.assertNotNull(namespace.sku());
Assert.assertTrue(namespace.sku().equals(NamespaceSku.PREMIUM_CAPACITY1));
Assert.assertNotNull(namespace.region());
Assert.assertTrue(namespace.region().equals(region));
Assert.assertNotNull(namespace.resourceGroupName());
Assert.assertTrue(namespace.resourceGroupName().equalsIgnoreCase(RG_NAME));
Assert.assertNotNull(namespace.createdAt());
Assert.assertNotNull(namespace.queues());
Assert.assertEquals(0, namespace.queues().list().size());
Assert.assertNotNull(namespace.topics());
Assert.assertEquals(0, namespace.topics().list().size());
Assert.assertNotNull(namespace.authorizationRules());
PagedList<NamespaceAuthorizationRule> defaultNsRules = namespace.authorizationRules().list();
Assert.assertEquals(1, defaultNsRules.size());
NamespaceAuthorizationRule defaultNsRule = defaultNsRules.get(0);
Assert.assertTrue(defaultNsRule.name().equalsIgnoreCase("RootManageSharedAccessKey"));
Assert.assertNotNull(defaultNsRule.rights());
Assert.assertNotNull(defaultNsRule.namespaceName());
Assert.assertTrue(defaultNsRule.namespaceName().equalsIgnoreCase(namespaceDNSLabel));
Assert.assertNotNull(defaultNsRule.resourceGroupName());
Assert.assertTrue(defaultNsRule.resourceGroupName().equalsIgnoreCase(RG_NAME));
namespace.update().withSku(NamespaceSku.PREMIUM_CAPACITY2).apply();
Assert.assertTrue(namespace.sku().equals(NamespaceSku.PREMIUM_CAPACITY2));
// TODO: There is a bug in LRO implementation of ServiceBusNamespace DELETE operation (Last poll returns 404, reported this to RP]
//
// serviceBusManager.namespaces().deleteByGroup(RG_NAME, namespace.name());
}
Aggregations