config

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointEnvVar       = "EQUINIX_API_ENDPOINT"
	ClientIDEnvVar       = "EQUINIX_API_CLIENTID"
	ClientSecretEnvVar   = "EQUINIX_API_CLIENTSECRET"
	ClientTokenEnvVar    = "EQUINIX_API_TOKEN"
	ClientTimeoutEnvVar  = "EQUINIX_API_TIMEOUT"
	MetalAuthTokenEnvVar = "METAL_AUTH_TOKEN"
)

Variables

View Source
var (
	DefaultBaseURL = "https://api.equinix.com"
	DefaultTimeout = 30
)

Functions

func RetryPolicy added in v1.36.0

func RetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)

Types

type Config

type Config struct {
	BaseURL        string
	AuthToken      string
	ClientID       string
	ClientSecret   string
	MaxRetries     int
	MaxRetryWait   time.Duration
	RequestTimeout time.Duration
	PageSize       int
	Token          string

	Ecx   ecx.Client
	Ne    ne.Client
	Metal *packngo.Client

	TerraformVersion string
	// contains filtered or unexported fields
}

Config is the configuration structure used to instantiate the Equinix provider.

func (*Config) AddFwModuleToMetalUserAgent added in v1.27.0

func (c *Config) AddFwModuleToMetalUserAgent(ctx context.Context, meta tfsdk.Config)

TODO (ocobleseqx) - known issue, Metal services are initialized using the metal client pointer if two or more modules in same project interact with metal resources they will override the UserAgent resulting in swapped UserAgent. This can be fixed by letting the headers be overwritten on the initialized Packngo ServiceOp clients on a query-by-query basis.

func (*Config) AddModuleToECXUserAgent

func (c *Config) AddModuleToECXUserAgent(client *ecx.Client, d *schema.ResourceData)

func (*Config) AddModuleToMetalUserAgent

func (c *Config) AddModuleToMetalUserAgent(d *schema.ResourceData)

func (*Config) AddModuleToNEUserAgent

func (c *Config) AddModuleToNEUserAgent(client *ne.Client, d *schema.ResourceData)

func (*Config) Load

func (c *Config) Load(ctx context.Context) error

Load function validates configuration structure fields and configures all required API clients.

func (*Config) NewFabricClientForSDK added in v1.36.0

func (c *Config) NewFabricClientForSDK(d *schema.ResourceData) *fabricv4.APIClient

NewFabricClientForSDK returns a terraform sdkv2 plugin compatible equinix-sdk-go/fabricv4 client to be used to access Fabric's V4 APIs

func (*Config) NewMetalClient

func (c *Config) NewMetalClient() *packngo.Client

NewMetalClient returns a new packngo client for accessing Equinix Metal's API. Deprecated: migrate to NewMetalClientForSdk or NewMetalClientForFramework instead

func (*Config) NewMetalClientForFramework added in v1.29.0

func (c *Config) NewMetalClientForFramework(ctx context.Context, meta tfsdk.Config) *metalv1.APIClient

func (*Config) NewMetalClientForSDK added in v1.29.0

func (c *Config) NewMetalClientForSDK(d *schema.ResourceData) *metalv1.APIClient

func (*Config) NewMetalClientForTesting added in v1.29.0

func (c *Config) NewMetalClientForTesting() *metalv1.APIClient

This is a short-term shim to allow tests to continue to have a client for cleanup and validation code that is outside of the resource or datasource under test Deprecated: when possible, API clients for test cleanup/validation should be moved to the acceptance package

type DumpTransport

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

func (*DumpTransport) RoundTrip

func (d *DumpTransport) RoundTrip(h *http.Request) (*http.Response, error)

type ProviderMeta

type ProviderMeta struct {
	ModuleName string `cty:"module_name"`
}

Jump to

Keyboard shortcuts

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