More renaming
This commit is contained in:
parent
274dc8283f
commit
4ee5aa6267
14
aci/aci.go
14
aci/aci.go
@ -42,7 +42,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func createACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
func createACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "cannot get container group client")
|
return errors.Wrapf(err, "cannot get container group client")
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ func createACIContainers(ctx context.Context, aciContext store.AciContext, group
|
|||||||
|
|
||||||
func createOrUpdateACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
func createOrUpdateACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
||||||
w := progress.ContextWriter(ctx)
|
w := progress.ContextWriter(ctx)
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "cannot get container group client")
|
return errors.Wrapf(err, "cannot get container group client")
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ func createOrUpdateACIContainers(ctx context.Context, aciContext store.AciContex
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) (containerinstance.ContainerGroup, error) {
|
func getACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) (containerinstance.ContainerGroup, error) {
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return containerinstance.ContainerGroup{}, fmt.Errorf("cannot get container group client: %v", err)
|
return containerinstance.ContainerGroup{}, fmt.Errorf("cannot get container group client: %v", err)
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ func getACIContainerGroup(ctx context.Context, aciContext store.AciContext, cont
|
|||||||
}
|
}
|
||||||
|
|
||||||
func deleteACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) (containerinstance.ContainerGroup, error) {
|
func deleteACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) (containerinstance.ContainerGroup, error) {
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return containerinstance.ContainerGroup{}, fmt.Errorf("cannot get container group client: %v", err)
|
return containerinstance.ContainerGroup{}, fmt.Errorf("cannot get container group client: %v", err)
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ func deleteACIContainerGroup(ctx context.Context, aciContext store.AciContext, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
func stopACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) error {
|
func stopACIContainerGroup(ctx context.Context, aciContext store.AciContext, containerGroupName string) error {
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot get container group client: %v", err)
|
return fmt.Errorf("cannot get container group client: %v", err)
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ func stopACIContainerGroup(ctx context.Context, aciContext store.AciContext, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
func execACIContainer(ctx context.Context, aciContext store.AciContext, command, containerGroup string, containerName string) (c containerinstance.ContainerExecResponse, err error) {
|
func execACIContainer(ctx context.Context, aciContext store.AciContext, command, containerGroup string, containerName string) (c containerinstance.ContainerExecResponse, err error) {
|
||||||
containerClient, err := login.GetContainerClient(aciContext.SubscriptionID)
|
containerClient, err := login.NewContainerClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c, errors.Wrapf(err, "cannot get container client")
|
return c, errors.Wrapf(err, "cannot get container client")
|
||||||
}
|
}
|
||||||
@ -245,7 +245,7 @@ func exec(ctx context.Context, address string, password string, request containe
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getACIContainerLogs(ctx context.Context, aciContext store.AciContext, containerGroupName, containerName string, tail *int32) (string, error) {
|
func getACIContainerLogs(ctx context.Context, aciContext store.AciContext, containerGroupName, containerName string, tail *int32) (string, error) {
|
||||||
containerClient, err := login.GetContainerClient(aciContext.SubscriptionID)
|
containerClient, err := login.NewContainerClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrapf(err, "cannot get container client")
|
return "", errors.Wrapf(err, "cannot get container client")
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ type aciContainerService struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cs *aciContainerService) List(ctx context.Context, all bool) ([]containers.Container, error) {
|
func (cs *aciContainerService) List(ctx context.Context, all bool) ([]containers.Container, error) {
|
||||||
groupsClient, err := login.GetContainerGroupsClient(cs.ctx.SubscriptionID)
|
groupsClient, err := login.NewContainerGroupsClient(cs.ctx.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -232,7 +232,7 @@ func (cs *aciContainerService) Start(ctx context.Context, containerID string) er
|
|||||||
return errors.New(fmt.Sprintf(msg, containerName, groupName, groupName))
|
return errors.New(fmt.Sprintf(msg, containerName, groupName, groupName))
|
||||||
}
|
}
|
||||||
|
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(cs.ctx.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(cs.ctx.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ func (cs *aciContainerService) Delete(ctx context.Context, containerID string, r
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !request.Force {
|
if !request.Force {
|
||||||
containerGroupsClient, err := login.GetContainerGroupsClient(cs.ctx.SubscriptionID)
|
containerGroupsClient, err := login.NewContainerGroupsClient(cs.ctx.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
const userAgent = "docker-cli"
|
const userAgent = "docker-cli"
|
||||||
|
|
||||||
// GetContainerGroupsClient get client toi manipulate containerGrouos
|
// NewContainerGroupsClient get client toi manipulate containerGrouos
|
||||||
func GetContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) {
|
func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) {
|
||||||
containerGroupsClient := containerinstance.NewContainerGroupsClient(subscriptionID)
|
containerGroupsClient := containerinstance.NewContainerGroupsClient(subscriptionID)
|
||||||
err := setupClient(&containerGroupsClient.Client)
|
err := setupClient(&containerGroupsClient.Client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -38,8 +38,8 @@ func setupClient(aciClient *autorest.Client) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetStorageAccountsClient get client to manipulate storage accounts
|
// NewStorageAccountsClient get client to manipulate storage accounts
|
||||||
func GetStorageAccountsClient(subscriptionID string) (storage.AccountsClient, error) {
|
func NewStorageAccountsClient(subscriptionID string) (storage.AccountsClient, error) {
|
||||||
containerGroupsClient := storage.NewAccountsClient(subscriptionID)
|
containerGroupsClient := storage.NewAccountsClient(subscriptionID)
|
||||||
err := setupClient(&containerGroupsClient.Client)
|
err := setupClient(&containerGroupsClient.Client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -51,8 +51,8 @@ func GetStorageAccountsClient(subscriptionID string) (storage.AccountsClient, er
|
|||||||
return containerGroupsClient, nil
|
return containerGroupsClient, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSubscriptionsClient get subscription client
|
// NewSubscriptionsClient get subscription client
|
||||||
func GetSubscriptionsClient() (subscription.SubscriptionsClient, error) {
|
func NewSubscriptionsClient() (subscription.SubscriptionsClient, error) {
|
||||||
subc := subscription.NewSubscriptionsClient()
|
subc := subscription.NewSubscriptionsClient()
|
||||||
err := setupClient(&subc.Client)
|
err := setupClient(&subc.Client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -61,8 +61,8 @@ func GetSubscriptionsClient() (subscription.SubscriptionsClient, error) {
|
|||||||
return subc, nil
|
return subc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGroupsClient get client to manipulate groups
|
// NewGroupsClient get client to manipulate groups
|
||||||
func GetGroupsClient(subscriptionID string) (resources.GroupsClient, error) {
|
func NewGroupsClient(subscriptionID string) (resources.GroupsClient, error) {
|
||||||
groupsClient := resources.NewGroupsClient(subscriptionID)
|
groupsClient := resources.NewGroupsClient(subscriptionID)
|
||||||
err := setupClient(&groupsClient.Client)
|
err := setupClient(&groupsClient.Client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -71,8 +71,8 @@ func GetGroupsClient(subscriptionID string) (resources.GroupsClient, error) {
|
|||||||
return groupsClient, nil
|
return groupsClient, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetContainerClient get client to manipulate containers
|
// NewContainerClient get client to manipulate containers
|
||||||
func GetContainerClient(subscriptionID string) (containerinstance.ContainerClient, error) {
|
func NewContainerClient(subscriptionID string) (containerinstance.ContainerClient, error) {
|
||||||
containerClient := containerinstance.NewContainerClient(subscriptionID)
|
containerClient := containerinstance.NewContainerClient(subscriptionID)
|
||||||
err := setupClient(&containerClient.Client)
|
err := setupClient(&containerClient.Client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -17,7 +17,7 @@ type StorageAccountHelper struct {
|
|||||||
|
|
||||||
// GetAzureStorageAccountKey retrieves the storage account ket from the current azure login
|
// GetAzureStorageAccountKey retrieves the storage account ket from the current azure login
|
||||||
func (helper StorageAccountHelper) GetAzureStorageAccountKey(ctx context.Context, accountName string) (string, error) {
|
func (helper StorageAccountHelper) GetAzureStorageAccountKey(ctx context.Context, accountName string) (string, error) {
|
||||||
client, err := GetStorageAccountsClient(helper.AciContext.SubscriptionID)
|
client, err := NewStorageAccountsClient(helper.AciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
@ -45,7 +45,7 @@ func NewACIResourceGroupHelper() ResourceGroupHelper {
|
|||||||
|
|
||||||
// GetGroup get a resource group from its name
|
// GetGroup get a resource group from its name
|
||||||
func (mgt aciResourceGroupHelperImpl) GetGroup(ctx context.Context, subscriptionID string, groupName string) (resources.Group, error) {
|
func (mgt aciResourceGroupHelperImpl) GetGroup(ctx context.Context, subscriptionID string, groupName string) (resources.Group, error) {
|
||||||
gc, err := login.GetGroupsClient(subscriptionID)
|
gc, err := login.NewGroupsClient(subscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resources.Group{}, err
|
return resources.Group{}, err
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ func (mgt aciResourceGroupHelperImpl) GetGroup(ctx context.Context, subscription
|
|||||||
|
|
||||||
// ListGroups list resource groups
|
// ListGroups list resource groups
|
||||||
func (mgt aciResourceGroupHelperImpl) ListGroups(ctx context.Context, subscriptionID string) ([]resources.Group, error) {
|
func (mgt aciResourceGroupHelperImpl) ListGroups(ctx context.Context, subscriptionID string) ([]resources.Group, error) {
|
||||||
gc, err := login.GetGroupsClient(subscriptionID)
|
gc, err := login.NewGroupsClient(subscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ func (mgt aciResourceGroupHelperImpl) ListGroups(ctx context.Context, subscripti
|
|||||||
|
|
||||||
// CreateOrUpdate create or update a resource group
|
// CreateOrUpdate create or update a resource group
|
||||||
func (mgt aciResourceGroupHelperImpl) CreateOrUpdate(ctx context.Context, subscriptionID string, resourceGroupName string, parameters resources.Group) (result resources.Group, err error) {
|
func (mgt aciResourceGroupHelperImpl) CreateOrUpdate(ctx context.Context, subscriptionID string, resourceGroupName string, parameters resources.Group) (result resources.Group, err error) {
|
||||||
gc, err := login.GetGroupsClient(subscriptionID)
|
gc, err := login.NewGroupsClient(subscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resources.Group{}, err
|
return resources.Group{}, err
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ func (mgt aciResourceGroupHelperImpl) CreateOrUpdate(ctx context.Context, subscr
|
|||||||
|
|
||||||
// DeleteAsync deletes a resource group. Does not wait for full deletion to return (long operation)
|
// DeleteAsync deletes a resource group. Does not wait for full deletion to return (long operation)
|
||||||
func (mgt aciResourceGroupHelperImpl) DeleteAsync(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
|
func (mgt aciResourceGroupHelperImpl) DeleteAsync(ctx context.Context, subscriptionID string, resourceGroupName string) (err error) {
|
||||||
gc, err := login.GetGroupsClient(subscriptionID)
|
gc, err := login.NewGroupsClient(subscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ func (mgt aciResourceGroupHelperImpl) DeleteAsync(ctx context.Context, subscript
|
|||||||
|
|
||||||
// GetSubscriptionIDs Return available subscription IDs based on azure login
|
// GetSubscriptionIDs Return available subscription IDs based on azure login
|
||||||
func (mgt aciResourceGroupHelperImpl) GetSubscriptionIDs(ctx context.Context) ([]subscription.Model, error) {
|
func (mgt aciResourceGroupHelperImpl) GetSubscriptionIDs(ctx context.Context) ([]subscription.Model, error) {
|
||||||
c, err := login.GetSubscriptionsClient()
|
c, err := login.NewSubscriptionsClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user