ecl

package
v0.0.0-...-0202a88 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MPL-2.0 Imports: 80 Imported by: 0

Documentation

Overview

Package ecl is set of code handles all functions required to configure networking on an ecl_compute_instance_v2 resource.

This is a complicated task because it's not possible to obtain all information in a single API call. In fact, it even traverses multiple ECL services.

The end result, from the user's point of view, is a structured set of understandable network information within the instance resource.

Index

Constants

View Source
const StorageRetryMaxCount int = 30

StorageRetryMaxCount is a integer value that means retry maximum count for request against storage SDP

View Source
const StorageRetryWaitMinute int = 1

StorageRetryWaitMinute is a integer value that means time for waiting between each request defined as minute.

Variables

View Source
var REDACT_HEADERS = []string{"x-auth-token", "x-auth-key", "x-service-token",
	"x-storage-token", "x-account-meta-temp-url-key", "x-account-meta-temp-url-key-2",
	"x-container-meta-temp-url-key", "x-container-meta-temp-url-key-2", "set-cookie",
	"x-subject-token"}

List of headers that need to be redacted

Functions

func AddValueSpecs

func AddValueSpecs(body map[string]interface{}) map[string]interface{}

AddValueSpecs expands the 'value_specs' object and removes 'value_specs' from the request body.

func BuildRequest

func BuildRequest(opts interface{}, parent string) (map[string]interface{}, error)

BuildRequest takes an opts struct and builds a request body for Eclcloud to execute

func CheckDeleted

func CheckDeleted(d *schema.ResourceData, err error, msg string) error

CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.

func DedicatedHypervisorServerV1StateRefreshFunc

func DedicatedHypervisorServerV1StateRefreshFunc(client *eclcloud.ServiceClient, id string) resource.StateRefreshFunc

func FormatHeaders

func FormatHeaders(headers http.Header, seperator string) string

FormatHeaders processes a headers object plus a deliminator, returning a string

func GetRegion

func GetRegion(d *schema.ResourceData, config *Config) string

GetRegion returns the region that was specified in the resource. If a region was not set, the provider-level region is checked. The provider-level region can either be set by the region argument or by OS_REGION_NAME.

func IntInSlice

func IntInSlice(valid []int) schema.SchemaValidateFunc

IntInSlice returns a SchemaValidateFunc which tests if the provided value is of type int and matches the value of an element in the valid slice

func MapValueSpecs

func MapValueSpecs(d *schema.ResourceData) map[string]string

MapValueSpecs converts ResourceData into a map

func Provider

func Provider() terraform.ResourceProvider

Provider returns a schema.Provider for Enterprise Cloud.

func RedactHeaders

func RedactHeaders(headers http.Header) (processedHeaders []string)

RedactHeaders processes a headers object, returning a redacted list

func ServerV2StateRefreshFunc

func ServerV2StateRefreshFunc(client *eclcloud.ServiceClient, instanceID string) resource.StateRefreshFunc

ServerV2StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an Enterprise Cloud instance.

func ValidateVRID

func ValidateVRID() schema.SchemaValidateFunc

ValidateVRID returns a SchemaValidateFunc which tests if the provided value is "null" or integer corresponding value in the range from 0 to 255

func VirtualStorageV1RefreshFunc

func VirtualStorageV1RefreshFunc(client *eclcloud.ServiceClient, virtualStorageID string) resource.StateRefreshFunc

VirtualStorageV1RefreshFunc returns a resource.StateRefreshFunc that is used to watch an ECL virtual storage.

func VolumeV1RefreshFunc

func VolumeV1RefreshFunc(client *eclcloud.ServiceClient, virtualStorageID string) resource.StateRefreshFunc

VolumeV1RefreshFunc returns a resource.StateRefreshFunc that is used to watch an storage service volume.

func VolumeV2StateRefreshFunc

func VolumeV2StateRefreshFunc(client *eclcloud.ServiceClient, volumeID string) resource.StateRefreshFunc

VolumeV2StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an ECL volume.

Types

type CommonFunctionGatewayCreateOpts

type CommonFunctionGatewayCreateOpts struct {
	common_function_gateways.CreateOpts
}

CommonFunctionGatewayCreateOpts represents the attributes used when creating a new common function gateway.

type Config

type Config struct {
	CACertFile        string
	ClientCertFile    string
	ClientKeyFile     string
	Cloud             string
	DefaultDomain     string
	DomainID          string
	DomainName        string
	EndpointType      string
	ForceSSSEndpoint  string
	IdentityEndpoint  string
	Insecure          *bool
	Password          string
	ProjectDomainName string
	ProjectDomainID   string
	Region            string
	TenantID          string
	TenantName        string
	Token             string
	UserDomainName    string
	UserDomainID      string
	Username          string
	UserID            string

	OsClient *eclcloud.ProviderClient
}

func (*Config) LoadAndValidate

func (c *Config) LoadAndValidate() error

type GatewayInterfaceCreateOpts

type GatewayInterfaceCreateOpts struct {
	gateway_interfaces.CreateOpts
}

GatewayInterfaceCreateOpts represents the attributes used when creating a new gateway interface.

type InstanceAddresses

type InstanceAddresses struct {
	NetworkName  string
	InstanceNICs []InstanceNIC
}

InstanceAddresses is a collection of Instance NICs, grouped by the network name. An instance/server could have multiple NICs on the same network.

type InstanceNIC

type InstanceNIC struct {
	FixedIPv4 string
	// FixedIPv6 string
	MAC string
}

InstanceNIC is a structured representation of a Eclcloud servers.Server virtual NIC.

type InstanceNetwork

type InstanceNetwork struct {
	UUID          string
	Name          string
	Port          string
	FixedIP       string
	AccessNetwork bool
}

InstanceNetwork represents a collection of network information that a Terraform instance needs to satisfy all network information requirements.

type InternetGatewayCreateOpts

type InternetGatewayCreateOpts struct {
	internet_gateways.CreateOpts
}

InternetGatewayCreateOpts represents the attributes used when creating a new Internet Gateway.

type KeyPairCreateOpts

type KeyPairCreateOpts struct {
	keypairs.CreateOpts
}

KeyPairCreateOpts represents the attributes used when creating a new keypair.

func (KeyPairCreateOpts) ToKeyPairCreateMap

func (opts KeyPairCreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)

ToKeyPairCreateMap casts a CreateOpts struct to a map. It overrides keypairs.ToKeyPairCreateMap to add the ValueSpecs field.

type LogRoundTripper

type LogRoundTripper struct {
	Rt      http.RoundTripper
	OsDebug bool
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow for logging.

func (*LogRoundTripper) RoundTrip

func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

type NetworkCreateOpts

type NetworkCreateOpts struct {
	networks.CreateOpts
}

NetworkCreateOpts represents the attributes used when creating a new network.

func (NetworkCreateOpts) ToNetworkCreateMap

func (opts NetworkCreateOpts) ToNetworkCreateMap() (map[string]interface{}, error)

ToNetworkCreateMap casts a CreateOpts struct to a map. It overrides networks.ToNetworkCreateMap to add the ValueSpecs field.

type PortCreateOpts

type PortCreateOpts struct {
	ports.CreateOpts
}

PortCreateOpts represents the attributes used when creating a new port.

func (PortCreateOpts) ToPortCreateMap

func (opts PortCreateOpts) ToPortCreateMap() (map[string]interface{}, error)

ToPortCreateMap casts a CreateOpts struct to a map. It overrides ports.ToPortCreateMap to add the ValueSpecs field.

type PublicIPCreateOpts

type PublicIPCreateOpts struct {
	public_ips.CreateOpts
}

PublicIPCreateOpts represents the attributes used when creating a new Public IP.

type RecordSetCreateOpts

type RecordSetCreateOpts struct {
	recordsets.CreateOpts
}

RecordSetCreateOpts represents the attributes used when creating a new DNS record set.

func (RecordSetCreateOpts) ToRecordSetCreateMap

func (opts RecordSetCreateOpts) ToRecordSetCreateMap() (map[string]interface{}, error)

ToRecordSetCreateMap casts a CreateOpts struct to a map. It overrides recordsets.ToRecordSetCreateMap to add the ValueSpecs field.

type StaticRouteCreateOpts

type StaticRouteCreateOpts struct {
	static_routes.CreateOpts
}

StaticRouteCreateOpts represents the attributes used when creating a new static route.

type SubnetCreateOpts

type SubnetCreateOpts struct {
	subnets.CreateOpts
}

SubnetCreateOpts represents the attributes used when creating a new subnet.

func (SubnetCreateOpts) ToSubnetCreateMap

func (opts SubnetCreateOpts) ToSubnetCreateMap() (map[string]interface{}, error)

ToSubnetCreateMap casts a CreateOpts struct to a map. It overrides subnets.ToSubnetCreateMap to add the ValueSpecs field.

type VirtualNetworkApplianceCreateOpts

type VirtualNetworkApplianceCreateOpts struct {
	appliances.CreateOpts
}

VirtualNetworkApplianceCreateOpts represents the attributes used when creating a new VNA appliance.

func (VirtualNetworkApplianceCreateOpts) ToVirtualNetworkApplianceCreateMap

func (opts VirtualNetworkApplianceCreateOpts) ToVirtualNetworkApplianceCreateMap() (map[string]interface{}, error)

ToVirtualNetworkApplianceCreateMap casts a CreateOpts struct to a map.

type ZoneCreateOpts

type ZoneCreateOpts struct {
	zones.CreateOpts
}

ZoneCreateOpts represents the attributes used when creating a new DNS zone.

func (ZoneCreateOpts) ToZoneCreateMap

func (opts ZoneCreateOpts) ToZoneCreateMap() (map[string]interface{}, error)

ToZoneCreateMap casts a CreateOpts struct to a map. It overrides zones.ToZoneCreateMap to add the ValueSpecs field.

Source Files

Directories

Path Synopsis
Package clientconfig provides convenient functions for creating Enterprise Cloud clients.
Package clientconfig provides convenient functions for creating Enterprise Cloud clients.
testhelper

Jump to

Keyboard shortcuts

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