azure

package
v0.0.0-...-a8b8e24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RunCommandLinuxShellScript = "RunShellScript"
	RunCommandPowerShellScript = "RunPowerShellScript"
)

Variables

This section is empty.

Functions

func UniqueManager

func UniqueManager(a []*manager.ManagerNode) []*manager.ManagerNode

func UniqueString

func UniqueString(a []string) []string

Types

type Creds

type Creds struct {
	Token          *adal.ServicePrincipalToken
	TenantID       string
	SubscriptionID string
}

func New

func New(clientID string, clientSecret string, tenantID string, subscriptionID string) (Creds, error)

New returns a Creds struct of ServicePrincipalToken and TenantID given azure creds

func (*Creds) GetSubscriptions

func (creds *Creds) GetSubscriptions(ctx context.Context, filters []*common.Filter) ([]*manager.ManagerNode, error)

func (*Creds) GetSubscriptionsForApi

func (creds *Creds) GetSubscriptionsForApi(ctx context.Context, filters []*common.Filter) ([]*manager.ManagerNode, error)

func (*Creds) GetTenantIds

func (creds *Creds) GetTenantIds(ctx context.Context) ([]string, error)

func (*Creds) ListLocations

func (creds *Creds) ListLocations(ctx context.Context, subs []*manager.ManagerNode) ([]string, error)

ListLocations returns an array of all locations for the account

func (*Creds) ListSubscriptions

func (creds *Creds) ListSubscriptions(ctx context.Context) ([]*manager.ManagerNode, error)

ListSubscriptions returns an array of all subscriptions for the account

func (*Creds) ListTags

func (creds *Creds) ListTags(ctx context.Context, subs []*manager.ManagerNode) (map[string][]string, error)

ListTags returns an array of all tags for the account

func (*Creds) QueryApis

func (creds *Creds) QueryApis(ctx context.Context, filters []*common.Filter) (map[string][]*manager.ManagerNode, error)

QueryApis returns an array of ManagerNodes, one for each vm in the account, over all subscriptions

func (*Creds) QueryField

func (creds *Creds) QueryField(ctx context.Context, filters []*common.Filter, field string, mgrType string) ([]string, error)

QueryField returns account tags, locations, subscriptions

func (*Creds) QueryVMState

func (creds *Creds) QueryVMState(ctx context.Context) ([]pgdb.InstanceState, error)

QueryVMState returns an array of ManagerNodes, one for each vm in the account, over all subscriptions

func (*Creds) QueryVMs

func (creds *Creds) QueryVMs(ctx context.Context, filters []*common.Filter) (map[string][]*manager.ManagerNode, error)

QueryVMs returns an array of ManagerNodes, one for each vm in the account, over all subscriptions

func (*Creds) SendRunCommandJob

func (creds *Creds) SendRunCommandJob(ctx context.Context, job *types.InspecJob, script string, scriptType string) error

func (*Creds) TestConnectivity

func (creds *Creds) TestConnectivity(ctx context.Context) error

TestConnectivity tests if we can reach azure and list subscriptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL