azure

package
v0.0.0-...-2e5ae1d Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package azure contains the Azure API calls

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session holds the active session login credentials and related settings.

func NewSession

func NewSession(ctx context.Context, principalID string) (*Session, error)

NewSession returns default credentials using the information from the OS environment. TODO: extract the users principal id somehow. Current solution is to extract it with: `az ad signed-in-user show | jq .id`

func (*Session) ActiveRoleAssignment

func (s *Session) ActiveRoleAssignment(subscriptionName, roleDisplayName, justifiction string, duration time.Duration) error

ActiveRoleAssignment will schedule a RoleAssignment for the given roleDisplayName scoped to the subscription.

func (*Session) RolesForSubscription

func (s *Session) RolesForSubscription(subscriptionName string) ([]string, error)

RolesForSubscription lists the available roles that have RoleEligibilitySchedules for the given subscription name.

func (*Session) Subscriptions

func (s *Session) Subscriptions() (map[string]subscriptionID, error)

Subscription returns all enabled subscriptions.

Jump to

Keyboard shortcuts

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