C# Class Microsoft.Azure.Commands.ResourceManager.Cmdlets.Components.ResourceIdUtility

Class for building and parsing resource Ids.
ファイルを表示 Open project: Azure/azure-powershell Class Usage Examples

Public Methods

Method Description
GetExtensionProviderNamespace ( string resourceId ) : string

Gets the extension provider namespace from the resource id.

GetExtensionResourceName ( string resourceId ) : string

Gets a resource name

GetExtensionResourceType ( string resourceId, bool includeProviderNamespace = true ) : string

Gets a resource type

GetProviderNamespace ( string resourceId ) : string

Gets the provider namespace from the resource id.

GetResourceCollectionId ( System.Guid subscriptionId, string resourceGroupName, string resourceType, string extensionResourceType = null ) : string

Processes the parameters to return a valid resource collection Id.

GetResourceGroupId ( string resourceId ) : string

Gets the id of the resource group from the resource id.

GetResourceGroupName ( string resourceId ) : string

Gets the name of the resource group from the resource id.

GetResourceGroupsId ( System.Guid subscriptionId ) : string

Processes the parameters to return a valid resource Id.

GetResourceId ( System.Guid subscriptionId, string resourceGroupName, string parentResource, string resourceType, string resourceName ) : string

Processes the parameters to return a valid resource Id.

GetResourceId ( System.Guid subscriptionId, string resourceGroupName, string resourceType, string resourceName, string extensionResourceType = null, string extensionResourceName = null ) : string

Processes the parameters to return a valid resource Id.

GetResourceId ( string resourceId, string extensionResourceType, string extensionResourceName = null ) : string

Processes the parameters to return a valid resource Id.

GetResourceName ( string resourceId ) : string

Gets a resource name

GetResourceType ( string resourceId, bool includeProviderNamespace = true ) : string

Gets a resource type

GetSubscriptionId ( string resourceId ) : string

Gets the subscription id from the resource id.

Private Methods

Method Description
GetExtensionResourceTypeOrName ( string resourceId, bool getResourceName, bool includeProviderNamespace = true ) : string

Gets either a resource type or resource Id based on the value of the getResourceName parameter.

GetNextSegmentAfter ( string resourceId, string segmentName, bool selectLastSegment = false ) : string

Gets the next segment after the one specified in segmentName.

GetProviderFromLegacyResourceTypeString ( string legacyResourceType ) : string

Gets the provider from the resource type for the legacy resource id format.

GetResourceTypeOrName ( string resourceId, bool getResourceName, bool includeProviderNamespace = true, bool useLastSegment = false ) : string

Gets either a resource type or resource Id based on the value of the getResourceName parameter.

GetSubstringAfterSegment ( string resourceId, string segmentName, bool selectLastSegment = true ) : string

Gets a the substring after a segment.

GetTypeFromLegacyResourceTypeString ( string legacyResourceType ) : string

Gets the resource type from the resource type for the legacy resource id format.

IsExtensionResourceId ( string resourceId ) : bool

Checks whether a resource id contains an extension resource.

ProcessResourceTypeAndName ( string resourceType, string resourceName ) : string

Processes a resource type string and a resource name string and

Method Details

GetExtensionProviderNamespace() public static method

Gets the extension provider namespace from the resource id.
public static GetExtensionProviderNamespace ( string resourceId ) : string
resourceId string The resource id.
return string

GetExtensionResourceName() public static method

Gets a resource name
public static GetExtensionResourceName ( string resourceId ) : string
resourceId string The resource Id.
return string

GetExtensionResourceType() public static method

Gets a resource type
public static GetExtensionResourceType ( string resourceId, bool includeProviderNamespace = true ) : string
resourceId string The resource Id.
includeProviderNamespace bool Indicates if the provider namespace should be included in the resource name.
return string

GetProviderNamespace() public static method

Gets the provider namespace from the resource id.
public static GetProviderNamespace ( string resourceId ) : string
resourceId string The resource id.
return string

GetResourceCollectionId() public static method

Processes the parameters to return a valid resource collection Id.
public static GetResourceCollectionId ( System.Guid subscriptionId, string resourceGroupName, string resourceType, string extensionResourceType = null ) : string
subscriptionId System.Guid The subscription.
resourceGroupName string The resource group
resourceType string The resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'
extensionResourceType string The extension resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'
return string

GetResourceGroupId() public static method

Gets the id of the resource group from the resource id.
public static GetResourceGroupId ( string resourceId ) : string
resourceId string The resource id.
return string

GetResourceGroupName() public static method

Gets the name of the resource group from the resource id.
public static GetResourceGroupName ( string resourceId ) : string
resourceId string The resource id.
return string

GetResourceGroupsId() public static method

Processes the parameters to return a valid resource Id.
public static GetResourceGroupsId ( System.Guid subscriptionId ) : string
subscriptionId System.Guid The subscription.
return string

GetResourceId() public static method

Processes the parameters to return a valid resource Id.
public static GetResourceId ( System.Guid subscriptionId, string resourceGroupName, string parentResource, string resourceType, string resourceName ) : string
subscriptionId System.Guid The subscription.
resourceGroupName string The resource group
parentResource string The parent resource in the format: '{resourceType}/{typeName}'
resourceType string The resource type string in the format: '{providerName}/{typeName}'
resourceName string The resource name in the format: '{resourceName}'
return string

GetResourceId() public static method

Processes the parameters to return a valid resource Id.
public static GetResourceId ( System.Guid subscriptionId, string resourceGroupName, string resourceType, string resourceName, string extensionResourceType = null, string extensionResourceName = null ) : string
subscriptionId System.Guid The subscription.
resourceGroupName string The resource group
resourceType string The resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'
resourceName string The resource name in the format: '{resourceName}[/{nestedResourceName}]'
extensionResourceType string The extension resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'
extensionResourceName string The extension resource name in the format: '{resourceName}[/{nestedResourceName}]'
return string

GetResourceId() public static method

Processes the parameters to return a valid resource Id.
public static GetResourceId ( string resourceId, string extensionResourceType, string extensionResourceName = null ) : string
resourceId string The resource Id.
extensionResourceType string The extension resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'
extensionResourceName string The extension resource name in the format: '{resourceName}[/{nestedResourceName}]'
return string

GetResourceName() public static method

Gets a resource name
public static GetResourceName ( string resourceId ) : string
resourceId string The resource Id.
return string

GetResourceType() public static method

Gets a resource type
public static GetResourceType ( string resourceId, bool includeProviderNamespace = true ) : string
resourceId string The resource Id.
includeProviderNamespace bool Indicates if the provider namespace should be included in the resource name.
return string

GetSubscriptionId() public static method

Gets the subscription id from the resource id.
public static GetSubscriptionId ( string resourceId ) : string
resourceId string The resource id.
return string