models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONDITION_DEPLOYED = "biganimal.com/deployed"
	PHASE_HEALTHY      = "Cluster in healthy state"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedIpRange

type AllowedIpRange struct {
	CidrBlock   string `json:"cidrBlock" mapstructure:"cidr_block"`
	Description string `json:"description" mapstructure:"description"`
}

type Architecture

type Architecture struct {
	ClusterArchitectureId string `json:"clusterArchitectureId" mapstructure:"id"`
	Nodes                 int    `json:"nodes" mapstructure:"nodes"`
}

type Cluster

type Cluster struct {
	AllowedIpRanges            *[]AllowedIpRange `json:"allowedIpRanges,omitempty"`
	BackupRetentionPeriod      *string           `json:"backupRetentionPeriod,omitempty"`
	ClusterArchitecture        *Architecture     `json:"clusterArchitecture,omitempty" mapstructure:"cluster_architecture"`
	ClusterId                  *string           `json:"clusterId,omitempty"`
	ClusterName                *string           `json:"clusterName,omitempty"`
	Conditions                 []Condition       `json:"conditions,omitempty"`
	CreatedAt                  *PointInTime      `json:"createdAt,omitempty"`
	CSPAuth                    *bool             `json:"cspAuth,omitempty"`
	DeletedAt                  *PointInTime      `json:"deletedAt,omitempty"`
	ExpiredAt                  *PointInTime      `json:"expiredAt,omitempty"`
	FirstRecoverabilityPointAt *PointInTime      `json:"firstRecoverabilityPointAt,omitempty"`
	InstanceType               *InstanceType     `json:"instanceType,omitempty"`
	LogsUrl                    *string           `json:"logsUrl,omitempty"`
	MetricsUrl                 *string           `json:"metricsUrl,omitempty"`
	Password                   *string           `json:"password,omitempty"`
	PgConfig                   *[]KeyValue       `json:"pgConfig,omitempty"`
	PgType                     *PgType           `json:"pgType,omitempty"`
	PgVersion                  *PgVersion        `json:"pgVersion,omitempty"`
	Phase                      *string           `json:"phase,omitempty"`
	PrivateNetworking          *bool             `json:"privateNetworking,omitempty"`
	Provider                   *Provider         `json:"provider,omitempty"`
	ReadOnlyConnections        *bool             `json:"readOnlyConnections,omitempty"`
	Region                     *Region           `json:"region,omitempty"`
	ResizingPvc                []string          `json:"resizingPvc,omitempty"`
	Storage                    *Storage          `json:"storage,omitempty"`
}

everything is omitempty, and everything is either nullable, or empty-able

func NewCluster

func NewCluster(d *schema.ResourceData) (*Cluster, error)

func NewClusterForCreate

func NewClusterForCreate(d *schema.ResourceData) (*Cluster, error)

func NewClusterForUpdate

func NewClusterForUpdate(d *schema.ResourceData) (*Cluster, error)

func (Cluster) IsHealthy

func (c Cluster) IsHealthy() bool

IsHealthy checks to see if the cluster has the right condition 'biganimal.com/deployed' as well as the correct 'healthy' phase. '

type ClusterConnection

type ClusterConnection struct {
	DatabaseName        string `json:"databaseName"`
	PgUri               string `json:"pgUri"`
	Port                string `json:"port"`
	ServiceName         string `json:"serviceName"`
	ReadOnlyPgUri       string `json:"readOnlyPgUri"`
	ReadOnlyPort        string `json:"readOnlyPort"`
	ReadOnlyServiceName string `json:"readOnlyServiceName"`
	Username            string `json:"username"`
}

type Condition

type Condition struct {
	ConditionStatus    *string      `json:"conditionStatus,omitempty"`
	LastTransitionTime *PointInTime `json:"lastTransitionTime,omitempty"`
	Message            *string      `json:"message,omitempty"`
	Reason             *string      `json:"reason,omitempty"`
	Type_              *string      `json:"type,omitempty"`
}

this is probably just a kube condition, and we might be able to import that struct from the kube libs

type InstanceType

type InstanceType struct {
	Category         string  `json:"category,omitempty"`
	Cpu              float64 `json:"cpu,omitempty"`
	FamilyName       string  `json:"familyName,omitempty"`
	InstanceTypeId   string  `json:"instanceTypeId"`
	InstanceTypeName string  `json:"instanceTypeName,omitempty"`
	Ram              float64 `json:"ram,omitempty"`
}

func (InstanceType) String

func (i InstanceType) String() string

type KeyValue

type KeyValue struct {
	Name  string `json:"name" mapstructure:"name"`
	Value string `json:"value" mapstructure:"value"`
}

type PgType

type PgType struct {
	PgTypeId                        string    `json:"pgTypeId"`
	PgTypeName                      string    `json:"pgTypeName,omitempty"`
	SupportedClusterArchitectureIds *[]string `json:"supportedClusterArchitectureIds,omitempty"`
}

func (PgType) String

func (p PgType) String() string

type PgVersion

type PgVersion struct {
	PgVersionId   string `json:"pgVersionId"`
	PgVersionName string `json:"pgVersionName,omitempty"`
}

func (PgVersion) String

func (p PgVersion) String() string

type PointInTime

type PointInTime struct {
	Nanos   float64 `json:"nanos"`
	Seconds float64 `json:"seconds"`
}

func (PointInTime) String

func (p PointInTime) String() string

PointInTimeToString transforms an apiv2 PointInTime to it's string representation

type Provider

type Provider struct {
	CloudProviderId   string `json:"cloudProviderId"`
	CloudProviderName string `json:"cloudProviderName,omitempty"`
	Connected         *bool  `json:"connected,omitempty"`
}

func (Provider) String

func (p Provider) String() string

type Region

type Region struct {
	Id        string `json:"regionId,omitempty" mapstructure:"region_id"`
	Name      string `json:"regionName,omitempty" mapstructure:"name,omitempty"`
	Status    string `json:"status,omitempty" mapstructure:"status,omitempty"`
	Continent string `json:"continent,omitempty" mapstructure:"continent,omitempty"`
}

func (Region) String

func (r Region) String() string

type Storage

type Storage struct {
	Iops               string `json:"iops,omitempty" mapstructure:"iops"`
	Size               string `json:"size" mapstructure:"size"`
	Throughput         string `json:"throughput,omitempty" mapstructure:"throughput"`
	VolumePropertiesId string `json:"volumePropertiesId" mapstructure:"volume_properties"`
	VolumeTypeId       string `json:"volumeTypeId" mapstructure:"volume_type"`
}

Jump to

Keyboard shortcuts

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