public final class ResourceUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
constructResourceId(String subscriptionId,
String resourceGroupName,
String resourceProviderNamespace,
String resourceType,
String resourceName,
String parentResourcePath)
Creates a resource ID from information of a generic resource.
|
static String |
defaultApiVersion(String id,
Provider provider)
Find out the default api version to make a REST request with from
the resource provider.
|
static String |
extractFromResourceId(String id,
String identifier)
Extract information from a resource ID string with the resource type
as the identifier.
|
static String |
groupFromResourceId(String id)
Extract resource group from a resource ID string.
|
static String |
nameFromResourceId(String id)
Extract name of the resource from a resource ID.
|
static String |
parentRelativePathFromResourceId(String id)
Extract parent resource path from a resource ID string.
|
static String |
parentResourceIdFromResourceId(String id)
Extract parent resource ID from a resource ID string.
|
static String |
relativePathFromResourceId(String id)
Extract the relative path to the current resource provider.
|
static String |
resourceProviderFromResourceId(String id)
Extract resource provider from a resource ID string.
|
static String |
resourceTypeFromResourceId(String id)
Extract resource type from a resource ID string.
|
static String |
subscriptionFromResourceId(String id)
Extract the subscription ID from a resource ID string.
|
public static String groupFromResourceId(String id)
id
- the resource ID stringpublic static String subscriptionFromResourceId(String id)
id
- the resource ID stringpublic static String resourceProviderFromResourceId(String id)
id
- the resource ID stringpublic static String resourceTypeFromResourceId(String id)
id
- the resource ID stringpublic static String parentResourceIdFromResourceId(String id)
id
- the resource ID stringpublic static String parentRelativePathFromResourceId(String id)
id
- the resource ID stringpublic static String relativePathFromResourceId(String id)
id
- the id of the resourcepublic static String extractFromResourceId(String id, String identifier)
id
- the resource IDidentifier
- the identifier to match, e.g. "resourceGroups", "storageAccounts"public static String nameFromResourceId(String id)
id
- the resource IDpublic static String defaultApiVersion(String id, Provider provider)
id
- the resource IDprovider
- the resource providerpublic static String constructResourceId(String subscriptionId, String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName, String parentResourcePath)
subscriptionId
- the subscription UUIDresourceGroupName
- the resource group nameresourceProviderNamespace
- the resource provider namespaceresourceType
- the type of the resource or nested resourceresourceName
- name of the resource or nested resourceparentResourcePath
- parent resource's relative path to the provider,
if the resource is a generic resourceCopyright © 2019. All rights reserved.