models

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MPL-2.0 Imports: 4 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 AWSConnection added in v0.4.0

type AWSConnection struct {
	ExternalID string `json:"externalId"`
	RoleArn    string `json:"roleArn"`
}

type AllowedIpRange

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

type Architecture

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

type AzureConnection added in v0.4.0

type AzureConnection struct {
	ClientId       string `json:"clientId"`
	ClientSecret   string `json:"clientSecret"`
	SubscriptionId string `json:"subscriptionId"`
	TenantId       string `json:"tenantId"`
}

type CloudProvider added in v0.3.0

type CloudProvider struct {
	CloudProviderId   string `json:"cloudProviderId,omitempty" tfsdk:"cloud_provider_id"`
	CloudProviderName string `json:"cloudProviderName,omitempty" tfsdk:"cloud_provider_name"`
}

type Cluster

type Cluster struct {
	ClusterType                *string                      `json:"clusterType,omitempty"`
	ReplicaSourceClusterId     *string                      `json:"replicaSourceClusterId,omitempty"`
	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"`
	FarawayReplicaIds          *[]string                    `json:"farawayReplicaIds,omitempty"`
	Groups                     *[]any                       `json:"groups,omitempty"`
	MaintenanceWindow          *commonApi.MaintenanceWindow `json:"maintenanceWindow,omitempty"`
	ServiceAccountIds          *[]string                    `json:"serviceAccountIds,omitempty"`
	PeAllowedPrincipalIds      *[]string                    `json:"peAllowedPrincipalIds,omitempty"`
	SuperuserAccess            *bool                        `json:"superuserAccess,omitempty"`
	Extensions                 *[]ClusterExtension          `json:"extensions,omitempty"`
	PgBouncer                  *PgBouncer                   `json:"pgBouncer,omitempty"`
}

Cluster struct 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 ClusterExtension added in v0.7.0

type ClusterExtension struct {
	Enabled     bool   `json:"enabled"`
	ExtensionId string `json:"extensionId"`
}

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" tfsdk:"name"`
	Value string `json:"value" mapstructure:"value" tfsdk:"value"`
}

type MaintenanceWindow added in v0.5.0

type MaintenanceWindow struct {
	IsEnabled *bool `json:"isEnabled,omitempty" tfsdk:"is_enabled"`
	// The day of week, 0 represents Sunday, 1 is Monday, and so on.
	StartDay  *float64 `json:"startDay,omitempty" tfsdk:"start_day"`
	StartTime *string  `json:"startTime,omitempty" tfsdk:"start_time"`
}

type PeAllowedPrincipalIds added in v0.6.1

type PeAllowedPrincipalIds struct {
	Data []string `json:"data"`
}

type PgBouncer added in v0.7.0

type PgBouncer struct {
	IsEnabled bool                 `json:"isEnabled"`
	Settings  *[]PgBouncerSettings `json:"settings,omitempty"`
}

type PgBouncerSettings added in v0.7.0

type PgBouncerSettings struct {
	Name      *string `json:"name,omitempty"`
	Operation *string `json:"operation,omitempty"`
	Value     *string `json:"value,omitempty"`
}

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 Project added in v0.3.0

type Project struct {
	ProjectId      string          `json:"projectId,omitempty" tfsdk:"project_id"`
	ProjectName    string          `json:"projectName,omitempty" tfsdk:"project_name"`
	UserCount      int             `json:"userCount,omitempty" tfsdk:"user_count"`
	ClusterCount   int             `json:"clusterCount,omitempty" tfsdk:"cluster_count"`
	CloudProviders []CloudProvider `json:"cloudProviders" tfsdk:"cloud_providers"`
}

func (Project) String added in v0.3.0

func (p Project) String() string

Check the return value, if ProjectName is also needed

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" tfsdk:"region_id"`
	Name      string `json:"regionName,omitempty" tfsdk:"name"`
	Status    string `json:"status,omitempty" tfsdk:"status"`
	Continent string `json:"continent,omitempty" tfsdk:"continent"`
}

func (Region) String

func (r Region) String() string

type ServiceAccountIds added in v0.6.1

type ServiceAccountIds struct {
	Data []string `json:"data"`
}

type Storage

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

Directories

Path Synopsis
common
api
pgd
api

Jump to

Keyboard shortcuts

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