akamai

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package akamai allows to initialize and set up Akamai Provider

Index

Constants

View Source
const (
	// ProviderRegistryPath is the path for the provider in the terraform registry
	ProviderRegistryPath = "registry.terraform.io/akamai/akamai"

	// ProviderName is the legacy name of the provider
	// Deprecated: terrform now uses registry paths, the shortest of which would be akamai/akamai"
	ProviderName = "terraform-provider-akamai"

	// ConfigurationIsNotSpecified is the message for when EdgeGrid configuration is not specified
	ConfigurationIsNotSpecified = "" /* 325-byte string literal not displayed */
)
View Source
const (
	DefaultTimestampFormat = "2006/01/02 03:04:05"
)

2020/12/02 11:51:03

View Source
const TFTestTempDir = "./test_tmp"

TFTestTempDir specifies the location of tmp directory which will be used by provider SDK's testing framework

Variables

View Source
var (
	// ErrDuplicateSchemaKey is returned when a duplicate schema key is detected during merge
	ErrDuplicateSchemaKey = &Error{"duplicate schema key", false}

	// ErrCacheEntryNotFound returns a cache entry error
	ErrCacheEntryNotFound = &Error{"cache entry not found", true}

	// ErrCacheDisabled is returned when the cache is disabled
	ErrCacheDisabled = &Error{"cache is disabled", false}

	// ErrProviderNotLoaded returned and panic'd when a requested provider is not loaded
	// Users should never see this, unit tests and sanity checks should pick this up
	ErrProviderNotLoaded = &Error{"provider not loaded", false}

	// NoticeDeprecatedUseAlias is returned for schema configurations that are deprecated
	// Terraform now supports section aliases
	// TODO: Add alias example to the examples directory
	NoticeDeprecatedUseAlias = func(n string) string {
		return fmt.Sprintf(`The setting %q has been deprecated. See:
	https://www.terraform.io/docs/configuration/providers.html#alias-multiple-provider-configurations`, n)
	}
)

Functions

func IsNotFoundError

func IsNotFoundError(e error) bool

IsNotFoundError is returned if the error has the notFound flag set

func Log

func Log(args ...interface{}) log.Interface

Log returns a global log object, there is no context like operation id

func LogFromContext

func LogFromContext(ctx context.Context, args ...interface{}) log.Interface

LogFromContext returns the logger from the context

func LogFromHCLog

func LogFromHCLog(l hclog.Logger) log.Interface

LogFromHCLog returns a new log.Interface from an hclog.Logger

func Provider

func Provider(provs ...Subprovider) plugin.ProviderFunc

Provider returns the provider function to terraform

func TFTestSetup

func TFTestSetup() error

TFTestSetup contains common setup for tests in all subproviders

func TFTestTeardown

func TFTestTeardown() error

TFTestTeardown contains common teardown for tests in all subproviders

Types

type Error

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

Error is the akamai error interface

func (Error) Diagnostic

func (e Error) Diagnostic(detail ...string) diag.Diagnostic

Diagnostic converts the error a diagnostic

func (Error) Diagnostics

func (e Error) Diagnostics(detail ...string) diag.Diagnostics

Diagnostics converts the error to a diag.DiaDiagnostics

func (Error) Error

func (e Error) Error() string

Error implements the error interface

type OperationMeta

type OperationMeta interface {
	// Log constructs an hclog sublogger and returns the log.Interface
	Log(args ...interface{}) log.Interface

	// OperationID returns the operation id
	OperationID() string

	// Session returns the operation API session
	Session() session.Session

	// CacheGet returns an object from the cache
	CacheGet(prov Subprovider, key string, out interface{}) error

	// CacheSet sets a value in the cache
	CacheSet(prov Subprovider, key string, val interface{}) error
}

OperationMeta is the akamai meta object interface

func Meta

func Meta(m interface{}) OperationMeta

Meta return the meta object interface

type Subprovider

type Subprovider interface {
	// Name should return the name of the subprovider
	Name() string

	// Version returns the version of the subprovider
	Version() string

	// Schema returns the schemas for the subprovider
	Schema() map[string]*schema.Schema

	// Resources returns the resources for the subprovider
	Resources() map[string]*schema.Resource

	// DataSources returns the datasources for the subprovider
	DataSources() map[string]*schema.Resource

	// Configure returns the subprovider opaque state object
	Configure(log.Interface, *schema.ResourceData) diag.Diagnostics
}

Subprovider is the interface implemented by the sub providers

Jump to

Keyboard shortcuts

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