client

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MPL-2.0 Imports: 20 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

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

func AzureTestHelper

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

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

func IgnoreAccessDenied

func IgnoreAccessDenied(err error) bool

func ParseSummaryMessage

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

func RedactError

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

func ScopeSubscription(subscriptionID string) string

ScopeSubscription returns a scope for the given subscription

func SingleSubscriptionMultiplex

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

SingleSubscriptionMultiplex can be used in cases where any single subscription would do. This can reduce the number of API calls.

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, servicesSet 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 (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

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