Documentation ¶
Index ¶
- func Cleanup(ctx context.Context) error
- func CreateGroup(ctx context.Context, groupName string) (resources.Group, error)
- func CreateGroupWithAuthFile(ctx context.Context, groupName string) (resources.Group, error)
- func DeleteAllGroupsWithPrefix(ctx context.Context, prefix string) (futures []resources.GroupsDeleteFuture, groups []string)
- func DeleteGroup(ctx context.Context, groupName string) (result resources.GroupsDeleteFuture, err error)
- func GetGroup(ctx context.Context) (resources.Group, error)
- func ListGroups(ctx context.Context) (resources.GroupListResultIterator, error)
- func WaitForDeleteCompletion(ctx context.Context, wg *sync.WaitGroup, ...)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGroup ¶
CreateGroup creates a new resource group named by env var
Example ¶
helpers.SetResourceGroupName("CreateGroup") defer Cleanup(context.Background()) _, err := CreateGroup(context.Background(), helpers.ResourceGroupName()) if err != nil { helpers.PrintAndLog(err.Error()) } helpers.PrintAndLog("resource group created")
Output: resource group created
func CreateGroupWithAuthFile ¶
CreateGroupWithAuthFile creates a new resource group. The client authorizer is set up based on an auth file created using the Azure CLI.
Example ¶
helpers.SetResourceGroupName("CreateGroupWithAuthFile") defer Cleanup(context.Background()) _, err := CreateGroupWithAuthFile(context.Background(), helpers.ResourceGroupName()) if err != nil { helpers.PrintAndLog(err.Error()) } helpers.PrintAndLog("resource group created, authentication was set up with an Azure CLI auth file")
Output: resource group created, authentication was set up with an Azure CLI auth file
func DeleteAllGroupsWithPrefix ¶
func DeleteAllGroupsWithPrefix(ctx context.Context, prefix string) (futures []resources.GroupsDeleteFuture, groups []string)
DeleteAllGroupsWithPrefix deletes all rescource groups that start with a certain prefix
func DeleteGroup ¶
func DeleteGroup(ctx context.Context, groupName string) (result resources.GroupsDeleteFuture, err error)
DeleteGroup removes the resource group named by env var
func ListGroups ¶
func ListGroups(ctx context.Context) (resources.GroupListResultIterator, error)
ListGroups gets an interator that gets all resource groups in the subscription
func WaitForDeleteCompletion ¶
func WaitForDeleteCompletion(ctx context.Context, wg *sync.WaitGroup, futures []resources.GroupsDeleteFuture, groups []string)
WaitForDeleteCompletion concurrently waits for delete group operations to finish
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.