/
azure.go
37 lines (30 loc) · 1.01 KB
/
azure.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package stocker
import (
"fmt"
"github.com/RHEcosystemAppEng/cluster-iq/internal/inventory"
"go.uber.org/zap"
)
// AzureStocker object to make stock on Azure
type AzureStocker struct {
region string
Account inventory.Account
logger *zap.Logger
}
// NewAzureStocker create and returns a pointer to a new AzureStocker instance
func NewAzureStocker(account inventory.Account, logger *zap.Logger) *AzureStocker {
st := AzureStocker{region: "default", logger: logger}
st.Account = *inventory.NewAccount(account.Name, inventory.AzureProvider, account.GetUser(), account.GetPassword())
return &st
}
// MakeStock Scans Azure cloud accounts
func (s AzureStocker) MakeStock() error {
return fmt.Errorf("AzureStocker.MakeStock not implemented")
}
// PrintStock prints by stdout the account object belongs to this stocker
func (s AzureStocker) PrintStock() {
s.Account.PrintAccount()
}
// GetResults resturns the scanned results on this stocker instance
func (s AzureStocker) GetResults() inventory.Account {
return s.Account
}