public final class ResourceManagerUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceManagerUtils.InternalRuntimeContext
The class provides the common methods required for SDK framework.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
createOdataFilterForTags(String tagName,
String tagValue)
Creates an Odata filter string that can be used for filtering list results by tags.
|
static String |
getDefaultScopeFromRequest(com.azure.core.http.HttpRequest request,
com.azure.core.management.AzureEnvironment environment)
Generates default scope for oauth2 from the specific request
|
static String |
getDefaultSubscription(com.azure.core.http.rest.PagedIterable<Subscription> subscriptions)
Gets the only subscription as the default one in the tenant if applicable.
|
static String |
getStorageConnectionString(String accountName,
String accountKey,
com.azure.core.management.AzureEnvironment environment)
Get the Azure storage account connection string.
|
static void |
sleep(Duration duration)
Wrapper for thread sleep.
|
static boolean |
toPrimitiveBoolean(Boolean value)
Converts an object Boolean to a primitive boolean.
|
static int |
toPrimitiveInt(Integer value)
Converts an object Integer to a primitive int.
|
static int |
toPrimitiveInt(Long value)
Converts an object Long to a primitive int.
|
static long |
toPrimitiveLong(Long value)
Converts an object Long to a primitive long.
|
public static boolean toPrimitiveBoolean(Boolean value)
value - the Boolean valuepublic static int toPrimitiveInt(Integer value)
value - the Integer valuepublic static int toPrimitiveInt(Long value)
value - the Long valuepublic static long toPrimitiveLong(Long value)
value - the Long valuepublic static void sleep(Duration duration)
duration - the duration value for which thread should put on sleep.public static String createOdataFilterForTags(String tagName, String tagValue)
tagName - the name of the tag. If not provided, all resources will be returned.tagValue - the value of the tag. If not provided, only tag name will be filtered.public static String getDefaultSubscription(com.azure.core.http.rest.PagedIterable<Subscription> subscriptions)
subscriptions - the list of subscriptionsIllegalStateException - when no subscription or more than one subscription foundpublic static String getDefaultScopeFromRequest(com.azure.core.http.HttpRequest request, com.azure.core.management.AzureEnvironment environment)
request - a http requestenvironment - the azure environment with current requestpublic static String getStorageConnectionString(String accountName, String accountKey, com.azure.core.management.AzureEnvironment environment)
accountName - storage account nameaccountKey - storage account keyenvironment - the Azure environmentCopyright © 2021 Microsoft Corporation. All rights reserved.