Class AzureAccount
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.auth.AzureAccount
-
- All Implemented Interfaces:
com.microsoft.azure.toolkit.lib.account.IAzureAccount,com.microsoft.azure.toolkit.lib.AzureService,com.microsoft.azure.toolkit.lib.common.entity.IAzureModule
public class AzureAccount extends Object implements com.microsoft.azure.toolkit.lib.account.IAzureAccount
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classAzureAccount.SimpleAccount
-
Constructor Summary
Constructors Constructor Description AzureAccount()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Accountaccount()Accountaccount(AccountEntity accountEntity)List<Account>accounts()private static Map<AuthType,java.util.function.Supplier<Account>>buildAccountMap()private AzureAccountfinishLogin(reactor.core.publisher.Mono<Account> mono)private com.azure.resourcemanager.resources.models.SubscriptiongetSubscription(String subscriptionId)List<com.microsoft.azure.toolkit.lib.common.model.Region>listRegions()see doc for: az account list-locations -o tableList<com.microsoft.azure.toolkit.lib.common.model.Region>listRegions(String subscriptionId)see doc for: az account list-locations -o tableAzureAccountlogin(Account targetAccount)AzureAccountlogin(Account targetAccount, boolean enablePersistence)AzureAccountlogin(AuthConfiguration auth)AzureAccountlogin(AuthConfiguration auth, boolean enablePersistence)AzureAccountlogin(AuthType type)AzureAccountlogin(AuthType type, boolean enablePersistence)reactor.core.publisher.Mono<Account>loginAsync(Account targetAccount, boolean enablePersistence)reactor.core.publisher.Mono<Account>loginAsync(AuthConfiguration auth, boolean enablePersistence)reactor.core.publisher.Mono<Account>loginAsync(AuthType type, boolean enablePersistence)voidlogout()private reactor.core.publisher.Mono<Account>restoreLogin(AccountEntity accountEntity)private static com.microsoft.azure.toolkit.lib.common.model.RegiontoRegion(com.azure.core.management.Region region)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
account
private Account account
-
-
Method Detail
-
account
public Account account() throws AzureToolkitAuthenticationException
- Specified by:
accountin interfacecom.microsoft.azure.toolkit.lib.account.IAzureAccount- Returns:
- the current account
- Throws:
AzureToolkitAuthenticationException- if not initialized
-
account
public Account account(@Nonnull AccountEntity accountEntity)
-
login
public AzureAccount login(@Nonnull AuthType type)
-
login
public AzureAccount login(@Nonnull Account targetAccount)
-
login
public AzureAccount login(@Nonnull AuthConfiguration auth)
-
login
public AzureAccount login(@Nonnull AuthType type, boolean enablePersistence)
-
login
public AzureAccount login(@Nonnull Account targetAccount, boolean enablePersistence)
-
login
public AzureAccount login(@Nonnull AuthConfiguration auth, boolean enablePersistence)
-
logout
public void logout()
-
restoreLogin
private reactor.core.publisher.Mono<Account> restoreLogin(@Nonnull AccountEntity accountEntity)
-
loginAsync
public reactor.core.publisher.Mono<Account> loginAsync(@Nonnull AuthType type, boolean enablePersistence)
-
loginAsync
public reactor.core.publisher.Mono<Account> loginAsync(@Nonnull AuthConfiguration auth, boolean enablePersistence)
-
loginAsync
public reactor.core.publisher.Mono<Account> loginAsync(Account targetAccount, boolean enablePersistence)
-
listRegions
@Cacheable(cacheName="Regions", key="$subscriptionId") public List<com.microsoft.azure.toolkit.lib.common.model.Region> listRegions(String subscriptionId)see doc for: az account list-locations -o table- Specified by:
listRegionsin interfacecom.microsoft.azure.toolkit.lib.account.IAzureAccount
-
listRegions
public List<com.microsoft.azure.toolkit.lib.common.model.Region> listRegions()
see doc for: az account list-locations -o table
-
toRegion
private static com.microsoft.azure.toolkit.lib.common.model.Region toRegion(com.azure.core.management.Region region)
-
finishLogin
private AzureAccount finishLogin(reactor.core.publisher.Mono<Account> mono)
-
buildAccountMap
private static Map<AuthType,java.util.function.Supplier<Account>> buildAccountMap()
-
getSubscription
@Cacheable(cacheName="Subscription", key="$subscriptionId") private com.azure.resourcemanager.resources.models.Subscription getSubscription(String subscriptionId)
-
-