use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class ManageVirtualMachinesInParallelWithNetwork method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BASIC).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class ManageVirtualNetwork method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BODY).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class ManageNetworkSecurityGroup method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BASIC).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-tools-for-java by Microsoft.
the class AzureSelectDockerHostStep method onRemoveDockerHostAction.
private void onRemoveDockerHostAction() {
DefaultTableModel tableModel = (DefaultTableModel) dockerHostsTable.getModel();
String apiURL = (String) tableModel.getValueAt(dockerHostsTable.getSelectedRow(), 4);
DockerHost deleteHost = dockerManager.getDockerHostForURL(apiURL);
Azure azureClient = dockerManager.getSubscriptionsMap().get(deleteHost.sid).azureClient;
int option = AzureDockerUIResources.deleteAzureDockerHostConfirmationDialog(azureClient, deleteHost);
if (option != 1 && option != 2) {
if (AzureDockerUtils.DEBUG)
System.out.format("User canceled delete Docker host op: %d\n", option);
return;
}
AppInsightsClient.createByType(AppInsightsClient.EventType.DockerHost, deleteHost.name, "Remove");
int currentRow = dockerHostsTable.getSelectedRow();
tableModel.removeRow(currentRow);
tableModel.fireTableDataChanged();
if (dockerHostsTableSelection.row == currentRow) {
dockerHostsTableSelection = null;
}
AzureDockerUIResources.deleteDockerHost(model.getProject(), azureClient, deleteHost, option, new Runnable() {
@Override
public void run() {
dockerManager.refreshDockerHostDetails();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
refreshDockerHostsTable();
}
});
}
});
setFinishButtonState(doValidate(false) == null);
setNextButtonState(doValidate(false) == null);
}
use of com.microsoft.azure.management.Azure in project azure-tools-for-java by Microsoft.
the class CreateRedisCacheForm method onOK.
private void onOK() {
try {
Azure azure = azureManager.getAzure(currentSub.getSubscriptionId());
setSubscription(currentSub);
ProcessingStrategy processor = RedisCacheUtil.doGetProcessor(azure, skus, redisCacheNameValue, selectedLocationValue, selectedResGrpValue, selectedPriceTierValue, noSSLPort, newResGrp);
ExecutorService executor = Executors.newSingleThreadExecutor();
ListeningExecutorService executorService = MoreExecutors.listeningDecorator(executor);
ListenableFuture<Void> futureTask = executorService.submit(new CreateRedisCallable(processor));
final ProcessingStrategy processorInner = processor;
Futures.addCallback(futureTask, new FutureCallback<Void>() {
@Override
public void onSuccess(Void arg0) {
if (onCreate != null) {
onCreate.run();
}
}
@Override
public void onFailure(Throwable throwable) {
JOptionPane.showMessageDialog(null, throwable.getMessage(), "Error occurred when creating Redis Cache: " + redisCacheNameValue, JOptionPane.ERROR_MESSAGE, null);
try {
// notify the waitting thread the thread being waited incurred exception to clear blocking queue
processorInner.notifyCompletion();
} catch (InterruptedException ex) {
String msg = String.format(CREATING_ERROR_INDICATOR, "notifyCompletion", ex.getMessage());
PluginUtil.displayErrorDialogAndLog(message("errTtl"), msg, ex);
}
}
});
close(DialogWrapper.OK_EXIT_CODE, true);
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations