-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move resource group creation to the cluster actuator
- Loading branch information
Showing
7 changed files
with
120 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package resourcemanagement | ||
|
||
import ( | ||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources" | ||
"github.com/Azure/go-autorest/autorest" | ||
"github.com/Azure/go-autorest/autorest/to" | ||
) | ||
|
||
func (s *Service) CreateOrUpdateGroup(resourceGroupName string, location string) (resources.Group, error) { | ||
return s.GroupsClient.CreateOrUpdate(s.ctx, resourceGroupName, resources.Group{Location: to.StringPtr(location)}) | ||
} | ||
|
||
func (s *Service) DeleteGroup(resourceGroupName string) (resources.GroupsDeleteFuture, error) { | ||
return s.GroupsClient.Delete(s.ctx, resourceGroupName) | ||
} | ||
|
||
func (s *Service) CheckGroupExistence(resourceGroupName string) (autorest.Response, error) { | ||
return s.GroupsClient.CheckExistence(s.ctx, resourceGroupName) | ||
} | ||
|
||
func (s *Service) WaitForGroupsFuture(future resources.GroupsDeleteFuture) error { | ||
return future.WaitForCompletionRef(s.ctx, s.GroupsClient.Client) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package resourcemanagement | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources" | ||
"github.com/Azure/go-autorest/autorest" | ||
) | ||
|
||
type Service struct { | ||
GroupsClient resources.GroupsClient | ||
ctx context.Context | ||
} | ||
|
||
func NewService(subscriptionId string) *Service { | ||
return &Service{ | ||
GroupsClient: resources.NewGroupsClient(subscriptionId), | ||
ctx: context.Background(), | ||
} | ||
} | ||
|
||
func (s *Service) SetAuthorizer(authorizer autorest.Authorizer) { | ||
s.GroupsClient.BaseClient.Client.Authorizer = authorizer | ||
} |