Documentation ¶
Index ¶
- func CancelSubscription(t *testing.T, id *uuid.UUID) error
- func DeleteResourceGroup(ctx context.Context, rgname string, subId uuid.UUID) error
- func GetSubscription(id uuid.UUID) (armsubscription.SubscriptionsClientGetResponse, error)
- func IsSubscriptionInManagementGroup(t *testing.T, id uuid.UUID, mg string) error
- func ListResourceGroup(ctx context.Context, subId uuid.UUID) ([]*armresources.ResourceGroup, error)
- func ListSubnets(rg, vnet string, subid uuid.UUID) ([]*armnetwork.Subnet, error)
- func NewManagementGroupSubscriptionsClient() (*armmanagementgroups.ManagementGroupSubscriptionsClient, error)
- func NewSubnetClient(id uuid.UUID) (*armnetwork.SubnetsClient, error)
- func NewSubscriptionClient() (*armsubscription.Client, error)
- func NewSubscriptionsClient() (*armsubscription.SubscriptionsClient, error)
- func SetSubscriptionManagementGroup(id uuid.UUID, mg string) error
- func SubscriptionExists(id uuid.UUID) (bool, error)
- type OidcCredential
- type OidcCredentialOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelSubscription ¶
CancelSubscription cancels the supplied Azure subscription. it retries a few times as the subscription api is eventually consistent.
func DeleteResourceGroup ¶
DeleteResourceGroup deletes a resource group by name and subscription id
func GetSubscription ¶
func GetSubscription(id uuid.UUID) (armsubscription.SubscriptionsClientGetResponse, error)
GetSubscription checks if the supplied subscription exists and returns it
func IsSubscriptionInManagementGroup ¶
IsSubscriptionInManagementGroup returns true if the subscription is a management group.
func ListResourceGroup ¶
func ListResourceGroup(ctx context.Context, subId uuid.UUID) ([]*armresources.ResourceGroup, error)
ListResourceGroup returns all resource groups in the subscription
func ListSubnets ¶
ListSubnets lists all subnets in the given virtual network.
func NewManagementGroupSubscriptionsClient ¶
func NewManagementGroupSubscriptionsClient() (*armmanagementgroups.ManagementGroupSubscriptionsClient, error)
NewManagementGroupSubscriptionsClient creates a new management group subscriptions client using azidentity.NewDefaultAzureCredential.
func NewSubnetClient ¶
func NewSubnetClient(id uuid.UUID) (*armnetwork.SubnetsClient, error)
NewSubnetClient creates a new subnet client using armnetwork.NewSubnetsClient
func NewSubscriptionClient ¶
func NewSubscriptionClient() (*armsubscription.Client, error)
NewSubscriptionClient creates a new subscription client using azidentity.NewDefaultAzureCredential.
func NewSubscriptionsClient ¶
func NewSubscriptionsClient() (*armsubscription.SubscriptionsClient, error)
NewSubscriptionsClient creates a new subscriptions client using azidentity.NewDefaultAzureCredential.
func SetSubscriptionManagementGroup ¶
SetSubscriptionManagementGroup moves the subscription to the management group.
Types ¶
type OidcCredential ¶
type OidcCredential struct {
// contains filtered or unexported fields
}
OidcCredential contains the fields needed to authenticate to Azure using an OIDC token
func NewOidcCredential ¶
func NewOidcCredential(options *OidcCredentialOptions) (*OidcCredential, error)
NewOidcCredential creates a new OidcCredential
func (*OidcCredential) GetToken ¶
func (w *OidcCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken gets a new token from the credential
type OidcCredentialOptions ¶
type OidcCredentialOptions struct { azcore.ClientOptions TenantID string ClientID string RequestToken string RequestUrl string Token string TokenFilePath string }
OidcCredentialOptions contains the fields needed to create an OidcCredential