client

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnapshotsDirPath   = "./snapshots"
	TestSubscriptionID = "test_sub"
	FakeResourceGroup  = "" /* 130-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func AzureMockTestHelper added in v0.3.9

func AzureMockTestHelper(t *testing.T, table *schema.Table, builder func(*testing.T, *gomock.Controller) services.Services, options TestOptions)

func AzureTestHelper added in v0.3.9

func AzureTestHelper(t *testing.T, table *schema.Table)

func Configure

func Configure(logger hclog.Logger, config interface{}) (schema.ClientMeta, diag.Diagnostics)

func DeleteSubscriptionFilter

func DeleteSubscriptionFilter(meta schema.ClientMeta, _ *schema.Resource) []interface{}

func ErrorClassifier added in v0.5.0

func ErrorClassifier(meta schema.ClientMeta, resourceName string, err error) diag.Diagnostics

func IgnoreAccessDenied added in v0.8.0

func IgnoreAccessDenied(err error) bool

func ParseSummaryMessage added in v0.5.0

func ParseSummaryMessage(subscriptionId string, err error, detailedError autorest.DetailedError) diag.BaseErrorOption

func RedactError added in v0.5.0

func RedactError(subId string, e diag.Diagnostic) diag.Diagnostic

RedactError redacts a given diagnostic and returns a RedactedDiagnostic containing both original and redacted versions

func ResolveAzureSubscription

func ResolveAzureSubscription(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error

func ScopeSubscription added in v0.3.0

func ScopeSubscription(subscriptionID string) string

ScopeSubscription returns a scope for the given subscription

func SubscriptionMultiplex

func SubscriptionMultiplex(meta schema.ClientMeta) []schema.ClientMeta

Types

type Client

type Client struct {

	// this is set by table client multiplexer
	SubscriptionId string
	// contains filtered or unexported fields
}

func NewAzureClient

func NewAzureClient(log hclog.Logger, subscriptionId []string) *Client

func (Client) Logger

func (c Client) Logger() hclog.Logger

func (Client) Services

func (c Client) Services() *services.Services

Services returns all available services of client, returns subscriptionId's specific services

func (*Client) SetSubscriptionServices

func (c *Client) SetSubscriptionServices(subscriptionId string, services services.Services)

SetSubscriptionServices adds a set of services to an azure subscription

type Config

type Config struct {
	Subscriptions []string `hcl:"subscriptions,optional"`
}

func (Config) Example

func (c Config) Example() string

type ResourceDetails

type ResourceDetails struct {
	Subscription  string
	ResourceGroup string
	Provider      string
	ResourceType  string
	ResourceName  string
}

ResourceDetails contains details about an Azure resource

func ParseResourceID

func ParseResourceID(resourceID string) (ResourceDetails, error)

ParseResourceID parses a resource ID into a ResourceDetails struct

type TestOptions added in v0.3.9

type TestOptions struct {
	SkipEmptyJsonB bool
}

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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