Search in sources :

Example 61 with AzureManager

use of com.microsoft.azuretools.sdkmanage.AzureManager in project azure-tools-for-java by Microsoft.

the class ClusterOperationImpl method requestWithToken.

@NotNull
public <T> T requestWithToken(@NotNull String tenantId, @NotNull final RequestCallback<T> requestCallback) throws Throwable {
    AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
    // not signed in
    if (azureManager == null) {
        return null;
    }
    String accessToken = azureManager.getAccessToken(tenantId);
    return requestCallback.execute(accessToken);
}
Also used : AzureManager(com.microsoft.azuretools.sdkmanage.AzureManager) NotNull(com.microsoft.azuretools.azurecommons.helpers.NotNull)

Aggregations

AzureManager (com.microsoft.azuretools.sdkmanage.AzureManager)61 Azure (com.microsoft.azure.management.Azure)17 SubscriptionManager (com.microsoft.azuretools.authmanage.SubscriptionManager)16 AzureCmdException (com.microsoft.azuretools.azurecommons.helpers.AzureCmdException)14 SubscriptionDetail (com.microsoft.azuretools.authmanage.models.SubscriptionDetail)12 Subscription (com.microsoft.azure.toolkit.lib.common.model.Subscription)9 AzureDockerHostsManager (com.microsoft.azure.docker.AzureDockerHostsManager)8 ResourceGroup (com.microsoft.azure.management.resources.ResourceGroup)8 DockerHost (com.microsoft.azure.docker.model.DockerHost)6 IOException (java.io.IOException)5 AuthMethodManager (com.microsoft.azuretools.authmanage.AuthMethodManager)4 ArrayList (java.util.ArrayList)4 AzureDockerImageInstance (com.microsoft.azure.docker.model.AzureDockerImageInstance)3 EditableDockerHost (com.microsoft.azure.docker.model.EditableDockerHost)3 VirtualMachine (com.microsoft.azure.management.compute.VirtualMachine)3 Network (com.microsoft.azure.management.network.Network)3 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)3 File (java.io.File)3 HashMap (java.util.HashMap)3 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)2