package resource
import "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
Index ¶
- Variables
- type ResourceID
- func ParseResourceID(id string) (*ResourceID, error)
- func (id *ResourceID) MarshalText() ([]byte, error)
- func (id *ResourceID) String() string
- func (id *ResourceID) UnmarshalText(text []byte) error
- type ResourceType
- func NewResourceType(providerNamespace, typeName string) ResourceType
- func ParseResourceType(resourceIDOrType string) (ResourceType, error)
- func (t ResourceType) AppendChild(childType string) ResourceType
- func (t ResourceType) IsParentOf(child ResourceType) bool
- func (t ResourceType) String() string
Variables ¶
var ProviderResourceType = NewResourceType(builtInResourceNamespace, "providers")
ProviderResourceType is the ResourceType of a provider
var ResourceGroupResourceType = NewResourceType(builtInResourceNamespace, "resourceGroups")
ResourceGroupResourceType is the ResourceType of a resource group
var RootResourceID = &ResourceID{ Parent: nil, ResourceType: TenantResourceType, Name: "", }
RootResourceID defines the tenant as the root parent of all other ResourceID.
var SubscriptionResourceType = NewResourceType(builtInResourceNamespace, "subscriptions")
SubscriptionResourceType is the ResourceType of a subscription
var TenantResourceType = NewResourceType(builtInResourceNamespace, "tenants")
TenantResourceType is the ResourceType of a tenant
Types ¶
type ResourceID ¶
type ResourceID struct {
// Parent is the parent ResourceID of this instance.
// Can be nil if there is no parent.
Parent *ResourceID
// SubscriptionID is the subscription ID in this resource ID.
// The value can be empty if the resource ID does not contain a subscription ID.
SubscriptionID string
// ResourceGroupName is the resource group name in this resource ID.
// The value can be empty if the resource ID does not contain a resource group name.
ResourceGroupName string
// Provider represents the provider name in this resource ID.
// This is only valid when the resource ID represents a resource provider.
// Example: `/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights`
Provider string
// Location is the location in this resource ID.
// The value can be empty if the resource ID does not contain a location name.
Location string
// ResourceType represents the type of this resource ID.
ResourceType ResourceType
// Name is the resource name of this resource ID.
Name string
// contains filtered or unexported fields
}
ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`. Don't create this type directly, use ParseResourceID instead. Fields are considered immutable and shouldn't be modified after creation.
func ParseResourceID ¶
func ParseResourceID(id string) (*ResourceID, error)
ParseResourceID parses a string to an instance of ResourceID
func (*ResourceID) MarshalText ¶
func (id *ResourceID) MarshalText() ([]byte, error)
MarshalText returns a textual representation of the ResourceID
func (*ResourceID) String ¶
func (id *ResourceID) String() string
String returns the string of the ResourceID
func (*ResourceID) UnmarshalText ¶
func (id *ResourceID) UnmarshalText(text []byte) error
UnmarshalText decodes the textual representation of a ResourceID
type ResourceType ¶
type ResourceType struct {
// Namespace is the namespace of the resource type.
// e.g. "Microsoft.Network" in resource type "Microsoft.Network/virtualNetworks/subnets"
Namespace string
// Type is the full type name of the resource type.
// e.g. "virtualNetworks/subnets" in resource type "Microsoft.Network/virtualNetworks/subnets"
Type string
// Types is the slice of all the sub-types of this resource type.
// e.g. ["virtualNetworks", "subnets"] in resource type "Microsoft.Network/virtualNetworks/subnets"
Types []string
// contains filtered or unexported fields
}
ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets". Don't create this type directly, use ParseResourceType or NewResourceType instead.
func NewResourceType ¶
func NewResourceType(providerNamespace, typeName string) ResourceType
NewResourceType creates an instance of ResourceType using a provider namespace such as "Microsoft.Network" and type such as "virtualNetworks/subnets".
func ParseResourceType ¶
func ParseResourceType(resourceIDOrType string) (ResourceType, error)
ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets) or a resource identifier string. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet)
func (ResourceType) AppendChild ¶
func (t ResourceType) AppendChild(childType string) ResourceType
AppendChild creates an instance of ResourceType using the receiver as the parent with childType appended to it.
func (ResourceType) IsParentOf ¶
func (t ResourceType) IsParentOf(child ResourceType) bool
IsParentOf returns true when the receiver is the parent resource type of the child.
func (ResourceType) String ¶
func (t ResourceType) String() string
String returns the string of the ResourceType
Source Files ¶
resource_identifier.go resource_type.go
- Version
- v1.18.2 (latest)
- Published
- Jul 31, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 8 months ago –
Tools for package owners.